-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(redis) add support for username/password auth #121
Merged
fffonion
merged 6 commits into
fffonion:master
from
gruceo:feat/support-username-password
Aug 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9b4cb7a
feat(redis) add support for username/password auth
gruceo 34bddd5
tests
gruceo 3766433
add new username/password fields
gruceo 8a7498c
fix tests
gruceo ad28d12
Apply suggestions from code review
fffonion 68e451d
fix tests 2
gruceo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would actually suggest new fields being added (username, password) in addition to
auth
, otherwise we may need to write complex compat code on kong side.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.
I think from style perspective I'd rather prefer to have separate fields as well. However I'm wondering - will it really require compat code on kong side? Even the way it's implemented here? 🤔 CP/DP will run different versions of this lib so I think we're good, right?
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.
we do, unfortunately, because we need to define the schema at kong side (https://github.com/Kong/kong/blob/master/kong/plugins/acme/schema.lua#L85).
actually, i'm thinking to implement a new redis storage, using the kong provided redis library + schema in the kong acme plugin, that skipped the redis storage provided by this library.
basically we only need to add a
kong/plugins/acme/storage/redis.lua
then do something similar as this line https://github.com/Kong/kong/blob/master/kong/plugins/acme/client.lua#L91.then we can from now on have aligned redis schema in the acme plugin with other plugins too.
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.
done here 3766433
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.
@fffonion Please correct me if I'm wrong but I think with the introduction of config adapter: https://github.com/Kong/kong/blob/master/kong/plugins/acme/storage/config_adapters/redis.lua
There's no need to write any compat code since plugin's schema is separated from this library's config.