feat(app): new token issuance - #1438
Open
raphaelrobert wants to merge 8 commits into
Open
Conversation
raphaelrobert
marked this pull request as ready for review
August 13, 2026 17:57
kkohbrok
approved these changes
Aug 14, 2026
| IssuanceConflict issuance_conflict = 2; | ||
| // The claimed allowance epoch is not current on the server. | ||
| InvalidAllowanceEpoch invalid_allowance_epoch = 3; | ||
| } |
Member
There was a problem hiding this comment.
Shouldn't these errors be part of a grpc status message?
Collaborator
There was a problem hiding this comment.
I think they are actually normal outcomes of this endpoint, that will happen in the normal multi client scenario. So, the client must handle them in any case. I think it fine to map them here, instead to grpc status codes.
| )); | ||
| } | ||
|
|
||
| let now = Utc::now(); |
Member
There was a problem hiding this comment.
Wouldn't it make sense to take that as input (at least in an internal helper) so we can test the exact epoch transitions?
| info.extend_from_slice(key_fingerprint); | ||
| info.extend_from_slice(&allowance_epoch.to_be_bytes()); | ||
|
|
||
| expand(token_seed, &info) |
Member
There was a problem hiding this comment.
In other places we use a struct with TLS serialization for this sort of thing. But since this is all constant length, I guess this works, too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Token batches are now derived from a seed the user's devices share, so issuance is idempotent and every device holds the same tokens. A repeat of a request is answered from the batch the server already locked, which makes retries and rotation recovery free.
This PR also fixes issues in the old issuance protocol around key rotation.
Token issuance
Key rotation
Multi-device seed agreement
Client replenishment
Storage