Repository navigation
Handle groups with slash and percent in provisioning API - #31017
phil-davis wants to merge 1 commit into
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31017 +/- ##
============================================
+ Coverage 62.57% 62.57% +<.01%
- Complexity 18249 18250 +1
============================================
Files 1145 1145
Lines 68416 68419 +3
Branches 1234 1234
============================================
+ Hits 42809 42812 +3
Misses 25246 25246
Partials 361 361
Continue to review full report at Codecov.
|
2a6a980 to
13347e7
Compare
|
@PVince81 @DeepDiver1975 can you have a look at the approach I took in @individual-it can review the test changes/additions. |
|
this needs to be added to the documentation @settermjd |
|
@PVince81 objections? |
0076442 to
57c3ced
Compare
Codecov Report
@@ Coverage Diff @@
## master #31017 +/- ##
============================================
- Coverage 64.8% 64.01% -0.79%
- Complexity 18375 18667 +292
============================================
Files 1199 1176 -23
Lines 69573 70236 +663
Branches 1282 1267 -15
============================================
- Hits 45089 44964 -125
- Misses 24111 24902 +791
+ Partials 373 370 -3
Continue to review full report at Codecov.
|
8657136 to
d087fe6
Compare
| * @return string | ||
| */ | ||
| private function unencodeGroupId($groupId) { | ||
| return \strtr($groupId, ['%25' => '%', '%2F' => '/']); |
There was a problem hiding this comment.
isn't there a PHP function that does that like urldecode or rawurldecode ?
There was a problem hiding this comment.
"@" signs work OK (API tests here check creating, working with and deleting such group names)
There was a problem hiding this comment.
I remember in some cases when talking Webdav we had to encode the "@" sign, so not sure if it applies here. what if a third party client decides to URL encode other special chars ?
There was a problem hiding this comment.
At this point we do not want to urldecode everything. If somebody wanted something literally in a group name like group%29435 then they really do want those characters in the group name, so we do not want to decode %29 into whatever ASCII that is.
Actually they will have sent us group%2529435 so that the % gets escaped on the way through and re-formed here.
|
This needs more thought to make sure it parses all group name possibilities. Related PRs in progress: #31224 generated resource routes should allow / |
2429053 to
e3640ca
Compare
63762d6 to
e0e5387
Compare
e0e5387 to
7b89570
Compare
93dda56 to
ce3c449
Compare
8647d27 to
ecce517
Compare
ecce517 to
8a69f14
Compare
|
So we fixed the app framework in #31224 but the provisioning API is not using it and uses OCS instead. As far as I remember there is a way to port the old OCS way to use App Framework controllers, but that would likely be a lot more work. |
|
I think we have come up with other ways to make this all work - I will look at what PRs are "out there". |
1565ca9 to
bf385ab
Compare
|
Rebased again to merge in the addition of skipped tests in master yesterday. Let's see what CI thinks. |
|
conflict. didn't we fix slash handling somewhere before ? |
|
I will rebase/resolve conflicts and check this again. Last time I looked there were still problems when the group name needs to be an embedded part of the URL - the slashes become ambiguous. |
bf385ab to
277c859
Compare
|
Rebased and resolved conflicts. Let's see what CI thinks. |
|
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
apiProvisioningacceptance test suite covering various group name combinations, including with/%?etc.apps/provisioning_api/lib/Groups.phpso it will turn a literal%2Finto a/- that provides a way to pass a/in a group name. (from outside you pass in%252Fand the%25turns into a%by the time it gets through the server and is delivered toGroups.php)%25into a%- you need that so you can always escape a%if you want to construct a literal group likemy%25groupormy%2FgroupRelated Issue
#31015
Motivation and Context
It is nice to be able to use all group names in the Provisioning API.
How Has This Been Tested?
Local API acceptance test runs.
Types of changes
Checklist: