-
Notifications
You must be signed in to change notification settings - Fork 512
Use automatic URI encoding #3352
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
Conversation
746dce4 to
6beafc2
Compare
426de06 to
f6bf0c4
Compare
|
@harshavardhana I noticed that you mentioned that we want to create a release for console soon. I think this PR is a significant improvement to code-quality and there's one thing less developer's need to worry about (do I need to encode or not?). Because the path/query parameters to the API use a different encoding, this is a breaking change for the Enterprise console. Although tested pretty extensively, it's pretty big code-change and we may introduce new issues. |
f6bf0c4 to
5f7bbbd
Compare
bexsoft
left a comment
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.
7498992 to
f60b363
Compare
|
@bexsoft Thanks for reporting. There was a Another annoying method removed 😄 |
a1ca775 to
d06ec64
Compare
|
@dvaldivia @harshavardhana Now we have released the console, I would suggest merge this PR. Then I can work on making the same changes on the Enterprise console and encoding should be a lot less troublesome. |
d06ec64 to
029d28b
Compare
|
I would like to merge this, but there are no reviewers. |
|
@ramondeklein the following api threw me an error. returns That's while trying to access a bucket with a folder: |
|
@cesnietor I'll check tomorrow (it's midnight here), but are you sure you also run the backend service on this branch? The I checked the code, but since I submitted this PR more code has been added that uses encoding, so I'll also fix that. But that only will affect the |
ahh you are right, I was using a different port and messed up my testing. |
|
The Enterprise console is now also updated (see https://github.com/miniohq/enterprise-console/pull/879). We need to make sure to merge both of the PRs at once and ensure that clusters will use the updated Minio version. |
|
@cesnietor There was one place where we still had base64 decoding (although it was skipped if it didn't work), so 81949d1 dismissed your review. Could you please re-approve? @bexsoft I have fixed the bug if files had spaces a while back, so could you please check and approve if you think it's okay? |
|
Can someone merge this (I don't have sufficient permissions). I will merge Enterprise console counterpart afterwards. PS: We need to upgrade enterprise.min.dev with new Enterprise console and Minio instances. |




This PR makes #3343 obsolete.
This PR uses proper URI encoding and enables a hook in the Swagger-based API generation that automatically encodes all parameters that are send in the URL path. The main advantage is that there is no encoding/decoding required in Javascript/Go code, unless paths are manually created.
Pros
Cons
I have tested all kind of "difficult" strings (including
%or/signs, Chinese characters, ...) for users, policies, groups and it all seems to work fine. Also the object-browser (websocket based) seems to be fine.IMPORTANT
After merging this PR, the console API effectively changes (due to different encoding). Because the Enterprise console also calls the Enterprise API the Enterprise console needs to be upgraded too.