Allow JWT signing method to be configurable. #80
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change creates a new
Signer
interface which encapsulates jwt.SigningMethod + the key material use to sign JWT tokens.This allows clients to modify how JWT tokens are signed by passing in their own Signer. In particular, I'm interested in coupling this with something like
https://github.com/golang-jwt/jwt#extensions to allow for JWT signing backed by KMS systems (Vault, Cloud KMS, etc) where the private key never resides on the local client.
Introduces a new
AppsTransportOptions
to make it easier to make new transport creation options without needing to make new funcs each time. For now only addedWithSigner
, but we could easily extend this out to other config options (Client, BaseURL, etc.)Finally, upgrades deprecated
jwt.StandardClaims
->jwt.RegisteredClaims
.