Skip to main content

mint_token

Function mint_token 

Source
pub async fn mint_token(
    client: &KanidmClient,
    metrics: &ControllerMetrics,
    account: &str,
    expiry: Option<OffsetDateTime>,
) -> ExecResult<MintedToken>
Expand description

Mint a read-only token on the (already ownership-verified) account.

expiry is TokenPolicy::new_token_expiry(now): set when rotation is enabled, absent otherwise. The bearer is not stored anywhere yet: the caller must verify it and persist it in the config Secret in the same reconcile. If this call fails after Kanidm accepted the request, the token is an orphan the planner revokes once past the grace period.