Options And Storage
Core options
MembershipsOptions controls invitation behavior, bootstrap policy, protection behavior, and default membership state.
| Option | Type | Default | What it controls |
|---|---|---|---|
InvitationTtl | TimeSpan | 7 days | How long an invitation token remains valid |
InvitationMaxOutstandingPerUserPerTenant | int | 5 | Outstanding invite cap for one user in one tenant |
RequireMatchingEmailOnAcceptance | bool | true | Whether the accepting user's email must match the invitation email |
AllowBootstrapWithoutInvite | bool | true | Whether the first tenant admin can be created without an invitation |
PersistActiveTenantSelection | bool | true | Whether active-tenant selection is stored |
EnableIdempotentInviteAcceptance | bool | true | Whether re-accepting a consumed invitation returns the existing membership |
FailClosedOnProtectionErrors | bool | true | Whether token unprotection errors fail immediately |
TokenPurpose | string | primus-memberships-invitations | Data Protection purpose string for invitation tokens |
MaxInvitationAcceptanceAttempts | int | 5 | Acceptance-attempt lockout threshold |
DefaultBootstrapRoles | IReadOnlyCollection<string> | ["TenantAdmin"] | Roles assigned by bootstrap when the request does not provide roles |
DefaultMembershipStatus | MembershipStatus | Pending | Starting status for newly created memberships |
Invalid core option values fail validation at startup.
Endpoint options
MembershipsEndpointOptions controls endpoint auth and tagging.
| Option | Type | Default | What it controls |
|---|---|---|---|
RequireAuthenticatedUser | bool | true | Whether endpoint auth is applied by default |
SelfPolicyName | string? | null | Optional policy applied to self routes |
AdminPolicyName | string? | null | Optional policy applied to admin routes |
EndpointTagName | string | Primus Memberships | OpenAPI tag name for mapped routes |
Storage choices
| Package | Use it for | Notes |
|---|---|---|
PrimusSaaS.Memberships.InMemory | Local development, tests, sample hosts | Not production persistence |
PrimusSaaS.Memberships.EFCore | Durable production storage in EF Core apps | Also provides Multi-Tenancy and Identity Broker bridge adapters |
PrimusSaaS.Memberships | Headless core services and contracts | Storage-agnostic by design |
Current validated boundary
- In-Memory and EF Core are the documented storage paths in the current validated docs surface.
- A Dapper package exists in the repo, but it is not part of the current validated Memberships docs path and is not surfaced here as a recommended starting point.