workflowsvc

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrGrantInactive is returned when a inactive grant is attempted to be revoked
	ErrGrantInactive = errors.New("only active grants can be revoked")
	// ErrNoGrant is returned when attempting to revoke a request which has no grant yet
	ErrNoGrant = errors.New("request has no grant")
)

Functions

This section is empty.

Types

type EventPutter

type EventPutter interface {
	Put(ctx context.Context, detail gevent.EventTyper) error
}

type GrantValidationError

type GrantValidationError struct {
	ValidationFailureMsg string
}

GrantValidationError is returned if grantValidation fails

func (GrantValidationError) Error

func (e GrantValidationError) Error() string

type Runtime

type Runtime interface {
	// isForTargetGroup tells the runtime how to process the request
	// grant is expected to be asyncronous
	Grant(ctx context.Context, grant ahTypes.CreateGrant, isForTargetGroup bool) error
	// isForTargetGroup tells the runtime how to process the request
	// revoke is expected to be syncronous
	Revoke(ctx context.Context, grantID string, isForTargetGroup bool) error
}

type Service

type Service struct {
	Runtime  Runtime
	DB       ddb.Storage
	Clk      clock.Clock
	Eventbus EventPutter
}

func (*Service) Grant

func (s *Service) Grant(ctx context.Context, request access.Request, accessRule rule.AccessRule) (*access.Grant, error)

func (*Service) Revoke

func (s *Service) Revoke(ctx context.Context, request access.Request, revokerID string, revokerEmail string) (*access.Request, error)

Revoke attepmts to syncronously revoke access to a request If it is successful, the request is updated in the database, and the updated request is returned from this method

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
runtimes

Jump to

Keyboard shortcuts

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