Documentation ¶
Index ¶
- type ACLChecker
- type InnerRingFetcher
- type MetaWithToken
- type Option
- type RequestInfo
- func (r RequestInfo) BasicACL() acl.Basic
- func (r RequestInfo) Bearer() *bearer.Token
- func (r *RequestInfo) CleanBearer()
- func (r RequestInfo) ContainerID() cid.ID
- func (r RequestInfo) ContainerNamespace() string
- func (r RequestInfo) ContainerOwner() user.ID
- func (r RequestInfo) IsSoftAPECheck() bool
- func (r RequestInfo) ObjectID() *oid.ID
- func (r RequestInfo) Operation() acl.Op
- func (r RequestInfo) Request() any
- func (r RequestInfo) RequestRole() acl.Role
- func (r RequestInfo) SenderKey() []byte
- func (r *RequestInfo) SetBasicACL(basicACL acl.Basic)
- func (r *RequestInfo) SetRequestRole(requestRole acl.Role)
- func (r *RequestInfo) SetSenderKey(senderKey []byte)
- type Service
- func (b Service) Delete(ctx context.Context, request *objectV2.DeleteRequest) (*objectV2.DeleteResponse, error)
- func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream) error
- func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetObjectRangeStream) error
- func (b Service) GetRangeHash(ctx context.Context, request *objectV2.GetRangeHashRequest) (*objectV2.GetRangeHashResponse, error)
- func (b Service) Head(ctx context.Context, request *objectV2.HeadRequest) (*objectV2.HeadResponse, error)
- func (b Service) Put() (object.PutObjectStream, error)
- func (b Service) PutSingle(ctx context.Context, request *objectV2.PutSingleRequest) (*objectV2.PutSingleResponse, error)
- func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStream) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLChecker ¶
type ACLChecker interface { // CheckBasicACL must return true only if request // passes basic ACL validation. CheckBasicACL(RequestInfo) bool // CheckEACL must return non-nil error if request // doesn't pass extended ACL validation. CheckEACL(any, RequestInfo) error // StickyBitCheck must return true only if sticky bit // is disabled or enabled but request contains correct // owner field. StickyBitCheck(RequestInfo, user.ID) bool }
ACLChecker is an interface that must provide ACL related checks.
type InnerRingFetcher ¶
type InnerRingFetcher interface { // InnerRingKeys must return list of public keys of // the actual inner ring. InnerRingKeys() ([][]byte, error) }
InnerRingFetcher is an interface that must provide Inner Ring information.
type MetaWithToken ¶
type MetaWithToken struct {
// contains filtered or unexported fields
}
MetaWithToken groups session and bearer tokens, verification header and raw API request.
func (MetaWithToken) RequestOwner ¶
RequestOwner returns ownerID and its public key according to internal meta information.
type RequestInfo ¶
type RequestInfo struct {
// contains filtered or unexported fields
}
RequestInfo groups parsed version-independent (from SDK library) request information and raw API request.
func (RequestInfo) BasicACL ¶
func (r RequestInfo) BasicACL() acl.Basic
BasicACL returns basic ACL of the container.
func (RequestInfo) Bearer ¶
func (r RequestInfo) Bearer() *bearer.Token
Bearer returns bearer token of the request.
func (*RequestInfo) CleanBearer ¶
func (r *RequestInfo) CleanBearer()
CleanBearer forces cleaning bearer token information.
func (RequestInfo) ContainerID ¶
func (r RequestInfo) ContainerID() cid.ID
ContainerID return container ID.
func (RequestInfo) ContainerNamespace ¶ added in v0.38.0
func (r RequestInfo) ContainerNamespace() string
func (RequestInfo) ContainerOwner ¶
func (r RequestInfo) ContainerOwner() user.ID
ContainerOwner returns owner if the container.
func (RequestInfo) IsSoftAPECheck ¶ added in v0.38.0
func (r RequestInfo) IsSoftAPECheck() bool
IsSoftAPECheck states if APE should perform soft checks. Soft APE check allows a request if CheckAPE returns NoRuleFound for it, otherwise it denies the request.
func (RequestInfo) Operation ¶
func (r RequestInfo) Operation() acl.Op
Operation returns request's operation.
func (RequestInfo) RequestRole ¶
func (r RequestInfo) RequestRole() acl.Role
RequestRole returns request sender's role.
func (RequestInfo) SenderKey ¶
func (r RequestInfo) SenderKey() []byte
SenderKey returns public key of the request's sender.
func (*RequestInfo) SetBasicACL ¶
func (r *RequestInfo) SetBasicACL(basicACL acl.Basic)
func (*RequestInfo) SetRequestRole ¶
func (r *RequestInfo) SetRequestRole(requestRole acl.Role)
func (*RequestInfo) SetSenderKey ¶
func (r *RequestInfo) SetSenderKey(senderKey []byte)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service checks basic ACL rules.
func New ¶
func New(next object.ServiceServer, nm netmap.Source, irf InnerRingFetcher, acl ACLChecker, cs container.Source, opts ...Option, ) Service
New is a constructor for object ACL checking service.
func (Service) Delete ¶
func (b Service) Delete( ctx context.Context, request *objectV2.DeleteRequest, ) (*objectV2.DeleteResponse, error)
func (Service) Get ¶
func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream) error
Get implements ServiceServer interface, makes ACL checks and calls next Get method in the ServiceServer pipeline.
func (Service) GetRange ¶
func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetObjectRangeStream) error
func (Service) GetRangeHash ¶
func (b Service) GetRangeHash( ctx context.Context, request *objectV2.GetRangeHashRequest, ) (*objectV2.GetRangeHashResponse, error)
func (Service) Head ¶
func (b Service) Head( ctx context.Context, request *objectV2.HeadRequest, ) (*objectV2.HeadResponse, error)
func (Service) PutSingle ¶ added in v0.37.0
func (b Service) PutSingle(ctx context.Context, request *objectV2.PutSingleRequest) (*objectV2.PutSingleResponse, error)
func (Service) Search ¶
func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStream) error