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 creation and verification for a specified time #50

Closed
chadjaros opened this issue Feb 29, 2016 · 3 comments
Closed

Allow creation and verification for a specified time #50

chadjaros opened this issue Feb 29, 2016 · 3 comments

Comments

@chadjaros
Copy link

Unit testing classes with expiring tokens with this library is difficult because it is tied to System.currentTimeMillis() in multiple places. I use JodaTime, which has a number of features which make unit testing easier, including freezing the joda clock at a specified time. I would like to inject the time for iat/exp on creation, and for verifying exp, such that it can be made to work with this Joda functionality.

I am already setting iat/exp manually to leverage this feature, but it doesn't seem possible to do so for verification at this time.

@arcseldon
Copy link
Contributor

@chadjaros - do you have a PR?

@chadjaros
Copy link
Author

I do not. I set up a workaround in my unit tests because that was the path of lesser resistance.

@hzalaz
Copy link
Member

hzalaz commented Dec 9, 2016

@chadjaros the path of lesser resistance is to make clock public and figure out how to inject it and avoid people messing with this since it's meant only for testing. So if you are able please submit a PR for allowing to define a clock

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

No branches or pull requests

3 participants