Skip to content
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

fix(auth): Setting expireEarly to default when the value is 0 #10732

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Aug 21, 2024

Issue:
While running the Bigtable client on GCE instance, token is not expired early.

Cause:
computeTokenProvider sets ExpireEarly to EarlyTokenRefresh but there is no way to pass this option in the gtransport.DialPool method used by bigtable.go

func computeTokenProvider(opts *DetectOptions) auth.TokenProvider {
return auth.NewCachedTokenProvider(computeProvider{scopes: opts.Scopes}, &auth.CachedTokenProviderOptions{
ExpireEarly: opts.EarlyTokenRefresh,
DisableAsyncRefresh: opts.DisableAsyncRefresh,
})
}

Fix:
Use the default expiry early delta if ExpireEarly is 0 or ctpo is nil

@bhshkh bhshkh requested a review from a team as a code owner August 21, 2024 23:11
@bhshkh bhshkh marked this pull request as draft August 21, 2024 23:37
@bhshkh bhshkh marked this pull request as ready for review August 22, 2024 13:26
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codyoss codyoss merged commit 5e67869 into googleapis:main Aug 22, 2024
8 checks passed
@bhshkh bhshkh deleted the fix/auth-expire-early branch August 22, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants