-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
API test for disabled public upload share #31697
Conversation
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.
See comments
| shareType | 3 | | ||
| permissions | 4 | | ||
When parameter "shareapi_allow_public_upload" of app "core" has been set to "no" |
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.
Use the When
form of this step:
When the administrator sets parameter "xyz" of app "core" to "no" using the API
| shareType | 3 | | ||
| permissions | 4 | | ||
When parameter "shareapi_allow_public_upload" of app "core" has been set to "yes" |
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.
Use the When
form of this step:
When the administrator sets parameter "xyz" of app "core" to "no" using the API
And the HTTP status code should be "403" | ||
|
||
Scenario: Uploading file to a public shared folder does not work when allow public uploads has disabled before sharing and again enabled after sharing the folder |
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.
s/has disabled/has been disabled/
| permissions | 4 | | ||
When parameter "shareapi_allow_public_upload" of app "core" has been set to "yes" | ||
Then publicly uploading a file should not work |
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.
Why "should not work"?
Is it because the share creation will have failed at line 247?
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.
So you could write another scenario also that tests that:
Given parameter "shareapi_allow_public_upload" of app "core" has been set to "no"
When user "user0" creates a share with settings:
...
then the status should be 4nn
and the share should not exist.
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.
No. line 247 should work fine.
I was about to talk to you about it. I think when public upload is disabled then all public shares created thereafter doesn't allow public uploading?
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.
What happens when the share is created at line 247?
Does it get created, but without the requested public upload permission?
Or?
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.
Sorry, the share doesn't get created. But if we share it with upload and read permission, it is created with read-only permission.
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.
So in this scenario share is not created so line 251 doesn't make sense. So I think I should change this scenario to share with permission 31. I think that would make more sense?
And the HTTP status code should be "401" | ||
|
||
Scenario: Uploading file to a public shared folder works when allow public uploads has disabled and again enabled after sharing the folder |
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.
s/has disabled/has been disabled/
ec5ae7f
to
bba20ab
Compare
bba20ab
to
b16165a
Compare
Codecov Report
@@ Coverage Diff @@
## master #31697 +/- ##
=========================================
Coverage 62.89% 62.89%
Complexity 18417 18417
=========================================
Files 1154 1154
Lines 69156 69156
Branches 1260 1260
=========================================
Hits 43498 43498
Misses 25289 25289
Partials 369 369
Continue to review full report at Codecov.
|
Backport on #31707 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This PR adds tests to:
allow public upload
isdisabled
.allow public upload
has beendisabled
and againenabled
after file has been shared.allow public upload
isdisabled
and re-enabled after the folder has been sharedRelated Issue
#31531
How Has This Been Tested?
Locally
Types of changes
Checklist: