Skip to content
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

CLOUDP-169104: Fix encoding for AWS IAM usernames #452

Merged
merged 1 commit into from Apr 13, 2023

Conversation

andmatei
Copy link
Contributor

@andmatei andmatei commented Apr 13, 2023

Description

As per the old docs:

AWS IAM usernames include characters which must be URL encoded.
Replace all : characters with %3A.
Replace all / characters with %2F.

https://www.mongodb.com/docs/atlas/reference/api/database-users-get-single-user/#example-request

Using url.PathEscape would only encode / characters, while url.QueryEscape encode both : and /

Link to any related issue(s): mongodb/mongodb-atlas-cli#1817

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

@andmatei andmatei requested a review from a team as a code owner April 13, 2023 12:22
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@wtrocki wtrocki left a comment

Choose a reason for hiding this comment

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

Awesome catch!

@andmatei
Copy link
Contributor Author

This will also be a problem with the autogenerated SDK - left more comments on the ticket

@andmatei andmatei merged commit 056a756 into master Apr 13, 2023
4 checks passed
@andmatei andmatei deleted the CLOUDP-169104_fix_query_encoding_for_dbusers branch April 13, 2023 12:37
matt-condon added a commit that referenced this pull request Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants