-
Notifications
You must be signed in to change notification settings - Fork 4
Description
- Spec says resumption tokens must be idempotent.
- By default, we simply encode the request parameters with Base64
- This opens the possibility for crafting stupid requests, etc
Adding a nonce when the token is created means it can be used to identify cached entries coming from the same origin. An implementing repository could discard any requests with an unrecognized nonce.
Of course, the nonce would need a shared secret between the library and the repository - otherwise there won't be a common ground to identify valid new tokens crafted by the library and sent to the repository. As there already is RepositoryConfiguration
, this is an easy thing to add.
The secret should be some random string by default, so it get's re-initialized on every application start by default to avoid at least very stupid replay attacks (expiring old tokens). An application using the library may choose to provide a static key, schedule rotation etc - that's up to their DevSecOps. Applications storing tokens in a database can use the recent secret to identify old entries.