[P0] F04: Integrate trusted identity, secure browser sessions and development-only identity #9

Open
opened 2026-10-21 20:29:23 +02:00 by amiryahaya · 0 comments
Owner

Backlog ID: F04 | Priority: P0 | Phase: M1 — Secure build and persistence foundation

Outcome and scope

Add the IdentityProvider contract, synthetic development adapter and organization-approved production adapter/session configuration. Validate server-trusted entitlements and secure the browser credential flow.

Dependencies and gates

Engineering prerequisites: #7 (F02), #8 (F03)

Development adapter and contracts can proceed now; the production adapter and credential profile require D01 identity/security approval.

Starting points

crates/authorization/src/identity/; crates/api/src/auth/; crates/api/tests/authentication.rs; web/src/auth/

These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion.

Acceptance criteria

  • Production startup refuses the development identity adapter and missing identity/entitlement configuration.
  • Expired/revoked/malformed tokens, invalid issuer/audience/signature and unavailable entitlement lookup deny protected operations.
  • Browser clearance/compartment/role fields cannot grant access; MFA/session expiry/logout follow the approved profile.
  • Use restrictive CORS, secure cookie/token handling and CSRF controls appropriate to the selected credential flow; errors disclose no sensitive details.

Verification

Contract tests cover unavailable/stale identity and forged browser claims; integration tests cover login/logout/expiry and production rejection of dev identity.

Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence.

Requirements and design

FR-AUTH-001, 004, 007; FR-ADMIN-001; architecture §§6.1, 9.3

Sources: SRS, system design. Local planning context: docs/implementation-plan.md and docs/development-backlog.md (not published by this task).

Security impact: Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue.

Parent roadmap: #1

**Backlog ID:** F04 | **Priority:** P0 | **Phase:** M1 — Secure build and persistence foundation ## Outcome and scope Add the IdentityProvider contract, synthetic development adapter and organization-approved production adapter/session configuration. Validate server-trusted entitlements and secure the browser credential flow. ## Dependencies and gates **Engineering prerequisites:** #7 (F02), #8 (F03) Development adapter and contracts can proceed now; the production adapter and credential profile require D01 identity/security approval. ## Starting points crates/authorization/src/identity/; crates/api/src/auth/; crates/api/tests/authentication.rs; web/src/auth/ These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion. ## Acceptance criteria - [ ] Production startup refuses the development identity adapter and missing identity/entitlement configuration. - [ ] Expired/revoked/malformed tokens, invalid issuer/audience/signature and unavailable entitlement lookup deny protected operations. - [ ] Browser clearance/compartment/role fields cannot grant access; MFA/session expiry/logout follow the approved profile. - [ ] Use restrictive CORS, secure cookie/token handling and CSRF controls appropriate to the selected credential flow; errors disclose no sensitive details. ## Verification Contract tests cover unavailable/stale identity and forged browser claims; integration tests cover login/logout/expiry and production rejection of dev identity. Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence. ## Requirements and design FR-AUTH-001, 004, 007; FR-ADMIN-001; architecture §§6.1, 9.3 Sources: [SRS](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/SRS.md), [system design](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/architecture.md). Local planning context: `docs/implementation-plan.md` and `docs/development-backlog.md` (not published by this task). **Security impact:** Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue. **Parent roadmap:** #1
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
primatekuntech/rag-rust#9
No description provided.