Expand description
Who may see a package: bearer token → sha256 → credential row → decision.
Raw tokens are never stored or logged; only hash_token of one leaves a request.
Modules§
Structs§
- Token
Row - A credential and its grants, as stored.
Enums§
Constants§
- TOKEN_
PREFIX - Marks a Pacenotes access key, for users and for secret scanners.
Functions§
- bearer_
from_ headers - The raw token from
Authorization: Bearer <token>, if well-formed. It is a credential: never log it or put it in an error. - decide
publicis always allowed; any other directory needs a live credential granted it, and a live credential without that grant sees the directory as absent.- hash_
token - Lowercase hex sha256: the only form of a credential the server keeps.
- load_
token - The credential with this hash and all its grants, in one query;
Nonewhen no such credential exists. - mint_
token pcn_+ 32 random bytes as unpadded base64url; the caller shows it once and stores onlyhash_tokenof it.- now
- Current unix seconds.
- well_
formed - Whether
mint_tokencould have produced this, checked before any database lookup so a garbage header costs no query, which remote libSQL bills.