Skip to content

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

achingbrain
Copy link
Member

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

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
@@ -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)
Copy link
Contributor

@MarcoPolo MarcoPolo May 1, 2025

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.

Copy link
Member Author

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.

Copy link
Member

@p-shahi p-shahi left a 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

@achingbrain
Copy link
Member Author

Refs ipshipyard/roadmaps#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

Include expiry date alongside bearer token in HTTP PeerId Auth
3 participants