Skip to content

F13.2 — rn-forge-auth package

State Closed
Parent E13
Iteration Release 7
Start Date 2026-10-27
Closed Date 2026-10-27
Predecessors S13.1.3 (F13.1), F15.1, F16.2
Source Owner-approved package split analysis, 2026-10-13

Stories: 5 Closed

Story State Depends on
S13.2.1 — Scaffold the package and its workspace wiring Closed (2026-10-27) —
S13.2.2 — Move or retire the commons token code Closed (2026-10-27) —
S13.2.3 — Move the web auth types Closed (2026-10-27) —
S13.2.4 — Repoint the framework packages Closed (2026-10-27) —
S13.2.5 — Document the package Closed (2026-10-27) —

Create rn-forge-auth and move into it the existing token verification, Principal and OIDC code that the library evaluation keeps, as the package placement proposes. Token code a library replaces is deleted instead of moved. This feature moves or deletes existing code only. The new adapters, the session surface, authorization policy and the removal of the JWT flows are the other E13 features, which build on it and ship in the same release.

Context

The library evaluation (S13.1.3) finished first, so the move carries only code that survives it. The package placement is accepted under ADR-0011. F16.2 landed first, and the package did not wait for F16.3 (owner decision, 2026-10-27): it joined the workspace through adding a package. The move was a breaking release of rn-forge-commons, rn-forge-web, rn-forge-django and rn-forge-fastapi, because ADR-0002 forbids aliases.

Design

The package takes ADR-0011's adapter structure from the start:

Module Holds after this feature Extra
rn_forge.auth (core, re-exported by the facade) Principal, Requirement, Authenticator, AsyncAuthenticator, Authorizer, ScopeAuthorizer, principal_from_claims none
rn_forge.auth.oidc (adapter, imported directly) OidcAuthenticator, and whichever of JwtVerifier, JwksCache, discover_oidc and fetch_json S13.1.3 keeps oidc, holding pyjwt[crypto], or the library S13.1.3 chose in its place

rn_forge.web.auth stays, holding only the wire contract (Credentials, parse_authorization, challenge_header, AUTH_FAILED_DETAIL), so rn_forge.web.problem keeps its import. rn_forge.web.oidc is deleted. Moved code keeps its names (ADR-0002 forbids aliases, and public names do not encode their module); the contract changes to Principal and Requirement are F13.3's.

S13.2.1 — Scaffold the package and its workspace wiring

State: Closed (2026-10-27)

Acceptance:

  • packages/rn-forge-auth/ exists with a pyproject.toml (version 0.1.0, internal dependencies as version ranges per ADR-0004, an oidc extra, and [tool.workspace-ci] adapters = ["oidc"]), README.md, CHANGELOG.md, docs/, a strict mkdocs.yml, src/rn_forge/auth/__init__.py and a tests/ tree with no __init__.py.
  • The root pyproject.toml lists it as a workspace member and in the root development group. .importlinter lists rn_forge.auth in root_packages, places it in the web-layers contract as its own layer between rn_forge.django : rn_forge.fastapi : rn_forge.sqlalchemy and rn_forge.web : rn_forge.data, and holds a forbidden contract that rn_forge.auth's core never imports rn_forge.auth.oidc.
  • Adding a package was followed, and rn-forge-devops adapters passes for the package.
  • If F16.3 has landed, .rn-forge/kiln/config.toml lists it in packages and modules.
  • uv run lint-imports and uv run pyright pass.

S13.2.2 — Move or retire the commons token code

State: Closed (2026-10-27)

Acceptance:

  • None of JwtVerifier, JwksCache, discover_oidc and fetch_json exists in rn_forge.commons.integration.
  • Each one the library evaluation keeps is importable from rn_forge.auth.oidc, with its tests in rn-forge-auth/tests/oidc/ passing.
  • Each one it replaces is deleted, and its in-repo callers use the chosen library.
  • rn-forge-commons has no auth extra.

S13.2.3 — Move the web auth types

State: Closed (2026-10-27)

Acceptance:

  • Principal, Requirement, Authenticator, AsyncAuthenticator, Authorizer, ScopeAuthorizer, principal_from_claims and OidcAuthenticator are importable from the modules in Design and gone from rn-forge-web; rn_forge.web.oidc no longer exists, and rn_forge.web.auth holds only the wire contract.
  • rn-forge-web still exports Credentials, parse_authorization, challenge_header, AUTH_FAILED_DETAIL, AuthenticationFailed, PermissionDenied and the problem responses, and has no auth extra.
  • Every in-repo import of a moved symbol points at rn-forge-auth, and the web conformance tests pass.

S13.2.4 — Repoint the framework packages

State: Closed (2026-10-27)

Acceptance:

  • rn-forge-django's and rn-forge-fastapi's oidc extras name rn-forge-auth[oidc] and no commons or web auth extra. No extra and no dependency group in any package names rn-forge-commons[auth] or rn-forge-web[auth], including Django's all extra.
  • Their tests pass with the moved imports. Django's jwt and saml extras keep their libraries until F13.7.
  • Each package's isolated-install check for the oidc extra passes.

S13.2.5 — Document the package

State: Closed (2026-10-27)

Acceptance:

  • The package has a site with a guide for the moved contracts, and its API reference builds.
  • The root README.md package table, docs/index.md, docs/architecture/workspace.md, docs/guides/choosing-packages.md and the root mkdocs.yml name rn-forge-auth.
  • The changed packages' changelogs record the breaking moves.
  • uv run --group docs mkdocs build --strict passes for the package site and the combined site.

Acceptance

  • The package exists, is wired into the workspace and passes the boundary checks (S13.2.1).
  • The commons token code is gone from commons, kept in rn-forge-auth or replaced by the chosen library (S13.2.2).
  • The web auth types live only in rn-forge-auth, and web keeps the wire contract (S13.2.3).
  • The framework packages' oidc extras name rn-forge-auth (S13.2.4).
  • The package, the root pages and the changelogs are documented and both strict builds pass (S13.2.5).
  • uv run pytest, uv run lint-imports, uv run pyright and sh docs/_update_board.sh --check pass.