← Back to list
01Issue
FeatureClosedSwamp CLIPublic
AssigneesNone
Relationships
↑ child of #662#668 serve-auth: Group aggregate + built-in model
Opened by stack72 · 6/17/2026
Parent
Sub-issue of #662 (serve authentication & authorization). Layer 1, item 2.
Summary
Implement the Group aggregate and built-in model for the domain/access/ bounded context. Groups are locally-managed named sets of principals, used as grant subjects alongside individual users and IdP-asserted groups (collectives).
What to build
A Group aggregate root as a built-in model following the enrollment-token / worker / step-lease precedent:
Group schema
name— unique group identifiermembers— array of principal references (user:<sub>)createdBy— principal who created the groupcreatedAt— timestamp
Model methods
create— create a new named groupadd-member— add a principal to the groupremove-member— remove a principal from the grouplist— list all groupsmembers— list members of a specific group
Key invariants
- Groups are locally-managed — membership is stored in the model. This is distinct from IdP-asserted groups (
idp-group:<name>) whose membership comes from the provider's userinfo response and is never stored locally. The two must not be confused. - Generic data writes must not be able to create or alter group records — the built-in model owns its data as
model-method(the existingOwnershipValidationErrorpattern) - Groups are referenced in grants as
group:<name>. TheAccessDecisionService(layer 1, item 4) will resolve group membership when evaluating grants — this model just stores the data.
Scope
- Pure domain code — no enforcement wiring, no CLI commands
- No dependency on OAuth, TLS, or other auth machinery
- Fully testable in isolation
- Does NOT handle IdP-asserted groups — those are resolved from the principal's claims snapshot at decision time (item 4)
References
- Enrollment token model for the built-in model pattern:
src/domain/models/worker/enrollment_token_model.ts - Worker model:
src/domain/models/worker/worker_model.ts - Grant model (sibling issue): #667
02Bog Flow
Closed
No activity in this phase yet.
03Sludge Pulse