-
Notifications
You must be signed in to change notification settings - Fork 288
docs: adds an expires field to the bearer token response #676
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
base: master
Are you sure you want to change the base?
Conversation
Where a bearer token is returned to the client for future use, optionally include an `expires` field which indicates the latest time that it will be treated as valid. The server is free to expire tokens at any time so this field is purely advisory. Fixes #674
http/peer-id-auth.md
Outdated
@@ -172,6 +172,17 @@ protocol operates as follows: | |||
Authentication-Info: libp2p-PeerID sig="<base64-signature-bytes>" bearer="<base64-encoded-opaque-blob>" | |||
``` | |||
|
|||
The server MAY include an `expires` field which contains the expiry time of | |||
the bearer token in [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use RFC 3339 instead. It's a subset of ISO 8601 with a focus on simplicity and use over the internet.
In JS, I believe toISOString()
is RFC 3339 compliant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's what I meant. I'm all in favour of simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to merge once the revision's updated
Where a bearer token is returned to the client for future use, optionally include an
expires
field which indicates the latest time that it will be treated as valid.The server is free to expire tokens at any time so this field is purely advisory.
Fixes #674