Skip to content

[Messenger] show sanitized DSN in exception message when no transport found matching DSN #60225

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

dantleech
Copy link
Contributor

@dantleech dantleech commented Apr 16, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? no
Issues Improve exception message when no transport found
License MIT
  • Improves the exception message thrown when no transport supports a given messenger DSN by showing the redacted password.
  • If the there is no user: component, then the "user" is redacted also.
  • Introduces a test for the transport factory

Before:

No transport supports the given Messenger DSN.

After:

No transport supports Messenger DSN "foobar://barfoo:******@host/foo"

or, in the case there is no user:

No transport supports Messenger DSN "foobar://******@host/foo"

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.3" but it seems your PR description refers to branch "7.3 for features / 6.4, and 7.2 for bug fixes".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@dantleech dantleech force-pushed the messenger-show-scheme-name-in-transport-not-found-exception-message branch from 7acb44a to 66c32b3 Compare April 16, 2025 09:00
@dantleech
Copy link
Contributor Author

Updated...

@dantleech dantleech force-pushed the messenger-show-scheme-name-in-transport-not-found-exception-message branch from 81e16f7 to 65e4475 Compare April 18, 2025 16:34
@nicolas-grekas nicolas-grekas changed the title [Messenger] show scheme in exception message when no transport found … [Messenger] show scheme in exception message when no transport found matching DSN Apr 22, 2025
@dantleech dantleech force-pushed the messenger-show-scheme-name-in-transport-not-found-exception-message branch from aaf02d4 to 8b69d29 Compare April 22, 2025 15:10
@dantleech
Copy link
Contributor Author

@nicolas-grekas fixed the Psalm error - but I guess the unit tests are failing on the target branch?

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

Including some small suggestions

@dantleech
Copy link
Contributor Author

updated!

@nicolas-grekas nicolas-grekas changed the title [Messenger] show scheme in exception message when no transport found matching DSN [Messenger] show sanitized DSN in exception message when no transport found matching DSN Apr 23, 2025
@nicolas-grekas nicolas-grekas force-pushed the messenger-show-scheme-name-in-transport-not-found-exception-message branch from e0322f7 to debe722 Compare April 23, 2025 07:35
@nicolas-grekas
Copy link
Member

Thank you @dantleech.

@nicolas-grekas nicolas-grekas merged commit 6dfbfff into symfony:7.3 Apr 23, 2025
6 of 11 checks passed
@dantleech dantleech deleted the messenger-show-scheme-name-in-transport-not-found-exception-message branch April 23, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants