Documentation
¶
Index ¶
- Constants
- Variables
- type AuthnService
- type Filter
- type Group
- type MembershipService
- type PolicyService
- type RelationService
- type Repository
- type Service
- func (s Service) Create(ctx context.Context, grp Group) (Group, error)
- func (s Service) DeleteModel(ctx context.Context, id string) error
- func (s Service) Disable(ctx context.Context, id string) error
- func (s Service) Enable(ctx context.Context, id string) error
- func (s Service) Get(ctx context.Context, id string) (Group, error)
- func (s Service) GetByIDs(ctx context.Context, ids []string) ([]Group, error)
- func (s Service) List(ctx context.Context, flt Filter) ([]Group, error)
- func (s Service) ListByOrganization(ctx context.Context, id string) ([]Group, error)
- func (s Service) ListByUser(ctx context.Context, principal authenticate.Principal, flt Filter) ([]Group, error)
- func (s Service) RemoveUsers(ctx context.Context, groupID string, userIDs []string) error
- func (s *Service) SetMembershipService(ms MembershipService)
- func (s Service) Update(ctx context.Context, grp Group) (Group, error)
- type State
Constants ¶
View Source
const ( Enabled State = "enabled" Disabled State = "disabled" AdminPermission = schema.DeletePermission MemberRole = schema.GroupMemberRole AdminRole = schema.GroupOwnerRole )
Variables ¶
View Source
var ( ErrNotExist = errors.New("group doesn't exist") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("group id is invalid") ErrConflict = errors.New("group already exist") ErrInvalidDetail = errors.New("invalid group detail") ErrListingGroupRelations = errors.New("error while listing relations") ErrFetchingUsers = errors.New("error while fetching users") ErrFetchingGroups = errors.New("error while fetching groups") )
Functions ¶
This section is empty.
Types ¶
type AuthnService ¶
type AuthnService interface {
GetPrincipal(ctx context.Context, via ...authenticate.ClientAssertion) (authenticate.Principal, error)
}
type MembershipService ¶ added in v0.102.0
type PolicyService ¶ added in v0.7.5
type RelationService ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, grp Group) (Group, error)
GetByID(ctx context.Context, id string) (Group, error)
GetByIDs(ctx context.Context, groupIDs []string, flt Filter) ([]Group, error)
List(ctx context.Context, flt Filter) ([]Group, error)
UpdateByID(ctx context.Context, toUpdate Group) (Group, error)
SetState(ctx context.Context, id string, state State) error
Delete(ctx context.Context, id string) error
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository, relationService RelationService, authnService AuthnService, policyService PolicyService) *Service
func (Service) DeleteModel ¶ added in v0.103.0
DeleteModel removes the group entity from storage and emits the audit event. All SpiceDB policy and relation cleanup is the caller's responsibility — see core/deleter.DeleteGroup for the orchestration that pairs this with membership.OnGroupDeleted.
func (Service) ListByOrganization ¶
ListByOrganization will be useful for nested groups but we don't do that at the moment so it will not be directly used
func (Service) ListByUser ¶
func (Service) RemoveUsers ¶
RemoveUsers removes users from a group as members
func (*Service) SetMembershipService ¶ added in v0.102.0
func (s *Service) SetMembershipService(ms MembershipService)
SetMembershipService sets the membership dependency after construction to break the circular init order between group and membership services.
Click to show internal directories.
Click to hide internal directories.