Skip to content

feat: add the guest account endpoints - #5

Draft
NikoHadouken wants to merge 6 commits into
mainfrom
feat/guest-accounts
Draft

NikoHadouken wants to merge 6 commits into
mainfrom
feat/guest-accounts

Conversation

@NikoHadouken

Copy link
Copy Markdown
Contributor

Why

The guest account endpoints exist only on sherpa-api's feat/guest-accounts branch, and Sherpa doesn't implement them yet. gruene-api can't build guest accounts or sync them without them.

Summary

The mock can now create, renew and revoke guest accounts. Its spec copy is pinned to sherpa-api's feat/guest-accounts.

  • A guest is marked by a role assignment with a made-up role id, 90000001, because Sherpa has no guest role yet. The roles list includes that role.
  • Role assignments now carry an expiry. It is empty except on guest markers, where create and renew both set it to 90 days from now. Nothing expires by itself.
  • Creating a guest matches existing records by email, ignoring case:
    • no match: a new record is created and marked, 201
    • one match without access: that record is marked and keeps its id, 200
    • one match with access: 409
    • several matches: 422
  • A record has access if it has an active membership, a role that grants access without a membership, or a guest marker. Those roles are the same as in gruene-api's user sync, kept in a hardcoded list.
  • New example users cover the guest cases: an active guest, a former member who can be reused, and two records that share an email.

Deployment

  1. Tag a release to publish the image.
  2. The database schema is migrated on startup. An existing database only gets the new example users after a reset.

@NikoHadouken
NikoHadouken marked this pull request as draft October 8, 2026 13:13
…ole assignments

The guest account endpoints only exist on sherpa-api's feat/guest-accounts so far. The new sequences prepare for creating users and role assignments through the API.
gruene-api needs them to build guest accounts and their user sync before Sherpa implements them. Sherpa has no guest role yet, so the mock adds a made-up one to the roles list.
Follows the spec change that makes the create call safe to retry after a lost response. An expired guest marker no longer counts as access either, so an expired guest can be invited again.
The spec now takes the invitation id as the key for a retry, so an active guest no longer comes back unchanged and gets 409 like anyone else with access.
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