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
- 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 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 ¶
This section is empty.
Types ¶
type External ¶ added in v0.10.8
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.
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"`
// Enabled defaults to true when nil.
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}
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.