Skip to content

Jwt validate exp #56

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

Merged
merged 10 commits into from
May 31, 2020
Merged

Jwt validate exp #56

merged 10 commits into from
May 31, 2020

Conversation

diogob
Copy link
Owner

@diogob diogob commented May 31, 2020

This will send a close request to the websocket if the channel was open with a JWT containing an exp claim once the expiration timestamp has passed.

There is a breaking change in the format of the timestamp sent in the message, now we send the POSIX time as an Integer value in nanoseconds. This is for the sake of consistency with the way exp claim is represented (although with a different resolution). Since we are breaking the format I took the oportunity to rename the field to something more JSON friendly, now it's called deliveredAt.

This PR uses verifyClaimsAt instead of verifyClaims so we can use an unified clock function avoiding wasting system resources.

It also adds the library alarmclock to set a concurrent timeout that will close our websocket connection.

It should address #54

@diogob diogob force-pushed the jwt-validate-exp branch from 2e66421 to ac75718 Compare May 31, 2020 21:40
@diogob diogob merged commit a4c0e55 into master May 31, 2020
@diogob diogob deleted the jwt-validate-exp branch May 31, 2020 22:53
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.

1 participant