Skip to content

feat: add Python service support and browser grants - #2662

Closed
jeremi wants to merge 34 commits into
mainfrom
feat/python-service-support
Closed

jeremi wants to merge 34 commits into
mainfrom
feat/python-service-support

Conversation

@jeremi

@jeremi jeremi commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add a neutral Python service connection for declared BReg and Messaging workloads, with typed product methods, bounded credential refresh, named bindings and an optional machine caller admission layer.
  • Add Flask and FastAPI machine integrations, a keyed Messaging effect and durable Coordinator job example, and separate holder and staff portal starters with optional OIDC and encrypted PostgreSQL sessions.
  • Extend rstack dev to prepare rotating workload credentials and local person picker descriptors. Update the licensing fixture for BReg Proposal, Casework and Messaging integration.
  • Register typed picker descriptor, token and generation formats, a Python offline checker, generated schemas and stopped-state examples. Bind the check report to its Python source in the configuration-format registry.
  • Include the OIDC and YAML native helpers, Python service modules, typing and optional extras in unified wheel assembly. Route the affected CI paths to nonpublishing exact-checkout wheel checks.
  • Include the preceding identity-track changes on this branch: explicit browser grants across resources, isolated generated SSO flows, declared user claims and reserved native user fields.

Verification

  • The exact-source installed macOS wheel passed the 131-test Python facade suite with disposable PostgreSQL and no skips, 16 portal PostgreSQL cases, and clean core, Flask, FastAPI, human-Flask and human-FastAPI install modes. The native picker reader/schema suite passed 19 tests. The configured picker, token rotation, stop, expiry and field-key removal passed the maintained TLS PostgreSQL development journey. The measured prepared-script journey passed in 32 seconds on its active path, with separate TTL, restart and recovery checks.
  • Machine-service tests passed 41 cases. A fresh install of the qualified macOS release-profile wheel verified 86 hashed installed files against RECORD and ran Flask/Gunicorn and FastAPI/Uvicorn with two declared Messaging bindings. Both frameworks matched the complete accepted body, state and receipt on same-key repeat, refused a missing binding, and preserved a real Messaging 403 profile.not-authorized as a terminal refusal without falling back to the other binding. A lookalike signed caller got 401. Seven extra-member 422s are closed-command schema refusals, not product authorization proof. The caller used disposable local RS256/JWKS and Messaging used plaintext loopback; no institutional issuer, TLS edge or final provider delivery was tested.
  • A separate native recovery run used a test-only Flask exit after real Messaging queued acceptance and before application receipt persistence. FastAPI restarted over the same SQLite effect store and recovered the exact pre-crash and direct-product receipt. Concurrent same-key requests converged to one receipt; changed work returned a stable 409; two admitted synthetic callers using the same input key received distinct receipts and recovery references. The deployment-revision check changed a startup marker over identical committed code; real code/schema migration, multihost recovery, actual receipt expiry and a live issuer remain open.
  • The Coordinator external-job example passed its 31-test Python suite, including eight disposable PostgreSQL cases. Its Rust external-wait target passed all 11 PostgreSQL cases, including process death after commit, restart and same-key recovery, encoder failure after commit and 429 before processing. An integrated Coordinator route committed and recovered a caller-bound Python job. Real issuer-qualified HTTPS acceptance remains open.
  • The maintained composition example passed its 26-test suite. A local, uncommitted candidate extends it to take an applicant-bound BReg client and passed 30 focused tests. Its native journey reached Proposal submission, Casework approval and automatic BReg apply, then stopped at the service workload's concealed Proposal get; a scoped read authorization decision is pending. The current PR does not claim that composition journey complete.
  • The nonpublishing release-profile wheel qualification run 43365704866 passed on source dd339e4584 for Linux amd64, Linux arm64 and macOS arm64. Each wheel passed checksum verification, clean core/framework/human-extra installs and installed-service smoke. The Linux wheel digests are identical to earlier source-bound wheels that passed compiler-free offline installation, explicit-CA real BReg HTTPS metadata, keyed Messaging HTTPS submit/receipt/status and post-fork child/parent calls. Linux arm64 was native; amd64 ran under arm64-host emulation. macOS wheel SHA-256: ffdf8ade1178fb9b15d5ebb572ca74c5be734cc26da7310c7deb1f68d7d9bb07. Later source through 4b1d2904ef changes only CI routing and machine-service tests, not wheel inputs. These are retained candidate artifacts, not published release assets.
  • Full protected RegistryStack CI passed on 575bda3dee across 65 jobs, including native client bindings and the installed-wheel Coordinator route. The exact-path CI classifier has 192 passing tests; release workflow structure checks passed 98 tests, plus actionlint, relevant Ruff, format, schema, identifier and whitespace checks. Protected CI 43366999583 passed across 65 jobs on preceding 6ead81fe37, including Native client bindings, all 11 Coordinator external-wait PostgreSQL cases and the aggregate result. DCO passed. The current test-only head 4b1d2904ef is running protected CI 43375930359.

Security review

  • rstack dev confines generated workload credentials and person picker state to a live, owner-only local run. The picker requires the run descriptor and exact loopback origin; the client checks token generation and declared product authority before use. Development grants have no production issuer key or deployment authority.
  • The offline picker checker follows referenced generation, token and workload state. Ready bearer files require current-user ownership, one link and owner-only permissions; stopped example files contain no bearer. Person credentials are limited to BReg/Casework, and service workloads to BReg/Messaging. The checker reports value-free, source-positioned refusals.
  • Machine routes verify the caller for their own issuer, resource, client and required claims. Handlers receive a context rather than a bearer. Product calls still use separately declared workload bindings and remain subject to each product's authorization.
  • Recovery persists the original command and a fingerprint of declared workload authority. Changing issuer, subject, client, profile, resource, scopes or declared claims cannot silently reuse an uncertain effect. The fingerprint does not independently verify opaque issued-token claims; live issuer and Messaging recovery proof remains required.
  • The portal binds a callback to the browser's pending chain without consuming mismatched state; logout and account switch cancel only server-registered chains. The Coordinator job example requires machine admission on both mutation and observation routes, and its client signing key uses the runtime's required file provider. It now binds durable admission and status lookup to the verified issuer, resource, subject, client, profile and persona via an owner digest. Different admitted callers may use the same key without recovering each other's receipt; cross-caller status reads return the ordinary not-found response. The example table stores no raw caller identity. Startup upgrades only an empty legacy table, including concurrent worker startup; a populated legacy table fails closed because its rows have no verified owner. Operators must finish and clear those rows before upgrading the example.
  • Application effect audit correlates the verified caller with the executing workload through a deployment-keyed, domain-separated HMAC. The HTTP factory requires a sink; the environment path writes bounded JSON to stderr. Sink failure is visible and same-command recovery does not resubmit. Deployment log capture remains an operator obligation; this example is not an append-only audit store.
  • The four inherited identity commits were independently source-reviewed against the pinned ThunderID release. Generated file-backed users cannot self-edit declared authority claims, and generated roles bind exact user IDs. Privileged out-of-band provisioning and role assignment are outside that generated boundary; live SSO and account-switch proof remain open.
  • Lost-supervisor recovery keeps the existing run and PostgreSQL ownership locks and cluster identity checks while retrying retained, idempotent database cleanup once after two seconds. A second failure remains visible with both error causes and keeps the run's recovery facts. No broader PostgreSQL privilege is granted. The original native journey failed twice at this race, then passed after the fix; an independent code review found no correctness issue, and focused success/failure regressions passed.

Remaining verification

  • Complete the native composition journey after the separate read-only service authorization decision. The candidate fix is local and uncommitted.
  • Complete real issuer and browser holder/staff sign-in, renewal, account replacement and machine-admission journeys. The current private-CA browser handoff, registered callback listener replacement and separate disposable issuer setup require Jeremi's pending approvals or interaction.
  • Verify a published wheel separately from these nonpublishing candidate artifacts, and finish the full definition of done before a release claim.
  • Current-head protected CI is running at 4b1d2904ef. The local checkout is behind current main; the PR's merge checkout uses current main for the integrated gate. The retired public editors/ subtree remains untouched. This PR does not publish a release or deploy a service.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi jeremi added ci:python-release-wheel Run nonpublishing Python wheel qualification on this PR and removed ci:python-release-wheel Run nonpublishing Python wheel qualification on this PR labels Nov 13, 2026
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi jeremi added ci:python-release-wheel Run nonpublishing Python wheel qualification on this PR and removed ci:python-release-wheel Run nonpublishing Python wheel qualification on this PR labels Nov 13, 2026
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>

jeremi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

We are not proceeding with the experimental service and portal implementation in this PR. Closing it without merging, while retaining the branch as reference material. The maintained Rust, Node and Python product clients remain separate from this experiment.

@jeremi jeremi closed this Nov 14, 2026
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.

2 participants