Skip to content

fix(auth): reserve ingest attribution for write scope - #370

Merged
fazpu merged 6 commits into
mainfrom
fix/ingest-principal-authority
Sep 3, 2026
Merged

fix(auth): reserve ingest attribution for write scope#370
fazpu merged 6 commits into
mainfrom
fix/ingest-principal-authority

Conversation

@fazpu

@fazpu fazpu commented Sep 3, 2026

Copy link
Copy Markdown
Member

Problem

OPUS review of #363 identified that a narrow browser ingest credential could still assert arbitrary immutable X-Ingest-Principal-* attribution when trusted_principal_source was enabled. D62 permits that browser to upload directly, but does not grant it authority to nominate another principal.

What this does

  • requires full write scope, in addition to the trusted network setting, before ingest attribution headers are accepted
  • continues to ignore untrusted attribution rather than failing an otherwise valid upload
  • preserves attribution for full-write and legacy shared-secret callers
  • adds signed HTTP proofs for narrow-header suppression, read refusal, and write compatibility
  • corrects the read scope wording noted in the same review

How verified

  • uv run lint-imports
  • uv run ruff check src/ benchmarks/
  • uv run ruff format --check src/ benchmarks/
  • uv run pyright src/ benchmarks/
  • uv run python scripts/export_openapi.py -o openapi.json and committed the regenerated security description
  • focused auth/OpenAPI/attribution suite: 91 passed, 3 skipped
  • monolithic PostgreSQL run reached 880 passes before unrelated migration-fixture deadlocks in test_backfill/test_clustering; split CI lanes are authoritative

Docs

The configuration page and ingest-principal design now state that narrow credentials cannot assert immutable principal attribution.

Contributor agreement

An ingest-scoped browser credential may upload a document but must not be able to assert another caller as its immutable creator. Gate trusted-principal headers on full write authority, document the boundary, and exercise both narrow refusal and write compatibility over signed HTTP requests.
Address every LOW finding from OPUS round 1. Make perimeter presence explicit at ingest composition, pin shared-secret compatibility with a real HTTP proof, split attribution from route-scope behavior, and align canonical and operator documentation with the full-write authority rule.
Address every LOW finding from OPUS round 2. State the presenting-credential rule at the canonical decision and OpenAPI source, remove stale per-caller wording, and make the composition flag required so a future call site cannot omit the fail-closed choice.
Address every LOW finding from OPUS round 3. Qualify the no-auth trusted-network path, state ingest/read disjointness precisely, restore the design rationale, use the canonical amendment form, and align the test module's stated scope.
Put the trusted-principal explanation beside its setting and name the exact operator control in public docs. Clarify that narrow credentials lose only their attribution headers while their upload still succeeds.
State that ingest credentials cannot create any attribution, including self-attribution, and enumerate the read-scoped operation and connector listing routes.
@fazpu
fazpu force-pushed the fix/ingest-principal-authority branch from 6e106a1 to c7213af Compare September 3, 2026 17:48
@fazpu
fazpu merged commit cad7e94 into main Sep 3, 2026
12 checks passed
@fazpu fazpu mentioned this pull request Sep 3, 2026
1 task
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