groups

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTenantID = "default"

Variables

View Source
var (
	ErrGroupNotFound       = errors.New("group not found")
	ErrInvalidGroupName    = errors.New("invalid group name")
	ErrDuplicateGroup      = errors.New("group already exists")
	ErrInvalidGroupType    = errors.New("invalid group type")
	ErrInvalidTenant       = errors.New("invalid tenant")
	ErrInternalServerError = errors.New("internal server error")
	ErrUserAlreadyInGroup  = errors.New("user already in group")
	ErrInvalidGroupID      = errors.New("invalid group id")
)

Functions

This section is empty.

Types

type AuthorizerInterface

type AuthorizerInterface interface {
	DeleteGroup(context.Context, string) error
}

type DatabaseInterface

type DatabaseInterface interface {
	ListGroups(context.Context) ([]*types.Group, error)
	CreateGroup(context.Context, *types.Group) (*types.Group, error)
	GetGroup(context.Context, string) (*types.Group, error)
	UpdateGroup(context.Context, string, *types.Group) (*types.Group, error)
	DeleteGroup(context.Context, string) error

	AddUsersToGroup(context.Context, string, []string) error
	ListUsersInGroup(context.Context, string) ([]string, error)
	RemoveUsersFromGroup(context.Context, string, []string) error

	GetGroupsForUser(context.Context, string) ([]*types.Group, error)
	UpdateGroupsForUser(context.Context, string, []string) error
}

type GrpcServer

type GrpcServer struct {
	v0_groups.UnimplementedAuthzGroupsServiceServer
	// contains filtered or unexported fields
}

func (*GrpcServer) AddUserToGroups

func (*GrpcServer) AddUsersToGroup

func (*GrpcServer) CreateGroup

func (*GrpcServer) GetGroup

func (*GrpcServer) ListGroups

func (*GrpcServer) ListUserGroups

func (*GrpcServer) ListUsersInGroup

func (*GrpcServer) RemoveGroup

func (*GrpcServer) UpdateGroup

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) AddUsersToGroup

func (s *Service) AddUsersToGroup(ctx context.Context, groupID string, userIDs []string) error

func (*Service) CreateGroup

func (s *Service) CreateGroup(ctx context.Context, group *types.Group) (*types.Group, error)

func (*Service) DeleteGroup

func (s *Service) DeleteGroup(ctx context.Context, id string) error

func (*Service) GetGroup

func (s *Service) GetGroup(ctx context.Context, id string) (*types.Group, error)

func (*Service) GetGroupsForUser

func (s *Service) GetGroupsForUser(ctx context.Context, userID string) ([]*types.Group, error)

func (*Service) ListGroups

func (s *Service) ListGroups(ctx context.Context) ([]*types.Group, error)

func (*Service) ListUsersInGroup

func (s *Service) ListUsersInGroup(ctx context.Context, groupID string) ([]string, error)

func (*Service) RemoveUsersFromGroup

func (s *Service) RemoveUsersFromGroup(ctx context.Context, groupID string, users []string) error

func (*Service) UpdateGroup

func (s *Service) UpdateGroup(ctx context.Context, id string, group *types.Group) (*types.Group, error)

func (*Service) UpdateGroupsForUser

func (s *Service) UpdateGroupsForUser(ctx context.Context, userID string, groupIDs []string) error

type ServiceInterface

type ServiceInterface interface {
	ListGroups(context.Context) ([]*types.Group, error)
	CreateGroup(context.Context, *types.Group) (*types.Group, error)
	GetGroup(context.Context, string) (*types.Group, error)
	UpdateGroup(context.Context, string, *types.Group) (*types.Group, error)
	DeleteGroup(context.Context, string) error

	AddUsersToGroup(context.Context, string, []string) error
	ListUsersInGroup(context.Context, string) ([]string, error)
	RemoveUsersFromGroup(context.Context, string, []string) error

	GetGroupsForUser(context.Context, string) ([]*types.Group, error)
	UpdateGroupsForUser(context.Context, string, []string) error
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage() *Storage

func (*Storage) AddUsersToGroup

func (m *Storage) AddUsersToGroup(ctx context.Context, groupID string, userIDs []string) error

func (*Storage) CreateGroup

func (m *Storage) CreateGroup(ctx context.Context, group *types.Group) (*types.Group, error)

func (*Storage) DeleteGroup

func (m *Storage) DeleteGroup(ctx context.Context, id string) error

func (*Storage) GetGroup

func (m *Storage) GetGroup(ctx context.Context, id string) (*types.Group, error)

func (*Storage) GetGroupsForUser

func (m *Storage) GetGroupsForUser(ctx context.Context, userID string) ([]*types.Group, error)

func (*Storage) ListGroups

func (m *Storage) ListGroups(ctx context.Context) ([]*types.Group, error)

func (*Storage) ListUsersInGroup

func (m *Storage) ListUsersInGroup(ctx context.Context, groupID string) ([]string, error)

func (*Storage) RemoveUsersFromGroup

func (m *Storage) RemoveUsersFromGroup(ctx context.Context, groupID string, userIDs []string) error

func (*Storage) UpdateGroup

func (m *Storage) UpdateGroup(ctx context.Context, id string, group *types.Group) (*types.Group, error)

func (*Storage) UpdateGroupsForUser

func (m *Storage) UpdateGroupsForUser(ctx context.Context, userID string, groupIDs []string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL