acl

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// FilterObjectVersion is a filter key to "version" field of the object header.
	FilterObjectVersion = ObjectFilterPrefix + "version"

	// FilterObjectID is a filter key to "object_id" field of the object.
	FilterObjectID = ObjectFilterPrefix + "objectID"

	// FilterObjectContainerID is a filter key to "container_id" field of the object header.
	FilterObjectContainerID = ObjectFilterPrefix + "containerID"

	// FilterObjectOwnerID is a filter key to "owner_id" field of the object header.
	FilterObjectOwnerID = ObjectFilterPrefix + "ownerID"

	// FilterObjectCreationEpoch is a filter key to "creation_epoch" field of the object header.
	FilterObjectCreationEpoch = ObjectFilterPrefix + "creationEpoch"

	// FilterObjectPayloadLength is a filter key to "payload_length" field of the object header.
	FilterObjectPayloadLength = ObjectFilterPrefix + "payloadLength"

	// FilterObjectPayloadHash is a filter key to "payload_hash" field of the object header.
	FilterObjectPayloadHash = ObjectFilterPrefix + "payloadHash"

	// FilterObjectType is a filter key to "object_type" field of the object header.
	FilterObjectType = ObjectFilterPrefix + "objectType"

	// FilterObjectHomomorphicHash is a filter key to "homomorphic_hash" field of the object header.
	FilterObjectHomomorphicHash = ObjectFilterPrefix + "homomorphicHash"
)
View Source
const ObjectFilterPrefix = "$Object:"

ObjectFilterPrefix is a prefix of key to object header value or property.

Variables

This section is empty.

Functions

func ActionToGRPCField

func ActionToGRPCField(t Action) acl.Action

ActionToGRPCField converts unified action enum into grpc enum.

func HeaderFiltersToGRPC added in v1.25.0

func HeaderFiltersToGRPC(fs []*HeaderFilter) (res []*acl.EACLRecord_Filter)

func HeaderTypeToGRPCField

func HeaderTypeToGRPCField(t HeaderType) acl.HeaderType

HeaderTypeToGRPCField converts unified header type enum into grpc enum.

func MatchTypeToGRPCField

func MatchTypeToGRPCField(t MatchType) acl.MatchType

MatchTypeToGRPCField converts unified match type enum into grpc enum.

func OperationToGRPCField

func OperationToGRPCField(t Operation) acl.Operation

OperationToGRPCField converts unified operation enum into grpc enum.

func RecordsToGRPC added in v1.25.0

func RecordsToGRPC(ts []*Record) (res []*acl.EACLRecord)

func RoleToGRPCField

func RoleToGRPCField(t Role) acl.Role

RoleToGRPCField converts unified role enum into grpc enum.

func TargetsToGRPC added in v1.25.0

func TargetsToGRPC(ts []*Target) (res []*acl.EACLRecord_Target)

Types

type Action

type Action uint32

Action is a unified enum of Action enum from proto definition.

const (
	ActionUnknown Action = iota
	ActionAllow
	ActionDeny
)

func ActionFromGRPCField

func ActionFromGRPCField(t acl.Action) Action

ActionFromGRPCField converts grpc enum into unified action enum.

func (*Action) FromString added in v1.28.0

func (x *Action) FromString(s string) bool

FromString parses Action from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (Action) String added in v1.28.0

func (x Action) String() string

String returns string representation of Action.

type BearerToken

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

func (*BearerToken) FromGRPCMessage added in v1.25.0

func (bt *BearerToken) FromGRPCMessage(m grpc.Message) error

func (*BearerToken) GetBody

func (bt *BearerToken) GetBody() *BearerTokenBody

func (*BearerToken) GetSignature

func (bt *BearerToken) GetSignature() *refs.Signature

func (*BearerToken) MarshalJSON

func (bt *BearerToken) MarshalJSON() ([]byte, error)

func (*BearerToken) SetBody

func (bt *BearerToken) SetBody(v *BearerTokenBody)

func (*BearerToken) SetSignature

func (bt *BearerToken) SetSignature(v *refs.Signature)

func (*BearerToken) StableMarshal

func (bt *BearerToken) StableMarshal(buf []byte) ([]byte, error)

func (*BearerToken) StableSize

func (bt *BearerToken) StableSize() (size int)

func (*BearerToken) ToGRPCMessage added in v1.25.0

func (bt *BearerToken) ToGRPCMessage() grpc.Message

func (*BearerToken) Unmarshal

func (bt *BearerToken) Unmarshal(data []byte) error

func (*BearerToken) UnmarshalJSON

func (bt *BearerToken) UnmarshalJSON(data []byte) error

type BearerTokenBody

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

func (*BearerTokenBody) FromGRPCMessage added in v1.25.0

func (bt *BearerTokenBody) FromGRPCMessage(m grpc.Message) error

func (*BearerTokenBody) GetEACL

func (bt *BearerTokenBody) GetEACL() *Table

func (*BearerTokenBody) GetLifetime

func (bt *BearerTokenBody) GetLifetime() *TokenLifetime

func (*BearerTokenBody) GetOwnerID

func (bt *BearerTokenBody) GetOwnerID() *refs.OwnerID

func (*BearerTokenBody) MarshalJSON

func (bt *BearerTokenBody) MarshalJSON() ([]byte, error)

func (*BearerTokenBody) SetEACL

func (bt *BearerTokenBody) SetEACL(v *Table)

func (*BearerTokenBody) SetLifetime

func (bt *BearerTokenBody) SetLifetime(v *TokenLifetime)

func (*BearerTokenBody) SetOwnerID

func (bt *BearerTokenBody) SetOwnerID(v *refs.OwnerID)

func (*BearerTokenBody) StableMarshal

func (bt *BearerTokenBody) StableMarshal(buf []byte) ([]byte, error)

func (*BearerTokenBody) StableSize

func (bt *BearerTokenBody) StableSize() (size int)

func (*BearerTokenBody) ToGRPCMessage added in v1.25.0

func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message

func (*BearerTokenBody) Unmarshal

func (bt *BearerTokenBody) Unmarshal(data []byte) error

func (*BearerTokenBody) UnmarshalJSON

func (bt *BearerTokenBody) UnmarshalJSON(data []byte) error

type HeaderFilter

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

HeaderFilter is a unified structure of FilterInfo message from proto definition.

func HeaderFiltersFromGRPC added in v1.25.0

func HeaderFiltersFromGRPC(fs []*acl.EACLRecord_Filter) (res []*HeaderFilter, err error)

func (*HeaderFilter) FromGRPCMessage added in v1.25.0

func (f *HeaderFilter) FromGRPCMessage(m grpc.Message) error

func (*HeaderFilter) GetHeaderType

func (f *HeaderFilter) GetHeaderType() HeaderType

func (*HeaderFilter) GetKey

func (f *HeaderFilter) GetKey() string

func (*HeaderFilter) GetMatchType

func (f *HeaderFilter) GetMatchType() MatchType

func (*HeaderFilter) GetValue

func (f *HeaderFilter) GetValue() string

func (*HeaderFilter) MarshalJSON

func (f *HeaderFilter) MarshalJSON() ([]byte, error)

func (*HeaderFilter) SetHeaderType

func (f *HeaderFilter) SetHeaderType(v HeaderType)

func (*HeaderFilter) SetKey

func (f *HeaderFilter) SetKey(v string)

func (*HeaderFilter) SetMatchType

func (f *HeaderFilter) SetMatchType(v MatchType)

func (*HeaderFilter) SetValue

func (f *HeaderFilter) SetValue(v string)

func (*HeaderFilter) StableMarshal

func (f *HeaderFilter) StableMarshal(buf []byte) ([]byte, error)

StableMarshal marshals unified header filter structure in a protobuf compatible way without field order shuffle.

func (*HeaderFilter) StableSize

func (f *HeaderFilter) StableSize() (size int)

StableSize of header filter structure marshalled by StableMarshal function.

func (*HeaderFilter) ToGRPCMessage added in v1.25.0

func (f *HeaderFilter) ToGRPCMessage() grpc.Message

func (*HeaderFilter) Unmarshal

func (f *HeaderFilter) Unmarshal(data []byte) error

func (*HeaderFilter) UnmarshalJSON

func (f *HeaderFilter) UnmarshalJSON(data []byte) error

type HeaderType

type HeaderType uint32

HeaderType is a unified enum of HeaderType enum from proto definition.

const (
	HeaderTypeUnknown HeaderType = iota
	HeaderTypeRequest
	HeaderTypeObject
)

func HeaderTypeFromGRPCField

func HeaderTypeFromGRPCField(t acl.HeaderType) HeaderType

HeaderTypeFromGRPCField converts grpc enum into unified header type enum.

func (*HeaderType) FromString added in v1.28.0

func (x *HeaderType) FromString(s string) bool

FromString parses HeaderType from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (HeaderType) String added in v1.28.0

func (x HeaderType) String() string

String returns string representation of HeaderType.

type MatchType

type MatchType uint32

Target is a unified enum of MatchType enum from proto definition.

const (
	MatchTypeUnknown MatchType = iota
	MatchTypeStringEqual
	MatchTypeStringNotEqual
)

func MatchTypeFromGRPCField

func MatchTypeFromGRPCField(t acl.MatchType) MatchType

MatchTypeFromGRPCField converts grpc enum into unified match type enum.

func (*MatchType) FromString added in v1.28.0

func (x *MatchType) FromString(s string) bool

FromString parses MatchType from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (MatchType) String added in v1.28.0

func (x MatchType) String() string

String returns string representation of MatchType.

type Operation

type Operation uint32

Operation is a unified enum of Operation enum from proto definition.

const (
	OperationUnknown Operation = iota
	OperationGet
	OperationHead
	OperationPut
	OperationDelete
	OperationSearch
	OperationRange
	OperationRangeHash
)

func OperationFromGRPCField

func OperationFromGRPCField(t acl.Operation) Operation

OperationFromGRPCField converts grpc enum into unified operation enum.

func (*Operation) FromString added in v1.28.0

func (x *Operation) FromString(s string) bool

FromString parses Operation from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (Operation) String added in v1.28.0

func (x Operation) String() string

String returns string representation of Operation.

type Record

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

Record is a unified structure of EACLRecord message from proto definition.

func RecordsFromGRPC added in v1.25.0

func RecordsFromGRPC(fs []*acl.EACLRecord) (res []*Record, err error)

func (*Record) FromGRPCMessage added in v1.25.0

func (r *Record) FromGRPCMessage(m grpc.Message) error

func (*Record) GetAction

func (r *Record) GetAction() Action

func (*Record) GetFilters

func (r *Record) GetFilters() []*HeaderFilter

func (*Record) GetOperation

func (r *Record) GetOperation() Operation

func (*Record) GetTargets

func (r *Record) GetTargets() []*Target

func (*Record) MarshalJSON

func (r *Record) MarshalJSON() ([]byte, error)

func (*Record) SetAction

func (r *Record) SetAction(v Action)

func (*Record) SetFilters

func (r *Record) SetFilters(v []*HeaderFilter)

func (*Record) SetOperation

func (r *Record) SetOperation(v Operation)

func (*Record) SetTargets

func (r *Record) SetTargets(v []*Target)

func (*Record) StableMarshal

func (r *Record) StableMarshal(buf []byte) ([]byte, error)

StableMarshal marshals unified acl record structure in a protobuf compatible way without field order shuffle.

func (*Record) StableSize

func (r *Record) StableSize() (size int)

StableSize of acl record structure marshalled by StableMarshal function.

func (*Record) ToGRPCMessage added in v1.25.0

func (r *Record) ToGRPCMessage() grpc.Message

func (*Record) Unmarshal

func (r *Record) Unmarshal(data []byte) error

func (*Record) UnmarshalJSON

func (r *Record) UnmarshalJSON(data []byte) error

type Role

type Role uint32

Role is a unified enum of Role enum from proto definition.

const (
	RoleUnknown Role = iota
	RoleUser
	RoleSystem
	RoleOthers
)

func RoleFromGRPCField

func RoleFromGRPCField(t acl.Role) Role

RoleFromGRPCField converts grpc enum into unified role enum.

func (*Role) FromString added in v1.28.0

func (x *Role) FromString(s string) bool

FromString parses Role from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (Role) String added in v1.28.0

func (x Role) String() string

String returns string representation of Role.

type Table

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

Table is a unified structure of EACLTable message from proto definition.

func (*Table) FromGRPCMessage added in v1.25.0

func (t *Table) FromGRPCMessage(m grpc.Message) error

func (*Table) GetContainerID

func (t *Table) GetContainerID() *refs.ContainerID

func (*Table) GetRecords

func (t *Table) GetRecords() []*Record

func (*Table) GetVersion

func (t *Table) GetVersion() *refs.Version

func (*Table) MarshalJSON

func (t *Table) MarshalJSON() ([]byte, error)

func (*Table) SetContainerID

func (t *Table) SetContainerID(v *refs.ContainerID)

func (*Table) SetRecords

func (t *Table) SetRecords(v []*Record)

func (*Table) SetVersion

func (t *Table) SetVersion(v *refs.Version)

func (*Table) StableMarshal

func (t *Table) StableMarshal(buf []byte) ([]byte, error)

StableMarshal marshals unified acl table structure in a protobuf compatible way without field order shuffle.

func (*Table) StableSize

func (t *Table) StableSize() (size int)

StableSize of acl table structure marshalled by StableMarshal function.

func (*Table) ToGRPCMessage added in v1.25.0

func (t *Table) ToGRPCMessage() grpc.Message

func (*Table) Unmarshal

func (t *Table) Unmarshal(data []byte) error

func (*Table) UnmarshalJSON

func (t *Table) UnmarshalJSON(data []byte) error

type Target

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

Target is a unified structure of Target message from proto definition.

func TargetsFromGRPC added in v1.25.0

func TargetsFromGRPC(fs []*acl.EACLRecord_Target) (res []*Target, err error)

func (*Target) FromGRPCMessage added in v1.25.0

func (t *Target) FromGRPCMessage(m grpc.Message) error

func (*Target) GetKeys

func (t *Target) GetKeys() [][]byte

func (*Target) GetRole

func (t *Target) GetRole() Role

func (*Target) MarshalJSON

func (t *Target) MarshalJSON() ([]byte, error)

func (*Target) SetKeys

func (t *Target) SetKeys(v [][]byte)

func (*Target) SetRole

func (t *Target) SetRole(v Role)

func (*Target) StableMarshal

func (t *Target) StableMarshal(buf []byte) ([]byte, error)

StableMarshal marshals unified role info structure in a protobuf compatible way without field order shuffle.

func (*Target) StableSize

func (t *Target) StableSize() (size int)

StableSize of role info structure marshalled by StableMarshal function.

func (*Target) ToGRPCMessage added in v1.25.0

func (t *Target) ToGRPCMessage() grpc.Message

func (*Target) Unmarshal

func (t *Target) Unmarshal(data []byte) error

func (*Target) UnmarshalJSON

func (t *Target) UnmarshalJSON(data []byte) error

type TokenLifetime

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

func (*TokenLifetime) FromGRPCMessage added in v1.25.0

func (l *TokenLifetime) FromGRPCMessage(m grpc.Message) error

func (*TokenLifetime) GetExp

func (l *TokenLifetime) GetExp() uint64

func (*TokenLifetime) GetIat

func (l *TokenLifetime) GetIat() uint64

func (*TokenLifetime) GetNbf

func (l *TokenLifetime) GetNbf() uint64

func (*TokenLifetime) MarshalJSON

func (l *TokenLifetime) MarshalJSON() ([]byte, error)

func (*TokenLifetime) SetExp

func (l *TokenLifetime) SetExp(v uint64)

func (*TokenLifetime) SetIat

func (l *TokenLifetime) SetIat(v uint64)

func (*TokenLifetime) SetNbf

func (l *TokenLifetime) SetNbf(v uint64)

func (*TokenLifetime) StableMarshal

func (l *TokenLifetime) StableMarshal(buf []byte) ([]byte, error)

func (*TokenLifetime) StableSize

func (l *TokenLifetime) StableSize() (size int)

func (*TokenLifetime) ToGRPCMessage added in v1.25.0

func (l *TokenLifetime) ToGRPCMessage() grpc.Message

func (*TokenLifetime) Unmarshal

func (l *TokenLifetime) Unmarshal(data []byte) error

func (*TokenLifetime) UnmarshalJSON

func (l *TokenLifetime) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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