source-cooperative / source-cooperative/data.source.coop

Integrate Roles in data.source.coop

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
24
Forks
6
Avg merge
1h 32m
Merged PRs (30d)
1

Description

Description

Implement the Role system in the data proxy (data.source.coop) as described in ADR-004.

Roles belong to an account (Individual or Organization) and define:

  • Who can assume the Role — identity constraints (IdP bindings with claim constraints)
  • What the Role's credentials can access — permission statements (action + resource patterns)
Key Requirements
  • Role schema: name, display_name, max_session_duration, identity_constraints[], permissions[]
  • Role URN format: sc::{account_id}::role/{role_name}
  • Built-in _default Role per account (unlimited ceiling, constrained to auth.source.coop IdP, cannot be deleted)
  • Role CRUD API: POST/GET/PUT/DELETE /api/accounts/{account_id}/roles/{role_name}
  • Identity constraint evaluation: claim constraints with equals and starts_with operators, AND within a binding, OR across bindings
  • Permission statements: read/write actions with URN resource patterns supporting prefix scoping
  • Role acts as a ceiling on account permissions — intersection at request time (ADR-005)
  • Validation rules: name format, max session duration bounds, limits on bindings/constraints/statements
References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ADR-004 and ADR-005, then inspect the existing data proxy architecture and account API entry points. Implement the role schema, CRUD endpoints, identity and permission evaluation, validation, and account-permission ceiling described in the issue. Done means the listed endpoints and authorization rules are integrated for Individual and Organization accounts, including the protected built-in _default role.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, authentication, authorization, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.