scimgroup

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: GPL-3.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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 New

func New(id, tenantID shared.ID, displayName, externalID string, members []shared.ID) *ScimGroup

New creates a group.

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.

func (*ScimGroup) CreatedAt

func (g *ScimGroup) CreatedAt() time.Time

func (*ScimGroup) DisplayName

func (g *ScimGroup) DisplayName() string

func (*ScimGroup) ExternalID

func (g *ScimGroup) ExternalID() string

func (*ScimGroup) ID

func (g *ScimGroup) ID() shared.ID

func (*ScimGroup) Members

func (g *ScimGroup) Members() []shared.ID

func (*ScimGroup) SetDisplayName

func (g *ScimGroup) SetDisplayName(n string)

func (*ScimGroup) SetMembers

func (g *ScimGroup) SetMembers(m []shared.ID)

func (*ScimGroup) TenantID

func (g *ScimGroup) TenantID() shared.ID

func (*ScimGroup) UpdatedAt

func (g *ScimGroup) UpdatedAt() time.Time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL