-
Notifications
You must be signed in to change notification settings - Fork 71
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: long running setup for expired auth token track 2 bug #391
Conversation
Pull Request Test Coverage Report for Build 9421738010Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9450969455Details
💛 - Coveralls |
2e7c340
to
bde0ca5
Compare
Pull Request Test Coverage Report for Build 9522232903Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9590583019Details
💛 - Coveralls |
does this workaround work? @Bryce-Soghigian |
pkg/auth/cred.go
Outdated
return azcore.AccessToken{}, err | ||
} | ||
logging.FromContext(ctx).Info("refreshing MDAL Token") | ||
token.ExpiresOn = time.Now().Add(2 * time.Hour) |
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.
Do we need to check the original ExpiresOn
in case it’s already less than 2 hours?
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 think that would be prudent
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.
IIRC the underlying token credential attempts to fetch from the cache first. It seems like it could return a short-lived token?
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.
yep this value should be set with the minimum value of token expires on and the 2hr we want to use here.
@andyzhangx yes it seems to be working for over a week for me |
Pull Request Test Coverage Report for Build 9669960661Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9670992016Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9700805392Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9701170413Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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
Pull Request Test Coverage Report for Build 9718106940Details
💛 - Coveralls |
* exp: testing long running setup for authentication token * fix: modifying refresh interval to every 2 hours * fix: ci * fix: adding some comments, minor refactor from public to private * Update pkg/auth/cred.go * fix: handling existing tokens in the cache * nit: move log
Fixes #
Description
The track 2 sdk has a bug for long living tokens(longer than 24hrs) they will not be refreshed properly. This pr adds a thin wrapper around the GetToken() interface method to set the ExpiresOn timestamp to be earlier and force a token refresh earlier.
How was this change tested?
Does this change impact docs?
Release Note