Skip to content

feat: invite users to services by link #101

Closed

Description

@uniqueg

Why?

With access control (#62), owners grant roles on their services by user identifier: PUT /services/{serviceId}/permissions/{userId}, where userId is the LS Login sub claim. The sub is the right identifier to store (stable and unique, unlike email addresses, which change and can be reassigned), but nobody knows their own sub, and LS Login offers no lookup from email address to sub for relying parties. Granting a colleague access therefore requires them to find and send their identifier first.

How?

Invitation links: an owner creates an invitation for a service and role and sends the link to a colleague through any channel; the colleague logs in and accepts it, which grants the role to their own sub. No email addresses are involved.

  1. Endpoints (additions spec, under the cloud-registry tag):
    • POST /services/{serviceId}/invitations with {"role": "owner" | "maintainer"}: owners (and admins) create an invitation; returns its identifier, role, expiry and a one-time token.
    • GET /services/{serviceId}/invitations: owners list open and accepted invitations (without tokens), including who accepted them.
    • DELETE /services/{serviceId}/invitations/{invitationId}: owners revoke an open invitation.
    • POST /invitations/accept with {"token": "..."}: any authenticated user accepts an invitation. The token goes in the body, not the path, so that it doesn't end up in access logs.
  2. Storage: collection invitations with a hash (SHA-256) of the token, never the token itself; service, role, creator, expiry (default 7 days, configurable) and acceptance (sub, display name, time). Expired invitations are removed by a TTL index.
  3. Accepting is atomic and single-use (find_one_and_update on an open, unexpired invitation). It grants the role like PUT .../permissions/{userId} (replacing another role on the service). Accepting an invitation for a deleted service fails with 404; deleting a service deletes its invitations.
  4. Display names: store the display name (and email, if released) from user info when an invitation is accepted, so that owners see who accepted. Coordinate with the open question in Cloud Registry backend: public read access, service ownership, ECP_CLN:ADMIN admin role #62 on exposing owners.
  5. Tokens: secrets.token_urlsafe(32). The UI builds the link and should carry the token in the URL fragment (#...), which browsers do not send to servers.
  6. Policies for the new paths in config.yaml; tests for every path (create, list, revoke, accept, expired, used twice, wrong role, non-owner, deleted service); docs.

A forwarded link grants the role to whoever accepts it first. Expiry, single use, and owners seeing who accepted (and being able to revoke the role) limit this, as with invitations in GitHub or Google Docs.

Acceptance criteria

  • An owner can invite a colleague without knowing their sub; after accepting, the colleague has the role.
  • Tokens are single-use, expire, can be revoked, and are not stored in plain text.
  • Maintainers and other users cannot create, list or revoke invitations of a service.

Dependencies: #62 (access control). The UI part (invite button, accept page) will be tracked in cloud-registry-ui. Related: ownership by groups (e.g., a node's team managed in Perun) needs FOCA support (elixir-cloud-aai/foca#316).

Activity

  1. added
    type: feature
    priority: medium
    workload: days
    status: on hold
    status: in progress
    and removed
    status: on hold
    on Oct 21, 2026
  2. added this to the v1.0.0-rc1 milestone on Oct 28, 2026
  3. removed
    status: in progress
    on Oct 28, 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: mediumtype: featureworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions