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 kid param to sign function #144

Merged
merged 4 commits into from Mar 15, 2024
Merged

Add kid param to sign function #144

merged 4 commits into from Mar 15, 2024

Conversation

ptoffy
Copy link
Member

@ptoffy ptoffy commented Mar 15, 2024

This adds back the kid parameter to the sign function, since passing it in the header looks a bit funny:

try await keyCollection.sign(somePayload, header: ["kid": .string(someKid.string)])

This can now be rewritten as

try await keyCollection.sign(somePayload, kid: someKid)

The passed in kid is prioritised, while the header is searched if none is passed in.
Also removes a now useless @preconcurrency attribute

@ptoffy ptoffy requested review from gwynne and 0xTim March 15, 2024 12:49
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.05%. Comparing base (65eb071) to head (91ab500).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
+ Coverage   68.85%   69.05%   +0.20%     
==========================================
  Files          59       59              
  Lines        1554     1561       +7     
==========================================
+ Hits         1070     1078       +8     
+ Misses        484      483       -1     
Files Coverage Δ
Sources/JWTKit/JWTKeyCollection.swift 89.33% <100.00%> (+1.09%) ⬆️
Sources/JWTKit/RSA/RSA.swift 75.00% <ø> (ø)

... and 1 file with indirect coverage changes

@ptoffy ptoffy merged commit 0be7f0a into main Mar 15, 2024
10 of 11 checks passed
@ptoffy ptoffy deleted the kid-param branch March 15, 2024 18:22
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.

None yet

2 participants