Documentation
¶
Overview ¶
Package group is the domain layer for the Group entity — a named set of users that role bindings can name as a subject. Local groups only: an IdP group of the same name unions with this one at login, and is never an object here.
Authorization is app/authz's concern; this package validates shape only.
Index ¶
- Constants
- func SameExceptPersonalAccount(a, b *Group) bool
- type External
- type Group
- type Spec
- type Store
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) Directory() directory.Store[directory.Group]
- func (s *Store) Get(ctx context.Context, id string) (*Group, error)
- func (s *Store) List(ctx context.Context) ([]*Group, error)
- func (s *Store) Upsert(ctx context.Context, g *Group) error
Constants ¶
const PersonalAccountAttribute = "personalAccount"
PersonalAccountAttribute is the directory attribute the group's PersonalAccount is stored under.
const SystemPrefix = "system:"
SystemPrefix marks the built-in virtual groups (system:authenticated, system:serviceaccounts, …). They are never rows, so a stored Group may not claim one of those names.
Variables ¶
This section is empty.
Functions ¶
func SameExceptPersonalAccount ¶ added in v0.20.0
SameExceptPersonalAccount reports whether a and b differ in nothing but personalAccount: name, display name, owner, members and enabled flag.
Types ¶
type External ¶ added in v0.10.8
type External struct {
Source string `json:"source" doc:"Name of the SCIM client that provisioned the group."`
ID string `json:"id,omitempty" doc:"The group's id at that source."`
}
External names the provisioning source that manages a group and the source's own id for it.
type Group ¶
type Group struct {
Meta meta.Metadata `json:"metadata" yaml:"metadata"`
Spec Spec `json:"spec" yaml:"spec"`
// External is set on a group a provisioning source manages. The server owns it: a write that carries it is ignored, so no caller can hand a group to a source.
External *External `` /* 199-byte string literal not displayed */
}
Group is a named set of users.
func FromDirectory ¶ added in v0.10.8
FromDirectory is a directory row as a Group. A group written as system-owned reads as the organization's.
func (*Group) PersonalAccountOwnerRule ¶ added in v0.20.0
PersonalAccountOwnerRule refuses personalAccount on a group the organization does not own: whoever owns a user's group edits its members and enabled flag, which would let a non-admin turn other users' personal accounts on or off.
func (*Group) ToDirectory ¶ added in v0.10.8
ToDirectory is g as the directory stores it. External is left out: the directory keeps the stored one when a write carries none, and a caller must not be able to set it.
type Spec ¶
type Spec struct {
// MemberIDs are User ids, in declaration order.
MemberIDs []string `json:"memberIds,omitempty" yaml:"memberIds,omitempty" validate:"omitempty,dive,uuid" doc:"Ids of the member users."`
// Enabled defaults to true when nil.
Enabled *bool `` /* 138-byte string literal not displayed */
// PersonalAccount is the group's say on its members' personal accounts; empty leaves it to the deployment's accounts setting.
PersonalAccount string `` /* 562-byte string literal not displayed */
}
Spec carries the member list and the enabled flag.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Directory ¶ added in v0.10.8
Directory is the auth module's store under this one, for writes that run through the directory.