Identity plane split, plan I3f2: the test harness (epic &133)
Status: Done (2026-10-11) — !1594
Epic: &133 (stage I3 of &130)
Issues: #2855 (U1, w2); #2856 (U2, w3); #2857 (U3, w5); #2858 (U4, w3); #2859 (U5, w3); #2860 (U6, w3); #2861 (U7, w3); #2862 (U8, w3); #2863 (U9, w3).
MR: feat/identity-test-harness, "the test harness (#2855 … #2863)".
One MR, one commit per issue, under the maintainer’s one-MR-per-related-group ruling. It merges once the pre-push battery passes. This is a Design + Scope plan: GitLab owns tracking, and the plan freezes when U1 starts. J1–J8 are this plan’s decisions (ADR-049 Amendment 24); R21–R23 are the maintainer’s rulings.
Context
I3f is the cut-over’s last stage before the switch (ADR-049 Amendment 11). R18 split it in two. I3f1, the Rust clients, has merged; I3f2 is "the test harness: the TypeScript broker, Playwright sign-in and k6".
K1 lets only additive library code and devstack infrastructure land before the switch, proven against the devstack’s identity plane. D14 bans test-only grants and password grants: "the battery signs in through the devstack’s upstream with a headless driver and federates as canopy-web does".
What exists:
-
canopy-test-lib’s
TokenBroker(crates/canopy-test-lib/src/identity_broker.rs, K7) handles Kanidm sign-in, federation as canopy-web, delegation and system tokens.-
It holds one 0600 cache entry per person under a flock, with 30 s TOTP spacing.
-
BrokerConfig::from_envreads sevenCANOPY_TEST__*keys. -
Its driver, cache and
spaced()are private. -
The Kanidm driver’s
authorise_query(uat, query)answersCode{code,state},ConsentRequested,AuthenticationRequiredorRefused. Consent is off for canopy-web, whose one registered redirect ishttps://web.canopy.test/auth/callback.
-
-
The in-network runner (
canopy-integration) reads its inputs from thecanopy_identity_inputsvolume and caches incanopy_identity_broker_cache.-
The inputs are kanidm.json, kanidm-ca.pem and
keys/. -
xtask/src/devstack_identity/broker_inputs.rs::installfills the volume; onlycmd/test.rscalls it.
-
-
Playwright (
tests/e2e, 1.60, a root container with no certutil) signs in through Keycloak.-
auth/setup.tsfills Keycloak’s form for nine roles. -
lib/given/auth.tsholds Keycloak password grants and client credentials, used in 36 files. -
The
canopy-e2eservice has no identity env or volumes.
-
-
k6 (
tests/k6,grafana/k6:2.3.0, digest-pinned) takes Keycloak tokens insetup().-
It runs on
{project}_defaultviaxtask/src/cmd/perf.rs, with--no-usage-reportandK6_AUTO_EXTENSION_RESOLUTION=false. -
--profileis a clap value list, andperf identityis already the capacity-harness subcommand.
-
Verified on the devstack (2026-10-11):
-
k6 2.3.0 verifies ES256 through
crypto.subtlefrom a JWK, runs anasync default, and decodesrawurlbase64. -
Kanidm’s
/ui/login/beginfor a person answers the TOTP step (form#login[action="/ui/login/totp"],#totp). -
Playwright 1.60 does not follow a
route.fulfill3xx on a navigation: Chromium goes to the network. A fulfilled200 text/htmlwhose script callslocation.replace(url)is followed. -
In the
canopy-e2eimage oncanopy_default, Chromium refuses Kanidm withERR_CERT_AUTHORITY_INVALID, and loads it when launched with--ignore-certificate-errors-spki-list=<leaf SPKI>.
The maintainer’s rulings (2026-10-11):
-
R21. The TypeScript broker is canopy-test-lib’s
TokenBroker, served over HTTP as a devstack service on the compose network only. Playwright and k6 get thin clients. -
R22. At the switch, Playwright signs workers in headlessly. A helper intercepts canopy-web’s redirect to Kanidm, the broker authorises that query with the person’s UAT, and the browser follows to canopy-web’s callback. A Kanidm login page object drives one
@identityspec through Kanidm’s real pages. -
R23. I3f2 lands the service, the clients, the helper and the page object, each proven against the identity plane. The switch flips the callers.
Decisions (ADR-049 Amendment 24, J1–J8; land with U1)
-
J1. Staging (R23).
-
I3f2’s proofs run against the identity plane only: tokens verified against canopy-security’s JWKS, and codes issued for canopy-web’s registered redirect. No service receives these tokens.
-
The switch moves
auth/setup.tsonto the headless helper and remaps the 36giventoken sites onto compiled client/edge pairs or delegations. It also moves k6’s profiles ontoidentity.js, rewrites the sign-out assertions, gives canopy-web itshttps://web.canopy.testorigin and registers the xsite redirect.
-
-
J2. The broker service (R21). The new crate
tools/canopy-token-brokeris a lib plus a bin, an axum server overTokenBroker, followingtools/canopy-seed.-
A crate rather than a bin in canopy-test-lib: the build cost is the same, canopy-test-lib stays a library, and the bin gets its own dependency set.
-
It listens on
0.0.0.0:8099on the compose network, with no published port, runs as uid 1000, and mounts the inputs and cache volumescanopy-integrationmounts. So its sessions and spacing are the in-network runner’s. -
It is never built by the root
Dockerfile(#2618).
-
-
J3. The browser steps in the library.
TokenBrokergains three methods, reusing its private cache andspaced():-
authorise_query(uat, query) → Authorization, delegating to the driver; -
upstream() → Upstream { origin, client_id, redirect_uri, ca_pem }.TokenBroker::newkeeps the CA PEM thatkanidm_driverreads, and the credentials' origin andclient_id;redirect_uriiskanidm::REDIRECT_URI; -
ui_credentials(person) → UiCredentials { username, password, totp, totp_valid_until }. The password and code areSecrets;Debugis redacted, andtotp_valid_untilis in Unix seconds.ui_credentialsholds the person’s entry and runs insidespaced(), after its 30 s wait. It waits until the current TOTP step has at least 15 s left, computes the six-digit zero-padded code, and is stamped byspaced(). So any next sign-in of that person comes at least 30 s later, in a later step, and no code is presented twice.The broker’s 90 s retry (
while_unavailable) gains two cases, so J4’s 503 holds under concurrency: -
a system-token call that waited on a failed shared acquisition (
SystemTokenError::SharedFailure) acquires again within the budget, rather than failing at once while the leading call retries; -
federation
openandrenew(which today call the federation client directly) go through the retry, as the minting grants do.
-
-
J4. The HTTP API. JSON with
deny_unknown_fields, and a 16 KiB body cap. Error bodies are{error, detail, reason?}:-
detailis a fixed sentence pererror, never aDisplay(reqwest’s URL would carry the query); -
reasonis a public code: the issuer’s RFC 6749 error, the canopy refusal,rate_limited,status_<n>, or Kanidm’sdeniedorstatus_<n>.Route Body 200 POST /v1/tokens/delegation{person, target, roles?: [..], programs?: [..]}, each joined by spaces forNarrowing::parse{token, token_type: "Bearer", expires_at}POST /v1/tokens/stepped-up{person, target}same
POST /v1/tokens/system{client, target, scope?}same
POST /v1/upstream/authorise{person, query}{code, state}POST /v1/upstream/ui-credentials{person}{username, password, totp, totp_valid_until}GET /v1/upstream—
{origin, client_id, redirect_uri, ca_pem}, all publicGET /healthz—
{status: "ok"} -
expires_atis the token’sexpin Unix seconds, read from its payload. -
Status codes.
PlaneError::from(BrokerError)is an exhaustive match, nested intoFederationError,DelegationError,SystemTokenErrorandKanidmError, with no wildcard arm, so a new variant does not compile until it is classified:Status errorVariants 400
invalid_requestThe service’s own checks: malformed JSON, an unknown target or client, a narrowing
Narrowing::parserefuses404
unknown_personUnknownPerson413
payload_too_largeA body past 16 KiB
502
refusedFederation(Refused | ClientRejected | InvalidRequest | Limited | Status);Delegation(Refused)andSystem(Refused)other than 503 (the issuer’sinvalid_scopeincluded);Kanidm(Denied | Status);NoIdToken;Authorization::Refused502
malformedFederation(Malformed),Delegation(Malformed),System(Malformed),Kanidm(UnexpectedState)502
unreachableTransportandBodyof the three clients,Kanidm(Http),Http,AdminTransport502
consent_requestedAuthorization::ConsentRequested502
authentication_requiredAuthorization::AuthenticationRequired, after the one re-sign-in (none for aprompt=loginquery)503
unavailableis_unavailable()once the 90 s retry is spent500
broker_failedEverything else: configuration, credentials, keys, cache,
Mint,Delegation(ForeignCache),System(SharedFailure)once the retry is spent, and Kanidm’sClient,CaRead,Migration,Enrolment,ClockandTotpCode -
UAT cache: authorise keeps one UAT per cast person, each behind a
tokio::sync::Mutex<Option<Secret>>built once from the cast.-
On
AuthenticationRequiredit signs that person in again (spaced, holding the lock) and retries once. -
A query carrying
prompt=logingets no re-sign-in, since even a fresh UAT is refused it (idp_conformance_kanidm.rs'sprompt_login_refuses_a_session_that_is_not_fresh).
-
-
-
J5. The Playwright client.
-
lib/given/broker.tsis a typed client that throwsBrokerCallError {status, error, reason}.-
It does no retry, because the service is healthy (
--wait) before Playwright starts. -
Its request timeout is
BROKER_BUDGET_MS(150 s: the spacing, a fresh TOTP step, and the 90 s retry). Every navigation or wait that can include a broker call uses the same budget.
-
-
lib/identity/jwks.tsverifyIdentityToken(token, jwks, {issuer, audience, maxLifetime, now})verifies with node:crypto against a JWKS,/identity/jwks's in the proofs. It checks:-
ES256 (P1363 signature), an RFC 7638 kid, and
typat+jwt; -
the issuer, and one
aud(the target’s); -
the receiver’s time rules (
check_times,identity_token.rs):exp − iatwithin 1..=maxLifetime(300 s for delegation, 600 s for system),iatandnbfno later thannow+ 60 s, andnowbeforeexp+ 60 s.
-
-
-
J6. Headless sign-in (R22).
lib/identity/sign-in.tsrouteUpstreamSignIn(context, broker, person, upstream)routes GET/ui/oauth2on Kanidm’s origin.-
It refuses (
route.abort(), nothing sent to the broker, the refusal recorded for the caller) a request whoseredirect_uriis not the registered one, or which carriesprompt=login.-
Re-authentication cannot be satisfied headlessly. canopy-web’s re-authentication moves at the switch with the sign-out migration, through the page object (J7).
-
-
It sends the raw query to the broker’s authorise.
-
It fulfills a
200 text/htmlthat callslocation.replace(redirect_uri?code&state); a fulfilled 3xx is not followed. -
The
identity-planeproject’snavigationTimeoutisBROKER_BUDGET_MS, so a navigation held by a spaced sign-in completes.
-
-
J7. Kanidm’s pages (R22).
lib/pages/kanidm-login.page.tsKanidmLoginPage:-
it fills
#usernameonform#login; -
it then answers each step by its form (
#totp,#password, a mechanism choice), at most five, until the URL leaves/ui/login; -
any other page fails, naming its heading.
The
@identityspec launches its own Chromium pinned to Kanidm’s leaf SPKI: standard base64 of SHA-256 over the SPKI DER ofgetPeerX509Certificate().publicKey.export({type: 'spki', format: 'der'}), read after Node’stls.connecthas verified the leaf against the CA from/v1/upstream. -
A leaf pin, not a CA pin: Chromium’s ignore list matches any certificate the server presents, chained or not, and the CA certificate is public.
-
ignoreHTTPSErrorsis never used.
-
-
J8. k6.
tests/k6/lib/identity.jsservesdelegation(person, target)andsystem(client, target)only, with no narrowing or scope, so its per-VU cache key (kind, principal, target) is complete.-
Cache rule: a token is served for the shorter of
maxAgeS(default 300 s, the Rust system cache’s revocation ceiling) and itsexpless 60 s, counted from issue. Refreshes are counted inidentity_token_refreshes. -
Broker calls set k6’s
timeoutto 180 s, since k6’s default of 60 s is shorter than the broker’s budget. -
verifyTokenapplies J5’s contract: ES256 throughcrypto.subtle, the kid,typ, the issuer, the audience, and the same time rules. -
The proof profile is
identity-tokens, so it doesn’t clash withperf identity, and it calls no service.
-
Units
Every commit goes through the pre-commit review. Each subject is at most 72 characters with its ` (#N). Every new devstack test uses canopy-test-lib’s `infrastructure_available() guard, which CANOPY_TEST_INFRA=required makes fatal, as the existing plane tests do.
Erratum (2026-10-11): U2’s retry is while_retryable(predicate, call) (not a reworked while_unavailable), with system_retryable as the system calls' predicate; kanidm_driver answers the driver and its Upstream together; and TOTP_STEP and UI_TOTP_MIN_REMAINING_SECS are named constants, the first checked at compile time against TOTP_STEP_SECONDS. U3’s PlaneError carries a Class whose status, error and fixed detail are each an exhaustive match; its binary installs no log subscriber and is inventoried in canopy-common’s ADR-041 executable inventory as a tool, and compose sets no RUST_LOG for it. U4’s builder also installs curl, for utoipa-swagger-ui's build script, and the broker joins NON_FLEET_CANOPY_SERVICES as well as E2E_ONLY_SERVICES. U5 matches --project names case-insensitively, removes the broker best-effort when its bring-up fails, adds the ignored the_service_comes_up_healthy_and_goes, and gives xtask a canopy-token-broker dev-dependency for the port pin. U7’s spec asserts that the only request to Kanidm’s origin is the routed /ui/oauth2, which the route answers. U8’s page object answers the three forms Kanidm 1.11 asks (/ui/login/begin, served first at /ui/oauth2 itself, then /ui/login/totp and /ui/login/pw) and has no mechanism-choice branch, since Kanidm asks for none; its spec starts with prompt=login, the re-authentication J6 defers to these pages, and reads the code and state from the callback’s request, because the redirect to canopy-web’s origin is a server redirect Playwright does not route, to an origin that resolves nowhere before the switch. U9’s cache answers {token, expiresAt, issuedAt} and counts a token’s age from its iat, since the broker’s system tokens come from its source’s cache and may arrive up to 300 s old. So a refreshed system token may be the same token: the profile asserts a new jti on refreshed delegations only, with an exp no earlier (not later), since a delegation ends no later than its session. An iteration that throws fails a check, and the profile’s one service call is canopy-security’s public JWKS. token_broker.rs gains SECURITY_URL for k6’s env, and perf.rs's wrapper is with_token_broker(project, needed, run), which removes a failed bring-up too.
-
U1 (#2855, w2)
docs(adr): record the test harness.-
ADR-049 Amendment 24 (R21–R23, J1–J8), and its Status line.
-
This page (
In progress) and its nav group.
-
-
U2 (#2856, w3)
feat(test-lib): expose the broker’s browser steps(J3).-
Files:
identity_broker.rs, adding:-
Upstream,UiCredentialsand the three methods; -
private
totp_wait(now) → Option<Duration>, which waits out the step when fewer than 15 s are left (checked arithmetic); -
private
six_digits(code); -
J3’s retry.
while_unavailabletakes aretryablepredicate:is_unavailable(), plusSystem(SharedFailure)for system calls. A privatemint_system(source, audience, scope), whichsystemcalls, wraps the source in it. Federationopenandreneware wrapped too.
-
-
Unit tests (
identity_broker/tests.rs):-
totp_waitfornow mod 30= 0, 14 and 15 (no wait), 16 (14 s) and 29 (1 s); -
six_digits(1234)is001234; -
Debugredacts the password and the code; -
against a scripted token endpoint answering 503 once, then 200: two concurrent
mint_systemcalls over oneSystemTokenSourceboth succeed, and a 400 is returned at once, unretried.
-
-
Devstack tests (
tests/identity_broker_test.rs):-
jane.auditor's credentials complete Kanidm’s JSON auth (TOTP, then password, then success), and a followingupstream_sign_inwaits out the spacing; -
an
AuthorizeRequest-built query authorises to a code with its state, andexchangeissues an id_token; -
upstream()matches the credentials file and the CA file.
-
-
Docs:
shared-crates.adoc,testing.adoc(the broker’s calls).
-
-
U3 (#2857, w5)
feat(tools): serve the token broker over HTTP(J2, J4).-
Files:
-
tools/canopy-token-broker/{Cargo.toml, src/{lib.rs, main.rs, plane.rs, routes.rs, uat.rs, expiry.rs, tests.rs}, tests/devstack_test.rs}; the rootCargo.tomlmember. -
plane.rs:trait Plane: Send + Sync + 'static. Six async methods withSendfutures (delegation,stepped_up,system,upstream_sign_in,authorise_query,ui_credentials) and a syncupstream();impl Plane for TokenBroker;PlaneError(thiserror) carrying J4’s table. -
main.rsserves on0.0.0.0:8099withcanopy_common::shutdown, logs no token or credential, and usesanyhowonly inmain.
-
-
Router tests (
FakePlane,oneshot):-
each route’s shape, with
expires_atequal toexp; -
every row of J4’s table, one variant per class, including 413 for 17 KiB, 400 not echoing the body, and the
reasonfor each refusal; -
UAT reuse, one re-sign-in on
AuthenticationRequired, 502 on a second, and none for aprompt=loginquery; -
no error body holds the fake’s UAT, password or token, and no body at all holds the UAT;
-
a proptest that
expires_atnever panics on arbitrary input.
-
-
Devstack test: the real router on
127.0.0.1:0overTokenBroker::from_env(), asjane.snap-worker:-
a delegation token and canopy-eligibility’s system token validate through
IdentityTokenValidator; -
an authorise round trip exchanges;
-
an unknown person gives 404.
-
-
Docs:
testing.adoc, "The token broker service" (J4’s tables).
-
-
U4 (#2858, w3)
feat(devstack): build and compose the token broker(J2).-
Image
tools/canopy-token-broker/Dockerfile, Alpine and multi-stage:-
builder
rust:1.96-alpinewith cache mountsid=/canopy-token-broker/usr/local/cargo/registryandid=/canopy-token-broker/app/target(sharing=locked), its own so its feature set never churns the root build’s target; -
the root Dockerfile’s #2237 content-hash touch;
-
cargo build --locked --profile devstack -p canopy-token-broker; -
runtime
alpine:3.23with userapp(uid 1000), the seeded/app/.identity-inputsand/app/.identity-broker,EXPOSE 8099and awgetHEALTHCHECK on/healthz.
-
-
Compose
canopy-token-broker, aftercanopy-e2e:-
profiles: [e2e]; -
the seven
CANOPY_TEST__*keys equal tocanopy-integration's; -
both volumes (inputs read-only);
-
read_only,tmpfs /tmp,ulimits core: 0; -
depends_oncanopy-security and kanidm, healthy; -
no
ports:.
-
-
docker.rs:TOKEN_BROKER_SERVICEjoinsE2E_ONLY_SERVICESin compose-file order, so teardowns anddev cleanremove it. Its doc no longer says every entry iscanopy-e2e's dependency. -
Tests:
-
the_e2e_only_removal_names_every_e2e_only_dependency_and_nothing_elsegains the broker in its expected argv (a new service, not a weakening); -
the compose block has no
ports:, has both volumes, and its keys equalcanopy-integration's; -
every_cache_mount_carries_an_explicit_id_and_locked_sharing, the content-hash pin andthe_runner_reads_the_inputs_where_the_install_puts_themextend to the broker’s Dockerfile.
-
-
Docs:
-
local-dev.adoc, "The token broker service"; -
security.adoc: a devstack-only service holding every client key and Kanidm’s credentials, which answers passwords onui-credentials, is unpublished, and is never in the root image.
-
-
-
U5 (#2859, w3)
feat(xtask): bring the token broker up for e2e(J2).-
Files:
-
broker_inputs::installtakesInstaller { Integration, TokenBroker }, choosing its one-off service and profiles (integration+full, ore2e+full);cmd/test.rspassesIntegration. -
The new
xtask/src/token_broker.rs:URL(http://canopy-token-broker:8099),bring_up(root, project, env)(install, then composeup_args()), andup_args()(--profile e2e --profile full up -d --no-deps --wait --wait-timeout 180 canopy-token-broker). -
e2e.rs:needs_token_broker(extra)is conservative. It is false only when the selection provably excludes theidentity-planeproject’s specs:-
a
--projectlist naming neitheridentity-planenor a wildcard (*,?), with no positional filter; or -
positional filters that are each a literal spec path (
specs/<name>.spec.ts, no other regex metacharacter) whose name does not start withidentity-, with no--projectnamingidentity-planeor a wildcard.Anything else (no selection, a directory, a regex,
-- specs,-- 'specs/.*') starts the broker. The call comes once after the pre-runremove_e2e_only_services, and the post-run removal takes the broker down. It also runs under--no-refresh, as thecanopy-e2ebuild does, because it is harness, not devstack.
-
-
-
Tests:
-
the predicate’s cases: none;
-- specs;-- 'specs/.';-- specs/identity-tokens.spec.ts;--project identity-plane;--project ''(each starts it); and-- specs/fixture-smoke.spec.tsand--project caseworker(neither does); -
every
cargo xtask e2eline in.gitlab-ci.ymlleaves the broker down; -
up_args; -
both installers' argv.
-
Run the ignored
the_install_lands_the_inputs_for_the_runnerby hand for both.
-
-
Docs:
tooling/xtask-catalog.adoc(e2e).
-
-
U6 (#2860, w3)
feat(e2e): mint and verify identity tokens through the broker(J5).-
Files:
-
lib/given/config.ts:tokenBrokerUrl,securityUrl,identityIssuer; -
lib/given/broker.ts,lib/identity/jwks.ts; -
playwright.config.ts: the projectidentity-plane(testMatch: /specs\/identity-.*\.spec\.ts/,timeout: 300_000,use.navigationTimeout=BROKER_BUDGET_MS, no auth-setup dependency, no storageState);-
caseworker's lookahead excludesidentity-; -
journeydoes not depend on it: tokens follow the wall clock (D14), so the fleet clock that journeys move cannot affect them;
-
-
canopy-e2egainsCANOPY_TESTTOKEN_BROKER_URL,SECURITY_URLand__IDENTITY_ISSUER.
-
-
Spec
specs/identity-tokens.spec.ts:-
jane.doeto persons verifies, withactnaming canopy-web andexpires_atequal toexp; -
a
caseworkernarrowing shows inroles; -
jane.adminstepped up has anauth_timewithin 300 s; -
canopy-eligibility’s system tokens for applications, enrollment, persons and rules verify;
-
the verifier refuses another audience, a flipped payload byte and an unknown kid. Against a JWKS of a key the spec generates with node:crypto, it also refuses tokens that are expired past the leeway, issued or not valid until past
now+ 60 s, of zero lifetime, or of a lifetime past the maximum; -
an unknown person gives 404, and
jane.unscopedgives 502refusedwithreasonmissing_primary_programs.
-
-
xtask pins: the project’s name, the
caseworkerexclusion, and thecanopy-e2ebroker URL equal totoken_broker::URL. -
Docs:
testing.adoc(E2E).
-
-
U7 (#2861, w3)
feat(e2e): sign in headlessly through the broker(J6).-
Files:
-
lib/identity/stand-in-rp.tsroutesupstream.redirect_uri's origin.-
/startserves a200 text/htmlthat doeslocation.replaceto Kanidm’s/ui/oauth2?<query>. The query isAuthorizeRequest::query's (login.rs):response_type=code,client_id,redirect_uri(the registered one),scope=openid profile, a freshstateandnonce,code_challenge(S256) andcode_challenge_method=S256, plus an optionalprompt=login. -
/auth/callbackis captured with a 200 stub.
-
-
lib/identity/sign-in.ts(J6).
-
-
Spec
specs/identity-sign-in.spec.ts(jane.admin.snap):-
the person is first given
uiCredentials, which stamps a sign-in. The headless sign-in’s navigation then waits out the spacing (at least 25 s elapsed) and still completes within the budget; -
the callback carries the RP’s state and a code;
-
the helper ran once, and no request reached Kanidm;
-
a foreign
redirect_uriand aprompt=loginquery each abort without a broker call.
-
-
Docs:
testing.adoc.
-
-
U8 (#2862, w3)
feat(e2e): sign in through Kanidm’s own pages(J7).-
Files:
-
lib/identity/pinned-browser.ts:kanidmLeafSpki(upstream)andlaunchPinnedChromium(upstream)(chromium.launchwith the pin; Playwright supplies the--user-data-dirthe flag needs); -
lib/pages/kanidm-login.page.ts.
-
-
Spec
specs/identity-kanidm-ui.spec.ts(@identity,jane.auditor.snap):-
unpinned Chromium fails
ERR_CERT_AUTHORITY_INVALID; -
pinned, a context naming an empty
storageState(the contexts lint) goes from the stand-in/start(the complete query, U7) to Kanidm’s pages; -
uiCredentialsis fetched just before, and the page object signs in; -
the callback carries the RP’s state and a code.
-
-
Docs:
testing.adoc(why the leaf is pinned).
-
-
U9 (#2863, w3)
feat(k6): mint identity tokens through the broker(J8).-
Files:
-
tests/k6/lib/identity.js. -
tests/k6/identity-tokens.js:-
setup()(withsetupTimeout300 s) warms the broker: one token of each kind, so spacing and issuer warm-up are spent before measurement; -
then 2 VUs for 60 s,
async default, withmaxAgeS20 s, so each VU refreshes within the window; -
eligibility’s four targets and
jane.doeto persons, each verified (J8) withexpires_at === exp; -
a refreshed token has a new
jtiand a laterexp; -
against a key the script generates with
crypto.subtle: a tampered token, an expired one and a future-dated one are refused; -
thresholds:
checksrate 1,identity_token_refreshescount > 0,http_req_failedrate 0.
-
-
perf.rs:-
identity-tokensin the value list; -
needs_token_broker(profile); -
a one-line
with_token_brokerwrapper inrun_k6(token_broker::bring_up, run, best-effort removal); -
k6_run_argspassing the threeCANOPY_TEST__*keys before the image.
-
-
-
Tests: the profile maps to its script, the env comes before the image, only
identity-tokensstarts the broker, and the existing pins are unchanged. -
Close:
-
tooling/xtask-catalog.adoc(perf, set apart fromperf identity); -
CHANGELOG.adoc(Added, and Changed: e2e starts the broker); -
Amendment 24’s as-built record;
-
the plan Done and archived;
-
plan-lint --donewith--allow-openfor U1–U9; -
a
perf --profile identity-tokensrun recorded in the MR; -
after merge, I3f2’s tasks ticked on the epic.
-
-
Scope
In: the broker’s browser steps, the broker service and its image, the e2e and perf wiring, the Playwright client, verifier, helper and page object with their proofs, and the k6 client and profile.
Out:
-
The switch (J1): plus the broker for CI’s e2e lanes, which needs a prebuilt image or an in-dind build.
-
Issues: the host cache, the volume cache and validate-in-network’s cache sharing no spacing; the
@identitysubset for alternative upstreams (&134).
Risks
-
Spacing across caches. The host cache and validate-in-network’s cache do not share spacing with the volume, and a cold start’s
link_castsignssec.adminin on the host. So the proofs avoidsec.admin. -
One service holds every client key. That is the same trust as
canopy-integration: compose network only, unpublished,core: 0, read-only, never deployed, and pinned by a test. -
Kanidm’s pages may change. The page object detects each step rather than assuming the order, and an image bump re-runs
@identity. -
Battery time.
-
The broker image’s first build compiles canopy-test-lib’s dependency tree; later builds reuse its cache mounts.
-
identity-planeadds about two minutes to eachcargo xtask e2erun (spacing, the fresh-step wait, the UI flow).
-
Verification
-
Per unit: fmt; clippy (the workspace with the lane’s features); quality-budgets; check-docs; plan-lint; private rustdoc;
npm run typecheckin the image build. -
nextest: canopy-test-lib, canopy-token-broker and xtask; and
cargo xtask test --integration --host -p canopy-test-lib -p canopy-token-broker --no-refresh --skip-static(U2, U3). -
E2E:
cargo xtask e2e — --project identity-plane(U6–U8). The bare battery runs it too. -
k6:
cargo xtask perf --profile identity-tokens(U9). -
Per MR: the pre-push battery.
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
1 |
Anthropic |
claude-opus-5-5 |
No-ship. Three blockers, fixed: J4’s error mapping: a variant-to-status table, fixed |
2 |
not stated (the maintainer’s other vendor) |
not stated |
No-ship. Ten findings and one switch concern, fixed in-plan: a conservative broker start (U5); navigation budgets equal to the broker’s, proven on a recently signed-in person (J5, J6, U7); |