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

[SDK-3149] Add Instant support #537

Merged
merged 6 commits into from
Mar 9, 2022
Merged

[SDK-3149] Add Instant support #537

merged 6 commits into from
Mar 9, 2022

Conversation

jimmyjames
Copy link
Contributor

Changes

🕐 Adds support for java.time.Instant 🕐

This PR adds support for java.time.Instant for creating and verifying JWTs. Key points to note:

  • Instant support is added to Date functionality; customers using Date can continue to do so.
  • Additional methods added to interfaces have a default implementation using the underlying Date methods
  • Internal implementation updated to use Instant for its improved functionality

Note: This PR does not include support for custom claim validation of type Instant. A separate PR will add support for this as well as address the current issue of Date-based claim validation not accounting for date/time claims being serialized as seconds since the epoch.

References

https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html

Testing

Existing unit tests provide good coverage, and tests added for new methods

@jimmyjames jimmyjames added this to the v4-Beta milestone Mar 7, 2022
@jimmyjames jimmyjames requested a review from a team as a code owner March 7, 2022 04:50
@jimmyjames jimmyjames changed the title Add instant support [SDK-3149] Add instant support Mar 7, 2022
@jimmyjames jimmyjames changed the title [SDK-3149] Add instant support [SDK-3149] Add Instant support Mar 7, 2022
Copy link
Contributor

@poovamraj poovamraj left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jimmyjames jimmyjames merged commit 90cea2d into v4-dev Mar 9, 2022
@jimmyjames jimmyjames deleted the add-instant-support branch March 9, 2022 20:27
poovamraj pushed a commit that referenced this pull request Mar 16, 2022
* [SDK-3149] Add support for java.time.Instant

* formatting fixes

* add javadocs

* remove custom Instant claim verification check (not yet supported)

* add tests for default method implementations

* fix NullClaimTest for asInstant
@poovamraj poovamraj modified the milestones: v4-Beta, 4.0.0-beta.0 May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants