fix: add no-arg RevokeToken() and expose GetAccessToken()#19
Merged
Conversation
Greptile SummaryAdds convenient no-arg Key Changes:
Documentation: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 61051cf |
Adds a no-arg RevokeToken() overload to AuthClient that revokes the currently authenticated session without requiring the caller to manually handle the access token. Previously, all auth login methods (LdapAuthLogin, UniversalAuthLogin, AwsAuthLogin, etc.) stored the token internally with no public way to retrieve it, making it impossible to call RevokeToken(token) after authentication without resorting to workarounds. The token is now tracked privately inside AuthClient and passed through to new instances created on re-authentication, so RevokeToken() works correctly across the full SDK lifecycle.
7264901 to
61051cf
Compare
Contributor
Author
|
@greptile review this again plz |
victorvhs017
approved these changes
Mar 2, 2026
victorvhs017
left a comment
There was a problem hiding this comment.
Tested in Java 8 and Java 24, all working good!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description 📣
Fixes a usability gap where callers had no way to revoke their own session after authenticating.
All auth methods (
LdapAuthLogin,UniversalAuthLogin,AwsAuthLogin, etc.) store the access token internally but never exposed it, making it impossible to callRevokeToken(token)— the caller simply had no way to obtain the token value.Changes
AuthClient.RevokeToken()— no-arg overload that revokes the currently authenticated session using the internally stored tokenAuthClientnow tracks the current access token privately, passed through to new instances created on re-authenticationUsage
Before this fix, callers had no way to revoke their session:
Now it works without any token handling:
The explicit
RevokeToken(String accessToken)overload still exists for cases where you want to revoke a specific token.Type ✨