Or Tzabary
09/05/2022, 1:10 PMencodeURIComponent
or encodeURI
doesn't help as % is used as part of the encoded value.
Another approach is to encode using base64 which is URL-safe.
I believe the right approach would be to disallow some characters for user/group/policy names as we use them in the URL and to avoid other potential bugs.
Comparing to AWS IAM's restrictions, they allow only specific characters to be used in the (alphanumeric and '+=,.@-_' characters.)
I think that restricting to these characters is a the right approach to take.
this means it'll be a breaking change in case someone used % in previous versions, but to be honest, the UX was already broken with entries with % in its name.
Thoughts?
@Elad Lachmi thanks for the helpElad Lachmi
09/05/2022, 1:26 PMAriel Shaqed (Scolnicov)
09/05/2022, 1:40 PMOr Tzabary
09/05/2022, 2:06 PMAriel Shaqed (Scolnicov)
09/05/2022, 2:07 PMOr Tzabary
09/05/2022, 2:32 PMAriel Shaqed (Scolnicov)
09/05/2022, 2:52 PMOr Tzabary
09/05/2022, 2:54 PMAriel Shaqed (Scolnicov)
09/05/2022, 2:54 PMOr Tzabary
09/05/2022, 2:57 PMElad Lachmi
09/05/2022, 2:58 PM%25
specificallyAriel Shaqed (Scolnicov)
09/05/2022, 2:59 PMElad Lachmi
09/05/2022, 3:04 PMAriel Shaqed (Scolnicov)
09/05/2022, 3:09 PMa%percent
in my playground. When I go to that user, I see this JavaScript error in the console:
Uncaught URIError: Pathname "/auth/users/a%percent/groups" could not be decoded. This is likely caused by an invalid percent-encoding.
And indeed the URL in the browser is broken: https://apparent-panther.lakefs-demo.io/auth/users/a%percent. Is this an error in the history library and not in our encoding of the path?Or Tzabary
09/05/2022, 3:09 PMAriel Shaqed (Scolnicov)
09/05/2022, 3:11 PMElad Lachmi
09/05/2022, 3:13 PMAriel Shaqed (Scolnicov)
09/05/2022, 3:15 PMElad Lachmi
09/05/2022, 3:21 PM%
Other characters are less of an issue and should be handled properly out-of-the-boxOr Tzabary
09/07/2022, 11:39 AM