Documentation
¶
Overview ¶
Package scimgroup is the domain model for SCIM 2.0 Groups (RFC-009 Phase 9c): IdP-pushed groups whose membership drives a user's tenant role.
Index ¶
- Variables
- type Repository
- type ScimGroup
- func (g *ScimGroup) CreatedAt() time.Time
- func (g *ScimGroup) DisplayName() string
- func (g *ScimGroup) ExternalID() string
- func (g *ScimGroup) ID() shared.ID
- func (g *ScimGroup) Members() []shared.ID
- func (g *ScimGroup) SetDisplayName(n string)
- func (g *ScimGroup) SetMembers(m []shared.ID)
- func (g *ScimGroup) TenantID() shared.ID
- func (g *ScimGroup) UpdatedAt() time.Time
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("scim group not found")
ErrNotFound is returned when no group matches the lookup.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, g *ScimGroup) error
GetByID(ctx context.Context, tenantID, id shared.ID) (*ScimGroup, error)
ListByTenant(ctx context.Context, tenantID shared.ID) ([]*ScimGroup, error)
UpdateDisplayName(ctx context.Context, tenantID, id shared.ID, displayName string) error
Delete(ctx context.Context, tenantID, id shared.ID) error
// SetMembers replaces the group's full membership.
SetMembers(ctx context.Context, groupID shared.ID, userIDs []shared.ID) error
// AddMembers / RemoveMembers apply incremental PATCH changes.
AddMembers(ctx context.Context, groupID shared.ID, userIDs []shared.ID) error
RemoveMembers(ctx context.Context, groupID shared.ID, userIDs []shared.ID) error
// RoleGroupNamesForUser returns the display names of the groups a user
// belongs to in a tenant, used to reconcile their effective role.
RoleGroupNamesForUser(ctx context.Context, tenantID, userID shared.ID) ([]string, error)
// GetRoleMappings returns the tenant's group-name → role overrides, keyed by
// lowercased group display name.
GetRoleMappings(ctx context.Context, tenantID shared.ID) (map[string]string, error)
// ReplaceRoleMappings replaces the tenant's group-name → role overrides.
ReplaceRoleMappings(ctx context.Context, tenantID shared.ID, mappings map[string]string) error
}
Repository persists SCIM groups + their membership.
type ScimGroup ¶
type ScimGroup struct {
// contains filtered or unexported fields
}
ScimGroup is an IdP-provisioned group within a tenant.
func Reconstruct ¶
func Reconstruct(id, tenantID shared.ID, displayName, externalID string, members []shared.ID, createdAt, updatedAt time.Time) *ScimGroup
Reconstruct rebuilds a group from persistence.