policy

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuditKeyPolicyCreate = "policy.create"
	AuditKeyPolicyUpdate = "policy.update"
)

Variables

View Source
var (
	// ErrEmptyIDParam is the error value if the policy id is empty
	ErrEmptyIDParam = errors.New("id can't be empty")
	// ErrPolicyNotFound is the error value if the designated policy not found
	ErrPolicyNotFound              = errors.New("policy not found")
	ErrIDContainsWhitespaces       = errors.New("id should not contain whitespaces")
	ErrStepNameContainsWhitespaces = errors.New("step name should not contain whitespaces")
	ErrInvalidApprovers            = errors.New("invalid approvers")
	ErrStepDependencyDoesNotExists = errors.New("step dependency does not exists")
)

Functions

func WithDryRun

func WithDryRun(ctx context.Context) context.Context

Types

type AppealMetadataSourceConfigHTTP added in v0.10.0

type AppealMetadataSourceConfigHTTP struct {
	http.HTTPClientConfig `mapstructure:",squash"`
	AllowFailed           bool `mapstructure:"allow_failed,omitempty" json:"allow_failed,omitempty" yaml:"allow_failed,omitempty"`
}

type Service

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

Service handling the business logics

func NewService

func NewService(deps ServiceDeps) *Service

NewService returns service struct

func (*Service) Create

func (s *Service) Create(ctx context.Context, p *domain.Policy) error

Create record

func (*Service) Find

func (s *Service) Find(ctx context.Context) ([]*domain.Policy, error)

Find records

func (*Service) GetOne

func (s *Service) GetOne(ctx context.Context, id string, version uint) (*domain.Policy, error)

GetOne record

func (*Service) Update

func (s *Service) Update(ctx context.Context, p *domain.Policy) error

Update a record

type ServiceDeps

type ServiceDeps struct {
	Repository      repository
	ResourceService resourceService
	ProviderService providerService
	IAMManager      domain.IAMManager

	Crypto      domain.Crypto
	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