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

CWT improvements #10

Merged
merged 5 commits into from
Feb 14, 2024
Merged

CWT improvements #10

merged 5 commits into from
Feb 14, 2024

Conversation

eelanagaraj
Copy link
Contributor

@eelanagaraj eelanagaraj commented Feb 12, 2024

Two small improvements:

  • Adds TryFrom<BTreeMap> for ClaimsSet: checks that keys are valid for CWT (int or string only) while parsing a BTreeMap -> ClaimsSet
    • updated a unit test to use this
  • Makes NumericDate conversion a feature (numericdate-conversion) so that use cases that don't require this do not need time and fmul_to_int dependencies.
    • Moves this into a new file numericdate_conversion.rs
    • Very open to a different name for the feature/module

Tested:

  • imported this in another repo and manually checked that the numericdate feature works (toy example with numericdate handling, checked that error imports worked as expected)

@eelanagaraj eelanagaraj marked this pull request as ready for review February 12, 2024 14:55
@eelanagaraj eelanagaraj requested a review from cobward February 12, 2024 15:26
Copy link
Collaborator

@cobward cobward left a comment

Choose a reason for hiding this comment

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

Nit: I'd suggest renaming the feature to time, which in the future could encapsulate further time dependent functionalities such as automatic expiration checking.

@eelanagaraj eelanagaraj merged commit 7bb6ad2 into main Feb 14, 2024
1 check passed
@eelanagaraj eelanagaraj deleted the eelanagaraj/cwt-improvements branch February 14, 2024 13:55
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