Versions in this module Expand all Collapse all v0 v0.0.7 Oct 27, 2026 v0.0.6 Oct 16, 2026 v0.0.5 Oct 12, 2026 Changes in this version + const CredentialPrefix + const DefaultCheckEvery + const DefaultRatePerMinute + const MaxGrace + var ErrBadCredential = errors.New("provision: unknown or wrong SCIM credential") + var ErrInvalid = errors.New("provision: invalid") + var ErrNoCredential = errors.New("provision: not a SCIM credential") + var ErrRevoked = errors.New("provision: the SCIM credential was revoked") + var MatchClaims = []MatchClaim + func FindCredential(db *statedb.DB, ref string) (statedb.SCIMCredentialRow, error) + func HoldIdentity(raw string) (string, error) + func ParseCredential(raw string) (id, secret string, ok bool) + func PlaceHold(db *statedb.DB, identity, holdReason string, ac AdminContext, now time.Time) (statedb.LegalHoldRow, error) + func ReleaseHold(db *statedb.DB, identity string, ac AdminContext, now time.Time) (statedb.LegalHoldRow, bool, error) + func RevokeCredential(db *statedb.DB, ref string, ac AdminContext, now time.Time) (statedb.SCIMCredentialRow, bool, error) + func SubjectValue(claim MatchClaim, s *authz.Subject) string + func UserValue(claim MatchClaim, row statedb.SCIMUserRow) string + func ValidCredentialName(name string) error + type Actor struct + CredentialID string + Name string + func (a Actor) Label() string + type AdminContext struct + Actor string + OSUser string + Reason string + Via string + type Config struct + MatchClaim MatchClaim + OffboardAfter time.Duration + type Directory struct + func NewDirectory(db *statedb.DB, claim MatchClaim, opts ...DirectoryOption) (*Directory, error) + func (d *Directory) Claim() MatchClaim + func (d *Directory) DirectoryGroups(s *authz.Subject) []string + func (d *Directory) Invalidate() + func (d *Directory) Stats() DirectoryStats + func (d *Directory) UserFor(s *authz.Subject) (id string, active, unique bool) + type DirectoryOption func(*Directory) + func WithCheckEvery(d time.Duration) DirectoryOption + func WithDirectoryClock(now func() time.Time) DirectoryOption + func WithDirectoryErrors(fn func(error)) DirectoryOption + type DirectoryStats struct + Active int + Ambiguous int + Groups int + Inactive int + Memberships int + Unmatchable int + Users int + Version int64 + type Hub interface + Collaborators func(db *statedb.DB) offboard.Options + DirectoryChanged func() + Severed func(Severance) + type MatchClaim string + const MatchEmail + const MatchOID + const MatchSub + const MatchUsername + func ParseMatchClaim(s string) (MatchClaim, error) + type Minted struct + Plaintext string + Row statedb.SCIMCredentialRow + func MintCredential(db *statedb.DB, name string, ac AdminContext, now time.Time) (Minted, error) + func RotateCredential(db *statedb.DB, ref string, grace time.Duration, ac AdminContext, ...) (Minted, error) + type RateLimiter struct + func NewRateLimiter(perMinute int) *RateLimiter + func (l *RateLimiter) Allow(key string) (bool, time.Duration) + func (l *RateLimiter) PerMinute() int + func (l *RateLimiter) SetClock(now func() time.Time) + type Result struct + Location string + Resource map[string]any + Status int + Version int64 + type Service struct + Config Config + DB *statedb.DB + Directory *Directory + Hub Hub + Now func() time.Time + func (s *Service) CreateGroup(ctx context.Context, a Actor, body []byte, base string) (Result, error) + func (s *Service) CreateUser(ctx context.Context, a Actor, body []byte, base string) (Result, error) + func (s *Service) DeleteGroup(ctx context.Context, a Actor, id, ifMatch string) (Result, error) + func (s *Service) DeleteUser(ctx context.Context, a Actor, id, ifMatch string) (Result, error) + func (s *Service) GetGroup(id string, q url.Values, base string) (Result, error) + func (s *Service) GetUser(id string, q url.Values, base string) (Result, error) + func (s *Service) ListGroups(q url.Values, base string) (scim.ListResponse, error) + func (s *Service) ListUsers(q url.Values, base string) (scim.ListResponse, error) + func (s *Service) OffboardExpired(ctx context.Context) (int, error) + func (s *Service) PatchGroup(ctx context.Context, a Actor, id string, body []byte, ifMatch, base string) (Result, error) + func (s *Service) PatchUser(ctx context.Context, a Actor, id string, body []byte, ifMatch, base string) (Result, error) + func (s *Service) ReplaceGroup(ctx context.Context, a Actor, id string, body []byte, ifMatch, base string) (Result, error) + func (s *Service) ReplaceUser(ctx context.Context, a Actor, id string, body []byte, ifMatch, base string) (Result, error) + type Severance struct + Actor string + GrantsResumed []string + GrantsSuspended []string + Offboard *offboard.Report + RoleBindings bool + Sessions []string + Tokens []string + type Verified struct + Actor Actor + Previous bool + type Verifier struct + DB *statedb.DB + Now func() time.Time + func (v *Verifier) Verify(raw string) (Verified, error)