Skip to main content

Module identity

Module identity 

Source
Expand description

Kanidm account naming, ownership-checked ensure and delete. Deterministic Kanidm identity for individual RADIUS custom resources, and the executors that ensure and delete it.

A Kubernetes object name is reusable after deletion. Kanidm accounts live outside Kubernetes garbage collection, so using only namespace/name would accidentally adopt a previous or unrelated account after recreation. Instead the immutable Kubernetes UID identifies the account. Always inspect existing account ownership metadata before updating it; a matching computed name alone must never authorize adoption.

Each CR owns exactly one account, joined to the built-in idm_radius_servers group additively: only this account’s membership edge is ever added or removed, never group_set_members, which could revoke unrelated RADIUS instances. Deleting the account removes every token on it. Call the executors only after namespace authorization, the restore guard and input validation.

Structs§

IdentityOutcome
What ensure_identity changed.
RadiusIdentity

Enums§

AccountState
What exists in Kanidm under this identity’s account name.
DeleteOutcome
What delete_identity found and did.
RadiusIdentityError

Constants§

RADIUS_GROUP
Built-in Kanidm group whose members may act as RADIUS servers.

Functions§

account_state
Classify a fetched account. Only the exact marker authorizes use; never update an existing account to make it match (silent adoption).
delete_identity
Remove exactly this CR’s membership edge, then delete its account. Call only after the workload has drained. An account without our marker is ExecError::AccountNotOwned and is left untouched (the finalizer turns that into a skip with a Warning event).
ensure_identity
Ensure the per-CR account (created, never adopted) and its own membership edge in idm_radius_servers. Mints, rotates and revokes nothing.
is_member
Is account in a member attribute list (names or SPNs)?