grant

package
v0.11.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuditKeyRevoke  = "grant.revoke"
	AuditKeyUpdate  = "grant.update"
	AuditKeyRestore = "grant.restore"
)

Variables

View Source
var (
	ErrEmptyIDParam        = errors.New("grant id can't be empty")
	ErrGrantNotFound       = errors.New("grant not found")
	ErrEmptyImportedGrants = errors.New("imported grants not found")
	ErrEmptyOwner          = errors.New("owner can't be empty")
)

Functions

This section is empty.

Types

type ImportFromProviderCriteria

type ImportFromProviderCriteria struct {
	ProviderID    string `validate:"required"`
	ResourceIDs   []string
	ResourceTypes []string
	ResourceURNs  []string
}

type Option

type Option func(*options)

func SkipNotifications

func SkipNotifications() Option

func SkipRevokeAccessInProvider

func SkipRevokeAccessInProvider() Option

type Service

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

func NewService

func NewService(deps ServiceDeps) *Service

func (*Service) BulkRevoke

func (s *Service) BulkRevoke(ctx context.Context, filter domain.RevokeGrantsFilter, actor, reason string) ([]*domain.Grant, error)

func (*Service) DormancyCheck added in v0.7.5

func (s *Service) DormancyCheck(ctx context.Context, criteria domain.DormancyCheckCriteria) error

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, id string) (*domain.Grant, error)

func (*Service) GetGrantsTotalCount added in v0.7.5

func (s *Service) GetGrantsTotalCount(ctx context.Context, filters domain.ListGrantsFilter) (int64, error)

func (*Service) ImportFromProvider

func (s *Service) ImportFromProvider(ctx context.Context, criteria ImportFromProviderCriteria) ([]*domain.Grant, error)

func (*Service) List

func (s *Service) List(ctx context.Context, filter domain.ListGrantsFilter) ([]domain.Grant, error)

func (*Service) ListUserRoles added in v0.7.6

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

func (*Service) Prepare

func (s *Service) Prepare(ctx context.Context, appeal domain.Appeal) (*domain.Grant, error)

func (*Service) Restore added in v0.11.0

func (s *Service) Restore(ctx context.Context, id, actor, reason string) (*domain.Grant, error)

func (*Service) Revoke

func (s *Service) Revoke(ctx context.Context, id, actor, reason string, opts ...Option) (*domain.Grant, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, payload *domain.Grant) error

type ServiceDeps

type ServiceDeps struct {
	Repository      repository
	ProviderService providerService
	ResourceService resourceService

	Notifier    notifier
	Validator   *validator.Validate
	Logger      log.Logger
	AuditLogger auditLogger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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