-
Notifications
You must be signed in to change notification settings - Fork 113
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
fix: return 403 statuscode instead of 404 when there's not enough share permission #4086
Conversation
d6f6c91
to
bad61b2
Compare
Looks like some test expectation needs to be changed. Scenario Outline: creating a public link from a share with read permission only is not allowed # /drone/src/tmp/testrunner/tests/acceptance/features/coreApiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature:14
Given using OCS API version "<ocs_api_version>" # FeatureContext::usingOcsApiVersion()
And user "Alice" has created folder "/test" # FeatureContext::userHasCreatedFolder()
And user "Alice" has shared folder "/test" with user "Brian" with permissions "read" # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
And user "Brian" has accepted share "/test" offered by user "Alice" # FeatureContext::userHasReactedToShareOfferedBy()
When user "Brian" creates a public link share using the sharing API with settings # FeatureContext::userCreatesAPublicLinkShareWithSettings()
| path | /Shares/test |
| publicUpload | false |
Then the OCS status code should be "404" # OCSContext::theOCSStatusCodeShouldBe()
And the HTTP status code should be "<http_status_code>" # FeatureContext::thenTheHTTPStatusCodeShouldBe()
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
Failed step: Then the OCS status code should be "404"
OCS status code is not any of the expected values 404 got 403
Failed asserting that an array contains '403'. I would think, for this scenario, the status code should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Awesome
I will test it in ocis (owncloud/ocis#6919), update expected failure list, merge it and then bump the ocis (after owncloud/ocis#6919) |
I suppose that test expectations need to be adjusted. Maybe you could adjust the test scenarios in ocis so they have the expected results. They will fail in the current ocis. Add them to expected-failures in ocis. Then bump ocis here in this reva PR - the tests should pass here. Then bump reva into ocis (removing the test scenarios from expected-failures in ocis) |
I was thinking of adding failures to expected-failure list here, merge it and bump reva in ocis, update test expectation (passing tests), merge it and then bump ocis here, remove tests from expected-failure list. Just the opposite 😅 |
Yes, that's fine to do it that way. |
bad61b2
to
c959ebe
Compare
c959ebe
to
bfc5c7a
Compare
bfc5c7a
to
b49c5e1
Compare
|
When trying to reshare a resource (that doesn't have share permission), the ocs response code is
404
but instead it should be403
.This PR fixes that issue and now the request returns
403
code.Before:
This PR:
Motivation: owncloud/ocis#5742 (comment)
Issue: owncloud/ocis#6670