Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue when the collaboration service registers apps also for… #10107

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-registers-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fixed the collaboration service registration

Fixed an issue when the collaboration service registers apps also for binary and unknown mime types.

https://github.com/owncloud/ocis/pull/10107
https://github.com/owncloud/ocis/issues/10086
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.11.0
github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb
github.com/cs3org/reva/v2 v2.24.2-0.20240919151635-556263192484
github.com/cs3org/reva/v2 v2.24.2-0.20240924091626-9635c6d8234e
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb h1:KmYZDReplv/yfwc1LNYpDcVhVujC3Pasv6WjXx1haSU=
github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb/go.mod h1:yyP8PRo0EZou3nSH7H4qjlzQwaydPeIRNgX50npQHpE=
github.com/cs3org/reva/v2 v2.24.2-0.20240919151635-556263192484 h1:MeHzCFCh5WttP2hz7UTCHgV6WQXrucQXSyQs5+aIrcY=
github.com/cs3org/reva/v2 v2.24.2-0.20240919151635-556263192484/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI=
github.com/cs3org/reva/v2 v2.24.2-0.20240924091626-9635c6d8234e h1:4K3F/kwEaTANja+d15FF4e10PHYtHAfk6y2uWqg/1NM=
github.com/cs3org/reva/v2 v2.24.2-0.20240924091626-9635c6d8234e/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
Expand Down
4 changes: 4 additions & 0 deletions services/collaboration/pkg/helpers/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func RegisterAppProvider(
for _, extensions := range appUrls {
for ext := range extensions {
m := mime.Detect(false, ext)
// skip the default
if m == "application/octet-stream" {
continue
}
mimeTypesMap[m] = true
}
}
Expand Down
37 changes: 18 additions & 19 deletions tests/acceptance/features/apiCollaboration/wopi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,7 @@ Feature: collaboration (wopi)
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" tries to create a file "testFile.txt" inside folder "testFolder" in space "Shares" using wopi endpoint
Then the HTTP status code should be "500"
And the JSON data of the response should match
Then the HTTP status code should be "403"
"""
{
"type": "object",
Expand All @@ -629,10 +628,10 @@ Feature: collaboration (wopi)
],
"properties": {
"code": {
"const": "SERVER_ERROR"
"const": "PERMISSION_DENIED"
},
"message": {
"const": "error calling InitiateFileUpload"
"const": "permission denied to create the file"
}
}
}
Expand Down Expand Up @@ -715,7 +714,7 @@ Feature: collaboration (wopi)
| shareType | user |
| permissionsRole | Space Viewer |
When user "Brian" tries to create a file "testFile.txt" inside folder "testFolder" in space "new-space" using wopi endpoint
Then the HTTP status code should be "500"
Then the HTTP status code should be "403"
And the JSON data of the response should match
"""
{
Expand All @@ -726,10 +725,10 @@ Feature: collaboration (wopi)
],
"properties": {
"code": {
"const": "SERVER_ERROR"
"const": "PERMISSION_DENIED"
},
"message": {
"const": "error calling InitiateFileUpload"
"const": "permission denied to create the file"
}
}
}
Expand Down Expand Up @@ -836,7 +835,7 @@ Feature: collaboration (wopi)
| shareType | user |
| permissionsRole | Space Viewer |
When user "Brian" tries to create a file "simple.odt" inside folder "testFolder" in space "new-space" using wopi endpoint
Then the HTTP status code should be "500"
Then the HTTP status code should be "403"
And the JSON data of the response should match
"""
{
Expand All @@ -847,10 +846,10 @@ Feature: collaboration (wopi)
],
"properties": {
"code": {
"const": "SERVER_ERROR"
"const": "PERMISSION_DENIED"
},
"message": {
"const": "error calling InitiateFileUpload"
"const": "permission denied to create the file"
}
}
}
Expand Down Expand Up @@ -903,7 +902,7 @@ Feature: collaboration (wopi)
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" tries to create a file "simple.odt" inside folder "testFolder" in space "Shares" using wopi endpoint
Then the HTTP status code should be "500"
Then the HTTP status code should be "403"
And the JSON data of the response should match
"""
{
Expand All @@ -914,10 +913,10 @@ Feature: collaboration (wopi)
],
"properties": {
"code": {
"const": "SERVER_ERROR"
"const": "PERMISSION_DENIED"
},
"message": {
"const": "error calling InitiateFileUpload"
"const": "permission denied to create the file"
}
}
}
Expand Down Expand Up @@ -966,7 +965,7 @@ Feature: collaboration (wopi)
| permissionsRole | view |
| password | %public% |
When the public tries to create a file "simple.odt" inside the last shared public link folder with password "%public%" using wopi endpoint
Then the HTTP status code should be "500"
Then the HTTP status code should be "403"
And the JSON data of the response should match
"""
{
Expand All @@ -977,10 +976,10 @@ Feature: collaboration (wopi)
],
"properties": {
"code": {
"const": "SERVER_ERROR"
"const": "PERMISSION_DENIED"
},
"message": {
"const": "error calling InitiateFileUpload"
"const": "permission denied to create the file"
}
}
}
Expand Down Expand Up @@ -1059,7 +1058,7 @@ Feature: collaboration (wopi)
| permissionsRole | view |
| password | %public% |
When the public tries to create a file "simple.odt" inside folder "testFolder" in the last shared public link space with password "%public%" using wopi endpoint
Then the HTTP status code should be "500"
Then the HTTP status code should be "403"
And the JSON data of the response should match
"""
{
Expand All @@ -1070,10 +1069,10 @@ Feature: collaboration (wopi)
],
"properties": {
"code": {
"const": "SERVER_ERROR"
"const": "PERMISSION_DENIED"
},
"message": {
"const": "error calling InitiateFileUpload"
"const": "permission denied to create the file"
}
}
}
Expand Down
Loading