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

Blob: Add TokenCredential auth #98

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Blob: Add TokenCredential auth #98

merged 1 commit into from
Oct 29, 2024

Conversation

dfederm
Copy link
Member

@dfederm dfederm commented Oct 25, 2024

This adds a new authentication type which can be used either by providing an access token via env var, or by providing a TokenCredential (or access token) in the ctor (when using the programmatic project cache API)


public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken)
// The token is static and we don't know the expiry, so just say it's a day from now.
=> new AccessToken(_accessToken, DateTimeOffset.Now.AddDays(1));
Copy link
Member Author

Choose a reason for hiding this comment

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

This seems sketchy, but I don't think there's a great alternative.

@dfederm dfederm merged commit 9ed3ab4 into main Oct 29, 2024
5 checks passed
@dfederm dfederm deleted the token-auth branch October 29, 2024 15:18
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