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

Feature request: Signature overload for time methods in builder #17

Closed
oliverhausler opened this issue Feb 12, 2015 · 3 comments
Closed

Comments

@oliverhausler
Copy link

It would be nice to see a second signature overload for .setExpiration(long), setIssuedAt(long) etc. which takes a long value instead of a date.

@lhazlewood
Copy link
Contributor

This was (initially) avoided due to possible confusion: JWTs represent time values as seconds since epoch (not millis) but Java longs usually represent millis since epoch.

A single long scalar value allows ambiguity that can only be understood by reading JavaDoc, whereas the current method signatures avoid this problem entirely.

@lhazlewood
Copy link
Contributor

additionally, there is nothing wrong with just calling:

setExpiration(new Date(yourLongValue))

@oliverhausler
Copy link
Author

Oh, I didn't realize they used seconds in the JWT specs. Then I would have used Date as well to avoid confusion.

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

2 participants