accessbox

package
v0.29.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_creds_accessbox_accessbox_proto protoreflect.FileDescriptor

Functions

func PackTokens

func PackTokens(gatesData []*GateData, secret []byte) (*AccessBox, *Secrets, error)

PackTokens adds bearer and session tokens to BearerTokens and SessionToken lists respectively. Session token can be nil. Secret can be nil. In such case secret will be generated.

Types

type AccessBox

type AccessBox struct {
	SeedKey         []byte                       `protobuf:"bytes,1,opt,name=seedKey,proto3" json:"seedKey,omitempty"`
	Gates           []*AccessBox_Gate            `protobuf:"bytes,2,rep,name=gates,proto3" json:"gates,omitempty"`
	ContainerPolicy []*AccessBox_ContainerPolicy `protobuf:"bytes,3,rep,name=containerPolicy,proto3" json:"containerPolicy,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessBox) Descriptor deprecated

func (*AccessBox) Descriptor() ([]byte, []int)

Deprecated: Use AccessBox.ProtoReflect.Descriptor instead.

func (*AccessBox) GetBox

func (x *AccessBox) GetBox(owner *keys.PrivateKey) (*Box, error)

GetBox parses AccessBox to Box.

func (*AccessBox) GetContainerPolicy

func (x *AccessBox) GetContainerPolicy() []*AccessBox_ContainerPolicy

func (*AccessBox) GetGates

func (x *AccessBox) GetGates() []*AccessBox_Gate

func (*AccessBox) GetPlacementPolicy

func (x *AccessBox) GetPlacementPolicy() ([]*ContainerPolicy, error)

GetPlacementPolicy returns ContainerPolicy from AccessBox.

func (*AccessBox) GetSeedKey added in v0.29.0

func (x *AccessBox) GetSeedKey() []byte

func (*AccessBox) GetTokens

func (x *AccessBox) GetTokens(owner *keys.PrivateKey) (*GateData, error)

GetTokens returns gate tokens from AccessBox.

func (*AccessBox) Marshal

func (x *AccessBox) Marshal() ([]byte, error)

Marshal returns the wire-format of AccessBox.

func (*AccessBox) ProtoMessage

func (*AccessBox) ProtoMessage()

func (*AccessBox) ProtoReflect

func (x *AccessBox) ProtoReflect() protoreflect.Message

func (*AccessBox) Reset

func (x *AccessBox) Reset()

func (*AccessBox) String

func (x *AccessBox) String() string

func (*AccessBox) Unmarshal

func (x *AccessBox) Unmarshal(data []byte) error

Unmarshal parses the wire-format message and put data to x.

type AccessBox_ContainerPolicy

type AccessBox_ContainerPolicy struct {
	LocationConstraint string `protobuf:"bytes,1,opt,name=locationConstraint,proto3" json:"locationConstraint,omitempty"`
	Policy             []byte `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessBox_ContainerPolicy) Descriptor deprecated

func (*AccessBox_ContainerPolicy) Descriptor() ([]byte, []int)

Deprecated: Use AccessBox_ContainerPolicy.ProtoReflect.Descriptor instead.

func (*AccessBox_ContainerPolicy) GetLocationConstraint

func (x *AccessBox_ContainerPolicy) GetLocationConstraint() string

func (*AccessBox_ContainerPolicy) GetPolicy

func (x *AccessBox_ContainerPolicy) GetPolicy() []byte

func (*AccessBox_ContainerPolicy) ProtoMessage

func (*AccessBox_ContainerPolicy) ProtoMessage()

func (*AccessBox_ContainerPolicy) ProtoReflect

func (*AccessBox_ContainerPolicy) Reset

func (x *AccessBox_ContainerPolicy) Reset()

func (*AccessBox_ContainerPolicy) String

func (x *AccessBox_ContainerPolicy) String() string

type AccessBox_Gate

type AccessBox_Gate struct {
	Tokens        []byte `protobuf:"bytes,1,opt,name=tokens,proto3" json:"tokens,omitempty"`
	GatePublicKey []byte `protobuf:"bytes,2,opt,name=gatePublicKey,proto3" json:"gatePublicKey,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessBox_Gate) Descriptor deprecated

func (*AccessBox_Gate) Descriptor() ([]byte, []int)

Deprecated: Use AccessBox_Gate.ProtoReflect.Descriptor instead.

func (*AccessBox_Gate) GetGatePublicKey

func (x *AccessBox_Gate) GetGatePublicKey() []byte

func (*AccessBox_Gate) GetTokens

func (x *AccessBox_Gate) GetTokens() []byte

func (*AccessBox_Gate) ProtoMessage

func (*AccessBox_Gate) ProtoMessage()

func (*AccessBox_Gate) ProtoReflect

func (x *AccessBox_Gate) ProtoReflect() protoreflect.Message

func (*AccessBox_Gate) Reset

func (x *AccessBox_Gate) Reset()

func (*AccessBox_Gate) String

func (x *AccessBox_Gate) String() string

type Box

type Box struct {
	Gate     *GateData
	Policies []*ContainerPolicy
}

Box represents friendly AccessBox.

type ContainerPolicy

type ContainerPolicy struct {
	LocationConstraint string
	Policy             netmap.PlacementPolicy
}

ContainerPolicy represents friendly AccessBox_ContainerPolicy.

type GateData

type GateData struct {
	SecretKey     string
	BearerToken   *bearer.Token
	SessionTokens []*session.Container
	GateKey       *keys.PublicKey
}

GateData represents gate tokens in AccessBox.

func NewGateData

func NewGateData(gateKey *keys.PublicKey, bearerTkn *bearer.Token) *GateData

NewGateData returns GateData from the provided bearer token and the public gate key.

func (*GateData) SessionToken added in v0.29.0

func (g *GateData) SessionToken() *session.Container

SessionToken returns the first container session context.

func (*GateData) SessionTokenForDelete

func (g *GateData) SessionTokenForDelete() *session.Container

SessionTokenForDelete returns the first suitable container session context for DELETE operation.

func (*GateData) SessionTokenForPut

func (g *GateData) SessionTokenForPut() *session.Container

SessionTokenForPut returns the first suitable container session context for PUT operation.

func (*GateData) SessionTokenForSetEACL

func (g *GateData) SessionTokenForSetEACL() *session.Container

SessionTokenForSetEACL returns the first suitable container session context for SetEACL operation.

type Secrets

type Secrets struct {
	SecretKey    string
	EphemeralKey *keys.PrivateKey
}

Secrets represents SecretKey and the key to encrypt gate tokens.

type Tokens

type Tokens struct {
	SecretKey     []byte   `protobuf:"bytes,1,opt,name=secretKey,proto3" json:"secretKey,omitempty"`
	BearerToken   []byte   `protobuf:"bytes,2,opt,name=bearerToken,proto3" json:"bearerToken,omitempty"`
	SessionTokens [][]byte `protobuf:"bytes,3,rep,name=sessionTokens,proto3" json:"sessionTokens,omitempty"`
	// contains filtered or unexported fields
}

func (*Tokens) Descriptor deprecated

func (*Tokens) Descriptor() ([]byte, []int)

Deprecated: Use Tokens.ProtoReflect.Descriptor instead.

func (*Tokens) GetBearerToken

func (x *Tokens) GetBearerToken() []byte

func (*Tokens) GetSecretKey added in v0.29.0

func (x *Tokens) GetSecretKey() []byte

func (*Tokens) GetSessionTokens

func (x *Tokens) GetSessionTokens() [][]byte

func (*Tokens) ProtoMessage

func (*Tokens) ProtoMessage()

func (*Tokens) ProtoReflect

func (x *Tokens) ProtoReflect() protoreflect.Message

func (*Tokens) Reset

func (x *Tokens) Reset()

func (*Tokens) String

func (x *Tokens) String() string

Jump to

Keyboard shortcuts

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