Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] [AMQP] Support decoding user/pass with special characters from DSN #45549

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

Closed
xtix opened this issue Feb 24, 2022 · 4 comments
Closed

Comments

@xtix
Copy link

xtix commented Feb 24, 2022

Description

Currently, amqp-messenger doesn't decode user/pass with special characters from DSN. Connection will fail (invalid credentials) if you encode your user/pass because it will contain unencoded characters (with % prefix). And if you try to leave user/pass unencoded in dsn, it might fail or be invalid (parse_url() function) with slash / for example.

Example

Connection failed (invalid credentials) with encoded special characters in user/pass:
MESSENGER_TRANSPORT_DSN=amqp://gu%2Fest:gu%2Fest@localhost:5672/%2f/messages

Invalid parsing with unencoded special characters in user/pass:
MESSENGER_TRANSPORT_DSN=amqp://gu/est:gu/est@localhost:5672/%2f/messages

Parsing failed with unencoded special character in pass:
MESSENGER_TRANSPORT_DSN=amqp://guest:gu/est@localhost:5672/%2f/messages

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@curlysanders
Copy link

I'm facing this problem at this moment. Our application needs to connect to a 3rd party RabbitMQ instance and the password contains a @.

@xabbuh
Copy link
Member

xabbuh commented Sep 9, 2022

see #47533 and #47534

xabbuh added a commit that referenced this issue Sep 11, 2022
…es/passwords (xabbuh)

This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] decode URL-encoded characters in DSN's usernames/passwords

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #45549
| License       | MIT
| Doc PR        |

Commits
-------

7ae7d7b decode URL-encoded characters in DSN's usernames/passwords
@xabbuh xabbuh closed this as completed Sep 11, 2022
@sidz
Copy link
Contributor

sidz commented Oct 5, 2022

Raised an issue #47788 as my password may contain any of characters which urldecode tries to decode. For example + sign which will be replaced by space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants