Files
Beenu Arora 50c32845a2 feat(8.1): a containerised identity provider signs somebody in over OIDC and SAML (#1327)
* chore(8.1): claim migrations 110-112 and ADR 0011 for identity and administration

* feat(8.1): a shared Keycloak realm and a SAML sign-in probe through the real app

* fix(sso): a stock Keycloak could not complete a SAML sign-in

Two defects, both found by driving the whole flow against a containerised
identity provider rather than one this repository authors.

`resolve_saml_connection` bound `:i` with no type, so `:i IS NULL` —
the branch `/auth/saml/login` takes when the console links to it without
an issuer, which is every console — made asyncpg answer 'could not
determine data type of parameter $1'. The lookup's `except` turned that
into 'no enabled SAML connection is configured', sending an operator to
re-create a connection that was already there. The live suite only ever
passed an issuer, so the branch was never driven.

Keycloak's built-in role-list mapper emits one <Attribute Name="Role">
element per role, and python3-saml refuses repeated names by default, so
`process_response()` raised past every handler and the ACS answered an
unhandled 500. Repeated attributes are legal SAML 2.0 and the signature is
checked before they are read.

`check_text_bind_casts.py` gains the untyped-null-bind signature.

* ci(8.1): a containerised Keycloak signs somebody in over SAML

Adds `sso-live.yml :: keycloak-saml`, which walks the whole SP-initiated
flow against a real Keycloak: the app's AuthnRequest, Keycloak's own login
page, a signed Response, and the real ACS against real Postgres as the
DML-only runtime role. Its negative control swaps the connection's
certificate for another realm's and requires the same assertion to be
refused.

Also corrects the `keycloak-oidc` header, which still said the job had
never been observed to pass. It has: run 38118951217, 2026-10-11. The
narrower half of that caveat stands and is kept — that job exercises no
browser hop, which is what the new one is for.

* feat(8.1): migration 110 — per-role MFA policy and a console-enrolled WebAuthn marker

* chore(8.1): move migration 110 to the console-MFA branch, one sub-item per PR

* fix(8.1): handle a descriptor with no certificate rather than indexing None

* docs(8.1): the SSO sign-in claim is GATED — the containerised legs now pass

* fix(gates): count a claim row by its Status cell, not by words in its prose

`readme_gates._matrix_counts` classified a row by scanning the whole line
for `NO GATE`, then `PARTIAL`, then `GATED`. A row's Notes cell is prose,
so the first GATED row to record *why* it had been PARTIAL -- which is
precisely what a row should say when a gate is built and the status
earned -- was counted as PARTIAL. `check_claim_gate_matrix.py`, which
locates the Status column by its header, read the same table as
300 GATED / 2 PARTIAL while this gate read 299 / 3.

Two honest components disagreeing about one table reads as drift rather
than as a parser bug, and the cheap fix is to reword the row and lose the
history. Reading the cell the column header names costs the same and
cannot be fooled by anything written in another column.

An unreadable table is now refused rather than counted as empty, because
a Status column that cannot be located is a defect and `(0, 0)` would
have been reported as "nothing to check". Both properties are pinned by
tests that fail against the previous parser.

The two documents that restate the tally are re-derived from the table.

* docs(8.1): record where this item actually stands, and three deviations

`[~]`, not `[x]`. Five of six sub-items are done, each in its own pull
request, and the two shortfalls are named rather than folded into a tick:
internationalisation is not started at all, and 4.5's six console pages
are not built while its enforcement bullet is.

The item's own "Done when" holds -- a CI test signs in through OIDC and
SAML with MFA enforced for the role, an elevation expires on schedule,
and the security pack passes both gates -- but the spec lists more than
its done-when, so the item is not closed.

Three deviations:

D12 -- migration `112` was claimed here and taken first by another lane.
"Re-read `main` before claiming" understates the problem: `main` is the
one place a number cannot yet be taken. Re-derived against all 259
remote branches, which put the first free number at `113`; the `112` row
is struck rather than silently reused.

D13 -- `readme_gates` and `check_claim_gate_matrix` disagreed about this
repository's own claim matrix, and the older one was wrong: it counted a
row by scanning the whole line, so the first GATED row to record why it
had been PARTIAL was counted as PARTIAL.

D14 -- what is not done, in full, with the reason.
2026-10-12 12:01:51 +08:00
..