Documentation
¶
Index ¶
- Variables
- type ActivityStore
- func (s *ActivityStore) ActivityStats(_ context.Context, filter types.ActivityStatsFilter) (types.ActivityStats, error)
- func (s *ActivityStore) ListActivity(_ context.Context, filter types.ActivityFilter) (types.ActivityPage, error)
- func (s *ActivityStore) Log(_ context.Context, record types.ActivityRecord) error
- type AuthRepository
- func (r *AuthRepository) AllowedTransitions(context.Context, uuid.UUID) ([]types.LifecycleTransition, error)
- func (r *AuthRepository) Create(_ context.Context, input *types.AuthUser) (*types.AuthUser, error)
- func (r *AuthRepository) GetByID(_ context.Context, id uuid.UUID) (*types.AuthUser, error)
- func (r *AuthRepository) GetByIdentifier(_ context.Context, identifier string) (*types.AuthUser, error)
- func (r *AuthRepository) ListUsers(_ context.Context, filter types.UserInventoryFilter) (types.UserInventoryPage, error)
- func (r *AuthRepository) ResetPassword(context.Context, uuid.UUID, string) error
- func (r *AuthRepository) Update(_ context.Context, input *types.AuthUser) (*types.AuthUser, error)
- func (r *AuthRepository) UpdateStatus(ctx context.Context, actor types.ActorRef, id uuid.UUID, ...) (*types.AuthUser, error)
- type PreferenceRepository
- func (r *PreferenceRepository) DeletePreference(_ context.Context, userID uuid.UUID, scope types.ScopeFilter, ...) error
- func (r *PreferenceRepository) ListPreferences(_ context.Context, filter types.PreferenceFilter) ([]types.PreferenceRecord, error)
- func (r *PreferenceRepository) UpsertPreference(_ context.Context, record types.PreferenceRecord) (*types.PreferenceRecord, error)
- type ProfileRepository
- type RoleRegistry
- func (r *RoleRegistry) AssignRole(_ context.Context, userID, roleID uuid.UUID, scope types.ScopeFilter, ...) error
- func (r *RoleRegistry) CreateRole(_ context.Context, input types.RoleMutation) (*types.RoleDefinition, error)
- func (r *RoleRegistry) DeleteRole(_ context.Context, id uuid.UUID, _ types.ScopeFilter, _ uuid.UUID) error
- func (r *RoleRegistry) GetRole(_ context.Context, id uuid.UUID, _ types.ScopeFilter) (*types.RoleDefinition, error)
- func (r *RoleRegistry) ListAssignments(_ context.Context, filter types.RoleAssignmentFilter) ([]types.RoleAssignment, error)
- func (r *RoleRegistry) ListRoles(_ context.Context, filter types.RoleFilter) (types.RolePage, error)
- func (r *RoleRegistry) UnassignRole(_ context.Context, userID, roleID uuid.UUID, scope types.ScopeFilter, ...) error
- func (r *RoleRegistry) UpdateRole(_ context.Context, id uuid.UUID, input types.RoleMutation) (*types.RoleDefinition, error)
- type SecureLinkManager
- func (s *SecureLinkManager) Generate(route string, payloads ...types.SecureLinkPayload) (string, error)
- func (s *SecureLinkManager) GetAndValidate(fn func(string) string) (types.SecureLinkPayload, error)
- func (s *SecureLinkManager) GetExpiration() time.Duration
- func (s *SecureLinkManager) Validate(token string) (map[string]any, error)
- type UserTokenRepository
- func (r *UserTokenRepository) CreateToken(_ context.Context, token types.UserToken) (*types.UserToken, error)
- func (r *UserTokenRepository) GetTokenByJTI(_ context.Context, tokenType types.UserTokenType, jti string) (*types.UserToken, error)
- func (r *UserTokenRepository) UpdateTokenStatus(_ context.Context, tokenType types.UserTokenType, jti string, ...) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ActivityStore ¶
type ActivityStore struct {
// contains filtered or unexported fields
}
ActivityStore logs activity entries in memory and exposes query helpers.
func NewActivityStore ¶
func NewActivityStore() *ActivityStore
NewActivityStore provisions the store.
func (*ActivityStore) ActivityStats ¶
func (s *ActivityStore) ActivityStats(_ context.Context, filter types.ActivityStatsFilter) (types.ActivityStats, error)
func (*ActivityStore) ListActivity ¶
func (s *ActivityStore) ListActivity(_ context.Context, filter types.ActivityFilter) (types.ActivityPage, error)
func (*ActivityStore) Log ¶
func (s *ActivityStore) Log(_ context.Context, record types.ActivityRecord) error
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
AuthRepository is an in-memory implementation of both the auth repository and the user inventory repository contracts. It is only intended for examples.
func NewAuthRepository ¶
func NewAuthRepository() *AuthRepository
NewAuthRepository provisions an in-memory auth repository.
func (*AuthRepository) AllowedTransitions ¶
func (r *AuthRepository) AllowedTransitions(context.Context, uuid.UUID) ([]types.LifecycleTransition, error)
func (*AuthRepository) GetByIdentifier ¶
func (*AuthRepository) ListUsers ¶
func (r *AuthRepository) ListUsers(_ context.Context, filter types.UserInventoryFilter) (types.UserInventoryPage, error)
func (*AuthRepository) ResetPassword ¶
func (*AuthRepository) UpdateStatus ¶
func (r *AuthRepository) UpdateStatus(ctx context.Context, actor types.ActorRef, id uuid.UUID, next types.LifecycleState, opts ...types.TransitionOption) (*types.AuthUser, error)
type PreferenceRepository ¶
type PreferenceRepository struct {
// contains filtered or unexported fields
}
PreferenceRepository persists preference records in memory.
func NewPreferenceRepository ¶
func NewPreferenceRepository() *PreferenceRepository
NewPreferenceRepository provisions the repo.
func (*PreferenceRepository) DeletePreference ¶
func (r *PreferenceRepository) DeletePreference(_ context.Context, userID uuid.UUID, scope types.ScopeFilter, level types.PreferenceLevel, key string) error
func (*PreferenceRepository) ListPreferences ¶
func (r *PreferenceRepository) ListPreferences(_ context.Context, filter types.PreferenceFilter) ([]types.PreferenceRecord, error)
func (*PreferenceRepository) UpsertPreference ¶
func (r *PreferenceRepository) UpsertPreference(_ context.Context, record types.PreferenceRecord) (*types.PreferenceRecord, error)
type ProfileRepository ¶
type ProfileRepository struct {
// contains filtered or unexported fields
}
ProfileRepository stores profile rows in memory.
func NewProfileRepository ¶
func NewProfileRepository() *ProfileRepository
NewProfileRepository provisions the repo.
func (*ProfileRepository) GetProfile ¶
func (r *ProfileRepository) GetProfile(_ context.Context, userID uuid.UUID, scope types.ScopeFilter) (*types.UserProfile, error)
func (*ProfileRepository) UpsertProfile ¶
func (r *ProfileRepository) UpsertProfile(_ context.Context, profile types.UserProfile) (*types.UserProfile, error)
type RoleRegistry ¶
type RoleRegistry struct {
// contains filtered or unexported fields
}
RoleRegistry is an in-memory registry used by examples.
func NewRoleRegistry ¶
func NewRoleRegistry() *RoleRegistry
NewRoleRegistry provisions the registry.
func (*RoleRegistry) AssignRole ¶
func (r *RoleRegistry) AssignRole(_ context.Context, userID, roleID uuid.UUID, scope types.ScopeFilter, actor uuid.UUID) error
func (*RoleRegistry) CreateRole ¶
func (r *RoleRegistry) CreateRole(_ context.Context, input types.RoleMutation) (*types.RoleDefinition, error)
func (*RoleRegistry) DeleteRole ¶
func (r *RoleRegistry) DeleteRole(_ context.Context, id uuid.UUID, _ types.ScopeFilter, _ uuid.UUID) error
func (*RoleRegistry) GetRole ¶
func (r *RoleRegistry) GetRole(_ context.Context, id uuid.UUID, _ types.ScopeFilter) (*types.RoleDefinition, error)
func (*RoleRegistry) ListAssignments ¶
func (r *RoleRegistry) ListAssignments(_ context.Context, filter types.RoleAssignmentFilter) ([]types.RoleAssignment, error)
func (*RoleRegistry) ListRoles ¶
func (r *RoleRegistry) ListRoles(_ context.Context, filter types.RoleFilter) (types.RolePage, error)
func (*RoleRegistry) UnassignRole ¶
func (r *RoleRegistry) UnassignRole(_ context.Context, userID, roleID uuid.UUID, scope types.ScopeFilter, _ uuid.UUID) error
func (*RoleRegistry) UpdateRole ¶
func (r *RoleRegistry) UpdateRole(_ context.Context, id uuid.UUID, input types.RoleMutation) (*types.RoleDefinition, error)
type SecureLinkManager ¶ added in v0.13.0
type SecureLinkManager struct {
// contains filtered or unexported fields
}
SecureLinkManager is an in-memory secure link stub for examples.
func NewSecureLinkManager ¶ added in v0.13.0
func NewSecureLinkManager() *SecureLinkManager
NewSecureLinkManager provisions a secure link stub.
func (*SecureLinkManager) Generate ¶ added in v0.13.0
func (s *SecureLinkManager) Generate(route string, payloads ...types.SecureLinkPayload) (string, error)
Generate returns a unique token and stores the supplied payloads.
func (*SecureLinkManager) GetAndValidate ¶ added in v0.13.0
func (s *SecureLinkManager) GetAndValidate(fn func(string) string) (types.SecureLinkPayload, error)
GetAndValidate extracts a token with the supplied getter and validates it.
func (*SecureLinkManager) GetExpiration ¶ added in v0.13.0
func (s *SecureLinkManager) GetExpiration() time.Duration
GetExpiration returns the configured expiration duration.
type UserTokenRepository ¶ added in v0.13.0
type UserTokenRepository struct {
// contains filtered or unexported fields
}
UserTokenRepository stores token metadata in memory for examples.
func NewUserTokenRepository ¶ added in v0.13.0
func NewUserTokenRepository() *UserTokenRepository
NewUserTokenRepository provisions a token repository stub.
func (*UserTokenRepository) CreateToken ¶ added in v0.13.0
func (r *UserTokenRepository) CreateToken(_ context.Context, token types.UserToken) (*types.UserToken, error)
CreateToken persists an onboarding token record.
func (*UserTokenRepository) GetTokenByJTI ¶ added in v0.13.0
func (r *UserTokenRepository) GetTokenByJTI(_ context.Context, tokenType types.UserTokenType, jti string) (*types.UserToken, error)
GetTokenByJTI returns a stored token record by type and JTI.
func (*UserTokenRepository) UpdateTokenStatus ¶ added in v0.13.0
func (r *UserTokenRepository) UpdateTokenStatus(_ context.Context, tokenType types.UserTokenType, jti string, status types.UserTokenStatus, usedAt time.Time) error
UpdateTokenStatus updates the stored token state.