service

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ZeroTTL is an upper bound of invalid TTL values.
	ZeroTTL = iota

	// NonForwardingTTL is a TTL value that does not imply a request forwarding.
	NonForwardingTTL

	// SingleForwardingTTL is a TTL value that imply potential forwarding with NonForwardingTTL.
	SingleForwardingTTL
)

TTL constants.

View Source
const ErrCannotFindOwner = internal.Error("cannot find owner public key")

ErrCannotFindOwner is raised when signatures empty in GetOwner.

View Source
const ErrEmptyDataWithSignature = internal.Error("empty data with signature")

ErrEmptyDataWithSignature is returned by functions that expect a non-nil DataWithSignature, but received nil.

View Source
const ErrInvalidPublicKeyBytes = internal.Error("cannot load public key")

ErrInvalidPublicKeyBytes means that the public key could not be unmarshaled.

View Source
const ErrInvalidTTL = internal.Error("invalid TTL value")

ErrInvalidTTL means that the TTL value does not satisfy a specific criterion.

View Source
const ErrNegativeLength = internal.Error("negative slice length")

ErrNegativeLength is returned by functions that received negative length for slice allocation.

View Source
const ErrNilDataWithTokenSignAccumulator = internal.Error("signed data with token is nil")

ErrNilDataWithTokenSignAccumulator is returned by functions that expect a non-nil DataWithTokenSignAccumulator, but received nil.

View Source
const ErrNilSignatureKeySource = internal.Error("empty key-signature source")

ErrNilSignatureKeySource is returned by functions that expect a non-nil SignatureKeySource, but received nil.

View Source
const ErrNilSignatureKeySourceWithToken = internal.Error("key-signature source with token is nil")

ErrNilSignatureKeySourceWithToken is returned by functions that expect a non-nil SignatureKeySourceWithToken, but received nil.

View Source
const ErrNilSignedDataReader = internal.Error("signed data reader is nil")

ErrNilSignedDataReader is returned by functions that expect a non-nil SignedDataReader, but received nil.

View Source
const ErrNilSignedDataSource = internal.Error("signed data source is nil")

ErrNilSignedDataSource returned by functions that expect a non-nil SignedDataSource, but received nil.

View Source
const ErrNilToken = internal.Error("token is nil")

ErrNilToken is returned by functions that expect a non-nil token argument, but received nil.

View Source
const ErrWrongOwner = internal.Error("wrong owner")

ErrWrongOwner is raised when passed OwnerID not equal to present PublicKey

Variables

View Source
var (
	ErrInvalidLengthMeta        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMeta          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMeta = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthVerify        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowVerify          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupVerify = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthVerifyTest        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowVerifyTest          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupVerifyTest = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Token_Info_Verb_name = map[int32]string{
	0: "Put",
	1: "Get",
	2: "Head",
	3: "Search",
	4: "Delete",
	5: "Range",
	6: "RangeHash",
}
View Source
var Token_Info_Verb_value = map[string]int32{
	"Put":       0,
	"Get":       1,
	"Head":      2,
	"Search":    3,
	"Delete":    4,
	"Range":     5,
	"RangeHash": 6,
}

Functions

func AddSignatureWithKey added in v0.7.4

func AddSignatureWithKey(key *ecdsa.PrivateKey, v DataWithSignKeyAccumulator) error

AddSignatureWithKey calculates the data signature and adds it to accumulator with public key.

Any change of data provoke signature breakdown.

Returns signing errors only.

func DataSignature added in v0.7.4

func DataSignature(key *ecdsa.PrivateKey, src SignedDataSource) ([]byte, error)

DataSignature returns the signature of data obtained using the private key.

If passed data container is nil, ErrNilSignedDataSource returns. If passed private key is nil, crypto.ErrEmptyPrivateKey returns. If the data container or the signature function returns an error, it is returned directly.

func ProcessRequestTTL

func ProcessRequestTTL(req TTLContainer, cond ...TTLCondition) error

ProcessRequestTTL validates and updates requests with TTL.

func SignDataWithSessionToken added in v0.7.4

func SignDataWithSessionToken(key *ecdsa.PrivateKey, src DataWithTokenSignAccumulator) error

SignDataWithSessionToken calculates data with token signature and adds it to accumulator.

Any change of data or session token info provoke signature breakdown.

If passed private key is nil, crypto.ErrEmptyPrivateKey returns. If passed DataWithTokenSignAccumulator is nil, ErrNilDataWithTokenSignAccumulator returns.

func SignedDataFromReader added in v0.7.4

func SignedDataFromReader(r SignedDataReader) ([]byte, error)

SignedDataFromReader allocates buffer and reads bytes from passed reader to it.

If passed SignedDataReader is nil, ErrNilSignedDataReader returns.

func VerifyAccumulatedSignatures added in v0.7.4

func VerifyAccumulatedSignatures(src DataWithSignKeySource) error

VerifyAccumulatedSignatures checks if accumulated key-signature pairs are valid.

Behaves like VerifySignatures. If passed key-signature source is empty, ErrNilSignatureKeySource returns.

func VerifyAccumulatedSignaturesWithToken added in v0.7.4

func VerifyAccumulatedSignaturesWithToken(src DataWithTokenSignSource) error

VerifyAccumulatedSignaturesWithToken checks if accumulated key-signature pairs of data with token are valid.

If passed DataWithTokenSignSource is nil, ErrNilSignatureKeySourceWithToken returns.

func VerifySignatureWithKey added in v0.7.4

func VerifySignatureWithKey(key *ecdsa.PublicKey, src DataWithSignature) error

VerifySignatureWithKey checks data signature from the passed container with passed key.

If passed data with signature is nil, ErrEmptyDataWithSignature returns. If passed key is nil, crypto.ErrEmptyPublicKey returns. A non-nil error returns if and only if the signature does not pass verification.

func VerifySignatures added in v0.7.4

func VerifySignatures(src SignedDataSource, items ...SignKeyPair) error

VerifySignatures checks passed key-signature pairs for data from the passed container.

If passed data source is nil, ErrNilSignedDataSource returns. If check data is not ready, corresponding error returns. If at least one of the pairs is invalid, an error returns.

Types

type Address added in v0.7.4

type Address = refs.Address

Address is a type alias of Address ref.

type AddressContainer added in v0.7.4

type AddressContainer = refs.AddressContainer

AddressContainer is a type alias of refs.AddressContainer.

type CreationEpochContainer added in v0.7.4

type CreationEpochContainer interface {
	CreationEpochSource
	SetCreationEpoch(uint64)
}

CreationEpochContainer is an interface of the container of a creation epoch number.

type CreationEpochSource added in v0.7.4

type CreationEpochSource interface {
	CreationEpoch() uint64
}

CreationEpochSource is an interface of the container of a creation epoch number with read access.

type DataWithSignKeyAccumulator added in v0.7.4

type DataWithSignKeyAccumulator interface {
	SignedDataSource
	SignKeyPairAccumulator
}

DataWithSignKeyAccumulator is an interface of data and key-signature accumulator pair.

func NewSignedSessionToken added in v0.7.5

func NewSignedSessionToken(token SessionToken) DataWithSignKeyAccumulator

NewSignedSessionToken wraps passed SessionToken in a component suitable for signing.

Result can be used in AddSignatureWithKey function.

type DataWithSignKeySource added in v0.7.4

type DataWithSignKeySource interface {
	SignedDataSource
	SignKeyPairSource
}

DataWithSignKeySource is an interface of data and key-signature source pair.

type DataWithSignature added in v0.7.4

type DataWithSignature interface {
	SignedDataSource
	SignatureSource
}

DataWithSignature is an interface of data-signature pair with read access.

func NewVerifiedSessionToken added in v0.7.5

func NewVerifiedSessionToken(token SessionToken) DataWithSignature

NewVerifiedSessionToken wraps passed SessionToken in a component suitable for signature verification.

Result can be used in VerifySignatureWithKey function.

type DataWithTokenSignAccumulator added in v0.7.4

type DataWithTokenSignAccumulator interface {
	SignedDataWithToken
	SignKeyPairAccumulator
}

DataWithTokenSignAccumulator is an interface of data-token pair with signature write access.

type DataWithTokenSignSource added in v0.7.4

type DataWithTokenSignSource interface {
	SignedDataWithToken
	SignKeyPairSource
}

DataWithTokenSignSource is an interface of data-token pair with signature read access.

type EpochContainer added in v0.7.4

type EpochContainer interface {
	EpochSource
	SetEpoch(uint64)
}

EpochContainer is an interface of the container of a NeoFS epoch number.

type EpochSource added in v0.7.4

type EpochSource interface {
	GetEpoch() uint64
}

EpochSource is an interface of the container of a NeoFS epoch number with read access.

type ExpirationEpochContainer added in v0.7.4

type ExpirationEpochContainer interface {
	ExpirationEpochSource
	SetExpirationEpoch(uint64)
}

ExpirationEpochContainer is an interface of the container of an expiration epoch number.

type ExpirationEpochSource added in v0.7.4

type ExpirationEpochSource interface {
	ExpirationEpoch() uint64
}

ExpirationEpochSource is an interface of the container of an expiration epoch number with read access.

type LifetimeContainer added in v0.7.4

type LifetimeContainer interface {
	CreationEpochContainer
	ExpirationEpochContainer
}

LifetimeContainer is an interface of the container of creation-expiration epoch pair.

type LifetimeSource added in v0.7.4

type LifetimeSource interface {
	CreationEpochSource
	ExpirationEpochSource
}

LifetimeSource is an interface of the container of creation-expiration epoch pair with read access.

type NodeRole

type NodeRole int32

NodeRole to identify in Bootstrap service.

const (

	// InnerRingNode that work like IR node.
	InnerRingNode NodeRole
	// StorageNode that work like a storage node.
	StorageNode
)

func (NodeRole) Bytes added in v0.7.4

func (nt NodeRole) Bytes() []byte

Bytes returns a binary representation of the NodeRole.

func (NodeRole) Size added in v0.7.4

func (nt NodeRole) Size() int

Size returns the size necessary for a binary representation of the NodeRole.

func (NodeRole) String

func (nt NodeRole) String() string

String is method, that represent NodeRole as string.

type OwnerID added in v0.7.4

type OwnerID = refs.OwnerID

OwnerID is a type alias of OwnerID ref.

type OwnerIDContainer added in v0.7.4

type OwnerIDContainer = refs.OwnerIDContainer

OwnerIDContainer is a type alias of refs.OwnerIDContainer.

type OwnerKeyContainer added in v0.7.5

type OwnerKeyContainer interface {
	OwnerKeySource
	SetOwnerKey([]byte)
}

OwnerKeyContainer is an interface of the container of owner key bytes.

type OwnerKeySource added in v0.7.5

type OwnerKeySource interface {
	GetOwnerKey() []byte
}

OwnerKeySource is an interface of the container of owner key bytes with read access.

type RawContainer added in v0.7.4

type RawContainer interface {
	RawSource
	SetRaw(bool)
}

RawContainer is an interface of the container of a boolean Raw value.

type RawSource added in v0.7.4

type RawSource interface {
	GetRaw() bool
}

RawSource is an interface of the container of a boolean Raw value with read access.

type RequestMetaContainer added in v0.7.4

type RequestMetaContainer interface {
	TTLContainer
	EpochContainer
	VersionContainer
	RawContainer
}

RequestMetaContainer is an interface of a fixed set of request meta value containers. Contains: - TTL value; - NeoFS epoch number; - Protocol version; - Raw toggle option.

type RequestMetaHeader

type RequestMetaHeader struct {
	// TTL must be larger than zero, it decreased in every NeoFS Node
	TTL uint32 `protobuf:"varint,1,opt,name=TTL,proto3" json:"TTL,omitempty"`
	// Epoch for user can be empty, because node sets epoch to the actual value
	Epoch uint64 `protobuf:"varint,2,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	// Version defines protocol version
	// TODO: not used for now, should be implemented in future
	Version uint32 `protobuf:"varint,3,opt,name=Version,proto3" json:"Version,omitempty"`
	// Raw determines whether the request is raw or not
	Raw                  bool     `protobuf:"varint,4,opt,name=Raw,proto3" json:"Raw,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RequestMetaHeader contains information about request meta headers (should be embedded into message)

func (*RequestMetaHeader) CutMeta added in v0.7.4

func (m *RequestMetaHeader) CutMeta() RequestMetaHeader

CutMeta returns current value and sets RequestMetaHeader to empty value.

func (*RequestMetaHeader) Descriptor

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

func (*RequestMetaHeader) GetEpoch

func (m *RequestMetaHeader) GetEpoch() uint64

func (*RequestMetaHeader) GetRaw added in v0.7.4

func (m *RequestMetaHeader) GetRaw() bool

func (*RequestMetaHeader) GetTTL

func (m *RequestMetaHeader) GetTTL() uint32

func (*RequestMetaHeader) GetVersion

func (m *RequestMetaHeader) GetVersion() uint32

func (*RequestMetaHeader) Marshal

func (m *RequestMetaHeader) Marshal() (dAtA []byte, err error)

func (*RequestMetaHeader) MarshalTo

func (m *RequestMetaHeader) MarshalTo(dAtA []byte) (int, error)

func (*RequestMetaHeader) MarshalToSizedBuffer

func (m *RequestMetaHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RequestMetaHeader) ProtoMessage

func (*RequestMetaHeader) ProtoMessage()

func (*RequestMetaHeader) Reset

func (m *RequestMetaHeader) Reset()

func (*RequestMetaHeader) RestoreMeta

func (m *RequestMetaHeader) RestoreMeta(v RequestMetaHeader)

RestoreMeta sets current RequestMetaHeader to passed value.

func (*RequestMetaHeader) SetEpoch

func (m *RequestMetaHeader) SetEpoch(v uint64)

SetEpoch is an Epoch field setter.

func (*RequestMetaHeader) SetRaw added in v0.7.4

func (m *RequestMetaHeader) SetRaw(raw bool)

SetRaw is a Raw field setter.

func (*RequestMetaHeader) SetTTL

func (m *RequestMetaHeader) SetTTL(v uint32)

SetTTL is a TTL field setter.

func (*RequestMetaHeader) SetVersion

func (m *RequestMetaHeader) SetVersion(v uint32)

SetVersion is a Version field setter.

func (*RequestMetaHeader) Size

func (m *RequestMetaHeader) Size() (n int)

func (*RequestMetaHeader) String

func (m *RequestMetaHeader) String() string

func (*RequestMetaHeader) Unmarshal

func (m *RequestMetaHeader) Unmarshal(dAtA []byte) error

func (*RequestMetaHeader) XXX_DiscardUnknown

func (m *RequestMetaHeader) XXX_DiscardUnknown()

func (*RequestMetaHeader) XXX_Marshal

func (m *RequestMetaHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestMetaHeader) XXX_Merge

func (m *RequestMetaHeader) XXX_Merge(src proto.Message)

func (*RequestMetaHeader) XXX_Size

func (m *RequestMetaHeader) XXX_Size() int

func (*RequestMetaHeader) XXX_Unmarshal

func (m *RequestMetaHeader) XXX_Unmarshal(b []byte) error

type RequestVerificationHeader

type RequestVerificationHeader struct {
	// Signatures is a set of signatures of every passed NeoFS Node
	Signatures []*RequestVerificationHeader_Signature `protobuf:"bytes,1,rep,name=Signatures,proto3" json:"Signatures,omitempty"`
	// Token is a token of the session within which the request is sent
	Token                *Token   `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message).

func (*RequestVerificationHeader) AddSignKey added in v0.7.4

func (m *RequestVerificationHeader) AddSignKey(sign []byte, key *ecdsa.PublicKey)

AddSignKey adds new element to Signatures field.

Sets Sign field to passed sign. Set Peer field to marshaled passed key.

func (*RequestVerificationHeader) Descriptor

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

func (RequestVerificationHeader) GetSessionToken added in v0.7.4

func (m RequestVerificationHeader) GetSessionToken() SessionToken

GetSessionToken returns SessionToken interface of Token field.

If token field value is nil, nil returns.

func (RequestVerificationHeader) GetSignKeyPairs added in v0.7.4

func (m RequestVerificationHeader) GetSignKeyPairs() []SignKeyPair

GetSignKeyPairs returns the elements of Signatures field as SignKeyPair slice.

func (*RequestVerificationHeader) GetSignatures

func (*RequestVerificationHeader) GetToken added in v0.7.4

func (m *RequestVerificationHeader) GetToken() *Token

func (*RequestVerificationHeader) Marshal

func (m *RequestVerificationHeader) Marshal() (dAtA []byte, err error)

func (*RequestVerificationHeader) MarshalTo

func (m *RequestVerificationHeader) MarshalTo(dAtA []byte) (int, error)

func (*RequestVerificationHeader) MarshalToSizedBuffer

func (m *RequestVerificationHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RequestVerificationHeader) ProtoMessage

func (*RequestVerificationHeader) ProtoMessage()

func (*RequestVerificationHeader) Reset

func (m *RequestVerificationHeader) Reset()

func (*RequestVerificationHeader) SetSignatures

func (m *RequestVerificationHeader) SetSignatures(signatures []*RequestVerificationHeader_Signature)

SetSignatures replaces signatures stored in RequestVerificationHeader.

func (*RequestVerificationHeader) SetToken added in v0.7.4

func (m *RequestVerificationHeader) SetToken(token *Token)

SetToken is a Token field setter.

func (*RequestVerificationHeader) Size

func (m *RequestVerificationHeader) Size() (n int)

func (*RequestVerificationHeader) String

func (m *RequestVerificationHeader) String() string

func (*RequestVerificationHeader) Unmarshal

func (m *RequestVerificationHeader) Unmarshal(dAtA []byte) error

func (*RequestVerificationHeader) XXX_DiscardUnknown

func (m *RequestVerificationHeader) XXX_DiscardUnknown()

func (*RequestVerificationHeader) XXX_Marshal

func (m *RequestVerificationHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestVerificationHeader) XXX_Merge

func (m *RequestVerificationHeader) XXX_Merge(src proto.Message)

func (*RequestVerificationHeader) XXX_Size

func (m *RequestVerificationHeader) XXX_Size() int

func (*RequestVerificationHeader) XXX_Unmarshal

func (m *RequestVerificationHeader) XXX_Unmarshal(b []byte) error

type RequestVerificationHeader_Signature

type RequestVerificationHeader_Signature struct {
	// Sign is signature of the request or session key.
	Sign []byte `protobuf:"bytes,1,opt,name=Sign,proto3" json:"Sign,omitempty"`
	// Peer is compressed public key used for signature.
	Peer                 []byte   `protobuf:"bytes,2,opt,name=Peer,proto3" json:"Peer,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RequestVerificationHeader_Signature) Descriptor

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

func (*RequestVerificationHeader_Signature) GetPeer added in v0.7.4

func (RequestVerificationHeader_Signature) GetPublicKey added in v0.7.4

GetPublicKey unmarshals and returns the result of a Peer field getter.

func (*RequestVerificationHeader_Signature) GetSign added in v0.7.4

func (RequestVerificationHeader_Signature) GetSignature added in v0.7.4

func (m RequestVerificationHeader_Signature) GetSignature() []byte

GetSignature returns the result of a Sign field getter.

func (*RequestVerificationHeader_Signature) Marshal

func (m *RequestVerificationHeader_Signature) Marshal() (dAtA []byte, err error)

func (*RequestVerificationHeader_Signature) MarshalTo

func (m *RequestVerificationHeader_Signature) MarshalTo(dAtA []byte) (int, error)

func (*RequestVerificationHeader_Signature) MarshalToSizedBuffer

func (m *RequestVerificationHeader_Signature) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RequestVerificationHeader_Signature) ProtoMessage

func (*RequestVerificationHeader_Signature) ProtoMessage()

func (*RequestVerificationHeader_Signature) Reset

func (*RequestVerificationHeader_Signature) Size

func (*RequestVerificationHeader_Signature) String

func (*RequestVerificationHeader_Signature) Unmarshal

func (m *RequestVerificationHeader_Signature) Unmarshal(dAtA []byte) error

func (*RequestVerificationHeader_Signature) XXX_DiscardUnknown

func (m *RequestVerificationHeader_Signature) XXX_DiscardUnknown()

func (*RequestVerificationHeader_Signature) XXX_Marshal

func (m *RequestVerificationHeader_Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestVerificationHeader_Signature) XXX_Merge

func (*RequestVerificationHeader_Signature) XXX_Size

func (*RequestVerificationHeader_Signature) XXX_Unmarshal

func (m *RequestVerificationHeader_Signature) XXX_Unmarshal(b []byte) error

type ResponseMetaHeader

type ResponseMetaHeader struct {
	// Current NeoFS epoch on server
	Epoch uint64 `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	// Version defines protocol version
	// TODO: not used for now, should be implemented in future
	Version              uint32   `protobuf:"varint,2,opt,name=Version,proto3" json:"Version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)

func (*ResponseMetaHeader) Descriptor

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

func (*ResponseMetaHeader) GetEpoch

func (m *ResponseMetaHeader) GetEpoch() uint64

func (*ResponseMetaHeader) GetVersion

func (m *ResponseMetaHeader) GetVersion() uint32

func (*ResponseMetaHeader) Marshal

func (m *ResponseMetaHeader) Marshal() (dAtA []byte, err error)

func (*ResponseMetaHeader) MarshalTo

func (m *ResponseMetaHeader) MarshalTo(dAtA []byte) (int, error)

func (*ResponseMetaHeader) MarshalToSizedBuffer

func (m *ResponseMetaHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ResponseMetaHeader) ProtoMessage

func (*ResponseMetaHeader) ProtoMessage()

func (*ResponseMetaHeader) Reset

func (m *ResponseMetaHeader) Reset()

func (*ResponseMetaHeader) SetEpoch

func (m *ResponseMetaHeader) SetEpoch(v uint64)

SetEpoch is an Epoch field setter.

func (*ResponseMetaHeader) SetVersion

func (m *ResponseMetaHeader) SetVersion(v uint32)

SetVersion is a Version field setter.

func (*ResponseMetaHeader) Size

func (m *ResponseMetaHeader) Size() (n int)

func (*ResponseMetaHeader) String

func (m *ResponseMetaHeader) String() string

func (*ResponseMetaHeader) Unmarshal

func (m *ResponseMetaHeader) Unmarshal(dAtA []byte) error

func (*ResponseMetaHeader) XXX_DiscardUnknown

func (m *ResponseMetaHeader) XXX_DiscardUnknown()

func (*ResponseMetaHeader) XXX_Marshal

func (m *ResponseMetaHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResponseMetaHeader) XXX_Merge

func (m *ResponseMetaHeader) XXX_Merge(src proto.Message)

func (*ResponseMetaHeader) XXX_Size

func (m *ResponseMetaHeader) XXX_Size() int

func (*ResponseMetaHeader) XXX_Unmarshal

func (m *ResponseMetaHeader) XXX_Unmarshal(b []byte) error

type SeizedMetaHeaderContainer added in v0.7.4

type SeizedMetaHeaderContainer interface {
	CutMeta() RequestMetaHeader
	RestoreMeta(RequestMetaHeader)
}

SeizedMetaHeaderContainer is an interface of container of RequestMetaHeader that can be cut and restored.

type SeizedRequestMetaContainer added in v0.7.4

type SeizedRequestMetaContainer interface {
	RequestMetaContainer
	SeizedMetaHeaderContainer
}

SeizedRequestMetaContainer is a RequestMetaContainer with seized meta.

type SessionKeyContainer added in v0.7.4

type SessionKeyContainer interface {
	SessionKeySource
	SetSessionKey([]byte)
}

SessionKeyContainer is an interface of the container of public session key bytes.

type SessionKeySource added in v0.7.4

type SessionKeySource interface {
	GetSessionKey() []byte
}

SessionKeySource is an interface of the container of session key bytes with read access.

type SessionToken added in v0.7.4

type SessionToken interface {
	SessionTokenInfo
	SignatureContainer
}

SessionToken is an interface of token information and signature pair.

type SessionTokenInfo added in v0.7.4

SessionTokenInfo is an interface of a fixed set of token information value containers. Contains: - ID of the token; - ID of the token's owner; - verb of the session; - address of the session object; - token lifetime; - public session key bytes; - owner's public key bytes.

type SessionTokenSource added in v0.7.4

type SessionTokenSource interface {
	GetSessionToken() SessionToken
}

SessionTokenSource is an interface of the container of a SessionToken with read access.

type SignKeyPair added in v0.7.4

type SignKeyPair interface {
	SignatureSource
	GetPublicKey() *ecdsa.PublicKey
}

SignKeyPair is an interface of key-signature pair with read access.

type SignKeyPairAccumulator added in v0.7.4

type SignKeyPairAccumulator interface {
	AddSignKey([]byte, *ecdsa.PublicKey)
}

SignKeyPairAccumulator is an interface of a set of key-signature pairs with append access.

type SignKeyPairSource added in v0.7.4

type SignKeyPairSource interface {
	GetSignKeyPairs() []SignKeyPair
}

SignKeyPairSource is an interface of a set of key-signature pairs with read access.

type SignatureContainer added in v0.7.4

type SignatureContainer interface {
	SignatureSource
	SetSignature([]byte)
}

SignatureContainer is an interface of the container of signature bytes.

type SignatureSource added in v0.7.4

type SignatureSource interface {
	GetSignature() []byte
}

SignatureSource is an interface of the container of signature bytes with read access.

type SignedDataReader added in v0.7.4

type SignedDataReader interface {
	// Must return the minimum length of the slice for full reading.
	// Must return a negative value if the length cannot be calculated.
	SignedDataSize() int

	// Must behave like Read method of io.Reader and differ only in the reading of the signed data.
	ReadSignedData([]byte) (int, error)
}

SignedDataReader is an interface of signed data reader.

type SignedDataSource added in v0.7.4

type SignedDataSource interface {
	// Must return the required for signature byte slice.
	// A non-nil error indicates that the data is not ready for signature.
	SignedData() ([]byte, error)
}

SignedDataSource is an interface of the container of a data for signing.

type SignedDataWithToken added in v0.7.4

type SignedDataWithToken interface {
	SignedDataSource
	SessionTokenSource
}

SignedDataWithToken is an interface of data-token pair with read access.

type TTLCondition

type TTLCondition func(uint32) error

TTLCondition is a function type that used to verify that TTL values match a specific criterion. Nil error indicates compliance with the criterion.

func IRNonForwarding

func IRNonForwarding(role NodeRole) TTLCondition

IRNonForwarding condition that allows NonForwardingTTL only for IR.

type TTLContainer added in v0.7.4

type TTLContainer interface {
	TTLSource
	SetTTL(uint32)
}

TTLContainer is an interface of the container of a numerical TTL value.

type TTLSource added in v0.7.4

type TTLSource interface {
	GetTTL() uint32
}

TTLSource is an interface of the container of a numerical TTL value with read access.

type TestRequest

type TestRequest struct {
	IntField                  int32            `protobuf:"varint,1,opt,name=IntField,proto3" json:"IntField,omitempty"`
	StringField               string           `protobuf:"bytes,2,opt,name=StringField,proto3" json:"StringField,omitempty"`
	BytesField                []byte           `protobuf:"bytes,3,opt,name=BytesField,proto3" json:"BytesField,omitempty"`
	CustomField               *testCustomField `protobuf:"bytes,4,opt,name=CustomField,proto3,customtype=testCustomField" json:"CustomField,omitempty"`
	RequestMetaHeader         `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
	RequestVerificationHeader `protobuf:"bytes,99,opt,name=Header,proto3,embedded=Header" json:"Header"`
	XXX_NoUnkeyedLiteral      struct{} `json:"-"`
	XXX_unrecognized          []byte   `json:"-"`
	XXX_sizecache             int32    `json:"-"`
}

func (*TestRequest) Descriptor

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

func (*TestRequest) GetBytesField

func (m *TestRequest) GetBytesField() []byte

func (*TestRequest) GetIntField

func (m *TestRequest) GetIntField() int32

func (*TestRequest) GetStringField

func (m *TestRequest) GetStringField() string

func (*TestRequest) Marshal

func (m *TestRequest) Marshal() (dAtA []byte, err error)

func (*TestRequest) MarshalTo

func (m *TestRequest) MarshalTo(dAtA []byte) (int, error)

func (*TestRequest) MarshalToSizedBuffer

func (m *TestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestRequest) ProtoMessage

func (*TestRequest) ProtoMessage()

func (*TestRequest) Reset

func (m *TestRequest) Reset()

func (*TestRequest) Size

func (m *TestRequest) Size() (n int)

func (*TestRequest) String

func (m *TestRequest) String() string

func (*TestRequest) Unmarshal

func (m *TestRequest) Unmarshal(dAtA []byte) error

func (*TestRequest) XXX_DiscardUnknown

func (m *TestRequest) XXX_DiscardUnknown()

func (*TestRequest) XXX_Marshal

func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TestRequest) XXX_Merge

func (m *TestRequest) XXX_Merge(src proto.Message)

func (*TestRequest) XXX_Size

func (m *TestRequest) XXX_Size() int

func (*TestRequest) XXX_Unmarshal

func (m *TestRequest) XXX_Unmarshal(b []byte) error

type Token added in v0.7.4

type Token struct {
	// TokenInfo is a grouped information about token
	Token_Info `protobuf:"bytes,1,opt,name=TokenInfo,proto3,embedded=TokenInfo" json:"TokenInfo"`
	// Signature is a signature of session token information
	Signature            []byte   `protobuf:"bytes,8,opt,name=Signature,proto3" json:"Signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

User token granting rights for object manipulation

func (*Token) Descriptor added in v0.7.4

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

func (*Token) GetSignature added in v0.7.4

func (m *Token) GetSignature() []byte

func (*Token) Marshal added in v0.7.4

func (m *Token) Marshal() (dAtA []byte, err error)

func (*Token) MarshalTo added in v0.7.4

func (m *Token) MarshalTo(dAtA []byte) (int, error)

func (*Token) MarshalToSizedBuffer added in v0.7.4

func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Token) ProtoMessage added in v0.7.4

func (*Token) ProtoMessage()

func (*Token) Reset added in v0.7.4

func (m *Token) Reset()

func (*Token) SetSignature added in v0.7.4

func (m *Token) SetSignature(sig []byte)

SetSignature is a Signature field setter.

func (*Token) Size added in v0.7.4

func (m *Token) Size() (n int)

func (*Token) String added in v0.7.4

func (m *Token) String() string

func (*Token) Unmarshal added in v0.7.4

func (m *Token) Unmarshal(dAtA []byte) error

func (*Token) XXX_DiscardUnknown added in v0.7.4

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal added in v0.7.4

func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Token) XXX_Merge added in v0.7.4

func (m *Token) XXX_Merge(src proto.Message)

func (*Token) XXX_Size added in v0.7.4

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal added in v0.7.4

func (m *Token) XXX_Unmarshal(b []byte) error

type TokenID added in v0.7.4

type TokenID = refs.UUID

TokenID is a type alias of UUID ref.

type TokenIDContainer added in v0.7.4

type TokenIDContainer interface {
	TokenIDSource
	SetID(TokenID)
}

TokenIDContainer is an interface of the container of a token ID value.

type TokenIDSource added in v0.7.4

type TokenIDSource interface {
	GetID() TokenID
}

TokenIDSource is an interface of the container of a token ID value with read access.

type TokenLifetime added in v0.7.4

type TokenLifetime struct {
	// Created carries an initial epoch of token lifetime
	Created uint64 `protobuf:"varint,1,opt,name=Created,proto3" json:"Created,omitempty"`
	// ValidUntil carries a last epoch of token lifetime
	ValidUntil           uint64   `protobuf:"varint,2,opt,name=ValidUntil,proto3" json:"ValidUntil,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TokenLifetime carries a group of lifetime parameters of the token

func (TokenLifetime) CreationEpoch added in v0.7.4

func (m TokenLifetime) CreationEpoch() uint64

CreationEpoch is a Created field getter.

func (*TokenLifetime) Descriptor added in v0.7.4

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

func (TokenLifetime) ExpirationEpoch added in v0.7.4

func (m TokenLifetime) ExpirationEpoch() uint64

ExpirationEpoch is a ValidUntil field getter.

func (*TokenLifetime) GetCreated added in v0.7.4

func (m *TokenLifetime) GetCreated() uint64

func (*TokenLifetime) GetValidUntil added in v0.7.4

func (m *TokenLifetime) GetValidUntil() uint64

func (*TokenLifetime) Marshal added in v0.7.4

func (m *TokenLifetime) Marshal() (dAtA []byte, err error)

func (*TokenLifetime) MarshalTo added in v0.7.4

func (m *TokenLifetime) MarshalTo(dAtA []byte) (int, error)

func (*TokenLifetime) MarshalToSizedBuffer added in v0.7.4

func (m *TokenLifetime) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TokenLifetime) ProtoMessage added in v0.7.4

func (*TokenLifetime) ProtoMessage()

func (*TokenLifetime) Reset added in v0.7.4

func (m *TokenLifetime) Reset()

func (*TokenLifetime) SetCreationEpoch added in v0.7.4

func (m *TokenLifetime) SetCreationEpoch(e uint64)

SetCreationEpoch is a Created field setter.

func (*TokenLifetime) SetExpirationEpoch added in v0.7.4

func (m *TokenLifetime) SetExpirationEpoch(e uint64)

SetExpirationEpoch is a ValidUntil field setter.

func (*TokenLifetime) Size added in v0.7.4

func (m *TokenLifetime) Size() (n int)

func (*TokenLifetime) String added in v0.7.4

func (m *TokenLifetime) String() string

func (*TokenLifetime) Unmarshal added in v0.7.4

func (m *TokenLifetime) Unmarshal(dAtA []byte) error

func (*TokenLifetime) XXX_DiscardUnknown added in v0.7.4

func (m *TokenLifetime) XXX_DiscardUnknown()

func (*TokenLifetime) XXX_Marshal added in v0.7.4

func (m *TokenLifetime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenLifetime) XXX_Merge added in v0.7.4

func (m *TokenLifetime) XXX_Merge(src proto.Message)

func (*TokenLifetime) XXX_Size added in v0.7.4

func (m *TokenLifetime) XXX_Size() int

func (*TokenLifetime) XXX_Unmarshal added in v0.7.4

func (m *TokenLifetime) XXX_Unmarshal(b []byte) error

type Token_Info added in v0.7.4

type Token_Info struct {
	// ID is a token identifier. valid UUIDv4 represented in bytes
	ID TokenID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=TokenID" json:"ID"`
	// OwnerID is an owner of manipulation object
	OwnerID OwnerID `protobuf:"bytes,2,opt,name=OwnerID,proto3,customtype=OwnerID" json:"OwnerID"`
	// Verb is a type of request for which the token is issued
	Verb Token_Info_Verb `protobuf:"varint,3,opt,name=verb,proto3,enum=service.Token_Info_Verb" json:"verb,omitempty"`
	// Address is an object address for which token is issued
	Address Address `protobuf:"bytes,4,opt,name=Address,proto3,customtype=Address" json:"Address"`
	// Lifetime is a lifetime of the session
	TokenLifetime `protobuf:"bytes,5,opt,name=Lifetime,proto3,embedded=Lifetime" json:"Lifetime"`
	// SessionKey is a public key of session key
	SessionKey []byte `protobuf:"bytes,6,opt,name=SessionKey,proto3" json:"SessionKey,omitempty"`
	// OwnerKey is a public key of the token owner
	OwnerKey             []byte   `protobuf:"bytes,7,opt,name=OwnerKey,proto3" json:"OwnerKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Token_Info) Descriptor added in v0.7.4

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

func (Token_Info) GetAddress added in v0.7.4

func (m Token_Info) GetAddress() Address

GetAddress is an Address field getter.

func (Token_Info) GetID added in v0.7.4

func (m Token_Info) GetID() TokenID

GetID is an ID field getter.

func (Token_Info) GetOwnerID added in v0.7.4

func (m Token_Info) GetOwnerID() OwnerID

GetOwnerID is an OwnerID field getter.

func (*Token_Info) GetOwnerKey added in v0.7.5

func (m *Token_Info) GetOwnerKey() []byte

func (*Token_Info) GetSessionKey added in v0.7.4

func (m *Token_Info) GetSessionKey() []byte

func (*Token_Info) GetVerb added in v0.7.4

func (m *Token_Info) GetVerb() Token_Info_Verb

func (*Token_Info) Marshal added in v0.7.4

func (m *Token_Info) Marshal() (dAtA []byte, err error)

func (*Token_Info) MarshalTo added in v0.7.4

func (m *Token_Info) MarshalTo(dAtA []byte) (int, error)

func (*Token_Info) MarshalToSizedBuffer added in v0.7.4

func (m *Token_Info) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Token_Info) ProtoMessage added in v0.7.4

func (*Token_Info) ProtoMessage()

func (*Token_Info) Reset added in v0.7.4

func (m *Token_Info) Reset()

func (*Token_Info) SetAddress added in v0.7.4

func (m *Token_Info) SetAddress(addr Address)

SetAddress is an Address field setter.

func (*Token_Info) SetID added in v0.7.4

func (m *Token_Info) SetID(id TokenID)

SetID is an ID field setter.

func (*Token_Info) SetOwnerID added in v0.7.4

func (m *Token_Info) SetOwnerID(id OwnerID)

SetOwnerID is an OwnerID field setter.

func (*Token_Info) SetOwnerKey added in v0.7.5

func (m *Token_Info) SetOwnerKey(key []byte)

SetOwnerKey is an OwnerKey field setter.

func (*Token_Info) SetSessionKey added in v0.7.4

func (m *Token_Info) SetSessionKey(key []byte)

SetSessionKey is a SessionKey field setter.

func (*Token_Info) SetVerb added in v0.7.4

func (m *Token_Info) SetVerb(verb Token_Info_Verb)

SetVerb is a Verb field setter.

func (*Token_Info) Size added in v0.7.4

func (m *Token_Info) Size() (n int)

func (*Token_Info) String added in v0.7.4

func (m *Token_Info) String() string

func (*Token_Info) Unmarshal added in v0.7.4

func (m *Token_Info) Unmarshal(dAtA []byte) error

func (*Token_Info) XXX_DiscardUnknown added in v0.7.4

func (m *Token_Info) XXX_DiscardUnknown()

func (*Token_Info) XXX_Marshal added in v0.7.4

func (m *Token_Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Token_Info) XXX_Merge added in v0.7.4

func (m *Token_Info) XXX_Merge(src proto.Message)

func (*Token_Info) XXX_Size added in v0.7.4

func (m *Token_Info) XXX_Size() int

func (*Token_Info) XXX_Unmarshal added in v0.7.4

func (m *Token_Info) XXX_Unmarshal(b []byte) error

type Token_Info_Verb added in v0.7.4

type Token_Info_Verb int32

Verb is an enumeration of session request types

const (
	// Put refers to object.Put RPC call
	Token_Info_Put Token_Info_Verb = 0
	// Get refers to object.Get RPC call
	Token_Info_Get Token_Info_Verb = 1
	// Head refers to object.Head RPC call
	Token_Info_Head Token_Info_Verb = 2
	// Search refers to object.Search RPC call
	Token_Info_Search Token_Info_Verb = 3
	// Delete refers to object.Delete RPC call
	Token_Info_Delete Token_Info_Verb = 4
	// Range refers to object.GetRange RPC call
	Token_Info_Range Token_Info_Verb = 5
	// RangeHash refers to object.GetRangeHash RPC call
	Token_Info_RangeHash Token_Info_Verb = 6
)

func (Token_Info_Verb) Bytes added in v0.7.4

func (x Token_Info_Verb) Bytes() []byte

Bytes returns a binary representation of the verb.

func (Token_Info_Verb) EnumDescriptor added in v0.7.4

func (Token_Info_Verb) EnumDescriptor() ([]byte, []int)

func (Token_Info_Verb) Size added in v0.7.4

func (x Token_Info_Verb) Size() int

Size returns the size of a binary representation of the verb.

func (Token_Info_Verb) String added in v0.7.4

func (x Token_Info_Verb) String() string

type VerbContainer added in v0.7.4

type VerbContainer interface {
	VerbSource
	SetVerb(Token_Info_Verb)
}

VerbContainer is an interface of the container of a token verb value.

type VerbSource added in v0.7.4

type VerbSource interface {
	GetVerb() Token_Info_Verb
}

VerbSource is an interface of the container of a token verb value with read access.

type VersionContainer added in v0.7.4

type VersionContainer interface {
	VersionSource
	SetVersion(uint32)
}

VersionContainer is an interface of the container of a numerical Version value.

type VersionSource added in v0.7.4

type VersionSource interface {
	GetVersion() uint32
}

VersionSource is an interface of the container of a numerical Version value with read access.

Jump to

Keyboard shortcuts

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