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

feat: add auth client #476

Merged
merged 21 commits into from
Sep 8, 2023
Merged

feat: add auth client #476

merged 21 commits into from
Sep 8, 2023

Conversation

pgautier404
Copy link
Contributor

@pgautier404 pgautier404 commented Sep 7, 2023

This commit adds an auth client that is currently solely responsible for generating disposable tokens.

@pgautier404 pgautier404 changed the title Add auth client feat: add auth client Sep 8, 2023
@pgautier404 pgautier404 marked this pull request as ready for review September 8, 2023 18:44
Copy link
Contributor

@cprice404 cprice404 left a comment

Choose a reason for hiding this comment

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

just the one possible blocker about the token endpoint, otherwise i think we can ship this

@@ -65,6 +68,9 @@ public static TokenAndEndpoints TryDecodeAuthToken(string authToken)
return new TokenAndEndpoints(
authToken,
claims.ControlEndpoint,
claims.CacheEndpoint,
// TODO: assuming legacy tokens will never have a token endpoint. AFAIK, they can't be used
// to generate disposable tokens anyway, but verify and see if this needs to be fixed.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is fine

@@ -17,6 +17,8 @@ public class StringMomentoTokenProvider : ICredentialProvider
public string ControlEndpoint { get; private set; }
/// <inheritdoc />
public string CacheEndpoint { get; private set; }
/// <inheritdoc />
public string TokenEndpoint { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

where does this get set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks. It gets set in b75af12 :-)

src/Momento.Sdk/Internal/AuthGrpcManager.cs Show resolved Hide resolved
@pgautier404 pgautier404 merged commit b2fc063 into main Sep 8, 2023
7 checks passed
@pgautier404 pgautier404 deleted the add-auth-client branch September 8, 2023 20:49
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.

3 participants