Repository navigation
Allow slash in group names in provisioning API - #31463
phil-davis wants to merge 2 commits into
Conversation
f111c76 to
95ca2c6
Compare
| // Check the group exists | ||
| if (!$this->groupManager->groupExists($groupId)) { | ||
| return new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, 'The requested group could not be found'); | ||
| return new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, \sprintf('The requested group could not be found: %s', $groupId)); |
There was a problem hiding this comment.
This change is not essential to anything - I just found it handy when trying to test all sorts of weird escaped group names, that I could see what the backend had actually received as the group name.
| } else { | ||
| $endpointText = \sprintf(' to "%s"', $endpoint); | ||
| } | ||
| $txt = "Invalid query$endpointText, please check the syntax. API specifications are here:' |
There was a problem hiding this comment.
This change is not essential to anything - I just found it handy when trying to test all sorts of weird escaped group names, that I could see what endpoint the backend thought it received, but could not match to a route.
95ca2c6 to
72bfc64
Compare
Codecov Report
@@ Coverage Diff @@
## master #31463 +/- ##
============================================
- Coverage 64.06% 64.01% -0.05%
- Complexity 18634 18667 +33
============================================
Files 1176 1176
Lines 70142 70236 +94
Branches 1267 1267
============================================
+ Hits 44934 44962 +28
- Misses 24838 24904 +66
Partials 370 370
Continue to review full report at Codecov.
|
|
Related attempts at this sort of thing: PR #31224 which does some more general allowing routes that have an PR #31017 - a different way to try and handle having a slash in the group name and escaping it it the URL. |
|
It is all a bit of a "dog's breakfast" because of the That could be a request to list the subadmins of a group called So I have banned creating groups with names that end in |
|
The API tests here are at least useful - they are what needs to pass, whatever backend code solution is done. If this seems useful, then there also needs to be code behind the webUI private endpoint that will prevent creating group names like |
72bfc64 to
e1f6e6a
Compare
|
Note: for Apache this requires: so that group names like That is the reason for fails in the drone acceptance tests here. Another way around this is for the test code to not That works, except when a group name contains multiple slashes - Life would be so much easier if we ban |
e1f6e6a to
cf80197
Compare
|
Is it possible to create a group with the name "group/../something" or something alike ? |
cf80197 to
ffb0000
Compare
|
I added tests to manage a group called #31017 is a way to allow any group name. That puts an extra layer of URL-encoding so that a client can use something like
Aaaargh! |
ffb0000 to
7f42034
Compare
7f42034 to
3856423
Compare
|
in general I'd expect this PR to not be necessary any more after #31224 |
|
Another one for me to review in the morning - there were a lot of attempts at different ways of making all these weird group names work. |
6411656 to
430cfd3
Compare
|
See #32430 where we can first add the test scenarios. |
430cfd3 to
3b2feee
Compare
|
The test scenarios have been added to |
|
As discussed in #35777 the master branch will from now on hold the ownCloud 10 codebase. This PR targetted ownCloud 11 which is postponed to a far distant future. Because of that I'm closing this PR and kindly ask you to re-submit this PR in a few days. Thanks a lot for your patience |
Description
groupidto have any characters (including/) except for group names that end in/subadmins/subadminsbecause that would cause conflict with being able to get the subadmins of a group.Related Issue
#31015
Motivation and Context
The provisioning API should be able to manage groups with a slash in their name.
How Has This Been Tested?
Local API acceptance test runs, and trying stuff with
curlcommands.Types of changes
Checklist: