Skip to main content
Version: Current

Options And Storage

Core options

MembershipsOptions controls invitation behavior, bootstrap policy, protection behavior, and default membership state.

OptionTypeDefaultWhat it controls
InvitationTtlTimeSpan7 daysHow long an invitation token remains valid
InvitationMaxOutstandingPerUserPerTenantint5Outstanding invite cap for one user in one tenant
RequireMatchingEmailOnAcceptancebooltrueWhether the accepting user's email must match the invitation email
AllowBootstrapWithoutInvitebooltrueWhether the first tenant admin can be created without an invitation
PersistActiveTenantSelectionbooltrueWhether active-tenant selection is stored
EnableIdempotentInviteAcceptancebooltrueWhether re-accepting a consumed invitation returns the existing membership
FailClosedOnProtectionErrorsbooltrueWhether token unprotection errors fail immediately
TokenPurposestringprimus-memberships-invitationsData Protection purpose string for invitation tokens
MaxInvitationAcceptanceAttemptsint5Acceptance-attempt lockout threshold
DefaultBootstrapRolesIReadOnlyCollection<string>["TenantAdmin"]Roles assigned by bootstrap when the request does not provide roles
DefaultMembershipStatusMembershipStatusPendingStarting status for newly created memberships

Invalid core option values fail validation at startup.

Endpoint options

MembershipsEndpointOptions controls endpoint auth and tagging.

OptionTypeDefaultWhat it controls
RequireAuthenticatedUserbooltrueWhether endpoint auth is applied by default
SelfPolicyNamestring?nullOptional policy applied to self routes
AdminPolicyNamestring?nullOptional policy applied to admin routes
EndpointTagNamestringPrimus MembershipsOpenAPI tag name for mapped routes

Storage choices

PackageUse it forNotes
PrimusSaaS.Memberships.InMemoryLocal development, tests, sample hostsNot production persistence
PrimusSaaS.Memberships.EFCoreDurable production storage in EF Core appsAlso provides Multi-Tenancy and Identity Broker bridge adapters
PrimusSaaS.MembershipsHeadless core services and contractsStorage-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.