Skip to content

Commit

Permalink
Merge pull request #10107 from 2403905/issue-10087
Browse files Browse the repository at this point in the history
Fixed an issue when the collaboration service registers apps also for…
  • Loading branch information
2403905 authored Sep 24, 2024
2 parents 7c8c3b9 + 870846f commit 6611c55
Show file tree
Hide file tree
Showing 19 changed files with 320 additions and 245 deletions.
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
2 changes: 1 addition & 1 deletion tests/acceptance/features/apiActivities/activities.feature
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Feature: check activities
"pattern": "%user_id_pattern%"
},
"displayName": {
"const": "Alice"
"const": "Alice Hansen"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ Feature: check share activity
"pattern": "%user_id_pattern%"
},
"displayName": {
"const": "Brian"
"const": "Brian Murphy"
}
}
}
Expand Down Expand Up @@ -715,7 +715,7 @@ Feature: check share activity
"pattern": "%user_id_pattern%"
},
"displayName": {
"const": "Brian"
"const": "Brian Murphy"
}
}
}
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

0 comments on commit 6611c55

Please sign in to comment.