session

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ObjectSessionContext_Verb_name = map[int32]string{
		0: "VERB_UNSPECIFIED",
		1: "PUT",
		2: "GET",
		3: "HEAD",
		4: "SEARCH",
		5: "DELETE",
		6: "RANGE",
		7: "RANGEHASH",
	}
	ObjectSessionContext_Verb_value = map[string]int32{
		"VERB_UNSPECIFIED": 0,
		"PUT":              1,
		"GET":              2,
		"HEAD":             3,
		"SEARCH":           4,
		"DELETE":           5,
		"RANGE":            6,
		"RANGEHASH":        7,
	}
)

Enum value maps for ObjectSessionContext_Verb.

View Source
var (
	ContainerSessionContext_Verb_name = map[int32]string{
		0: "VERB_UNSPECIFIED",
		1: "PUT",
		2: "DELETE",
		3: "SETEACL",
	}
	ContainerSessionContext_Verb_value = map[string]int32{
		"VERB_UNSPECIFIED": 0,
		"PUT":              1,
		"DELETE":           2,
		"SETEACL":          3,
	}
)

Enum value maps for ContainerSessionContext_Verb.

View Source
var ErrNilSessionServiceClient = errors.New("session gRPC client is nil")

ErrNilSessionServiceClient is returned by functions that expect a non-nil SessionServiceClient, but received nil.

View Source
var File_session_grpc_service_proto protoreflect.FileDescriptor
View Source
var File_session_grpc_types_proto protoreflect.FileDescriptor
View Source
var SessionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "neo.fs.v2.session.SessionService",
	HandlerType: (*SessionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _SessionService_Create_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "session/grpc/service.proto",
}

SessionService_ServiceDesc is the grpc.ServiceDesc for SessionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSessionServiceServer

func RegisterSessionServiceServer(s grpc.ServiceRegistrar, srv SessionServiceServer)

Types

type Client

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

Client wraps SessionServiceClient with pre-defined configurations.

func NewClient

func NewClient(c SessionServiceClient, opts ...Option) (*Client, error)

NewClient creates, initializes and returns a new Client instance.

Options are applied one by one in order.

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

type ContainerSessionContext

type ContainerSessionContext struct {

	// Type of request for which the token is issued
	Verb ContainerSessionContext_Verb `protobuf:"varint,1,opt,name=verb,proto3,enum=neo.fs.v2.session.ContainerSessionContext_Verb" json:"verb,omitempty"`
	// Spreads the action to all owner containers.
	// If set, container_id field is ignored.
	Wildcard bool `protobuf:"varint,2,opt,name=wildcard,proto3" json:"wildcard,omitempty"`
	// Particular container to which the action applies.
	// Ignored if wildcard flag is set.
	ContainerId *grpc.ContainerID `protobuf:"bytes,3,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"`
	// contains filtered or unexported fields
}

Context information for Session Tokens related to ContainerService requests.

func (*ContainerSessionContext) Descriptor deprecated

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

Deprecated: Use ContainerSessionContext.ProtoReflect.Descriptor instead.

func (*ContainerSessionContext) GetContainerId

func (x *ContainerSessionContext) GetContainerId() *grpc.ContainerID

func (*ContainerSessionContext) GetVerb

func (*ContainerSessionContext) GetWildcard

func (x *ContainerSessionContext) GetWildcard() bool

func (*ContainerSessionContext) ProtoMessage

func (*ContainerSessionContext) ProtoMessage()

func (*ContainerSessionContext) ProtoReflect

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

func (*ContainerSessionContext) Reset

func (x *ContainerSessionContext) Reset()

func (*ContainerSessionContext) SetContainerId

func (x *ContainerSessionContext) SetContainerId(v *refs.ContainerID)

SetContainerId sets identifier of the container related to the session.

func (*ContainerSessionContext) SetVerb

SetVerb sets type of request for which the token is issued.

func (*ContainerSessionContext) SetWildcard

func (x *ContainerSessionContext) SetWildcard(v bool)

SetWildcard sets wildcard flag of the container session.

func (*ContainerSessionContext) String

func (x *ContainerSessionContext) String() string

type ContainerSessionContext_Verb

type ContainerSessionContext_Verb int32

Container request verbs

const (
	// Unknown verb
	ContainerSessionContext_VERB_UNSPECIFIED ContainerSessionContext_Verb = 0
	// Refers to container.Put RPC call
	ContainerSessionContext_PUT ContainerSessionContext_Verb = 1
	// Refers to container.Delete RPC call
	ContainerSessionContext_DELETE ContainerSessionContext_Verb = 2
	// Refers to container.SetExtendedACL RPC call
	ContainerSessionContext_SETEACL ContainerSessionContext_Verb = 3
)

func (ContainerSessionContext_Verb) Descriptor

func (ContainerSessionContext_Verb) Enum

func (ContainerSessionContext_Verb) EnumDescriptor deprecated

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

Deprecated: Use ContainerSessionContext_Verb.Descriptor instead.

func (*ContainerSessionContext_Verb) FromString

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

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

Returns true if s was parsed successfully.

func (ContainerSessionContext_Verb) Number

func (ContainerSessionContext_Verb) String

func (ContainerSessionContext_Verb) Type

type CreateRequest

type CreateRequest struct {

	// Body of a create session token request message.
	Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// Carries request meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
	// Carries request verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
	// contains filtered or unexported fields
}

Information necessary for opening a session.

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetBody

func (x *CreateRequest) GetBody() *CreateRequest_Body

func (*CreateRequest) GetMetaHeader

func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader

func (*CreateRequest) GetVerifyHeader

func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) SetBody

func (m *CreateRequest) SetBody(v *CreateRequest_Body)

SetBody sets body of the request.

func (*CreateRequest) SetMetaHeader

func (m *CreateRequest) SetMetaHeader(v *RequestMetaHeader)

SetMetaHeader sets meta header of the request.

func (*CreateRequest) SetVerifyHeader

func (m *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader)

SetVerifyHeader sets verification header of the request.

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateRequest_Body

type CreateRequest_Body struct {

	// Session initiating user's or node's key derived `OwnerID`
	OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
	// Session expiration `Epoch`
	Expiration uint64 `protobuf:"varint,2,opt,name=expiration,proto3" json:"expiration,omitempty"`
	// contains filtered or unexported fields
}

Session creation request body

func (*CreateRequest_Body) Descriptor deprecated

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

Deprecated: Use CreateRequest_Body.ProtoReflect.Descriptor instead.

func (*CreateRequest_Body) GetExpiration

func (x *CreateRequest_Body) GetExpiration() uint64

func (*CreateRequest_Body) GetOwnerId

func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID

func (*CreateRequest_Body) ProtoMessage

func (*CreateRequest_Body) ProtoMessage()

func (*CreateRequest_Body) ProtoReflect

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

func (*CreateRequest_Body) Reset

func (x *CreateRequest_Body) Reset()

func (*CreateRequest_Body) SetExpiration

func (m *CreateRequest_Body) SetExpiration(v uint64)

SetExpiration sets lifetime of the session.

func (*CreateRequest_Body) SetOwnerId

func (m *CreateRequest_Body) SetOwnerId(v *refs.OwnerID)

SetOwnerId sets identifier of the session initiator.

func (*CreateRequest_Body) String

func (x *CreateRequest_Body) String() string

type CreateResponse

type CreateResponse struct {

	// Body of create session token response message.
	Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// Carries response meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
	// Carries response verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
	// contains filtered or unexported fields
}

Information about the opened session.

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetBody

func (x *CreateResponse) GetBody() *CreateResponse_Body

func (*CreateResponse) GetMetaHeader

func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader

func (*CreateResponse) GetVerifyHeader

func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) SetBody

func (m *CreateResponse) SetBody(v *CreateResponse_Body)

SetBody sets body of the response.

func (*CreateResponse) SetMetaHeader

func (m *CreateResponse) SetMetaHeader(v *ResponseMetaHeader)

SetMetaHeader sets meta header of the response.

func (*CreateResponse) SetVerifyHeader

func (m *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader)

SetVerifyHeader sets verification header of the response.

func (*CreateResponse) String

func (x *CreateResponse) String() string

type CreateResponse_Body

type CreateResponse_Body struct {

	// Identifier of a newly created session
	Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Public key used for session
	SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey,proto3" json:"session_key,omitempty"`
	// contains filtered or unexported fields
}

Session creation response body

func (*CreateResponse_Body) Descriptor deprecated

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

Deprecated: Use CreateResponse_Body.ProtoReflect.Descriptor instead.

func (*CreateResponse_Body) GetId

func (x *CreateResponse_Body) GetId() []byte

func (*CreateResponse_Body) GetSessionKey

func (x *CreateResponse_Body) GetSessionKey() []byte

func (*CreateResponse_Body) ProtoMessage

func (*CreateResponse_Body) ProtoMessage()

func (*CreateResponse_Body) ProtoReflect

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

func (*CreateResponse_Body) Reset

func (x *CreateResponse_Body) Reset()

func (*CreateResponse_Body) SetId

func (m *CreateResponse_Body) SetId(v []byte)

SetId sets identifier of the session token.

func (*CreateResponse_Body) SetSessionKey

func (m *CreateResponse_Body) SetSessionKey(v []byte)

SetSessionKey sets session public key in a binary format.

func (*CreateResponse_Body) String

func (x *CreateResponse_Body) String() string

type ObjectSessionContext

type ObjectSessionContext struct {

	// Type of request for which the token is issued
	Verb ObjectSessionContext_Verb `protobuf:"varint,1,opt,name=verb,proto3,enum=neo.fs.v2.session.ObjectSessionContext_Verb" json:"verb,omitempty"`
	// Object session target. MUST be correctly formed and set. If `objects`
	// field is not empty, then the session applies only to these elements,
	// otherwise, to all objects from the specified container.
	Target *ObjectSessionContext_Target `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
	// contains filtered or unexported fields
}

Context information for Session Tokens related to ObjectService requests

func (*ObjectSessionContext) Descriptor deprecated

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

Deprecated: Use ObjectSessionContext.ProtoReflect.Descriptor instead.

func (*ObjectSessionContext) GetTarget added in v2.14.0

func (*ObjectSessionContext) GetVerb

func (*ObjectSessionContext) ProtoMessage

func (*ObjectSessionContext) ProtoMessage()

func (*ObjectSessionContext) ProtoReflect

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

func (*ObjectSessionContext) Reset

func (x *ObjectSessionContext) Reset()

func (*ObjectSessionContext) SetTarget added in v2.14.0

func (m *ObjectSessionContext) SetTarget(cnr *refs.ContainerID, objs []*refs.ObjectID)

SetTarget specifies objects involved in the object session.

func (*ObjectSessionContext) SetVerb

SetVerb sets type of request for which the token is issued.

func (*ObjectSessionContext) String

func (x *ObjectSessionContext) String() string

type ObjectSessionContext_Target added in v2.14.0

type ObjectSessionContext_Target struct {

	// Indicates which container the session is spread to. Field MUST be set
	// and correct.
	Container *grpc.ContainerID `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"`
	// Indicates which objects the session is spread to. Objects are expected
	// to be stored in the NeoFS container referenced by `container` field.
	// Each element MUST have correct format.
	Objects []*grpc.ObjectID `protobuf:"bytes,2,rep,name=objects,proto3" json:"objects,omitempty"`
	// contains filtered or unexported fields
}

Carries objects involved in the object session.

func (*ObjectSessionContext_Target) Descriptor deprecated added in v2.14.0

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

Deprecated: Use ObjectSessionContext_Target.ProtoReflect.Descriptor instead.

func (*ObjectSessionContext_Target) GetContainer added in v2.14.0

func (x *ObjectSessionContext_Target) GetContainer() *grpc.ContainerID

func (*ObjectSessionContext_Target) GetObjects added in v2.14.0

func (x *ObjectSessionContext_Target) GetObjects() []*grpc.ObjectID

func (*ObjectSessionContext_Target) ProtoMessage added in v2.14.0

func (*ObjectSessionContext_Target) ProtoMessage()

func (*ObjectSessionContext_Target) ProtoReflect added in v2.14.0

func (*ObjectSessionContext_Target) Reset added in v2.14.0

func (x *ObjectSessionContext_Target) Reset()

func (*ObjectSessionContext_Target) String added in v2.14.0

func (x *ObjectSessionContext_Target) String() string

type ObjectSessionContext_Verb

type ObjectSessionContext_Verb int32

Object request verbs

const (
	// Unknown verb
	ObjectSessionContext_VERB_UNSPECIFIED ObjectSessionContext_Verb = 0
	// Refers to object.Put RPC call
	ObjectSessionContext_PUT ObjectSessionContext_Verb = 1
	// Refers to object.Get RPC call
	ObjectSessionContext_GET ObjectSessionContext_Verb = 2
	// Refers to object.Head RPC call
	ObjectSessionContext_HEAD ObjectSessionContext_Verb = 3
	// Refers to object.Search RPC call
	ObjectSessionContext_SEARCH ObjectSessionContext_Verb = 4
	// Refers to object.Delete RPC call
	ObjectSessionContext_DELETE ObjectSessionContext_Verb = 5
	// Refers to object.GetRange RPC call
	ObjectSessionContext_RANGE ObjectSessionContext_Verb = 6
	// Refers to object.GetRangeHash RPC call
	ObjectSessionContext_RANGEHASH ObjectSessionContext_Verb = 7
)

func (ObjectSessionContext_Verb) Descriptor

func (ObjectSessionContext_Verb) Enum

func (ObjectSessionContext_Verb) EnumDescriptor deprecated

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

Deprecated: Use ObjectSessionContext_Verb.Descriptor instead.

func (*ObjectSessionContext_Verb) FromString

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

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

Returns true if s was parsed successfully.

func (ObjectSessionContext_Verb) Number

func (ObjectSessionContext_Verb) String

func (x ObjectSessionContext_Verb) String() string

func (ObjectSessionContext_Verb) Type

type Option

type Option func(*cfg)

Option represents Client option.

func WithCallOptions

func WithCallOptions(opts []grpc.CallOption) Option

WithCallOptions returns Option that configures Client to attach call options to each rpc call.

type RequestMetaHeader

type RequestMetaHeader struct {

	// Peer's API version used
	Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Peer's local epoch number. Set to 0 if unknown.
	Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"`
	// Maximum number of intermediate nodes in the request route
	Ttl uint32 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// Request X-Headers
	XHeaders []*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders,proto3" json:"x_headers,omitempty"`
	// Session token within which the request is sent
	SessionToken *SessionToken `protobuf:"bytes,5,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"`
	// `BearerToken` with eACL overrides for the request
	BearerToken *grpc1.BearerToken `protobuf:"bytes,6,opt,name=bearer_token,json=bearerToken,proto3" json:"bearer_token,omitempty"`
	// `RequestMetaHeader` of the origin request
	Origin *RequestMetaHeader `protobuf:"bytes,7,opt,name=origin,proto3" json:"origin,omitempty"`
	// NeoFS network magic. Must match the value for the network
	// that the server belongs to.
	MagicNumber uint64 `protobuf:"varint,8,opt,name=magic_number,json=magicNumber,proto3" json:"magic_number,omitempty"`
	// contains filtered or unexported fields
}

Meta information attached to the request. When forwarded between peers, request meta headers are folded in matryoshka style.

func (*RequestMetaHeader) Descriptor deprecated

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

Deprecated: Use RequestMetaHeader.ProtoReflect.Descriptor instead.

func (*RequestMetaHeader) GetBearerToken

func (x *RequestMetaHeader) GetBearerToken() *grpc1.BearerToken

func (*RequestMetaHeader) GetEpoch

func (x *RequestMetaHeader) GetEpoch() uint64

func (*RequestMetaHeader) GetMagicNumber added in v2.12.0

func (x *RequestMetaHeader) GetMagicNumber() uint64

func (*RequestMetaHeader) GetNetworkMagic added in v2.12.0

func (m *RequestMetaHeader) GetNetworkMagic() uint64

GetNetworkMagic returns NeoFS network magic.

func (*RequestMetaHeader) GetOrigin

func (x *RequestMetaHeader) GetOrigin() *RequestMetaHeader

func (*RequestMetaHeader) GetSessionToken

func (x *RequestMetaHeader) GetSessionToken() *SessionToken

func (*RequestMetaHeader) GetTtl

func (x *RequestMetaHeader) GetTtl() uint32

func (*RequestMetaHeader) GetVersion

func (x *RequestMetaHeader) GetVersion() *grpc.Version

func (*RequestMetaHeader) GetXHeaders

func (x *RequestMetaHeader) GetXHeaders() []*XHeader

func (*RequestMetaHeader) ProtoMessage

func (*RequestMetaHeader) ProtoMessage()

func (*RequestMetaHeader) ProtoReflect

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

func (*RequestMetaHeader) Reset

func (x *RequestMetaHeader) Reset()

func (*RequestMetaHeader) SetBearerToken

func (m *RequestMetaHeader) SetBearerToken(v *acl.BearerToken)

SetBearerToken sets bearer token of the request.

func (*RequestMetaHeader) SetEpoch

func (m *RequestMetaHeader) SetEpoch(v uint64)

SetEpoch sets client local epoch.

func (*RequestMetaHeader) SetNetworkMagic added in v2.12.0

func (m *RequestMetaHeader) SetNetworkMagic(v uint64)

SetNetworkMagic sets NeoFS network magic.

func (*RequestMetaHeader) SetOrigin

func (m *RequestMetaHeader) SetOrigin(v *RequestMetaHeader)

SetOrigin sets origin request meta header.

func (*RequestMetaHeader) SetSessionToken

func (m *RequestMetaHeader) SetSessionToken(v *SessionToken)

SetSessionToken sets session token of the request.

func (*RequestMetaHeader) SetTtl

func (m *RequestMetaHeader) SetTtl(v uint32)

SetTtl sets request TTL.

func (*RequestMetaHeader) SetVersion

func (m *RequestMetaHeader) SetVersion(v *refs.Version)

SetVersion sets client protocol version.

func (*RequestMetaHeader) SetXHeaders

func (m *RequestMetaHeader) SetXHeaders(v []*XHeader)

SetXHeaders sets request X-Headers.

func (*RequestMetaHeader) String

func (x *RequestMetaHeader) String() string

type RequestVerificationHeader

type RequestVerificationHeader struct {

	// Request Body signature. Should be generated once by the request initiator.
	BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature,proto3" json:"body_signature,omitempty"`
	// Request Meta signature is added and signed by each intermediate node
	MetaSignature *grpc.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"`
	// Signature of previous hops
	OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature,proto3" json:"origin_signature,omitempty"`
	// Chain of previous hops signatures
	Origin *RequestVerificationHeader `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
	// contains filtered or unexported fields
}

Verification info for the request signed by all intermediate nodes.

func (*RequestVerificationHeader) Descriptor deprecated

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

Deprecated: Use RequestVerificationHeader.ProtoReflect.Descriptor instead.

func (*RequestVerificationHeader) GetBodySignature

func (x *RequestVerificationHeader) GetBodySignature() *grpc.Signature

func (*RequestVerificationHeader) GetMetaSignature

func (x *RequestVerificationHeader) GetMetaSignature() *grpc.Signature

func (*RequestVerificationHeader) GetOrigin

func (*RequestVerificationHeader) GetOriginSignature

func (x *RequestVerificationHeader) GetOriginSignature() *grpc.Signature

func (*RequestVerificationHeader) ProtoMessage

func (*RequestVerificationHeader) ProtoMessage()

func (*RequestVerificationHeader) ProtoReflect

func (*RequestVerificationHeader) Reset

func (x *RequestVerificationHeader) Reset()

func (*RequestVerificationHeader) SetBodySignature

func (m *RequestVerificationHeader) SetBodySignature(v *refs.Signature)

SetBodySignature sets signature of the request body.

func (*RequestVerificationHeader) SetMetaSignature

func (m *RequestVerificationHeader) SetMetaSignature(v *refs.Signature)

SetMetaSignature sets signature of the request meta.

func (*RequestVerificationHeader) SetOrigin

SetOrigin sets origin verification header of the request.

func (*RequestVerificationHeader) SetOriginSignature

func (m *RequestVerificationHeader) SetOriginSignature(v *refs.Signature)

SetOriginSignature sets signature of the origin verification header of the request.

func (*RequestVerificationHeader) String

func (x *RequestVerificationHeader) String() string

type ResponseMetaHeader

type ResponseMetaHeader struct {

	// Peer's API version used
	Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Peer's local epoch number
	Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"`
	// Maximum number of intermediate nodes in the request route
	Ttl uint32 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// Response X-Headers
	XHeaders []*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders,proto3" json:"x_headers,omitempty"`
	// `ResponseMetaHeader` of the origin request
	Origin *ResponseMetaHeader `protobuf:"bytes,5,opt,name=origin,proto3" json:"origin,omitempty"`
	// Status return
	Status *grpc2.Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Information about the response

func (*ResponseMetaHeader) Descriptor deprecated

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

Deprecated: Use ResponseMetaHeader.ProtoReflect.Descriptor instead.

func (*ResponseMetaHeader) GetEpoch

func (x *ResponseMetaHeader) GetEpoch() uint64

func (*ResponseMetaHeader) GetOrigin

func (x *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader

func (*ResponseMetaHeader) GetStatus

func (x *ResponseMetaHeader) GetStatus() *grpc2.Status

func (*ResponseMetaHeader) GetTtl

func (x *ResponseMetaHeader) GetTtl() uint32

func (*ResponseMetaHeader) GetVersion

func (x *ResponseMetaHeader) GetVersion() *grpc.Version

func (*ResponseMetaHeader) GetXHeaders

func (x *ResponseMetaHeader) GetXHeaders() []*XHeader

func (*ResponseMetaHeader) ProtoMessage

func (*ResponseMetaHeader) ProtoMessage()

func (*ResponseMetaHeader) ProtoReflect

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

func (*ResponseMetaHeader) Reset

func (x *ResponseMetaHeader) Reset()

func (*ResponseMetaHeader) SetEpoch

func (m *ResponseMetaHeader) SetEpoch(v uint64)

SetEpoch sets server local epoch.

func (*ResponseMetaHeader) SetOrigin

func (m *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader)

SetOrigin sets origin response meta header.

func (*ResponseMetaHeader) SetStatus

func (m *ResponseMetaHeader) SetStatus(v *status.Status)

SetStatus sets response status.

func (*ResponseMetaHeader) SetTtl

func (m *ResponseMetaHeader) SetTtl(v uint32)

SetTtl sets response TTL.

func (*ResponseMetaHeader) SetVersion

func (m *ResponseMetaHeader) SetVersion(v *refs.Version)

SetVersion sets server protocol version.

func (*ResponseMetaHeader) SetXHeaders

func (m *ResponseMetaHeader) SetXHeaders(v []*XHeader)

SetXHeaders sets response X-Headers.

func (*ResponseMetaHeader) String

func (x *ResponseMetaHeader) String() string

type ResponseVerificationHeader

type ResponseVerificationHeader struct {

	// Response Body signature. Should be generated once by an answering node.
	BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature,proto3" json:"body_signature,omitempty"`
	// Response Meta signature is added and signed by each intermediate node
	MetaSignature *grpc.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"`
	// Signature of previous hops
	OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature,proto3" json:"origin_signature,omitempty"`
	// Chain of previous hops signatures
	Origin *ResponseVerificationHeader `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
	// contains filtered or unexported fields
}

Verification info for the response signed by all intermediate nodes

func (*ResponseVerificationHeader) Descriptor deprecated

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

Deprecated: Use ResponseVerificationHeader.ProtoReflect.Descriptor instead.

func (*ResponseVerificationHeader) GetBodySignature

func (x *ResponseVerificationHeader) GetBodySignature() *grpc.Signature

func (*ResponseVerificationHeader) GetMetaSignature

func (x *ResponseVerificationHeader) GetMetaSignature() *grpc.Signature

func (*ResponseVerificationHeader) GetOrigin

func (*ResponseVerificationHeader) GetOriginSignature

func (x *ResponseVerificationHeader) GetOriginSignature() *grpc.Signature

func (*ResponseVerificationHeader) ProtoMessage

func (*ResponseVerificationHeader) ProtoMessage()

func (*ResponseVerificationHeader) ProtoReflect

func (*ResponseVerificationHeader) Reset

func (x *ResponseVerificationHeader) Reset()

func (*ResponseVerificationHeader) SetBodySignature

func (m *ResponseVerificationHeader) SetBodySignature(v *refs.Signature)

SetBodySignature sets signature of the response body.

func (*ResponseVerificationHeader) SetMetaSignature

func (m *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature)

SetMetaSignature sets signature of the response meta.

func (*ResponseVerificationHeader) SetOrigin

SetOrigin sets origin verification header of the response.

func (*ResponseVerificationHeader) SetOriginSignature

func (m *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature)

SetOriginSignature sets signature of the origin verification header of the response.

func (*ResponseVerificationHeader) String

func (x *ResponseVerificationHeader) String() string

type SessionServiceClient

type SessionServiceClient interface {
	// Open a new session between two peers.
	//
	// Statuses:
	// - **OK** (0, SECTION_SUCCESS):
	// session has been successfully opened;
	// - Common failures (SECTION_FAILURE_COMMON).
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
}

SessionServiceClient is the client API for SessionService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type SessionServiceServer

type SessionServiceServer interface {
	// Open a new session between two peers.
	//
	// Statuses:
	// - **OK** (0, SECTION_SUCCESS):
	// session has been successfully opened;
	// - Common failures (SECTION_FAILURE_COMMON).
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
}

SessionServiceServer is the server API for SessionService service. All implementations should embed UnimplementedSessionServiceServer for forward compatibility

type SessionToken

type SessionToken struct {

	// Session Token contains the proof of trust between peers to be attached in
	// requests for further verification. Please see corresponding section of
	// NeoFS Technical Specification for details.
	Body *SessionToken_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// Signature of `SessionToken` information
	Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

NeoFS Session Token.

func (*SessionToken) Descriptor deprecated

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

Deprecated: Use SessionToken.ProtoReflect.Descriptor instead.

func (*SessionToken) GetBody

func (x *SessionToken) GetBody() *SessionToken_Body

func (*SessionToken) GetSignature

func (x *SessionToken) GetSignature() *grpc.Signature

func (*SessionToken) ProtoMessage

func (*SessionToken) ProtoMessage()

func (*SessionToken) ProtoReflect

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

func (*SessionToken) Reset

func (x *SessionToken) Reset()

func (*SessionToken) SetBody

func (m *SessionToken) SetBody(v *SessionToken_Body)

SetBody sets session token body.

func (*SessionToken) SetSignature

func (m *SessionToken) SetSignature(v *refs.Signature)

SetSignature sets session token signature.

func (*SessionToken) String

func (x *SessionToken) String() string

type SessionToken_Body

type SessionToken_Body struct {

	// Token identifier is a valid UUIDv4 in binary form
	Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Identifier of the session initiator
	OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"`
	// Lifetime of the session
	Lifetime *SessionToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
	// Public key used in session
	SessionKey []byte `protobuf:"bytes,4,opt,name=session_key,json=sessionKey,proto3" json:"session_key,omitempty"`
	// Session Context information
	//
	// Types that are assignable to Context:
	//
	//	*SessionToken_Body_Object
	//	*SessionToken_Body_Container
	Context isSessionToken_Body_Context `protobuf_oneof:"context"`
	// contains filtered or unexported fields
}

Session Token body

func (*SessionToken_Body) Descriptor deprecated

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

Deprecated: Use SessionToken_Body.ProtoReflect.Descriptor instead.

func (*SessionToken_Body) GetContainer

func (x *SessionToken_Body) GetContainer() *ContainerSessionContext

func (*SessionToken_Body) GetContext

func (m *SessionToken_Body) GetContext() isSessionToken_Body_Context

func (*SessionToken_Body) GetId

func (x *SessionToken_Body) GetId() []byte

func (*SessionToken_Body) GetLifetime

func (*SessionToken_Body) GetObject

func (x *SessionToken_Body) GetObject() *ObjectSessionContext

func (*SessionToken_Body) GetOwnerId

func (x *SessionToken_Body) GetOwnerId() *grpc.OwnerID

func (*SessionToken_Body) GetSessionKey

func (x *SessionToken_Body) GetSessionKey() []byte

func (*SessionToken_Body) ProtoMessage

func (*SessionToken_Body) ProtoMessage()

func (*SessionToken_Body) ProtoReflect

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

func (*SessionToken_Body) Reset

func (x *SessionToken_Body) Reset()

func (*SessionToken_Body) SetContainerSessionContext

func (m *SessionToken_Body) SetContainerSessionContext(v *ContainerSessionContext)

SetContainerSessionContext sets container context of the session token.

func (*SessionToken_Body) SetId

func (m *SessionToken_Body) SetId(v []byte)

SetId sets identifier of the session token.

func (*SessionToken_Body) SetLifetime

SetLifetime sets lifetime of the session token.

func (*SessionToken_Body) SetObjectSessionContext

func (m *SessionToken_Body) SetObjectSessionContext(v *ObjectSessionContext)

SetObjectAddressContext sets object context of the session token.

func (*SessionToken_Body) SetOwnerId

func (m *SessionToken_Body) SetOwnerId(v *refs.OwnerID)

SetOwnerId sets identifier of the session token owner.

func (*SessionToken_Body) SetSessionKey

func (m *SessionToken_Body) SetSessionKey(v []byte)

SetSessionKey sets public session key in a binary format.

func (*SessionToken_Body) String

func (x *SessionToken_Body) String() string

type SessionToken_Body_Container

type SessionToken_Body_Container struct {
	// ContainerService session context
	Container *ContainerSessionContext `protobuf:"bytes,6,opt,name=container,proto3,oneof"`
}

type SessionToken_Body_Object

type SessionToken_Body_Object struct {
	// ObjectService session context
	Object *ObjectSessionContext `protobuf:"bytes,5,opt,name=object,proto3,oneof"`
}

type SessionToken_Body_TokenLifetime

type SessionToken_Body_TokenLifetime struct {

	// Expiration Epoch
	Exp uint64 `protobuf:"varint,1,opt,name=exp,proto3" json:"exp,omitempty"`
	// Not valid before Epoch
	Nbf uint64 `protobuf:"varint,2,opt,name=nbf,proto3" json:"nbf,omitempty"`
	// Issued at Epoch
	Iat uint64 `protobuf:"varint,3,opt,name=iat,proto3" json:"iat,omitempty"`
	// contains filtered or unexported fields
}

Lifetime parameters of the token. Field names taken from rfc7519.

func (*SessionToken_Body_TokenLifetime) Descriptor deprecated

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

Deprecated: Use SessionToken_Body_TokenLifetime.ProtoReflect.Descriptor instead.

func (*SessionToken_Body_TokenLifetime) GetExp

func (*SessionToken_Body_TokenLifetime) GetIat

func (*SessionToken_Body_TokenLifetime) GetNbf

func (*SessionToken_Body_TokenLifetime) ProtoMessage

func (*SessionToken_Body_TokenLifetime) ProtoMessage()

func (*SessionToken_Body_TokenLifetime) ProtoReflect

func (*SessionToken_Body_TokenLifetime) Reset

func (*SessionToken_Body_TokenLifetime) SetExp

SetExp sets epoch number of the token expiration.

func (*SessionToken_Body_TokenLifetime) SetIat

SetIat sets the number of the epoch in which the token was issued.

func (*SessionToken_Body_TokenLifetime) SetNbf

SetNbf sets starting epoch number of the token.

func (*SessionToken_Body_TokenLifetime) String

type UnimplementedSessionServiceServer

type UnimplementedSessionServiceServer struct {
}

UnimplementedSessionServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedSessionServiceServer) Create

type UnsafeSessionServiceServer

type UnsafeSessionServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeSessionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SessionServiceServer will result in compilation errors.

type XHeader

type XHeader struct {

	// Key of the X-Header
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Value of the X-Header
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Extended headers for Request/Response. They may contain any user-defined headers to be interpreted on application level.

Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or Responses with duplicated header names or headers with empty values will be considered invalid.

There are some "well-known" headers starting with `__NEOFS__` prefix that affect system behaviour:

  • __NEOFS__NETMAP_EPOCH \ Netmap epoch to use for object placement calculation. The `value` is string encoded `uint64` in decimal presentation. If set to '0' or not set, the current epoch only will be used.
  • __NEOFS__NETMAP_LOOKUP_DEPTH \ If object can't be found using current epoch's netmap, this header limits how many past epochs the node can look up through. The `value` is string encoded `uint64` in decimal presentation. If set to '0' or not set, only the current epoch will be used.

func (*XHeader) Descriptor deprecated

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

Deprecated: Use XHeader.ProtoReflect.Descriptor instead.

func (*XHeader) GetKey

func (x *XHeader) GetKey() string

func (*XHeader) GetValue

func (x *XHeader) GetValue() string

func (*XHeader) ProtoMessage

func (*XHeader) ProtoMessage()

func (*XHeader) ProtoReflect

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

func (*XHeader) Reset

func (x *XHeader) Reset()

func (*XHeader) SetKey

func (m *XHeader) SetKey(v string)

SetKey sets key to the X-Header.

func (*XHeader) SetValue

func (m *XHeader) SetValue(v string)

SetValue sets value of the X-Header.

func (*XHeader) String

func (x *XHeader) String() string

Jump to

Keyboard shortcuts

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