-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add user
option to Redis
adapter to authenticate with a specific user
#92
Conversation
Signed-off-by: Christian Braun <christian.braun@vogel.de>
6e2bf1a
to
3258419
Compare
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.
Sorry for the late feedback, I didn't felt like having a look into it.
However, thanks for this contribution. I wonder if it is also available for RedisCluster
but I do not have a problem if that is a Redis
-only feature for now, can be implemented for RedisCluster
once requested.
I do have some nitpicks and some change requests.
- especially the native return types and argument types should be added
- we should have a test which verifies that the user can be extracted from the server URI
I think its time to have a proper resource array shape declared in the RedisResourceManager
so that we do not have that weird array
with "whatever" array keys in it. Once I find some time, I might implement that myself and push it to this patch - if you think you want to that on your own, I'd be happy to review that change again.
We recently introduced SSLContextArrayShape
in SslContext
. You can take that as an example on how to declare array shapes if you do not have an idea on how that might work.
Once we defined the RedisResourceArrayShape
, we can use that for RedisResourceManager::$resources
. That will most probably remove a bunch of baseline entries and errors within the RedisResourceManager
so that would be a huge improvement.
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Thank you very much for the detailed review. I changed the code according to your comments. I also added the suggested ResourceArrayShape. I`d be happy, if have another look at my changes. |
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.
Nice, thanks for updating and providing proper type-hints for the new methods!
I put some suggestions and comments to your latest changes regarding the array shape. If you apply these changes, I guess psalm will stop reporting some errors.
You might want to have a look on these psalm issues as they might tell you why some types may probably not correct 👍🏼
If you need help, just let me know.
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Signed-off-by: Christian Braun <christian.braun@vogel.de>
Thank you again for having a deep look at my commits again. The types declared in the array shape and related return types should be correct now. Also I think the Assertment in Line 177 is not necessary anymore, because the instance is already checked in line 169. |
Due to the way how this class worked before, we make an assumption that a provided `iterable` will contain at least those keys we are supporting. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Yes you are right, one of the issues were due to the I also removed the fixed issues with psalm from the baseline by updating the baseline using I will have a closer look on the integration tests, it seems that the password test is actually introducing problems when used on a server without a configured password. |
Due to refactoring, the property reference was removed but the resource was only re-written to the propery cache when the version was not available. This is fixed with this commit. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
To have the same functionality as in other methods (which provide fluent interface), we should use early return to prevent unsetting `initialized` logic. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
…ase selection was executed Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
…rage` property anymore Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Okay, that was a tough one. I was wondering why stuff started to went wrong after my changes. Another good reason on why having these property references removed from our code. |
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
user
option to Redis
adapter to authenticate with a specific user
Thanks @vcg-development and @cbraunVBM! |
Description
Description
This PR is adding the possibility to authenticate with Redis with a custom username. The ACL feature is available in Redis since Version 6.
The username can be passed as an resource option.