Skip to content

SAML S4 rollover parity: SAML signing key as a served set (#13796) - #17357

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
xaltha/13796-saml-rollover
Nov 30, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
xaltha/13796-saml-rollover

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Refs #13796 — this lands the rollover half of S4 only. The doors half remains gated on the federation-door live registrations (#13411/#13412/#13414) and is recorded as the precise remainder on #13796.

What changes

Following the Slice 5 OIDC pattern (TokenSigner served set, jwks_from_cert_pems overlap publication, tests/rollover.rs phase evidence):

  • saml::MetadataSigner now holds a served set of validated key/certificate pairs, keyed by certificate thumbprint (the same x5t#S256 kid convention as OIDC), signing with the configured active key. from_pairs fails closed exactly like TokenSigner::from_keys: empty set, duplicate certificate, key/cert mismatch, or an active kid outside the set are all startup errors. MetadataSigner::new keeps the single-pair shape.
  • metadata_xml publishes every certificate in the set as its own KeyDescriptor (overlap publication — an SP refreshing metadata learns the successor before the flip) and signs the document with the active key. signed_response signs with the active pair.
  • Config parity: IDP_PROVIDER_SAML_KEYS / IDP_PROVIDER_SAML_CERTS (comma-separated parallel lists) and IDP_PROVIDER_SAML_ACTIVE_KID, falling back to the single IDP_PROVIDER_SAML_KEY / IDP_PROVIDER_SAML_CERT pair. The loader proves each key matches the certificate at its position before serving anything, as the OIDC loader does.
  • A rollover is now configuration only: publish the successor alongside the incumbent → flip IDP_PROVIDER_SAML_ACTIVE_KID → retire the incumbent by removing its pair. No SP flag day.

Evidence

tests/saml_rollover.rs walks the OIDC rollover phases against the local metadata/response surface, with samael's XML-DSig verifier as oracle:

  • Overlap: 2 KeyDescriptors, both certificates published, document verifies under the incumbent and not the successor.
  • Flip: same set, active = successor — metadata and a signed response verify under the new key and not the old; the response embeds the new certificate.
  • Retirement: set = {successor} — 1 KeyDescriptor, retired certificate absent from the served metadata.
  • Bad sets: empty / duplicate / active-not-in-set / key-cert mismatch all rejected.

Verification: fleet queue dispatch run 46473608889 (developing-today-forks/fleet) at head eb5bce8 — full cargo test for pkgs/idp-provider, counts read firsthand from the run log before merge.

README documents the served set and the three new variables.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-30T17:28:35Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "1afb80aa405c56b71c8a63176670cb22ba449a92"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Refs #13796. The SAML signing key becomes a served set following
the Slice 5 OIDC pattern: MetadataSigner holds several validated
key/certificate pairs keyed by certificate thumbprint (the x5t#S256
kid convention), metadata publishes every certificate in the set as
its own KeyDescriptor (overlap publication), responses and metadata
are signed with the configured active key, and retirement is
removal from the configured set — no SP flag day.

Config parity with OIDC: IDP_PROVIDER_SAML_KEYS /
IDP_PROVIDER_SAML_CERTS parallel lists and
IDP_PROVIDER_SAML_ACTIVE_KID, falling back to the single
IDP_PROVIDER_SAML_KEY / IDP_PROVIDER_SAML_CERT pair. The loader
stays fail-closed: counts must match and every key must match the
certificate at its position before anything is served.

Evidence: tests/saml_rollover.rs walks the OIDC rollover phases
(overlap publication, active flip across metadata + responses,
retirement) against samael's XML-DSig verifier, plus bad-set
rejection. README documents the new variables.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c9bbae91-5068-4df9-b3ef-e85288151aab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant