Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

do not urlencode group id #20

Merged
merged 3 commits into from
Jun 27, 2018
Merged

do not urlencode group id #20

merged 3 commits into from
Jun 27, 2018

Conversation

butonic
Copy link
Contributor

@butonic butonic commented Apr 12, 2018

fixes #19

Text added by phil-davis:
Also see core issue owncloud/core#31279 - groups with / or % in the name do not list the members

These problems are here in the user_management app, and also in core stable10 (which still has this user management code bundled in core)

@butonic butonic requested a review from DeepDiver1975 April 12, 2018 14:42
@butonic butonic self-assigned this Apr 12, 2018
@CLAassistant
Copy link

CLAassistant commented Apr 12, 2018

CLA assistant check
All committers have signed the CLA.

@butonic butonic added the bug Something isn't working label Apr 12, 2018
@butonic butonic added this to the development milestone Apr 12, 2018
@butonic
Copy link
Contributor Author

butonic commented Apr 12, 2018

backport for core stable10 in owncloud/core#31109

@DeepDiver1975
Copy link
Contributor

please sign cla - THX

@phil-davis
Copy link
Contributor

works for me - see comments owncloud/core#31109 (comment)

@DeepDiver1975
Copy link
Contributor

acceptance tests are failing ...

@PVince81
Copy link
Contributor

did we not recently switch to encoding it, and now we revert that again ? somehow can't find the PR

@PVince81
Copy link
Contributor

are we at least encoding in another location before sending to server ?

@PVince81
Copy link
Contributor

never mind, I think this proof is enough owncloud/core#31109 (comment)

@phil-davis
Copy link
Contributor

I am working to fix whatever acceptance CI needs refactoring for recent core changes:
#22

When that is good again, then this can be rebased and we can see if there are actually any real issues/regressions.

@phil-davis
Copy link
Contributor

phil-davis commented Apr 13, 2018

PR #22 has fixed the acceptance tests here on top of recent core changes. Rebased this PR.

@codecov-io
Copy link

codecov-io commented Apr 13, 2018

Codecov Report

Merging #20 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #20   +/-   ##
=========================================
  Coverage     76.86%   76.86%           
  Complexity      186      186           
=========================================
  Files            19       19           
  Lines           765      765           
=========================================
  Hits            588      588           
  Misses          177      177

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 914f285...7a7f6f6. Read the comment docs.

@phil-davis
Copy link
Contributor

Before this PR, groups with / or % in the group name could be deleted on the webUI.
After this PR they can no longer be deleted.
This is why the acceptance tests fail.

So there is more detail think about.

@phil-davis
Copy link
Contributor

phil-davis commented Apr 13, 2018

That last commit should fix it - encodeURIComponent() is only needed when we are sending off a delete. In the other cases where we are just displaying groups and their members we use the ordinary "raw" ASCII group name.

And I added a commit to test deleting a group with a space in the name on the webUI, since that is an obvious deletion case that is not currently there.

@butonic
Copy link
Contributor Author

butonic commented Apr 20, 2018

User listing for groups with / and % is also broken.

@phil-davis hm if only delete is affected then the problem seems to be caused by the DeleteHandler ... so what does that do: https://github.com/owncloud/user_management/blob/7a69da7e49a8d76e4d9310dcb68d8e4872938a18/js/deleteHandler.js#L194

It uses OC.generateUrl, which already does encodeURIComponent ... maybe the serverside? Aha:
https://github.com/owncloud/user_management/blob/cc021358a789be720732696c30c48ca2b4230c04/lib/Controller/GroupsController.php#L129-L131

double urldecode ... the implicit one by the framework and this one. I removed it bte it seems I cannot delete groups with / ... the request fails with a 404 which means something in the resource route matching is fishy.

@butonic
Copy link
Contributor Author

butonic commented Apr 20, 2018

[Fri Apr 20 11:17:10.184979 2018] [core:info] [pid 24476] [client 127.0.0.1:47726] AH00026: found %2f (encoded '/') in URI (decoded='/index.php/settings/users/groups/foo/bar'), returning 404

WTF

@phil-davis
Copy link
Contributor

I just tried:

  • created groups called a/slash and a%percent
  • put some users in them
  • listed them on the webUI
  • deleted them on the webUI

with current core master and this branch of user_management

@butonic
Copy link
Contributor Author

butonic commented Apr 20, 2018

and then the Router throws a ResourceNotFoundException because the Symphony URLMapper does a rawurldecode before matching ...

will update this PR and open core issue

@butonic
Copy link
Contributor Author

butonic commented Apr 20, 2018

also needs AllowEncodedSlashes On to get around #20 (comment)

@butonic
Copy link
Contributor Author

butonic commented Apr 20, 2018

@phil-davis yes this branch currently works, but there is a more fundamental problem

@butonic
Copy link
Contributor Author

butonic commented May 30, 2018

superseded by owncloud/core#31224

@butonic butonic closed this May 30, 2018
@butonic butonic deleted the bugfix/19 branch May 30, 2018 09:29
@phil-davis phil-davis restored the bugfix/19 branch May 30, 2018 11:16
@phil-davis
Copy link
Contributor

phil-davis commented Jun 1, 2018

This is also needed so that the front-end sends the correct encoding (or not) for the various requests.
Matching core stable10 PR owncloud/core#31109

Re-opened and re-based.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍

@PVince81 PVince81 modified the milestones: maybe some day, development Jun 26, 2018
@PVince81
Copy link
Contributor

@ownclouders rebase

@phil-davis
Copy link
Contributor

I rebased locally just now and force pushed. Let's see what CI thinks.
@PVince81 @DeepDiver1975 core master owncloud/core#31224 was just merged. So this should be "a good thing" to go with it.

@PVince81 PVince81 merged commit 6e401bc into master Jun 27, 2018
@PVince81 PVince81 deleted the bugfix/19 branch June 27, 2018 10:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trying to list users of a groups with a space yields empty list
6 participants