Skip to main content

Module token_secret

Module token_secret 

Source

Constantsยง

TOKEN_BODY_LEN ๐Ÿ”’
The random part of a minted key: 32 bytes as unpadded base64url.
TOKEN_PREFIX
Marks a Pacenotes access key, for users and for secret scanners.

Functionsยง

base64url ๐Ÿ”’
hash_token
Lowercase hex sha256: the only form of a credential the server keeps.
mint_token
pcn_ + 32 random bytes as unpadded base64url; the caller shows it once and stores only hash_token of it.
well_formed
Whether mint_token could have produced this, checked before any database lookup so a garbage header costs no query, which remote libSQL bills.