grant

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

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) GetByID

func (s *Service) GetByID(ctx context.Context, id string) (*domain.Grant, 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) Prepare

func (s *Service) Prepare(ctx context.Context, appeal domain.Appeal) (*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