UserIdentity
Group agentprimitives.authzed.com · Scope Cluster · Short names uid
UserIdentity is a human's credential catalog: the credentials one person has linked, keyed by their canonical SpiceDB subject, used by identityMode=userPassthrough agents through a per-session SessionUserIdentity projection.
Cluster-scoped. Reconciled by pkg/controllers/useridentity -- one reconciler for validity, one for proactive OAuth refresh. metadata.name is a deterministic hash of spec.subject rather than the subject itself, and the referenced Secrets live in the agentprimitives-identities namespace.
Spec
| Field | Type | Description |
|---|---|---|
spec.credentials | []object | Credentials are the user's reusable named credentials. Same shape as AgentIdentity.Spec.Credentials. The secretRefs name Secrets in the agentprimitives-identities namespace (IdentitiesNamespace). Credential names must match what tools declare (or the runtime default — see MCPServerAuth.Credential / ToolkitEnvVar.Credential). |
spec.credentials[].allowedHosts | []string | AllowedHosts scopes where this credential may be sent, as host patterns ("github.com", ".internal.example"). Matching is on the URL authority (host and port), case-insensitively; a leading "." matches one or more leading labels but never the apex, so an author who wants both lists both. It exists because destination and credential were independent fields on the same tenant-writable object with nothing tying them together: a SkillSource naming spec.repoURL: "https://attacker.example/x.git" and spec.auth pointing at a production PAT made the operator send that PAT to that host as an HTTP Basic password, reading the Secret with its own cluster-wide credentials so the actor never needed get secrets. EMPTY MEANS UNSCOPED, which is the only reading that does not break every existing credential on upgrade. That makes the field opt-in, so a caller with a stricter default enforces it itself rather than relying on this: the SkillSource controller refuses an unscoped credential for a clone outright, because there is no safe default destination for one. |
spec.credentials[].federated | object | Federated is populated when type=federated. The credential is MINTED on demand via ID-JAG from the user's enterprise identity — there is no stored access token. Valid ONLY on UserIdentity / SessionUserIdentity; rejected on AgentIdentity (bot identities have no human subject to assert). |
spec.credentials[].federated.idpSecretRef * | object | IdPSecretRef points at the subject-keyed IdP-identity Secret in IdentitiesNamespace (the user's refresh token). |
spec.credentials[].federated.idpSecretRef.name * | string | Name is the Secret's name, in the referring object's own namespace. |
spec.credentials[].federated.resource * | string | Resource is the identifier the IdP knows the MCP server by — the ID-JAG audience. |
spec.credentials[].federated.resourceServerURL * | string | ResourceServerURL is the MCP server URL whose authorization server accepts the ID-JAG (leg 2 discovery target). |
spec.credentials[].federated.scopes | []string | Scopes are optional scopes requested at the resource AS. |
spec.credentials[].githubApp | object | GitHubApp is populated when type=githubApp. |
spec.credentials[].githubApp.secretRef * | object | SecretRef points at the Secret the channel wizard wrote. |
spec.credentials[].githubApp.secretRef.name * | string | Name is the Secret's name, in the referring object's own namespace. |
spec.credentials[].name * | string | Name is the credential's unique identifier. It is matched against the credential names a toolkit/MCPServer declares to inject the resolved value at runtime. |
spec.credentials[].oauth | object | OAuth is populated when type=oauth. The referenced Secret holds access_token, refresh_token, expires_at, token_endpoint, client_id, scope as separate keys. Key names are fixed; not configurable. |
spec.credentials[].oauth.secretRef * | object | SecretRef points at a Secret whose keys hold the OAuth state. Required keys (read at runtime / refresh time): access_token — current access token refresh_token — long-lived refresh token (optional) expires_at — RFC 3339 timestamp; absent → never expires token_endpoint — auth-server URL for refresh client_id — OAuth client ID used at registration scope — granted scopes (informational) |
spec.credentials[].oauth.secretRef.name * | string | Name is the Secret's name, in the referring object's own namespace. |
spec.credentials[].static | object | Static is populated when type=static. |
spec.credentials[].static.secretRef * | object | SecretRef points at a Secret in the same namespace as the AgentIdentity. |
spec.credentials[].static.secretRef.key * | string | Key is the data key within the Secret holding the value. |
spec.credentials[].static.secretRef.name * | string | Name is the Secret's name, in the referring object's own namespace. |
spec.credentials[].type * | string | Type discriminates which of the blocks below is populated. (enum: static | oauth | federated | githubApp) |
spec.displayName | string | DisplayName is a human-friendly label (e.g. an email address) surfaced in CLI output and the web UI. |
spec.refreshThreshold | string | RefreshThreshold overrides the operator-wide default OAuth refresh threshold for this identity. No effect on type=static credentials. |
spec.subject * | string | Subject is the canonical SpiceDB subject of the user this catalog belongs to, e.g. "user:YWxpY2VAZXhhbXBsZS5jb20=". metadata.name is a deterministic hash of this value (see pkg/platform/identity/useridentity). |
Status
Status is controller-owned (observed state).
| Field | Type | Description |
|---|---|---|
status.availableCredentials | []string | AvailableCredentials is the set of credential names this identity successfully provides — a convenience for the operator's passthrough gate and CLI output. |
status.channelIdentities | []object | ChannelIdentities is the durable directory of the channel-native identities (Slack user in a workspace, …) that map to this canonical user. One canonical user fans out to many entries — the same human has distinct external IDs across unrelated Slack workspaces/orgs. Written by channelsd (best-effort) via a status merge-patch disjoint from the credential fields the useridentity controller owns. |
status.channelIdentities[].displayName | string | DisplayName is the channel-native display/real name, when known. |
status.channelIdentities[].domain * | string | Domain is the workspace/org scope (Slack team_id); "" for kinds without one. |
status.channelIdentities[].email | string | Email is the trusted email the channel vouched for, when known. |
status.channelIdentities[].externalID * | string | ExternalID is the channel-native user id, e.g. a Slack user_id. |
status.channelIdentities[].kind * | string | Kind is the channel kind, e.g. "slack". |
status.conditions | []object | Conditions carries Valid and Refresh; the reason constants are shared with AgentIdentity. |
status.conditions[].lastTransitionTime * | string (date-time) | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
status.conditions[].message * | string | message is a human readable message indicating details about the transition. This may be an empty string. |
status.conditions[].observedGeneration | integer (int64) | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. (min 0) |
status.conditions[].reason * | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. |
status.conditions[].status * | string | status of the condition, one of True, False, Unknown. (enum: True | False | Unknown) |
status.conditions[].type * | string | type of condition in CamelCase or in foo.example.com/CamelCase. |
status.lastRefreshAt | string (date-time) | LastRefreshAt is the most recent successful OAuth refresh. |
status.observedCredentials | []object | ObservedCredentials is the durable trigger state for in-flight credential revocation — see AgentIdentityStatus.ObservedCredentials for the full contract. SecretNames is unused here: a UserIdentity credential's master Secret name is derived from (identity, credential) rather than referenced by the spec. |
status.observedCredentials[].fingerprint * | string | Fingerprint is "<type>:<secretRefName>": stable across reconciles and sensitive to both a type change (static↔oauth) and a Secret-ref rename, which is how an OAuth refresh surfaces a replaced credential. |
status.observedCredentials[].name * | string | Name is the credential name from spec.credentials[].name. |
status.observedCredentials[].secretNames | []string | SecretNames are the backing Secret names for this credential, recorded so a REMOVED credential's revoke key can be reconstructed without re-reading a spec that no longer mentions it. Empty for UserIdentity, whose backing Secret name is derived from (identity name, credential name) rather than referenced by the spec. |
status.observedGeneration | integer (int64) | ObservedGeneration is the spec generation this status reflects. |
status.resolvedCredentials | []string | ResolvedCredentials lists credential names whose Secret + key resolved. |