Skip to main content

Module kanidm_token

Module kanidm_token 

Source
Expand description

Kanidm token mint, verify and revoke executors. Kanidm token executors: list, mint, verify and revoke.

These perform the effects the pure planner (super::token) decides on. They never choose what to do: minting happens only for a CurrentToken::Mint plan, revoking only for ids in a plan computed from a fresh observation (see the planner’s module docs).

Bearer tokens are write-only and shown once by Kanidm. Bearer holds one without Display, Serialize or a revealing Debug, so it cannot reach a log line or event by accident; call Bearer::expose only to write the config Secret or authenticate a verification session.

Structs§

Bearer
A Kanidm bearer token. Deliberately opaque: see the module docs.
MintedToken
A freshly minted, not yet verified or stored token.
VerifyRetry
How verify_token retries. Right after a mint, a Kanidm replica other than the one that issued the token may not know it yet.

Enums§

RevokeOutcome
What revoke_token did.

Functions§

find_minted_token
Find the one token carrying label that was not in before.
list_tokens
Tokens currently on the account.
mint_token
Mint a read-only token on the (already ownership-verified) account.
new_token_label
A unique label for one mint. The account is dedicated to one CR UID, so the label is informational (it names the issuer in Kanidm’s UI) and the uniqueness only serves to find the new token’s id after the call.
revoke_token
Revoke one token by id. A token that is already gone is success, so the call is idempotent across retries and concurrent reconciles.
verify_token
Promotion gate: authenticate to Kanidm with the candidate token alone. KanidmClient::new_session copies the cached client’s address and TLS settings but not its bearer, so a success proves the candidate itself.