Documentation
¶
Overview ¶
Package agenttoken mints and parses fleet agent credentials. A credential is opaque to the agent but carries a routable, non-secret prefix so the server can resolve the tenant (and agent) before a Row-Level-Security lookup, then verify the secret by a constant-time hash comparison. Only the hash of the secret is ever stored; the plaintext is shown once at creation.
Format: "<kind>.<b64url(tenantID)>.<b64url(id)>.<b64url(secret)>". For an enrolment token id is empty. The tenant/id parts are NOT secret (they just route the lookup); forging them fails the hash comparison because the attacker cannot produce the matching secret.
Index ¶
Constants ¶
const ( KindEnrol = "et" // single-use enrolment token KindAgent = "fa" // long-lived agent bearer credential )
Kinds of credential.
Variables ¶
This section is empty.
Functions ¶
func B64 ¶
B64 encodes a routable (non-secret) token part with the same alphabet Mint uses. Exposed so callers and tests can construct or inspect the tenant/id parts of a token.
Types ¶
This section is empty.