-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
agent: allow auto-auth to use an existing token #10850
Conversation
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.
The tests and example bootstrap script work for me. Just a couple questions.
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.
One small note, otherwise looks good!
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, just one suggestion to simplify control logic around backoffs.
This PR changes auto-auth to accept a token during the creation of the auth handler. This feature will be used with persistent caching where a token is decrypted from the cache file and passed into auto-auth. Reusing an existing token is critical to maintaining leases previously owned by the token loaded from the cache.
Currently this feature only attempts to load the token on the first run and falls back to auto-auth if that's unsuccessful. Retry logic could be added if valuable, but likely if there's an issue loading retrying won't help.
Once the token is no longer renewable, the renewer will fall back to auto-auth and reauthenticate.
To test this feature you can run the unit tests: