group

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateGroupRequest

type CreateGroupRequest struct {
	Name string
}

CreateGroupRequest represents a request to create a new group

type Group

type Group = iam.Group

Group is a service-layer view of an IAM group

type Repository

type Repository interface {
	CreateGroup(ctx context.Context, groupName string) error
	GetGroup(ctx context.Context, groupName string) (*metadata.Group, error)
	DeleteGroup(ctx context.Context, groupName string) error
	ListGroupNames(ctx context.Context) ([]string, error)
	GetUser(ctx context.Context, userUID uuid.UUID) (*metadata.User, error)
	GetUserByAccessKey(ctx context.Context, accessKey string) (*metadata.User, error)
	AddUserToGroup(ctx context.Context, groupName string, userUID uuid.UUID) error
	RemoveUserFromGroup(ctx context.Context, groupName string, userUID uuid.UUID) error
	AttachPolicyToGroup(ctx context.Context, groupName, policyName string) error
	DetachPolicyFromGroup(ctx context.Context, groupName, policyName string) error
	SetGroupStatus(ctx context.Context, groupName string, status iam.GroupStatus) error
	GetPolicy(ctx context.Context, name string) (*metadata.Policy, error)
}

Repository is the persistence interface required by the group Service.

type Service

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

Service provides group management operations

func NewService

func NewService(m Repository) *Service

NewService creates a new group service

func (*Service) AddMember

func (s *Service) AddMember(ctx context.Context, groupName string, userUID uuid.UUID) error

AddMember adds a user to a group (idempotent).

func (*Service) AddMemberByAccessKey

func (s *Service) AddMemberByAccessKey(ctx context.Context, groupName, accessKey string) error

AddMemberByAccessKey resolves an access key to a UUID and adds the user to the group.

func (*Service) AttachPolicy

func (s *Service) AttachPolicy(ctx context.Context, groupName, policyName string) error

AttachPolicy attaches a policy to a group (idempotent)

func (*Service) Create

func (s *Service) Create(ctx context.Context, req *CreateGroupRequest) (*iam.Group, error)

Create creates a new empty group

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, name string) error

Delete deletes a group by name

func (*Service) DetachPolicy

func (s *Service) DetachPolicy(ctx context.Context, groupName, policyName string) error

DetachPolicy detaches a policy from a group

func (*Service) Get

func (s *Service) Get(ctx context.Context, name string) (*iam.Group, error)

Get retrieves a group by name

func (*Service) GetMemberAccessKeys

func (s *Service) GetMemberAccessKeys(ctx context.Context, groupName string) ([]string, error)

GetMemberAccessKeys returns the access keys for all members of the group, resolving the stored UUIDs via the metadata manager.

func (*Service) List

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

List returns all group names

func (*Service) RemoveMember

func (s *Service) RemoveMember(ctx context.Context, groupName string, userUID uuid.UUID) error

RemoveMember removes a user from a group.

func (*Service) RemoveMemberByAccessKey

func (s *Service) RemoveMemberByAccessKey(ctx context.Context, groupName, accessKey string) error

RemoveMemberByAccessKey resolves an access key to a UUID and removes the user from the group.

func (*Service) SetStatus

func (s *Service) SetStatus(ctx context.Context, groupName string, status iam.GroupStatus) error

SetStatus enables or disables a group

type UpdateGroupMembersRequest

type UpdateGroupMembersRequest struct {
	GroupName string
	Members   []string
	IsRemove  bool // true = remove members, false = add members
}

UpdateGroupMembersRequest represents a request to add or remove members from a group

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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