Skip to content

app/: invitations and members (sc-8900) - #65

Merged
ndbroadbent merged 5 commits into
mainfrom
laravel-invitations
Dec 2, 2026
Merged

ndbroadbent merged 5 commits into
mainfrom
laravel-invitations

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Part of sc-8900 (the auth side of the Laravel Rust port), stacked on #64 (tokens).

Ports today's invitations and member management to app/:

  • Migration: invitations, as today's (with for_user_id and the pending unique indexes).
  • Invite (POST /api/ui/orgs/{org}/invitations, admins): by email or GitHub login. If the account exists already, the invitation is recorded for it. Re-inviting changes the pending invitation's role. Daily limits: 50 per organization, 3 per address; staff are exempt. An invitation by login to someone without an account sends no email.
  • The invitee (GET /api/ui/invitations, POST …/{id}/accept|decline): an invitation shows when it was recorded for them, sent to their verified email, or sent to one of their github.com or gitlab.com logins. Accepting never lowers a role they already have. Declining withdraws the invitation.
  • Admins:
    • GET /api/ui/orgs/{org}/members lists members (with emails, for admins) and pending invitations.
    • DELETE …/invitations/{id} withdraws an invitation.
    • PATCH|DELETE …/members/{pid} changes a member's role or removes them. Memberships the forge decides can't be changed (422), and the organization keeps an admin (422). A removed member is emailed, unless they removed themselves.
  • Outbox: adds To::Address, for invitees who have no account yet.

Status codes: bad input 422, over the daily limit 429, a member who isn't an admin 403, anyone else 404.

Tests: app/tests/invitations.rs, 4 tests, passing on docspring-dev; clippy is clean.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #328 · 331 unchanged · no changes

This PR vs base: nothing since #224, across 6 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent force-pushed the laravel-invitations branch 2 times, most recently from 1651f49 to 9533f34 Compare December 2, 2026 16:01
@ndbroadbent
ndbroadbent force-pushed the laravel-tokens branch 2 times, most recently from 503c4b8 to db21706 Compare December 2, 2026 16:06
@ndbroadbent
ndbroadbent changed the base branch from laravel-tokens to main December 2, 2026 17:06
…gin (admins; 50 a day per organization, 3 a day per address, staff exempt), waiting for the invitee to accept or decline whether or not they have an account (recorded for their account when one exists); accepting never lowers a role; admins withdraw invitations, change roles and remove members, except where the forge decides the membership, and the organization keeps an admin; a removed member is told unless they left themselves
…aren't in (their tools are the admin MCP's, with its audit log); changing or removing a member locks the admin memberships first, so two admins demoting each other can't leave none; accepting re-reads the invitation FOR UPDATE (a withdrawn one or a second click is a 404) and tells the person they joined
@ndbroadbent
ndbroadbent merged commit 2efb434 into main Dec 2, 2026
21 checks passed
@ndbroadbent
ndbroadbent deleted the laravel-invitations branch December 2, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant