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 support for public and private header parameters #312

Merged
merged 7 commits into from
May 13, 2024

Conversation

daniel-moh
Copy link
Member

Adds support for working with arbitrary header parameters as per RFC-7515, 4.2/3 (JWS) and RFC-1716-4.2/3 (JWE).

Special Considerations

  • This API ensures that the dictionary used to access parameters and the underlying JSON data representation stay in sync. This avoids any situations where the parameters dictionary contains a value that cannot be represented in JSON and therefore the resulting JWS/E header does not.
  • It is also guaranteed that required header parameters are not removed or altered via the new API. Required header parameters must be set when initializing the JWS/E header.

Misc

Continuing what we started in #310, this adds deterministic JSON encoding (.sortedKeys) to the header JSON representation.

This outdates and closes #282.

@daniel-moh daniel-moh requested a review from haeser May 10, 2024 23:07
@daniel-moh daniel-moh self-assigned this May 10, 2024
Copy link
Member

@haeser haeser left a comment

Choose a reason for hiding this comment

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

👏🏼 very nice and clean approach that fits neatly.

Copy link

sonarcloud bot commented May 13, 2024

@daniel-moh daniel-moh merged commit fbce498 into master May 13, 2024
8 checks passed
@daniel-moh daniel-moh deleted the private-header-params branch May 13, 2024 08:58
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.

2 participants