ape

package
v0.42.18 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	CheckAPE(context.Context, Prm) error
}

Checker provides methods to check requests and responses with access policy engine.

func NewChecker

func NewChecker(localOverrideStorage policyengine.LocalOverrideStorage, morphChainStorage policyengine.MorphRuleChainStorageReader, headerProvider HeaderProvider, frostFSIDClient frostfsidcore.SubjectProvider, nm netmap.Source, st netmap.State, cnrSource container.Source, nodePK []byte) Checker

type HeaderProvider

type HeaderProvider interface {
	GetHeader(ctx context.Context, cnr cid.ID, oid oid.ID, local bool) (*objectSDK.Object, error)
}

func NewStorageEngineHeaderProvider

func NewStorageEngineHeaderProvider(e *engine.StorageEngine, s *getsvc.Service) HeaderProvider

type Prm

type Prm struct {
	Namespace string

	Container cid.ID

	// Object ID is omitted for some methods.
	Object *oid.ID

	// If Header is set, then object attributes and properties will be parsed from
	// a request/response's header.
	Header *objectV2.Header

	// Method must be represented only as a constant represented in native schema.
	Method string

	// Role must be representedonly as a constant represented in native schema.
	Role string

	// An encoded sender's public key string.
	SenderKey string

	// An encoded container's owner user ID.
	ContainerOwner user.ID

	// If SoftAPECheck is set to true, then NoRuleFound is interpreted as allow.
	SoftAPECheck bool

	// If true, object headers will not retrieved from storage engine.
	WithoutHeaderRequest bool

	// The request's bearer token. It is used in order to check APE overrides with the token.
	BearerToken *bearer.Token

	// XHeaders from the request.
	XHeaders []session.XHeader
}

type Service

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

func NewService

func NewService(log *logger.Logger, apeChecker Checker, next objectSvc.ServiceServer) *Service

func (*Service) Delete

func (*Service) Get

func (c *Service) Get(request *objectV2.GetRequest, stream objectSvc.GetObjectStream) error

func (*Service) GetRange

func (c *Service) GetRange(request *objectV2.GetRangeRequest, stream objectSvc.GetObjectRangeStream) error

func (*Service) GetRangeHash

func (*Service) Head

func (*Service) Put

func (c *Service) Put() (objectSvc.PutObjectStream, error)

func (*Service) PutSingle

func (*Service) Search

func (c *Service) Search(request *objectV2.SearchRequest, stream objectSvc.SearchStream) error

Jump to

Keyboard shortcuts

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