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

Allow external signing of JWTs #234

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Allow external signing of JWTs #234

merged 2 commits into from
Dec 13, 2024

Conversation

aricart
Copy link
Member

@aricart aricart commented Nov 26, 2024

feat: Claims interface now has EncodeWithSigner(nkeys.KeyPair, fn: SignFn) where signing can be delegated to a function. Thetype SignFn func(pub string, data []byte) ([]byte, error)` is provided with the public key whose matching private key should be used to sign the provided payload.

This feature enables an external signing service to be incorporated in the workflow for signing a JWT.

…SignFn)` where signing can be delegated to a function. The `type SignFn func(pub string, data []byte) ([]byte, error)` is provided with the public key whose matching private key should be used to sign the provided payload.

This feature enables an external signing service to be incorporated in the workflow for signing a JWT.

Signed-off-by: Alberto Ricart <alberto@synadia.com>
@coveralls
Copy link

coveralls commented Nov 26, 2024

Pull Request Test Coverage Report for Build 12040964895

Details

  • 39 of 47 (82.98%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 81.072%

Changes Missing Coverage Covered Lines Changed/Added Lines %
v2/genericlaims.go 2 4 50.0%
v2/claims.go 12 18 66.67%
Files with Coverage Reduction New Missed Lines %
v2/genericlaims.go 1 55.21%
Totals Coverage Status
Change from base Build 11261855873: -0.04%
Covered Lines: 2767
Relevant Lines: 3413

💛 - Coveralls

Signed-off-by: Alberto Ricart <alberto@synadia.com>
Copy link

@kthomas kthomas left a comment

Choose a reason for hiding this comment

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

LGTM

@aricart aricart merged commit 698cd7e into main Dec 13, 2024
6 of 8 checks passed
@aricart aricart deleted the sign-fn branch December 13, 2024 16:42
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