Documentation ¶
Index ¶
- Constants
- Variables
- type AuthnService
- type Filter
- type Group
- type PolicyService
- type RelationService
- type Repository
- type Service
- func (s Service) AddMember(ctx context.Context, groupID string, principal authenticate.Principal) error
- func (s Service) AddUsers(ctx context.Context, groupID string, userIDs []string) error
- func (s Service) Create(ctx context.Context, grp Group) (Group, error)
- func (s Service) Delete(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, userId string, flt Filter) ([]Group, error)
- func (s Service) RemoveUsers(ctx context.Context, groupID string, userIDs []string) error
- func (s Service) Update(ctx context.Context, grp Group) (Group, error)
- type State
Constants ¶
View Source
const ( Enabled State = "enabled" Disabled State = "disabled" MemberPermission = schema.MembershipPermission AdminPermission = schema.DeletePermission )
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 PolicyService ¶ added in v0.7.5
type RelationService ¶
type RelationService interface { Create(ctx context.Context, rel relation.Relation) (relation.Relation, error) ListRelations(ctx context.Context, rel relation.Relation) ([]relation.Relation, error) LookupSubjects(ctx context.Context, rel relation.Relation) ([]string, error) LookupResources(ctx context.Context, rel relation.Relation) ([]string, error) Delete(ctx context.Context, rel relation.Relation) error }
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) ListGroupRelations(ctx context.Context, objectId, subjectType, role string) ([]relation.Relation, 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) AddMember ¶
func (s Service) AddMember(ctx context.Context, groupID string, principal authenticate.Principal) error
AddMember adds a subject(user) to group as member
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
Click to show internal directories.
Click to hide internal directories.