Identity plane split, plan I0: ADR-049, ADR-050 and the Kanidm upstream verification (epic &130)

Status: Done (2026-09-30) — !1543
Epic: &130 (identity plane split)
Issues: #2485 (w3), #2486 (w5), #2487 (w5), #2488 (w2)
Branches:

  • MR-1 docs/adr-049-identity-plane-split (U1). It carries this page.

  • MR-2 feat/kanidm-upstream-conformance (U2, U3, U4), titled "Kanidm upstream profile, conformance suite and ADR-050 (#2486, #2487, #2488)". ADR-050’s evidence is U2 and U3’s output, so the three units ship together.

This is a Design + Scope plan. GitLab owns tracking. The plan freezes when U1 starts.

Erratum (2026-09-30): D2 and D3 are corrected to the as-built cache facts found in U1’s review. Delegation tokens are reused only within their request (ruling R4, ExchangeCache). Today’s subject_scoped_key covers audience, scopes and purpose, not roles and programs. The mitigation that D2 credits to caching is the system-token cache (ADR-037). The credentials file keeps secrets as zeroize::Zeroizing with a redacting Debug (the ServiceCredentials pattern), not secrecy::SecretString, which is not a workspace dependency.

Erratum (2026-09-30): U1’s security review tightened ADR-049, which is canonical from U1 on. The changes:

  • step-up is enforced by the issuer’s device-approval grant and the security-admin routes;

  • a system token is never a delegation subject token;

  • a federated id_token must be at most 5 minutes old, and canopy-web checks its nonce;

  • device codes get phishing mitigations (RFC 8628 §5.4);

  • a replica’s first key signs for at most 10 minutes, and the next key is inserted at least 60 s before sign_until;

  • the compromise response revokes every row inserted since the compromise;

  • the threat-model bounds are restated.

Erratum (2026-09-30): U2 and U3 differ from this page as built. The differences:

  • totp-lite lands in U2, because enrolment answers totpverify;

  • lanes::CLIPPY_FEATURES and its validate wiring land in U3 with the feature;

  • the command times an explicit compose build, and stop leaves the container for the next run to remove;

  • the scope map grants idm_all_persons;

  • the runtime image adds ca-certificates;

  • the realm usernames are kept, because Kanidm accepts . and -;

  • persons_are_offered_only_password_with_totp became a_person_cannot_commit_a_password_only_credential_and_is_offered_only_passwordmfa, which also proves that a password-only commit is refused;

  • a default run removes its container, and the devstack’s own probes ignore opt-in services.

Context

  • Goal. Kanidm becomes canopy’s default human IdP. ZITADEL and Keycloak become first-class alternatives, and all three are tested.

  • Why today’s design cannot reach it. ADR-048 makes the IdP the one issuer for sign-in, both exchange hops, every receiver and every service token (§2, §5). Kanidm 1.11.2 cannot be that issuer. Each client gets its own issuer. Exchange takes service-account subjects only. Access tokens carry only standard claims, none of the mapped authorization claims. Client-credentials tokens are JWE. Tokens live a fixed 900 s. There is no password grant. (Source: https://github.com/kanidm/kanidm/blob/v1.11.2/server/lib/src/idm/oauth2.rs, lines 976-980, 1747-1850, 1858-1976 and 2040-2111.)

  • The other products. ZITADEL 4.19.3 hides the exchange grant and only narrows audiences. Keycloak works, but canopy has compiled Keycloak’s rules in:

    • aud-<target> scopes (services/canopy-portal/src/tokens.rs, services/canopy-eligibility/src/orchestrator.rs);

    • the hop-2 audience pair (crates/canopy-auth/src/receiver.rs);

    • the harness password grant (crates/canopy-test-lib/src/auth.rs, about 90 files).

  • Maintainer rulings (2026-09-29/30).

    • canopy runs its own issuer, hosted in canopy-security. The IdP authenticates humans only.

    • Calls act as the user, per hop. Background work uses purpose-scoped system tokens.

    • Keys are per-replica ES256, held in memory.

    • Native clients use the RFC 8628 device flow.

    • canopy mints its own subjects.

    • The IdP profile is deployment configuration.

    • There is no backward compatibility and no timing constraint.

  • Constraints in the tree.

    • Receivers trust one issuer, default to RS256 and ignore the JOSE typ (crates/canopy-auth/src/jwks.rs).

    • signing_key_history is owned by the runtime role and has a SET LOCAL bypass (services/canopy-security/migrations/20260624000000_create_signing_key_history.sql).

    • The worker directory has no disabled flag.

    • Refresh single-flight is per process (services/canopy-web/src/auth/refresh.rs).

    • The devstack has no TLS.

    • An owner/runtime role split exists (MIGRATION_DATABASE_URL, crates/canopy-api/src/bootstrap.rs; canopy-reporting uses it).

Scope

In scope:

  • ADR-049 (D1-D14) and its banners;

  • the opt-in Kanidm devstack profile and its provisioning;

  • the Kanidm conformance suite;

  • ADR-050 (E1-E5);

  • the GitLab filing below.

Out of scope:

  • building canopy-identity (I1, I2), the cut-over (I3) and the alternative profiles (I4);

  • the key and secret loader defects, which get their own issue;

  • each amended ADR’s detailed amendment, which lands with the stage that makes it true.

Design

ADR-049: the identity plane (U1)

# Decision

D1

Two layers, one issuer each.

  • The edge has one upstream OIDC IdP per deployment, and canopy-web is its only client.

  • Internally, canopy-identity is the one issuer every receiver trusts.

  • ADR-048 §2 is restated per layer. Trigger 4 becomes "a second upstream at the edge, or a second issuer at receivers".

  • §5’s exchange topology retires, and with it the ZITADEL and authentik findings. An upstream owes OIDC sign-in only.

  • canopy never verifies a human’s password.

D2

canopy-identity is a module of canopy-security, not a new service.

  • ADR-019. Options 2 (canopy signs its own tokens) and 3 (an identity service) are adopted in modified form. Option 4’s "a contract, not a service container" is superseded. Option 3’s objections are answered by in-process signing, 2+ replicas, system-token caches and a capacity test before I3.

  • Isolation. A dedicated DB pool. Minting never takes the audit chain’s advisory lock.

  • Boot. An issuer-host bootstrap: its receivers read the in-process registry, and it boots on its DB alone.

  • Cold start. Postgres → migrations → canopy-security (ready after the publish lead) → other services (which accept an empty JWKS meanwhile) → canopy-web.

  • Edge. canopy-web stays the only public edge and forwards the device-authorization and token endpoints. The issuer identifier and internal URL are deployment configuration.

  • Split trigger. A separation-of-duties rule, or issuance load degrading canopy-security’s other work.

D3

Credentials. Compact JWS, ES256 (pinned in code), kid = the RFC 7638 thumbprint. One claim layout: iss sub aud exp iat nbf jti client_id sid roles programs act purpose scope auth_time.

  • Session. Opaque, client-bound and stored hashed; never a JWT. It comes from federation (web) or the device grant (native).

  • Delegation token (typ: at+jwt, RFC 9068). One audience. Carries the RFC 8693 act chain, which reverses ADR-043 A2’s unused act. Lives at most min(now + 300 s, the subject credential’s exp, the session’s end). This keeps today’s sender-side subject-exp check (crates/canopy-auth/src/token_exchanger.rs). Roles and programs may narrow, never widen.

  • System token (typ: at+jwt). sub is the client; it carries a purpose, one audience and the allowed scopes. Lives at most 600 s. It carries no user: the actor is the service, and an originating human is a referent (ADR-043 Amendment 1 holds).

  • Removed. canopy-internal-service, service:* roles, aud-* scopes and receiver introspection.

  • Routing. User-specific data goes by delegation, process-wide data by system purpose. A sender reuses a delegation token only within the request it serves (ruling R4). The reuse key is a digest of the exact subject credential plus the normalized request: today’s subject_scoped_key covers audience, scopes and purpose, and delegation adds the narrowed roles and programs. A narrower request therefore never receives a broader token. A reuse re-checks expiry.

D4

Policy is code. The call graph (caller → target) and the purpose registry ((client, audience) → scopes) are compiled tables in canopy-auth, not jurisdiction configuration. The issuer applies them; receivers re-check aud, typ and the last act hop.

D5

One trust root per credential, never shared.

  • Token at a receiver. The key registry; aud = the receiver.

  • Subject token at delegation. The key registry; aud = the authenticated client, plus a call-graph edge.

  • Client assertion (RFC 7523). The client registry; aud = the token endpoint; jti single-use.

  • Upstream id_token. The profile’s JWKS; iss exact; aud contains the client, with azp = client when there are several audiences; nonce checked.

  • DPoP proof (RFC 9449). The embedded JWK, whose thumbprint is the native session’s binding.

D6

Worker sign-in (canopy-web).

  • Upstream client. Confidential: authorization code, PKCE S256, state and nonce. The profile names the upstream client-auth method.

  • Federation. canopy-web validates the id_token and presents it to federation (RFC 8693, subject type id_token) using private_key_jwt. canopy-identity re-validates it, projects claims through the profile (ClaimContract::project), links the subject (D8), checks suspension and opens a session. With a userinfo profile, canopy-web also sends the upstream access token (the upstream_access_token parameter). canopy-identity calls userinfo with it, and projects claims only when userinfo’s sub equals the verified id_token’s (OIDC Core §5.3.2).

  • Refresh.

    • canopy-web re-federates after each upstream refresh, at least every 900 s, single-flight across replicas.

    • Each profile declares whether refresh returns an id_token. Kanidm does, and U3 proves it. A refreshed id_token must match the session’s iss, aud, sub and original auth_time. It must carry a newer iat and repeat the original nonce when present (OIDC Core §12.2). A profile without refreshed id_tokens renews through userinfo.

    • canopy-identity refuses to mint from any session whose last upstream validation is older than 900 s plus the grace. A refusal ends the session. An unavailable upstream gets at most 30 min of grace (code cap 60 min), which is audited.

  • Logout. Revokes the session and uses RP-initiated logout where advertised. Otherwise it revokes the upstream refresh token (RFC 7009) and the next sign-in sends prompt=login.

  • Step-up. Device approval and security administration need auth_time within 10 min, via max_age.

  • AC-8 and MFA. canopy-web renders the AC-8 banner. MFA stays the IdP’s obligation (ADR-048 §4); canopy does not read amr.

D7

Native and machine clients.

  • Native. RFC 8628 device authorization. A signed-in worker approves the code in canopy-web (D6 step-up). The session is a DPoP-bound rotating refresh credential. Per-target tokens come from refresh with an RFC 8707 resource. The password grant goes.

  • Machine. Client credentials with private_key_jwt.

  • Native revalidation. The step-up sign-in at approval gives canopy-web an upstream grant dedicated to the native session. canopy-web re-federates it like a web session, at least every 900 s, until the native session ends (8 h absolute, code cap 24 h) or is revoked. D6’s freshness rule applies, so upstream deprovisioning ends native issuance within the same bound.

  • Access tokens stay bearer.

D8

Subjects.

  • canopy mints a UUID v7 subject on first federation of an unseen (upstream iss, upstream sub). It matches that exact pair, never an email.

  • The link sits beside ADR-046’s directory, which re-keys on the canopy subject.

  • Seed links and re-links are audited security-admin writes. The seed’s fixed UUIDs become canopy subjects.

  • Sign-in now needs canopy-security, which reverses ADR-046 item 2.

D9

Keys.

  • Generation. Each replica generates an ES256 key in memory (p256 SigningKey::random(&mut OsRng)) and never persists it. The key sits behind a KeySigner trait in canopy-signing, which determination signing shares while keeping its provisioned keys (ADR-036).

  • Registry. Owned by a NOLOGIN role and migrated through MIGRATION_DATABASE_URL. The runtime role has INSERT and SELECT only.

  • Trigger (no bypass). Stamps created_at; sets sign_from +60 s, sign_until ≤ +24 h (default 6 h), and publish_until = sign_until + 720 s (600 s longest token + 60 s leeway + 60 s skew). Under a table lock it refuses a 65th published row. It refuses UPDATE and DELETE.

  • Revocation. A separate INSERT-only table. The JWKS (published minus revoked) is served from the DB and stays under canopy-auth’s 64 KiB cap.

  • Receivers. Receivers enforce three limits: the typ, exp − iat ≤ 600 s, and iat ≤ now + 60 s.

    • They refresh the internal JWKS every 300 s and on an unknown kid.

    • They fail closed for this issuer once their key set is 720 s stale. Today’s cache keeps keys after a failed refresh with no bound (crates/canopy-auth/src/jwks.rs). A retired or stolen key therefore stops working within that bound even during a JWKS outage.

  • Lifecycle. A replica publishes its key last at boot, and cannot become ready while the DB is down.

  • Compromise. Revoke the row, rotate the runtime DB credential, restart.

  • Hardening. Non-dumpable, no core dumps, read-only root, no exec in production RBAC.

  • Optional backends. An HSM or KMS backend only when a jurisdiction’s SC-12/SC-13 demands it; FIPS is per jurisdiction. Not Eviden/Cosmian: it is BUSL-1.1 and its client needs OpenSSL.

D10

Client auth is private_key_jwt (RFC 7523) for services, canopy-web, the portal and machine clients.

  • Per-client ES256 keys come through SecretProvider (ADR-017), with no file fallback. Up to two public keys per client are held in deployment configuration.

  • Assertion exp ≤ 60 s; jti single-use across replicas.

  • Not adopted: mTLS (RFC 8705) and platform tokens. Trigger: service-mesh PKI asking for sender-constrained tokens.

D11

Applicant portal. It keeps its own applicant authentication; its per-target tokens become system tokens with portal purposes. X-Canopy-Applicant stays portal-signed as a named carve-out. Its two-secret separation is the threat model in crates/canopy-signing/src/applicant_claim.rs.

D12

Revocation. canopy-security owns subject suspension (new), session revocation, client disablement and key revocation. Every mint checks them, so an in-flight token stays acceptable for at most 300 s (delegation) or 600 s (system), plus the 60 s leeway and 60 s skew. The admin routes need a security-admin role, are surfaced in canopy-web, and are audited.

D13

Issuance audit. Every mint and refusal appends to an INSERT-only log in canopy-security’s DB, with group commit. A credential is released only after its row commits (fail-closed), keeping the audit-before-release contract of crates/canopy-auth/src/exchange_audit.rs. The log is exported through ADR-041’s channel. canopy-security mints for itself in-process.

D14

Time and tests.

  • The issuer, receivers and sender caches read chrono::Utc::now(), never the test offset of canopy_common::clock.

  • No test-only grant exists. The battery signs in through the devstack’s upstream with a headless driver and federates as canopy-web does, on production images (ADR-040).

  • Each IdP gets a conformance suite. Playwright covers the default IdP plus an @identity subset per alternative.

  • The password grant goes everywhere.

ADR-049 also carries:

  • a threat model: stolen credentials; a compromised service, canopy-web or upstream; a stolen runtime DB credential; a memory read;

  • the rejected alternatives: Kanidm as issuer, multi-issuer receivers, Keycloak as issuer, and the other custody options;

  • reopen triggers: separation of duties, a mandated HSM or FIPS module, and a source no single upstream can broker;

  • references: RFCs 6749, 7009, 7523, 7638, 8414, 8628, 8693, 8707, 9068 and 9449, OIDC Core, and the IETF Transaction Tokens draft;

  • the filing map below;

  • a classification of every ADR that grep -ril "keycloak\|issuer\|client_credentials\|exchange" finds in the ADR directory, as amended (a decision changes; banner now, amendment with the stage), mentioned (context only; listed) or unaffected.

It takes effect at the I3 cut-over. Until then, ADR-048 describes the running system (the ADR-041 precedent).

ADR-050: Kanidm as the default upstream (U4)

  • E1. Default. Kanidm is the default for the devstack, the reference deployment and greenfield jurisdictions. ZITADEL and Keycloak are first-class alternatives (I4). A jurisdiction whose sources Kanidm cannot broker (Georgia: Okta SAML and eDirectory) picks ZITADEL, Keycloak or Okta OIDC as its one upstream. That is configuration, not code.

  • E2. Profiles are deployment configuration. [identity] and leave the ruleset’s idp.toml. The profiles are kanidm, zitadel, keycloak and oidc-generic. A vendor profile ships only with a passing conformance suite (ADR-048 §3 restated). Upstream clients take extra trust anchors from configuration.

  • E3. Operating model. Quarterly releases, upgrades from N-1 only, and 2-node replication. Logout is refresh revocation plus prompt=login, with the AC-8 banner in canopy-web. Kanidm is built from source on rust:alpine; failing that, the image is pinned by digest and the Alpine exception is recorded here.

  • E4. Verified facts. Dated and tagged, taken from U3’s JUnit results; build times and image size come from the command’s final step.

    • A per-client issuer, signing ES256.

    • Claim maps appear in the id_token and userinfo, never the access token, and are re-issued from current membership on refresh.

    • sub is the entry UUID. There is no acr or amr. Persons require MFA.

    • Presenting a refresh token after a rotation that happened in a later second revokes the whole session. A rotation within the token’s own issuance second is not detected (the comparison is in whole seconds). So single-flight must hold across replicas, and a lost refresh response forces re-login.

    • An expired account cannot refresh.

    • No end-session endpoint. Client authentication is basic or post only. Access tokens live 900 s.

    • Tolerated deviation, read from source: authorization codes may be reusable within their 60 s lifetime. PKCE and the confidential client mitigate this.

  • E5. New-dependency comparison. Kanidm against ZITADEL, Keycloak and authentik on licence (each LICENSE at the pinned tag), maintenance, adoption, security, musl/Alpine fit and footprint.

The Kanidm profile and suite (U2, U3)

  • Image (devstack/kanidm/Dockerfile).

    • Builder: rust:1.96-alpine plus build-base cmake. It builds the v1.11.2 tarball (SHA-256 verified) with cargo build --locked --release -p daemon and KANIDM_BUILD_PROFILE=container_generic. It links no OpenSSL; deny.toml covers canopy’s own workspace only.

    • Runtime: alpine:3.23, non-root, with server/core/static at /hpkg. The command is kanidmd server. HEALTHCHECK runs kanidmd scripting healthcheck.

    • There is no entrypoint.sh.

  • Compose. Service kanidm in profile idp-kanidm, which is outside every default profile and CI.

    • Port 8443.

    • server.toml (version = "2", migration_path = the migrations directory under /etc/kanidm) and that directory are bound read-only.

    • The DB is a tmpfs at /data, so every run starts fresh. The named volume kanidm-tls is at /tls.

    • Environment: KANIDM_DOMAIN=idm.canopy.test and KANIDM_ORIGIN=https://idm.canopy.test:<port>, since Kanidm overlays KANIDM_* variables.

    • KANIDM_CONFIG, set to the mounted server.toml under /etc/kanidm. Every kanidmd subcommand reads it (Kanidm’s server/daemon/src/opt.rs, line 117 at the tag), so cert-generate, scripting healthcheck and scripting recover-account see the mounted configuration. Without it, the container profile would default to /data/server.toml.

  • xtask.

    • The port comes from PORT_MAPPINGS (xtask/src/docker.rs), and discover_all_ports skips opt-in profiles.

    • One helper in xtask/src/devstack_guard.rs computes the infra hash for both sites and excludes devstack/kanidm/.

  • Migration (devstack/kanidm/migrations/00-canopy.hjson).

    • Persons jane.doe, jane.snap-worker and jane.unscoped. Roles and primary_programs mirror devstack/keycloak/canopy-realm.json. Each UUID is the realm id with its fourth group set to 0001, because Kanidm reserves everything below 00000000-0000-0000-0001-000000000000.

    • Groups canopy_role_<role> and canopy_program_<program>.

    • A basic client canopy-web:

      • claim maps roles and primary_programs (array join);

      • scope map openid profile;

      • oauth2_consent_prompt_enable: false;

      • short usernames;

      • an https redirect that is never followed;

      • PKCE enforced.

    • A name Kanidm refuses gets _ in place of ., noted in the file.

  • Command (cargo xtask identity conformance --idp kanidm [--keep]).

    1. Build with --build.

    2. Clear the previous run: rm --stop --force kanidm (after a failed run or --keep), then remove kanidm-tls.

    3. Run run --rm kanidm kanidmd cert-generate. It produces a 5-day leaf whose only SAN is the origin host.

    4. up -d, and wait until healthy.

    5. Copy the public CA out (cp kanidm:/tls/ca.pem to .devstack/idp/kanidm-ca.pem) before any host-side HTTPS request.

    6. exec kanidm kanidmd scripting recover-account idm_admin, which prints JSON.

    7. Provision through canopy_test_lib::upstream::kanidm::admin (the upstream module is not feature-gated):

      1. verify each migrated entry over REST, since a failed migration is only logged;

      2. set a random 32-character password, then enrol TOTP through the credential-update session and read back the SHA-256 secret;

      3. read GET /v1/oauth2/canopy-web/_basic_secret.

    8. Write the credentials file (.devstack/idp/kanidm.json, mode 0600) as upstream::kanidm::Credentials:

      • fields: origin, CA path, port, client id and secret, the idm_admin password, and each person’s name, UUID, password and TOTP secret;

      • secrets are secrecy::SecretString, and nothing is printed.

    9. Run cargo clippy -p canopy-test-lib --all-targets --features idp-conformance -- -D warnings. Then run cargo nextest run -p canopy-test-lib --features idp-conformance --profile idp-conformance --test idp_conformance_kanidm with CANOPY_IDP_CONFORMANCE__CREDENTIALS set. The JUnit then holds only this suite.

    10. Stop unless --keep is given (step 2 of the next run removes the container either way). Print the cold and warm build times and the image size.

  • Driver (crates/canopy-test-lib/src/upstream/kanidm/login.rs, JSON only).

    • POST /v1/auth, echoing X-KANIDM-AUTH-SESSION-ID, through init, begin passwordmfa, TOTP, then password, which yields the UAT.

    • GET /oauth2/authorise as bearer. Discovery names the HTML /ui/oauth2; the code comments why the driver doesn’t use it.

    • /oauth2/token with basic auth.

    • The HTTP client is built from reqwest::Client::builder(): timeouts, the file’s CA, resolve("idm.canopy.test", 127.0.0.1:<port>), no redirects.

    • The id_token is verified with jsonwebtoken via canopy_auth::jwks::bind_algorithm against the per-client JWKS. Claims are judged by a ClaimContract with algorithms [ES256] and array pointers /roles and /primary_programs.

  • TOTP. totp-lite 2.0.1 (SHA-256; MIT; 1.8 M downloads; small and finished, last released 2023-10). It fits the workspace’s hmac 0.12 and sha2 0.10.

    • totp-rs 6.0.0 (2026-08, 10.7 M downloads) would duplicate hmac, sha2 and sha1.

    • A hand-rolled RFC 6238 would be custom crypto.

  • Suite (crates/canopy-test-lib/tests/idp_conformance_kanidm.rs, required-features = ["idp-conformance"]).

    • The lane partition lists only TEST_FEATURES, so the battery never runs it. validate’s clippy stage lints it through a new lanes::CLIPPY_FEATURES (TEST_FEATURES plus canopy-test-lib/idp-conformance).

    • The idp-conformance profile serializes the suite with profile-level test-threads = 1. It uses no override group: test-lanes-lint lists every group filter under TEST_FEATURES only (xtask/src/cmd/test_lanes_lint.rs), so it would reject a group for this gated binary.

    • The profile also carries the eligibility clock pinner override, which eligibility_clock_pin_runs_alone_in_every_profile (xtask/src/lanes.rs) requires in every profile.

    • CI’s clippy job (.gitlab-ci.yml, which quotes the features by hand) also adds canopy-test-lib/idp-conformance.

    • A missing credentials file fails the test with an error; the test never returns early.

    • jane.doe:

      • discovery_names_a_per_client_es256_issuer_without_end_session (basic and post only);

      • sign_in_with_pkce_and_totp_yields_a_verified_id_token (iss, aud, azp, nonce and auth_time present; sub is the UUID; no consent; no acr or amr);

      • id_token_claims_project_through_an_oidc_generic_contract (the three roles union);

      • prompt_login_refuses_a_session_that_is_not_fresh;

      • max_age_refuses_a_stale_uat_and_a_fresh_sign_in_updates_auth_time (with max_age=2, a UAT older than 3 s is refused; then a fresh sign-in yields a code whose id_token has auth_time no earlier than that sign-in);

      • the_access_token_lives_900_seconds_and_carries_no_claim_maps;

      • persons_are_offered_only_password_with_totp.

    • jane.snap-worker:

      • refresh_reissues_claims_from_current_membership_and_userinfo_matches:

        • adds canopy_program_tanf;

        • the refreshed id_token has the same iss, aud, sub, auth_time and nonce, with a newer iat;

        • userinfo’s sub equals the id_token’s;

      • replaying_a_rotated_refresh_token_revokes_the_session:

        • sleeps 1.1 s between obtaining the token and rotating it, because Kanidm compares the token’s issuance second with the latest rotation’s;

        • the same-second exception is recorded in E4 and not tested, because that test would depend on timing;

      • a_revoked_refresh_token_cannot_refresh.

    • jane.unscoped: an_expired_account_cannot_refresh (sets account_expire in the past).

    • Unit tests: the compose arguments; the credentials file (round trip and 0600); proptests that the recover-account and compact-JWT splitters never panic.

  • Decision rules (applied in U4).

    • Claims are absent from the id_token but present in userinfo: the kanidm profile names userinfo.

    • Refresh omits the id_token: the kanidm profile renews through userinfo (D6).

    • STOP if any of these holds; ADR-050 is not accepted, and the result goes to the maintainer:

      • there is no claim path at all;

      • prompt=login is ignored (logout relies on it);

      • max_age is ignored (step-up relies on it);

      • an expired account can still refresh.

    • The Alpine build fails: pin by digest and record the exception.

    • Any other difference: correct E4, along with that test’s assertion and name, and explain it in the commit message. If it changes an ADR-049 row, STOP and report.

GitLab filing (at approval)

  • Epic &130 (program::infrastructure). Its body links this page, ADR-049 and ADR-050, the stage epics and U1-U4.

  • Stage epics (children of &130):

    • I1 (&131) "canopy-identity core: keys, client authentication, system tokens": D2, D3’s system token, D4’s purposes, D9, D10, D13. Absorbs #2343.

    • I2 (&132) "canopy-identity user plane: federation, sessions, delegation, revocation, device flow": D3’s session and delegation token, D4’s call graph, D5-D8, D12, E2. Absorbs #1447 and #1448.

    • I3 (&133) "Cut-over: every service on canopy-identity, Kanidm the default upstream": receivers, senders, canopy-web and its approval pages, the portal, canopy-cli, operator tools, k6, CI, a prebuilt Kanidm image, and the deletions. Absorbs #2344, #2345, #1595, #1869 and #1901.

    • I4 (&134) "Alternative upstreams: Keycloak and ZITADEL profiles and conformance lanes". Absorbs #2347 and #2349, and #2342 re-scoped to "a second upstream at the edge".

  • Closed as MR-1 merges: #2335 (obsolete); #2351 and #513 (won’t do).

  • U1-U4: priority::high, program::infrastructure, milestone "T5 — New Features".

    • U1 and U4: type::documentation, service::security.

    • U2: type::feature, service::devstack.

    • U3: type::feature, service::shared-crates.

  • The loader issue (#2489), "fix(signing,portal): key and secret loaders fail open outside development". type::security, priority::high, service::shared-crates, milestone "T1 — Correctness". It covers:

    • the .keys/ directory fallback and MissingKey::Noop (crates/canopy-signing/src/program_signer.rs);

    • file and environment fallbacks (crates/canopy-signing/src/applicant_claim.rs);

    • std::env::var reads, including the client secret’s literal dev fallback (services/canopy-portal/src/main.rs);

    • the .keys/ directory fallback (services/canopy-notices/src/main.rs).

Units — U1 → (U2 → U3 → U4)

U1 (w3) — docs: accept ADR-049, the identity plane split (#2485)

Files:

  • docs/modules/ROOT/pages/adrs/adr-049-identity-plane-split.adoc;

  • [NOTE] banners on the ADRs classed amended;

  • nav.adoc (the ADR row and this plan’s group);

  • architecture.adoc (the index row);

  • glossary.adoc (canopy-identity: ADR-019’s contract name, now canopy’s issuer);

  • idp-integration.adoc (a NOTE);

  • nist-architecture-mapping.adoc (PL-8);

  • CHANGELOG.adoc (Changed);

  • this page.

ADR-049 is Accepted (date) with a Ruling: line, and uses ADR-048’s sections plus Threat model and Alternatives. The banner reads: "Superseded in part by ADR-049, effective at the I3 cut-over: <one sentence>. Until then this ADR describes the running system." ADR-048’s Status gains "amended by ADR-049 (date)".

Acceptance: ADR-049 states D1-D14, the extras and the filing map, and every amended ADR carries its banner.

U2 (w5) — feat(devstack): add the opt-in Kanidm upstream profile (#2486)

Files:

  • devstack/kanidm/{Dockerfile,server.toml,migrations/00-canopy.hjson} and docker-compose.yml;

  • xtask/src/{docker.rs,devstack_guard.rs,lanes.rs};

  • xtask/src/cmd/{dev.rs,validate.rs,identity.rs} (clean gains the profile; clippy uses CLIPPY_FEATURES) and xtask/src/cmd/identity/conformance.rs;

  • rust-toolchain.toml (the fifth Dockerfile);

  • crates/canopy-test-lib/src/upstream/{mod.rs,kanidm/mod.rs,kanidm/admin.rs};

  • local-dev.adoc, tooling/xtask-catalog.adoc and CHANGELOG.adoc (Added).

Acceptance: steps 1-8 succeed on a clean machine and again after a --keep run, the unit tests pass, and no secret is printed.

U3 (w5) — test(identity): add the Kanidm upstream conformance suite (#2487)

Files:

  • crates/canopy-test-lib/src/upstream/kanidm/login.rs;

  • crates/canopy-test-lib/tests/idp_conformance_kanidm.rs;

  • crates/canopy-test-lib/Cargo.toml (the feature, the entry and totp-lite), plus the workspace Cargo.toml;

  • .config/nextest.toml (profile idp-conformance, JUnit written to test-results/integration/idp-conformance.xml);

  • .gitlab-ci.yml (the clippy job’s features).

Acceptance: all eleven tests pass on two fresh runs, and cargo xtask test-lanes-lint --static passes.

U4 (w2) — docs: accept ADR-050, Kanidm as the default upstream (#2488)

Files:

  • docs/modules/ROOT/pages/adrs/adr-050-kanidm-default-upstream.adoc;

  • nav.adoc, architecture.adoc, nist-architecture-mapping.adoc (PL-8) and CHANGELOG.adoc;

  • this page.

Acceptance: E1-E5 are recorded with the evidence, and the decision rules are applied.

Verification

  1. MR-1. cargo xtask plan-lint, then git push (the pre-push battery).

  2. MR-2.

    1. Open it as Draft: so its !N exists.

    2. Run cargo xtask identity conformance --idp kanidm twice, and read the JUnit file in full.

    3. Make the completion commit:

      1. set Done (YYYY-MM-DD) — !N;

      2. git mv this page to docs/modules/ROOT/pages/plans/archive/identity-plane-split-i0.adoc and repoint the nav;

      3. run cargo xtask plan-lint --done with --allow-open for U2-U4 and every issue mapped to a stage epic above, naming them in the commit message.

    4. git push, then take the MR out of draft.

Documentation Updates

  • The pages each unit lists.

Review log

round vendor resolved model verdict

1 (2026-09-30)

Anthropic

claude-opus-5-5

no-ship. Five blockers fixed: the completion sequence, the GitLab filing map, test isolation, clippy for the gated suite, and D9’s retire window.

2 (2026-09-30)

OpenAI

gpt-6-astra

no-ship. 15 findings and two corrections, all fixed:

  • the delegation cache key binds the subject credential and the request;

  • native sessions are revalidated upstream;

  • receivers bound key staleness and token lifetime;

  • KANIDM_CONFIG reaches every kanidmd subcommand;

  • the suite is serialized without an override group, and the clock pinner override is kept;

  • the userinfo fallback carries the access token and binds sub;

  • refreshed id_tokens have declared rules;

  • delegation keeps the subject-exp cap;

  • prompt and max_age are tested and gated separately;

  • the replay timing is correct;

  • CI’s clippy job lints the suite;

  • --test isolates the suite;

  • the CA is exported to the host;

  • the previous container is removed first;

  • the access-token and revocation-window wording is corrected.

No round 3.

Edit this page · default