diff --git a/v2/session/grpc/service.pb.go b/v2/session/grpc/service.pb.go index e18b8f3..223c38b 100644 --- a/v2/session/grpc/service.pb.go +++ b/v2/session/grpc/service.pb.go @@ -176,7 +176,7 @@ type CreateRequest_Body struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Dession initiating user's or node's key derived `OwnerID`. + // 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"` diff --git a/v2/session/grpc/types.pb.go b/v2/session/grpc/types.pb.go index fe557fd..aba3ceb 100644 --- a/v2/session/grpc/types.pb.go +++ b/v2/session/grpc/types.pb.go @@ -218,7 +218,25 @@ func (x *SessionToken) GetSignature() *grpc.Signature { return nil } -// Extended headers for Request/Response. +// Extended headers for Request/Response. May contain any user-defined headers +// to be interpreted on application level. +// +// Key name must be 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 back the node can lookup. The `value` is string +// encoded `uint64` in decimal presentation. If set to '0' or not set, the +// current epoch only will be used. type XHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/v2/session/xheaders.go b/v2/session/xheaders.go new file mode 100644 index 0000000..64b16de --- /dev/null +++ b/v2/session/xheaders.go @@ -0,0 +1,16 @@ +package session + +// ReservedXHeaderPrefix is a prefix of keys to "well-known" X-headers. +const ReservedXHeaderPrefix = "__NEOFS__" + +const ( + // XHeaderNetmapEpoch is a key to the reserved X-header that specifies netmap epoch + // to use for object placement calculation. If set to '0' or not set, the current + // epoch only will be used. + XHeaderNetmapEpoch = ReservedXHeaderPrefix + "NETMAP_EPOCH" + + // XHeaderNetmapLookupDepth is a key to the reserved X-header that limits + // how many past epochs back the node will can lookup. If set to '0' or not + // set, the current epoch only will be used. + XHeaderNetmapLookupDepth = ReservedXHeaderPrefix + "NETMAP_LOOKUP_DEPTH" +)