Documentation
¶
Overview ¶
Package groupsync applies an SSO provider's group claims to Miabi access at sign-in: explicit mappings (group to platform admin, or to a role in a fixed workspace) and structured groups "<prefix>:<workspace>:<role>". It only ever changes memberships it governs, so a member added by hand keeps their place, and it never leaves a workspace without an owner.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
User *models.User
// Manager is the provider name recorded on the memberships this sync grants.
Manager string
Groups []string
Rules []Rule
// Prefix enables structured groups; empty ignores them.
Prefix string
}
Input is one sign-in to reconcile.
type Rule ¶
type Rule struct {
Group string
SystemAdmin bool
WorkspaceID *uint
Role models.WorkspaceRole
}
Rule is one explicit mapping.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer applies group claims.
type Users ¶
type Users interface {
Update(u *models.User) error
CountByRole(role models.SystemRole) (int64, error)
}
Users promotes and demotes platform admins (*repositories.UserRepository).
type Workspaces ¶
type Workspaces interface {
FindByName(name string) (*models.Workspace, error)
FindMember(workspaceID, userID uint) (*models.WorkspaceMember, error)
AddMember(m *models.WorkspaceMember) error
UpdateMemberRole(workspaceID, userID uint, role models.WorkspaceRole) error
SetMemberManagedBy(workspaceID, userID uint, manager string) error
RemoveMember(workspaceID, userID uint) error
CountOwners(workspaceID uint) (int64, error)
ListManagedBy(userID uint, manager string) ([]models.WorkspaceMember, error)
}
Workspaces is the membership storage group sync needs (*repositories.WorkspaceRepository).
Click to show internal directories.
Click to hide internal directories.