ADR-019: canopy-identity — Identity-Service Contract for Workers and Services
Amended by ADR-043 and
ADR-037 /
retired in part by #1443 (OIDC C1, 2026-08-24). The service identity
half of this ADR (per-service client_credentials tokens, service:*
roles; the audit actor_service column was never built — see
Amendment 1) remains the fleet contract, with ADR-037
adding sender-side revalidation of the cached service token. The
on-behalf-of half — the X-Canopy-Actor header and its canopy-signing
actor JWTs — is RETIRED: worker identity now rides RFC 8693 exchanged
bearers (ADR-043 amendment A2 + the receiver-contract slices), and the
auth middleware rejects any request still carrying the header (401). The
sections below describing the actor mechanism are preserved as the
historical design record. Its provider list and the configurable roles path
are corrected by ADR-048
(Amendment 2).
2026-10-12: both halves are now canopy-identity’s own tokens, system tokens and onward delegation; see Amendment 3.
Environment keys as built (2026-09-17). None of the
CANOPY_IDENTITY_* / CANOPY_<SERVICE>_CLIENT_* names in the "Required
environment variables" table below is read by any code; the contract is
carried by the per-service CANOPY_<SVC>__OIDC_* keys of
ServiceSettings (crates/canopy-common/src/settings.rs, ADR-012
layering). Authoritative list and defaults:
Configuration Reference ›
Baseline variables.
| Contract variable | As built |
|---|---|
|
|
|
|
|
No key. Service tokens carry |
|
Retired (Amendment 2): the roles sources and the service marker’s wire prefix are |
|
|
|
|
The only CANOPY_IDENTITY_* names any code reads are the two secret inputs of
cargo xtask identity verify (CANOPY_IDENTITY_EXCHANGER_SECRET,
CANOPY_IDENTITY_PORTAL_SECRET, xtask/src/cmd/identity.rs) — tool
inputs, not service configuration.
2026-10-12: the OIDC_* keys and both tool inputs are gone; each service
reads IDENTITY_ISSUER and IDENTITY_INTERNAL_URL. See
Amendment 3.
Context
Service-to-service calls in canopy currently pass the worker’s JWT end-to-end. canopy-web extracts the worker’s bearer token from the inbound HTTP request and attaches it to the outbound call to canopy-eligibility, which attaches it to canopy-snap, which attaches it to canopy-rules. Three observed problems:
-
Per-endpoint role gates pile up at every internal boundary. E0.5 (#429) had to add
Claims::require_any_role(&["caseworker","supervisor","admin"])toPOST /v1/evaluateon canopy-rules — an internal endpoint that should never be reachable by anything other than program services. The role check protects against the bad case where a worker JWT does reach canopy-rules, but the bad case shouldn’t be possible in the first place. Every internal service grows a cargo-culted set of these checks; missing one is a vulnerability (canopy-rules went unprotected for months). -
Worker JWT lifetime bounds service-to-service calls. The token expires when the worker session does (8h sliding for canopy-web). A long-running orchestrator dispatch or a deferred outbox-drainer publish can outlive that token. Today this is masked because most calls are synchronous and complete in seconds, but
canopy-eligibility::orchestratoralready times out individual program calls at 5–30 s, and any drift toward longer-running flows walks straight into expired-token-mid-flight failures. -
Service-to-service calls have no caller-service identity in audit logs. The
audit_eventschain (ADR-014) recordsactor_user = subfrom the JWT. When canopy-eligibility calls canopy-snap, the audit row says "actor=worker:jane.doe" — true at the top of the call chain, but useless for "which service initiated this read of FTI?" because the answer is always the same: the worker. Reviewer noted on the 2026-05-07 audit that we cannot distinguish "worker invoked SNAP determination directly" from "worker invoked eligibility orchestration which fanned out to SNAP" without parsing logs.
The architectural endpoint is service identity — each canopy-* service authenticates as itself to other canopy-* services. Worker identity, when relevant for audit or eligibility decisions, travels alongside as an explicit "on-behalf-of" assertion, not as the credential itself.
Constraints
-
Per-jurisdiction, not multi-tenant SaaS. Each jurisdiction runs its own canopy stack. Architectural simplicity per stack is what matters.
-
Operators choose any IAM backend. Per
idp-integration.adoc, deployers run whatever they have — Keycloak, Okta, Auth0, Azure AD / Entra ID, Authentik, ForgeRock, PingFederate, on-prem AD with ADFS or LDAP. Canopy must not lock anyone into a specific backend. -
Canopy is not in the ops business. xtask is dev/CI tooling. Production identity-backend lifecycle (provisioning, secret rotation, access-review) is the deployer’s responsibility via their existing IaC and operations practices. Canopy supplies contract, conformance test, and reference templates — nothing that mutates production infrastructure.
Relationship to CRAIG
CRAIG (the sibling CCWIS project) has converged on three principles for worker authentication:
-
CRAIG ADR-011 — Published JWT contract; any RFC 6749 + OIDC-discovery IdP works; configurable role claim path; no IdP admin API dependency.
-
CRAIG ADR-021 — Per-service
audenforcement,azp/scope/typvalidation. -
CRAIG ADR-026 —
worker_identitiestable populated lazily from observed JWT claims; no calls to IdP admin APIs to map preferred_username → sub.
Canopy adopts these worker-auth patterns as-is. Same contract, same enforcement, same identity-normalization approach. Where canopy is currently ahead of CRAIG (canopy-auth already uses OIDC discovery and OIDC_ISSUER env var convention; CRAIG’s ADR-011 says it should but the code still has Keycloak-specific paths), CRAIG should catch up.
Where canopy genuinely diverges from CRAIG: internal service identity. CRAIG’s call graph is dominated by RabbitMQ async messaging (CRAIG ADR-003); canopy’s orchestrator pattern produces ~30 synchronous service-to-service calls per worker action, each currently passing the worker JWT. CRAIG can defer service-identity work until they hit the same scale; canopy cannot.
Options considered
-
OAuth2 client_credentials directly against the operator’s IdP, no canopy-side abstraction. Each canopy service registered as a client in the deployer’s IdP. Major IdPs all support this; bare AD/SAML-only deployers must run their own federator (Keycloak/Dex/etc.) outside canopy. Considered. Loses the "single integration point per service" property — every canopy service ends up with operator-IdP-specific config (claim paths, audience values, token endpoints) duplicated.
-
Self-signed service JWTs with canopy-signing as trust root. Every service self-signs its own service token; canopy-signing publishes an aggregated JWKS. Builds a parallel auth system inside canopy. Confuses canopy-signing’s existing role (signed determinations per ADR-002) with auth identity. Forces every service to validate two kinds of tokens. Rejected.
-
Build a canopy-identity proxy service that wraps backends. New canopy-* service container that sits between canopy services and the actual IAM backend. Adds latency, a SPOF, and operational footprint. Most of what such a proxy would do is already done by OIDC discovery. Rejected.
-
Define canopy-identity as an interface contract; backends fulfill it directly. No new service container. canopy services depend on
CANOPY_IDENTITY_ISSUER(an OIDC issuer URL); operators point that at any compliant backend. Selected.
Decision
canopy-identity is a contract, not a service container. Every canopy-* service depends on the canopy-identity contract URL — an OIDC issuer that satisfies the requirements below. No new service is introduced. Operators choose any compliant backend (Keycloak by default in the dev stack; Dex, Authentik, Okta, Entra, ForgeRock, or custom in production). Canopy ships the contract definition, a conformance test, and reference IaC templates — but does not own production identity-backend lifecycle.
The canopy-identity contract
Required environment variables
| Variable | Meaning |
|---|---|
|
OIDC issuer URL. Used for |
|
Optional override of the issuer URL for in-cluster traffic (Docker network, Kubernetes service DNS). Same content, different network locator. Replaces the existing per-service |
|
Audience claim canopy services validate against. |
|
JSON-pointer-style path to the roles array in the JWT. Default |
|
Prefix marking a role as a service identity. Default |
|
The OAuth2 client_id this service uses for its own client_credentials grant. Example: |
|
Secret for the OAuth2 client. Encrypted via SOPS per ADR-017 in |
Required OIDC discovery endpoints
The issuer’s /.well-known/openid-configuration document MUST advertise:
-
authorization_endpoint— for workerauthorization_code+ PKCE flows from the BFFs. -
token_endpoint— supportinggrant_type=client_credentials(services) andgrant_type=authorization_code(workers). -
jwks_uri— for JWT signature verification. -
end_session_endpoint— RP-initiated logout from the BFFs (recommended; not required).
Required token shape
Service tokens (issued via client_credentials):
-
issmatchesCANOPY_IDENTITY_ISSUER. -
subis stable across the service principal’s lifetime. -
azp(orclient_idclaim) identifies the calling service. -
audincludescanopy-internal-service. -
exp,iatstandard. -
The roles claim (at
CANOPY_IDENTITY_ROLES_CLAIM_PATH) contains an entry starting withCANOPY_IDENTITY_SERVICE_ROLE_PREFIX. Default:service:canopy-<name>.
Worker tokens (issued via authorization_code to a BFF client):
-
issmatchesCANOPY_IDENTITY_ISSUER. -
subis the worker’s stable identifier. -
audis the requesting BFF client (canopy-ui,canopy-api, etc.). -
preferred_username,emailstandard OIDC. -
Roles claim contains worker roles (no
service:*entries). Per-jurisdiction role taxonomy (peridp-integration.adoc).
Canopy Claims deserialization tolerates either string or array aud (per CRAIG ADR-021’s aud_or_vec deserializer). Roles are looked up via the configured path with a default-Keycloak fallback.
Conformance: cargo xtask identity verify
A read-only conformance check that points at any candidate backend and confirms it satisfies the contract. Behavior:
-
Hits
<issuer>/.well-known/openid-configuration. Verifies the four required endpoints are present. -
Fetches
jwks_uri. Confirms it parses, contains usable signing keys. -
Performs a
client_credentialsgrant using a test service principal (configured in the same env vars as a real canopy service). Validates the response token against the contract:iss,aud,exp, role claim shape, audience. -
Performs an
authorization_codeflow with PKCE against a test worker principal (when test credentials are available). Validates the resulting token similarly. -
Reports per-check pass/fail with diagnostic detail.
cargo xtask identity verify --issuer <url> is safe to run anywhere — dev, CI, production deployment-gating. It does not mutate the backend. Production deployers run it as part of their canopy rollout pipeline; CI runs it against the devstack Keycloak as a regression check.
Reference templates: cargo xtask identity render
Pure code generation. Emits IaC fragments for backends canopy provides adapters for:
-
cargo xtask identity render --backend keycloak [--out realm.json]— emits a Keycloak realm definition with the worker realm + 13 service-account clients + audience mappers +service:canopy-*realm roles. Operators merge it into their Keycloak Operator CR / Helm chart / Terraform Keycloak provider config. -
cargo xtask identity render --backend authentik [--out blueprint.yaml]— emits an Authentik blueprint covering the same shape. -
cargo xtask identity render --backend dex [--out dex.yaml]— emits a Dex static-clients + connector-config template.
Backends without a render adapter (Okta, Entra, ForgeRock, PingFederate, custom) require operator-side configuration in whatever tooling the operator already uses. The contract definition above + the conformance test give them the spec they need.
Lifecycle ownership
Canopy ships:
-
The contract (this ADR + env-var schema in canopy-common config).
-
The conformance test (
cargo xtask identity verify). -
Reference IaC templates (
cargo xtask identity render --backend …). -
Devstack provisioning (
cargo xtask dev identity provision— namespaced underdevso the dev-only intent is unmistakable; mutates the devstack Keycloak admin API to install the canopy realm). -
Client-side code in canopy-auth that consumes the contract (token sources, JWT validators, claims extensions).
Canopy does not ship:
-
Production provisioning that mutates a deployer’s IAM backend.
-
Production secret rotation tooling.
-
A canopy-identity service container.
The application requires service client credentials to exist; it does not own their lifecycle. Production deployments provision them through the deployer’s existing operations stack (Terraform with the relevant IAM provider, Helm/Kustomize values, Ansible, Vault scripts, Authentik blueprints in gitops, Keycloak Operator CRs, or human admin-console clicks) and validate them with cargo xtask identity verify before rolling out canopy services.
On-behalf-of: X-Canopy-Actor
When a service makes an outbound call on behalf of a worker (e.g., canopy-eligibility orchestrating a SNAP determination requested by worker:jane.doe), the bearer token is the calling service’s client_credentials-issued token. Worker identity propagates via an X-Canopy-Actor header carrying a service-signed JWT:
{
"iss": "canopy-eligibility",
"sub": "<worker-sub>",
"preferred_username": "jane.doe",
"<roles-claim-path>": ["caseworker"],
"aud": "canopy-internal-actor",
"exp": <now + 600>,
"iat": <now>,
"act_for": "canopy-eligibility"
}
The actor JWT is signed by the calling service’s existing canopy-signing keypair (the same key used for ADR-002 signed determinations). Different aud namespace (canopy-internal-actor) separates the two uses — a leaked determination JWS doesn’t grant actor authority and vice versa. The actor JWT validates against canopy-signing’s JWKS (separate from canopy-identity’s JWKS).
Two JWKS to validate per request when X-Canopy-Actor is present is by design. The bearer is canopy-identity-issued (operator backend); the actor is canopy-signing-issued (canopy-internal). Conflating them would put canopy in the IdP business; keeping them separate keeps the operator’s IAM backend the single source of truth for who and canopy-signing the source of truth for which canopy service signed this assertion.
This pattern works regardless of whether the operator’s backend supports RFC 8693 token-exchange (most don’t, today). Operators with token-exchange-capable backends could in principle use backend-issued actor tokens; canopy doesn’t require it.
Receiving-side validation
canopy-auth::middleware:
-
Extract
Authorization: Bearer <token>. Validate against canopy-identity’s JWKS (cached at startup, refreshed onkidcache miss). Validateaudmatches per-endpoint expectation:canopy-internal-servicefor internal endpoints, the BFF client for worker-facing entry points. Validateexp,iss. -
Look up the configured roles claim path. If any entry starts with
CANOPY_IDENTITY_SERVICE_ROLE_PREFIX, markClaims::is_service() == true. -
If the request also carries
X-Canopy-Actor, validate the actor JWT against canopy-signing’s JWKS, checkaud == "canopy-internal-actor", setclaims.actor = Some(Box::new(actor_claims)). -
Reject if either validation fails. Never silently drop.
Claims API
impl Claims {
pub fn is_service(&self) -> bool {
self.roles().iter().any(|r| r.starts_with(SERVICE_ROLE_PREFIX))
}
pub fn service_id(&self) -> Option<&str> {
self.roles().iter()
.find_map(|r| r.strip_prefix(SERVICE_ROLE_PREFIX))
.or(self.azp.as_deref())
}
pub fn require_service_caller(&self) -> Result<(), ApiError> {
if self.is_service() { Ok(()) } else { Err(ApiError::Forbidden) }
}
pub fn actor(&self) -> Option<&Claims> { self.actor.as_deref() }
}
Claims::roles() reads from the configured path (default realm_access.roles).
As built (2026-09-11, #1848). No Claims::roles() accessor was ever
built. Roles are read straight from the realm_access.roles claim:
Claims::has_role — and require_role / require_any_role / the
require_*_or_above bars layered on it, plus the is_service /
service_id helpers shown above — all iterate that field
(crates/canopy-auth/src/claims.rs). CANOPY_IDENTITY_ROLES_CLAIM_PATH
(listed among the required environment variables above) is read by no
code today; the deserializer expects the Keycloak shape, and the
configurable roles-claim path remains a follow-up, tracked by #515
(multi-IdP claim-shape support — roles_claim_path + validation mode),
which owns claim-shape configurability repo-wide. The paragraph above
is preserved as the historical design record.
Consequences
Positive
-
Single integration point per service. Every canopy-* service depends on one URL (
CANOPY_IDENTITY_ISSUER). No per-service operator-IdP integration. No per-service per-IdP claim-mapper hand-coding. -
Genuine backend pluggability. Services don’t know the backend type because they only consume OIDC discovery + JWKS + standard JWT claims. Keycloak, Dex, Authentik, Okta, Entra, ForgeRock, or a custom Rust binary all work as long as
xtask identity verifypasses. -
No new service container. Zero net deployment-surface increase. canopy-auth (existing crate) gains client-side helpers; everything else is reference templates and a verifier.
-
Production identity lifecycle stays with the deployer. Canopy doesn’t claim ownership of secrets, client registrations, or rotation schedules. Operators use their existing IaC.
-
Per-endpoint role gates collapse. Internal endpoints check
claims.is_service(). The role-gates added in #429 becomeclaims.require_service_caller()— one line per endpoint. -
Audit log gains caller-service.
audit_events.actor_service = claims.service_id()(always present on service tokens).actor_user = claims.actor.as_ref().map(|a| &a.sub)(when X-Canopy-Actor is present). The reviewer’s "did the worker invoke SNAP directly or via orchestrator" question now has a definitive per-row answer. -
Service token lifetime decoupled from worker session. Service tokens refresh on the service’s schedule. Long-running flows don’t fail mid-flight on session expiry.
-
Aligns canopy with CRAIG on worker auth. CRAIG ADR-011/021/026 patterns adopted verbatim. Canopy is ahead on implementation; this ADR codifies the shared direction.
Negative
-
Two JWKS to validate per request when X-Canopy-Actor is present. Bearer validates against canopy-identity JWKS; actor validates against canopy-signing JWKS. Mitigated by caching: canopy-auth caches verified JWTs for 30 s, with separate cache hits for bearer and actor tokens.
-
Operators must configure 13 service-account clients in their IAM backend. This is real work, but it’s a one-time per-stack cost (canopy is per-jurisdiction, not multi-tenant SaaS) and
xtask identity renderprovides a starting template for the supported backends. -
Reference templates can drift from canopy’s expectations. Mitigated by
xtask identity verify— operators run it post-provisioning to confirm their backend matches canopy’s contract. -
Secrets rotation is the deployer’s job. Canopy-side caching survives a rotation event up to the cached service-token TTL (1h default); after that, services need a fresh client_credentials grant. Operators document their rotation procedure; canopy doesn’t ship rotation tooling.
Mitigations
-
JWKS staleness: OIDC discovery + JWKS endpoints publish with sensible cache headers; canopy-auth refreshes on
kidcache miss. -
Per-stack trust isolation: Each canopy stack uses its own canopy-identity issuer URL. Tokens from stack A don’t validate against stack B because the JWKS keys differ.
-
Per-endpoint role gates from #429: Removed during the cutover MR (Phase 3).
require_service_calleris the structural replacement.
Migration: hard cutover (pre-1.0)
Pre-1.0 with no production users. Three implementation MRs after the ADR lands:
| Phase | Behavior |
|---|---|
MR 1 — ADR + contract docs |
This ADR lands standalone. Plus updates to |
MR 2 — Foundations |
|
MR 3 — Outbound flip + cutover |
Every canopy-eligibility orchestrator + canopy-web outbound call switches from forwarding worker JWT to |
Worker-facing entry points (canopy-web, canopy-portal, canopy-applications intake, canopy-eligibility’s /v1/eligibility/determine worker entry, canopy-enrollment caseworker actions, canopy-renewals, canopy-appeals) keep accepting worker JWTs validated against canopy-identity’s JWKS — same JWKS, different aud. That’s the steady state.
Out of scope
-
mTLS between services. Could layer on top of this design. Not a substitute.
-
Token-binding (RFC 8473). Not necessary at canopy’s threat model.
-
Per-service token audience. Single
aud: canopy-internal-serviceis sufficient. -
Replacing canopy-signing. canopy-signing keeps its existing role (signed determinations, ADR-002) plus a small extension (signed actor JWTs, distinct
audnamespace). -
Worker on-behalf-of without going through a BFF / determine entry. Worker tokens are validated once at the front door; thereafter worker identity travels as actor JWTs. There is no "worker calls canopy-rules directly" path — that was never supposed to be possible and is now structurally prevented.
-
Service catalog, multi-tenancy, projects/domains, quotas, endpoint registry. OpenStack Keystone provides these; canopy doesn’t need them.
-
Production provisioning tooling. Canopy ships dev provisioning + reference templates + a conformance test. Production lifecycle is the deployer’s responsibility.
References
-
ADR-002 — Black-box determination contract (canopy-signing’s existing role)
-
ADR-014 — FTI audit hash chain (audit log shape this ADR enriches)
-
ADR-017 — Encrypted secrets at rest (where service-account client secrets live)
-
idp-integration.adoc(jurisdiction-onboarding constraints — canopy-identity contract is documented here for operators) -
CRAIG ADR-011 (IAM abstraction — published JWT contract for worker auth, external)
-
CRAIG ADR-021 (JWT validation — per-service
audenforcement, external) -
CRAIG ADR-026 (IdP-neutral identity — never call IdP admin APIs, external)
-
RFC 8693 — OAuth 2.0 Token Exchange (semantic inspiration for X-Canopy-Actor)
-
OpenStack Keystone federation (architectural inspiration: services trust one identity contract; backend pluggability is a property of the contract, not the implementation)
-
GitLab issue #424 (this ADR’s implementation tracker)
-
GitLab issue #429 (the per-endpoint role-gate finding this ADR obsoletes structurally)
-
GitLab issue #422 (existing OIDC pluggability work — closed; the worker-side groundwork this ADR builds on)
Amendment 1 (2026-09-17) — as built
Status unchanged. This amendment records where the shipped service-identity half differs from the text above; the Decision and Consequences are not edited. The on-behalf-of half is covered by the retirement banner and ADR-043.
-
actor_servicewas never built. No.rsor.sqlfile in the tree names anactor_serviceoractor_user_subcolumn. The audit envelope carriessource_service— the publishing service (canopy_mq::envelope;audit_events.source_serviceinservices/canopy-security/migrations/20260326000000_create_security_tables.sql) — not the calling service. The caller’s identity is available on a service token asClaims::service_id()(crates/canopy-auth/src/claims.rs) but is not persisted as an audit column. The "Audit log gains caller-service" consequence and the MR 3 row "Audit log writers gainactor_service+actor_user_subcolumns" are therefore not as built. -
Environment keys. See the banner table: the contract is carried by the per-service
CANOPY_<SVC>__OIDC_*keys under ADR-012 layering, so the "single URL per service" consequence reads as-built as oneOIDC_ISSUER/OIDC_INTERNAL_URLpair per service, sourced from each service’s YAML tier. -
cargo xtask identity renderships Keycloak only. TheBackendenum inxtask/src/cmd/identity.rshas the single variantKeycloak; no Authentik blueprint or Dex template renderer was built. -
cargo xtask dev identity provisiondoes not exist. The module documentation ofxtask/src/cmd/identity.rsrecordsprovisionas deliberately absent; the devstack realm is imported fromdevstack/keycloak/canopy-realm.jsonthrough Keycloak’s--import-realm.cargo xtask identity verifyexists (Subcommand::Verify) and is the conformance check the Decision describes. -
ADR-037. The service-token acquisition half is amended by ADR-037: the holder of a cached
client_credentialstoken revalidates it against a bounded-freshness JWKS and re-mints when its signing key has been deleted.
Amendment 2 (2026-09-26, #515, ADR-048) — one trusted issuer, a declared claim contract
Status unchanged. ADR-048 corrects this ADR’s provider claims. The Decision and Consequences are not edited.
-
Supported backends. The Decision’s "Dex, Authentik, Okta, Entra, ForgeRock, or custom in production", the Context’s backend list and the Consequences' "all work as long as
xtask identity verifypasses" are not as built. canopy trusts exactly one issuer. The jurisdiction declares that issuer’s claim layout in the[identity]table ofrulesets/<jurisdiction>/idp.toml(canopy_auth::IdentityConfig), with two presets:keycloakandoidc-generic. Keycloak 26.2+ is the verified broker. Authentik and ZITADEL are recorded as incompatible with canopy’s exchange topology. A backend works when it meets the claim contract and the topology.cargo xtask identity verify --issuer <url> --jurisdiction <slug> --check-exchangechecks the contract’s projection of a service token and one single-audience exchange; it does not exercise hop 1’s two-audience mint or the hop-2 chained exchange, which only exchanging through both hops against that issuer proves (ADR-048 decision 5). SAML, LDAP and AD sources federate into the trusted issuer; canopy terminates none of them. -
The roles path and the service prefix are retired, not revived.
CANOPY_IDENTITY_ROLES_CLAIM_PATHandCANOPY_IDENTITY_SERVICE_ROLE_PREFIXstay unread. Their job is done by[identity.claims]:-
rolesis one or more RFC 6901 pointer sources (arrayorobject_keys), unioned; -
service_prefixis the service marker’s wire prefix (defaultservice:). Projection rewrites a kept marker to the in-processSERVICE_ROLE_PREFIX, soClaims::is_serviceandClaims::service_idnever depend on the issuer’s spelling.
-
-
Claims::roles()exists. The #1848 note under "ClaimsAPI" records that it was never built; #515 built it. Every validated token is projected throughClaimContract::project(crates/canopy-auth/src/claim_contract.rs), androles()returns the projected set: theROLE_VOCABULARYroles and the service markers, nothing else.realm_accessis gone fromClaims. -
azporclient_id. The token-shape rule "azp(orclient_idclaim) identifies the calling service" is as built since #515: projection takesazp, elseclient_id(RFC 9068), and refuses a token carrying both with different values.
Amendment 3 (2026-10-12, #2883, ADR-049) — canopy-identity is canopy’s issuer
Status unchanged. ADR-049 supersedes this ADR’s Decision in part, and its plan I3g made that effective. The Decision and Consequences are not edited.
-
A module of canopy-security, not a contract. The Decision’s "canopy-identity is a contract, not a service container" and the rejection of options 2 and 3 are superseded (ADR-049 D1, D2). canopy-identity is canopy’s own OAuth 2.0 issuer, a module of canopy-security, and every receiver trusts only it. No operator IdP issues a token a service accepts: the upstream IdP only signs workers in at canopy-web (ADR-048 Amendment 1). Still no new container ships.
-
Service identity becomes system tokens. A service authenticates as itself with a system token: one audience, its purpose’s scope, at most 600 s, minted only for a compiled
SystemorBothcall-graph edge (ADR-049 Amendments 3, 4 and 16). It is obtained byprivate_key_jwtwith the service’s own key (D10), not byclient_credentialswith a secret.service:*roles and thecanopy-internal-serviceaudience are gone, which also ends Out of scope’s single shared audience. A receiver refuses a system token whose client has no edge to it (Amendment 14, L3), and a handler admits the caller by the route’s namedAdmission(principal.admit), which replacesrequire_service_caller. -
On-behalf-of becomes onward delegation. The retired
X-Canopy-Actorheader is refused with 400actor_header_retired(Amendment 14, L4). A call inside a worker’s request carries a delegation token: the worker’s canopy subject assub, and an RFC 8693actchain naming each hop (D3). A service delegates onward from the token addressed to it, never widening (Amendment 7, G9). The Context’s three problems are answered by structure:-
a worker’s token reaches only a route whose admission admits its roles, from any actor or only through the actors it lists;
-
background work takes a system token, which no worker session bounds;
-
the
actchain names the calling service on every delegated call.
canopy-cli’s delegation reaches services directly, canopy-rules included, under each route’s admission (ADR-007 Amendment 4).
-
-
Attribution. A system caller’s recorded actor is its client id, and a delegated call records the worker’s canopy subject (
Principal::actorandattribution_sub; ADR-049 Amendment 3, A4). Theactor_servicecolumn remains unbuilt (Amendment 1). -
Configuration. Each service reads the required
IDENTITY_ISSUERandIDENTITY_INTERNAL_URL(ServiceSettings). A service that calls another holds its client key as a reserved secret (ADR-017 Amendment 3). TheOIDC_*keys, the service client id and secret, the exchanger pair andaccept_own_audienceare gone. -
Tooling.
cargo xtask identity verifyandidentity renderare gone.cargo xtask identity checkis canopy-identity’s deploy gate (ADR-049 Amendment 23, O8), andidentity conformanceruns an upstream IdP’s conformance lane. Production lifecycle stays the deployer’s: a deployment registers each client’s public keys in canopy-security’sidentity-clients.yamland provisions the private keys through its secret provider. -
ADR-037. The cached-token revalidation Amendment 1 cites is superseded too (ADR-037 Amendment 2).