Documentation
¶
Overview ¶
Package admin manages the read API's bearer-token file.
On first run we create data/admin_token with a fresh random token (256 bits, hex-encoded). On subsequent runs we read it. ARCHITECTURE § 6 says: "auto-generated on first run; print to stdout once at startup; if deleted, regenerate on next startup and print again".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareConst ¶
CompareConst constant-time compares two tokens. Use this in the authentication middleware to avoid timing leaks per SECURITY.md threat model.
The expected token is the 64-char hex value generated by EnsureToken; its length is a fixed public constant of the project. Any candidate whose length differs is rejected up front — there is no length to leak. subtle.ConstantTimeCompare then runs on equal-length inputs.
Types ¶
This section is empty.