Skip to content

feat!: move role endpoints under users #336

Closed

Description

@uniqueg

Problem

User roles live at /services/{serviceId}/permissions/{userId}, next to /services/{serviceId}/permissions/groups/{group}. As user identifiers may contain slashes (namespaced by issuer), the two collide, and the code has to refuse users called groups. FOCA's layout doesn't have this problem, and trs-filer follows it. rc1 exists to fix mistakes like this one.

Change

  • /services/{serviceId}/permissions/{userId} becomes /services/{serviceId}/permissions/users/{userId}.
  • Groups stay under /services/{serviceId}/permissions/groups/{group}.
  • No alias for the old paths.
  • Stored roles don't change, as they are granted on the service path.

To do

  • cloud_registry/api/additions.openapi.yaml: the paths and the descriptions that mention them.
  • cloud_registry/config.yaml: owners-change-permissions becomes .../permissions/users/*. owners-change-group-permissions keeps its path, but is now the only rule for groups, as the old wildcard no longer covers them.
  • permissions.py:
    • Remove the groups collision check (_first_segment(...) == "groups" in the controller and in the user ID checks), and the tests and EXAMPLE_USERS logic that exist only for it.
    • Update warn_owner_rules(), which warns about the side effect that the old wildcard covers groups, and the path it builds with f"{service}/permissions/{user}".
  • invitations.py: check its docstrings, and that it builds these paths or relies on owners-change-permissions only as intended (_warn_invitation_rules).
  • Tests, and anything else that builds these paths.
  • Docs: docs/access-control.md, docs/api.md.
  • docs/upgrading.md: deployers with config overlays must update both policies, and API clients must move to the new paths. Release notes under "Breaking changes".

Acceptance criteria

  • The old paths return 404; the new paths behave as the old ones did, including a user called groups, and user identifiers with slashes.
  • Roles stored before the change keep working, without a migration.
  • Tests and strict docs build pass.

The client in cloud-registry-ui moves in a separate issue and ships with this one.

Activity

  1. added this to the v1.0.0-rc2 milestone on Nov 3, 2026
  2. added
    priority: high
    status: triage
    type flag: breaking change
    type: feature
    workload: days
    on Nov 3, 2026
  3. added
    status: in progress
    and removed
    status: triage
    on Nov 3, 2026
  4. removed
    status: in progress
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: hightype flag: breaking changetype: featureworkload: days

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions