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

Add on-demand jwt credentials #136

Closed
theacodes opened this issue Mar 22, 2017 · 6 comments
Closed

Add on-demand jwt credentials #136

theacodes opened this issue Mar 22, 2017 · 6 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Milestone

Comments

@theacodes
Copy link
Contributor

theacodes commented Mar 22, 2017

jwt.Credentials only works for a single audience at a time and must have knowledge of the audience beforehand. gRPC APIs, however, may not be able to determine the audience beforehand so JWTs should be generated on-demand during the before_request callback.

We previously had this behavior as part of jwt.Credentials, but it was removed because it made the behavior of the class ambiguous. This feature request is to bring that functionality back as a separate class jwt.OnDemandCredentials.

This class:

  • Doesn't accept an audience argument in its constructor.
  • Can be created from existing credentials using from_signing_credentials.
  • Holds a cache of JWTs for specific audiences using cachetools.LRUCache.
  • Generates a new JWT for the specific audience in before_request or uses an existing cached JWT.
  • Is always valid and never expires but never has a token.

Context.

@dhermes @lukesneeringer any concerns about the name or dependency on cachetools?
@jboeuf any concerns on the behavior here?

@jboeuf
Copy link

jboeuf commented Mar 22, 2017

@jonparrott That looks about right to me. I assume that the from_signing_credentials class method for this new class would not take an audience parameter just like the constructor. Thanks!

@theacodes
Copy link
Contributor Author

I assume that the from_signing_credentials class method for this new class would not take an audience parameter just like the constructor.

correct.

@jboeuf is there any external (or internal) documentation you can share with me on this behavior? one of my biggest goals with this library is that it's well-researched and documented with references. Anything helps.

@jboeuf
Copy link

jboeuf commented Mar 22, 2017 via email

@theacodes
Copy link
Contributor Author

@jboeuf this helps but i was specifically talking about the auth metadata callback stuff.

@jboeuf
Copy link

jboeuf commented Mar 23, 2017 via email

@theacodes
Copy link
Contributor Author

theacodes commented Mar 23, 2017 via email

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants