-
Notifications
You must be signed in to change notification settings - Fork 404
feat(auth): CredentialStore trait #542
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
aec2b30 to
adb0f89
Compare
36ef601 to
c3e6d71
Compare
| rustdoc-args = ["--cfg", "docsrs"] | ||
|
|
||
| [dependencies] | ||
| async-trait = "0.1.89" |
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.
not sure how big a concern it is to have this, but if you want to avoid adding this dependency you can have the trait return Futures
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 often use this dependency and I am planning to introduce it in the future to make the code more concise. Do you want to change other implementations to this dependency implementation as well?
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.
Yes, we can use it more - it seems nice
c3e6d71 to
a9b1962
Compare
jokemanfire
left a comment
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.
LGTM
479c0ce
a9b1962 to
479c0ce
Compare
Description
Adds the concept of a configurable
CredentialStoreforAuthorizationManagerto useThe current implementation writes to
credentialsin memory. This change gives the flexibility for users ofAuthorizationManagerto provide a custom implementation that persists credentials (to keychain, disk, etc).There is no change to default behavior, as a default implementation is provided which does the same as now (
InMemoryCredentialStore)Motivation
The motivation came from this bug report to goose that new refresh tokens sent from the server during token exchange were not being saved/used block/goose#5259
We store access tokens and refresh tokens via
keyring, but we only did it on the initial auth and previously had no way to be informed of new refresh tokens received whenrmcpexchanges tokens.This allows for a provided
CredentialStoreto always load/save/clear token information from the storage mechanism of choice, and will fix block/goose#5259