Skip to content

[Cache] Add url decoding of password in RedisTrait DSN #52688

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

Merged

Conversation

alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Nov 22, 2023

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #52420
License MIT

This brings support for @ char in passwords

@nicolas-grekas
Copy link
Member

Why not as a bug fix? This looks like one to me. For 5.4 then.

public static function setUpBeforeClass(): void
{
if (!getenv('REDIS_CLUSTER_HOSTS')) {
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
Copy link
Member

Choose a reason for hiding this comment

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

but we still need the env var to run all the other test cases, don't we?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but this env var presence is already checked in testCreateConnection so it can be removed from here

} else {
$params['parameters']['password'] = $auth;
$params['parameters']['password'] = urldecode($auth);
Copy link
Member

Choose a reason for hiding this comment

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

everywhere this?

Suggested change
$params['parameters']['password'] = urldecode($auth);
$params['parameters']['password'] = rawurldecode($auth);

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea!

7.1
---

* Add url decoding of password in `RedisTrait` DSN
Copy link
Member

Choose a reason for hiding this comment

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

not needed for bug fixes

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh alright, I thought it was considered as a feature. I'll update this as well as the base branch

@alexandre-daubois alexandre-daubois changed the base branch from 7.1 to 5.4 November 24, 2023 12:29
@alexandre-daubois
Copy link
Member Author

I addressed your comments and rebased on 5.4. The fix is different from other branches, I'll provide a fix for those if needed 🙂

@nicolas-grekas nicolas-grekas modified the milestones: 7.1, 5.4 Nov 24, 2023
@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit 12845ab into symfony:5.4 Nov 24, 2023
@alexandre-daubois alexandre-daubois deleted the redis-decode-parameters branch November 24, 2023 12:59
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 24, 2023

I addressed your comments and rebased on 5.4. The fix is different from other branches, I'll provide a fix for those if needed 🙂

No need, that was easy to fix as part of the merge conflict.

Note that I didn't change CouchbaseCollectionAdapter nor CouchbaseBucketAdapter because while they have the same issue, they're more severely broken and would deserve a dedicated PR, if anyone is up to have a look ;)

This was referenced Nov 26, 2023
This was referenced Nov 29, 2023
nicolas-grekas added a commit that referenced this pull request Dec 30, 2023
This PR was merged into the 7.1 branch.

Discussion
----------

[Cache] Fix Couchbase password parsing

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

This is the followup for #52688 (comment).

Commits
-------

4e6f052 [Cache] Add support for URL encoded characters in Couchbase DSN
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.

[Cache] The RedisTrait DSN parsing doesn't urldecode the params
3 participants