-
Notifications
You must be signed in to change notification settings - Fork 273
fix(amazonq): clear out cached supplier if connection is invalidated … #5881
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
…/ clear tokens on InvalidGrantException when a user reauthenticates while reusing a connection, the cached supplier can incorrectly retain the last token instead of immediately returning the new one additionally, the cached supplier can infinitely attempt token refresh since we are retaining invalid tokens instead of destroying them
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
522f5f3
to
7bc23fb
Compare
?.tokenProvider | ||
?.delegate | ||
?.let { it as? BearerTokenProvider } ?: return@scheduleWithFixedDelay | ||
tokenProvider.resolveToken() |
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.
does this attempt to use the cached supplier to refresh? should the refresh called be used here?
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.
cached supplier will refresh if needed
this.lastToken.set(it) | ||
} | ||
} | ||
override fun refresh(): AccessToken = supplier.supplier.refresh() |
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.
should this also refresh cached supplier?
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.
deleted
…/ clear tokens on InvalidGrantException
when a user reauthenticates while reusing a connection, the cached supplier can incorrectly retain the last token instead of immediately returning the new one
additionally, the cached supplier can infinitely attempt token refresh since we are retaining invalid tokens instead of destroying them
Types of changes
Description
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.