source-cooperative / source-cooperative/data.source.coop
Epic: Federated backend authentication (proxy-side — federation client + caching)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24
- Forks
- 6
- Avg merge
- 1h 32m
- Merged PRs (30d)
- 1
Description
Epic: Federated backend authentication — proxy-side
Enable the source-data-proxy worker to communicate with private storage backends by federating its OIDC identity into customer-owned roles at request time, replacing the current skip_signature / anonymous_access path. This epic covers the proxy (Rust/Cloudflare Worker) half; the app/API/UI half lives in source-cooperative/source.coop (see its companion epic).
Why
src/registry.rs resolves the backend bucket/region/prefix but tells multistore not to sign:
// TODO: For authenticated users, provide real backend credentials ...
backend_options.insert("skip_signature".to_string(), "true".to_string());
// ...
anonymous_access: true,
So every private backend is unreachable. multistore's BucketConfig.backend_options already accepts access_key_id / secret_access_key / session_token — we just need to populate them with federated credentials.
Flow
- Layer-1 caller authz (must precede federation — confused-deputy guard)
resolve_product→ role ARN + audience +subject_scope(no secret)- Mint RS256 assertion (
iss=https://data.source.coop,aud=<const>,sub=<rendered>) AssumeRoleWithWebIdentityatsts.<region>.amazonaws.com(web-identity token is the auth — no SigV4 on the STS call)- Signed
backend_options; multistore streams - Cache creds keyed by rendered subject; refresh-ahead + single-flight
Subject contract
Versioned, structured sub (AWS trust policies can only condition on :aud/:sub):
scv1:conn:{id} | scv1:conn:{id}:account:{acct} | scv1:conn:{id}:product:{acct}/{product}.
subject_scope is per-connection so the shared connection caches one credential.
Reference
Design doc: source.coop/docs/plans/2026-06-02-federated-backend-auth-design.md (local working doc).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the local design document at source.coop/docs/plans/2026-06-02-federated-backend-auth-design.md, then inspect src/registry.rs and its current skip_signature and anonymous_access handling. The work is complete when the proxy follows the documented authorization, assertion, STS federation, credential caching, and signed backend-options flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- authentication, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100