source-cooperative / source-cooperative/data.source.coop
feat(federation): versioned subject contract + render_subject(subject_scope)
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Rust
- Stars
- 24
- Forks
- 6
- Avg merge
- 1h 32m
- Merged PRs (30d)
- 1
Description
Part of the Federated backend authentication epic (proxy-side).
What
Implement the versioned, structured subject contract and a render_subject function. AWS trust policies can only condition on :aud / :sub for generic OIDC IdPs, so all scoping context is packed into sub.
Contract (scv1 scheme — public, versioned)
scv1:conn:{connection_id}
scv1:conn:{connection_id}:account:{product_account}
scv1:conn:{connection_id}:product:{product_account}/{product_id}
fn render_subject(scope: &SubjectScope, conn_id: &str, account: &str, product: &str) -> String
Notes
subis a public contract: customer trust policies hard-code its shape. Any futurescv2must be dual-minted during a transition (claim-level analog of dual-key JWKS rotation).- Source IDs are
[a-z0-9-], so:and/are safe delimiters.
Acceptance
-
render_subjectcovers all three scopes - Unit tests assert exact strings per scope
- Scheme tag (
scv1:) present and documented as stable
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 by locating SubjectScope and the proxy-side authentication entry point where render_subject belongs. Implement the documented scv1 contract for all three scopes, then add unit tests asserting each exact subject string and verify the scheme tag is documented as stable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication, backend, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100