diff --git a/accounting/decimal.go b/accounting/decimal.go index 9cea6618..5141801a 100644 --- a/accounting/decimal.go +++ b/accounting/decimal.go @@ -1,93 +1,97 @@ package accounting import ( - "github.com/nspcc-dev/neofs-api-go/v2/accounting" + "github.com/nspcc-dev/neofs-sdk-go/api/accounting" + "google.golang.org/protobuf/proto" ) // Decimal represents decimal number for accounting operations. // -// Decimal is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/accounting.Decimal -// message. See ReadFromV2 / WriteToV2 methods. +// Decimal is mutually compatible with [accounting.Decimal] message. See +// [Decimal.ReadFromV2] / [Decimal.WriteToV2] methods. // // Instances can be created using built-in var declaration. -// -// Note that direct typecast is not safe and may result in loss of compatibility: -// -// _ = Decimal(accounting.Decimal{}) // not recommended -type Decimal accounting.Decimal +type Decimal struct { + val int64 + prec uint32 +} -// ReadFromV2 reads Decimal from the accounting.Decimal message. Checks if the -// message conforms to NeoFS API V2 protocol. +// ReadFromV2 reads Decimal from the [accounting.Decimal] message. Checks if the +// message conforms to NeoFS API V2 protocol. The message must not be nil. // -// See also WriteToV2. -func (d *Decimal) ReadFromV2(m accounting.Decimal) error { - *d = Decimal(m) +// See also [Decimal.WriteToV2]. +func (d *Decimal) ReadFromV2(m *accounting.Decimal) error { + d.val = m.Value + d.prec = m.Precision return nil } -// WriteToV2 writes Decimal to the accounting.Decimal message. -// The message must not be nil. +// WriteToV2 writes Decimal to the [accounting.Decimal] message. The message +// must not be nil. // -// See also ReadFromV2. +// See also [Decimal.ReadFromV2]. func (d Decimal) WriteToV2(m *accounting.Decimal) { - *m = (accounting.Decimal)(d) + m.Value = d.val + m.Precision = d.prec } // Value returns value of the decimal number. // // Zero Decimal has zero value. // -// See also SetValue. +// See also [Decimal.SetValue]. func (d Decimal) Value() int64 { - return (*accounting.Decimal)(&d).GetValue() + return d.val } // SetValue sets value of the decimal number. // -// See also Value. +// See also [Decimal.Value]. func (d *Decimal) SetValue(v int64) { - (*accounting.Decimal)(d).SetValue(v) + d.val = v } // Precision returns precision of the decimal number. // // Zero Decimal has zero precision. // -// See also SetPrecision. +// See also [Decimal.SetPrecision]. func (d Decimal) Precision() uint32 { - return (*accounting.Decimal)(&d).GetPrecision() + return d.prec } // SetPrecision sets precision of the decimal number. // -// See also Precision. +// See also [Decimal.Precision]. func (d *Decimal) SetPrecision(p uint32) { - (*accounting.Decimal)(d).SetPrecision(p) + d.prec = p } // Marshal encodes Decimal into a binary format of the NeoFS API protocol // (Protocol Buffers with direct field order). // -// See also Unmarshal. +// See also [Decimal.Unmarshal]. func (d Decimal) Marshal() []byte { var m accounting.Decimal d.WriteToV2(&m) - return m.StableMarshal(nil) + b := make([]byte, m.MarshaledSize()) + m.MarshalStable(b) + return b } // Unmarshal decodes NeoFS API protocol binary format into the Decimal // (Protocol Buffers with direct field order). Returns an error describing // a format violation. // -// See also Marshal. +// See also [Decimal.Marshal]. func (d *Decimal) Unmarshal(data []byte) error { var m accounting.Decimal - err := m.Unmarshal(data) + err := proto.Unmarshal(data, &m) if err != nil { return err } - return d.ReadFromV2(m) + return d.ReadFromV2(&m) } diff --git a/accounting/decimal_test.go b/accounting/decimal_test.go index 18392c52..fc3149c9 100644 --- a/accounting/decimal_test.go +++ b/accounting/decimal_test.go @@ -3,9 +3,9 @@ package accounting_test import ( "testing" - v2accounting "github.com/nspcc-dev/neofs-api-go/v2/accounting" "github.com/nspcc-dev/neofs-sdk-go/accounting" accountingtest "github.com/nspcc-dev/neofs-sdk-go/accounting/test" + apiaccounting "github.com/nspcc-dev/neofs-sdk-go/api/accounting" "github.com/stretchr/testify/require" ) @@ -25,25 +25,20 @@ func TestDecimalData(t *testing.T) { } func TestDecimalMessageV2(t *testing.T) { - var ( - d accounting.Decimal - m v2accounting.Decimal - ) - - m.SetValue(7) - m.SetPrecision(8) + m := &apiaccounting.Decimal{Value: 7, Precision: 8} + var d accounting.Decimal require.NoError(t, d.ReadFromV2(m)) - require.EqualValues(t, m.GetValue(), d.Value()) - require.EqualValues(t, m.GetPrecision(), d.Precision()) + require.EqualValues(t, 7, d.Value()) + require.EqualValues(t, 8, d.Precision()) - var m2 v2accounting.Decimal + var m2 apiaccounting.Decimal d.WriteToV2(&m2) - require.EqualValues(t, d.Value(), m2.GetValue()) - require.EqualValues(t, d.Precision(), m2.GetPrecision()) + require.EqualValues(t, 7, m2.GetValue()) + require.EqualValues(t, 8, m2.GetPrecision()) } func TestDecimal_Marshal(t *testing.T) { diff --git a/accounting/example_test.go b/accounting/example_test.go index ed33b09c..a875a6dc 100644 --- a/accounting/example_test.go +++ b/accounting/example_test.go @@ -1,8 +1,8 @@ package accounting_test import ( - apiGoAccounting "github.com/nspcc-dev/neofs-api-go/v2/accounting" "github.com/nspcc-dev/neofs-sdk-go/accounting" + apiaccounting "github.com/nspcc-dev/neofs-sdk-go/api/accounting" ) func Example() { @@ -16,11 +16,10 @@ func Example() { // On the client side. - // import apiGoAccounting "github.com/nspcc-dev/neofs-api-go/v2/accounting" - var msg apiGoAccounting.Decimal + var msg apiaccounting.Decimal dec.WriteToV2(&msg) // *send message* // On the server side. - _ = dec.ReadFromV2(msg) + _ = dec.ReadFromV2(&msg) } diff --git a/api/accounting/encoding.go b/api/accounting/encoding.go new file mode 100644 index 00000000..328cd7e3 --- /dev/null +++ b/api/accounting/encoding.go @@ -0,0 +1,65 @@ +package accounting + +import ( + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" +) + +const ( + _ = iota + fieldDecimalValue + fieldDecimalPrecision +) + +func (x *Decimal) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldDecimalValue, x.Value) + + proto.SizeVarint(fieldDecimalPrecision, x.Precision) + } + return sz +} + +func (x *Decimal) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldDecimalValue, x.Value) + proto.MarshalVarint(b[off:], fieldDecimalPrecision, x.Precision) + } +} + +const ( + _ = iota + fieldBalanceReqOwner +) + +func (x *BalanceRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldBalanceReqOwner, x.OwnerId) + } + return sz +} + +func (x *BalanceRequest_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldBalanceReqOwner, x.OwnerId) + } +} + +const ( + _ = iota + fieldBalanceRespBalance +) + +func (x *BalanceResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldBalanceRespBalance, x.Balance) + } + return sz +} + +func (x *BalanceResponse_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldBalanceRespBalance, x.Balance) + } +} diff --git a/api/accounting/encoding_test.go b/api/accounting/encoding_test.go new file mode 100644 index 00000000..a6fdeb81 --- /dev/null +++ b/api/accounting/encoding_test.go @@ -0,0 +1,49 @@ +package accounting_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/accounting" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestBalanceRequest_Body(t *testing.T) { + v := &accounting.BalanceRequest_Body{ + OwnerId: &refs.OwnerID{ + Value: []byte("any_owner"), + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res accounting.BalanceRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.OwnerId, res.OwnerId) + // TODO: test field order. Pretty challenging in general, but can be simplified + // for NeoFS specifics (forbid group types, maps, etc.). +} + +func TestBalanceResponse_Body(t *testing.T) { + v := &accounting.BalanceResponse_Body{ + Balance: &accounting.Decimal{ + Value: 12, + Precision: 34, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res accounting.BalanceResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Balance, res.Balance) +} diff --git a/api/accounting/service.pb.go b/api/accounting/service.pb.go new file mode 100644 index 00000000..b37016ce --- /dev/null +++ b/api/accounting/service.pb.go @@ -0,0 +1,451 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: accounting/grpc/service.proto + +package accounting + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// BalanceRequest message +type BalanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the balance request message. + Body *BalanceRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *BalanceRequest) Reset() { + *x = BalanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_accounting_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest) ProtoMessage() {} + +func (x *BalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_accounting_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead. +func (*BalanceRequest) Descriptor() ([]byte, []int) { + return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *BalanceRequest) GetBody() *BalanceRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *BalanceRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *BalanceRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// BalanceResponse message +type BalanceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the balance response message. + Body *BalanceResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *BalanceResponse) Reset() { + *x = BalanceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_accounting_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse) ProtoMessage() {} + +func (x *BalanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_accounting_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead. +func (*BalanceResponse) Descriptor() ([]byte, []int) { + return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *BalanceResponse) GetBody() *BalanceResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *BalanceResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *BalanceResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// To indicate the account for which the balance is requested, its identifier +// is used. It can be any existing account in NeoFS sidechain `Balance` smart +// contract. If omitted, client implementation MUST set it to the request's +// signer `OwnerID`. +type BalanceRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Valid user identifier in `OwnerID` format for which the balance is + // requested. Required field. + OwnerId *refs.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` +} + +func (x *BalanceRequest_Body) Reset() { + *x = BalanceRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_accounting_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest_Body) ProtoMessage() {} + +func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_accounting_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BalanceRequest_Body.ProtoReflect.Descriptor instead. +func (*BalanceRequest_Body) Descriptor() ([]byte, []int) { + return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *BalanceRequest_Body) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +// The amount of funds in GAS token for the `OwnerID`'s account requested. +// Balance is given in the `Decimal` format to avoid precision issues with rounding. +type BalanceResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Amount of funds in GAS token for the requested account. + Balance *Decimal `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (x *BalanceResponse_Body) Reset() { + *x = BalanceResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_accounting_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse_Body) ProtoMessage() {} + +func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_accounting_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BalanceResponse_Body.ProtoReflect.Descriptor instead. +func (*BalanceResponse_Body) Descriptor() ([]byte, []int) { + return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *BalanceResponse_Body) GetBalance() *Decimal { + if x != nil { + return x.Balance + } + return nil +} + +var File_accounting_grpc_service_proto protoreflect.FileDescriptor + +var file_accounting_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, + 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, + 0x3a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xae, 0x02, 0x0a, 0x0f, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69, + 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x11, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x56, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x62, 0x5a, 0x3f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, + 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, + 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_accounting_grpc_service_proto_rawDescOnce sync.Once + file_accounting_grpc_service_proto_rawDescData = file_accounting_grpc_service_proto_rawDesc +) + +func file_accounting_grpc_service_proto_rawDescGZIP() []byte { + file_accounting_grpc_service_proto_rawDescOnce.Do(func() { + file_accounting_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_service_proto_rawDescData) + }) + return file_accounting_grpc_service_proto_rawDescData +} + +var file_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_accounting_grpc_service_proto_goTypes = []interface{}{ + (*BalanceRequest)(nil), // 0: neo.fs.v2.accounting.BalanceRequest + (*BalanceResponse)(nil), // 1: neo.fs.v2.accounting.BalanceResponse + (*BalanceRequest_Body)(nil), // 2: neo.fs.v2.accounting.BalanceRequest.Body + (*BalanceResponse_Body)(nil), // 3: neo.fs.v2.accounting.BalanceResponse.Body + (*session.RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader + (*session.RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader + (*session.ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader + (*session.ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader + (*refs.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID + (*Decimal)(nil), // 9: neo.fs.v2.accounting.Decimal +} +var file_accounting_grpc_service_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.accounting.BalanceRequest.body:type_name -> neo.fs.v2.accounting.BalanceRequest.Body + 4, // 1: neo.fs.v2.accounting.BalanceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 5, // 2: neo.fs.v2.accounting.BalanceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 3, // 3: neo.fs.v2.accounting.BalanceResponse.body:type_name -> neo.fs.v2.accounting.BalanceResponse.Body + 6, // 4: neo.fs.v2.accounting.BalanceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 7, // 5: neo.fs.v2.accounting.BalanceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.accounting.BalanceRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 9, // 7: neo.fs.v2.accounting.BalanceResponse.Body.balance:type_name -> neo.fs.v2.accounting.Decimal + 0, // 8: neo.fs.v2.accounting.AccountingService.Balance:input_type -> neo.fs.v2.accounting.BalanceRequest + 1, // 9: neo.fs.v2.accounting.AccountingService.Balance:output_type -> neo.fs.v2.accounting.BalanceResponse + 9, // [9:10] is the sub-list for method output_type + 8, // [8:9] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_accounting_grpc_service_proto_init() } +func file_accounting_grpc_service_proto_init() { + if File_accounting_grpc_service_proto != nil { + return + } + file_accounting_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_accounting_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounting_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounting_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounting_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_accounting_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_accounting_grpc_service_proto_goTypes, + DependencyIndexes: file_accounting_grpc_service_proto_depIdxs, + MessageInfos: file_accounting_grpc_service_proto_msgTypes, + }.Build() + File_accounting_grpc_service_proto = out.File + file_accounting_grpc_service_proto_rawDesc = nil + file_accounting_grpc_service_proto_goTypes = nil + file_accounting_grpc_service_proto_depIdxs = nil +} diff --git a/api/accounting/service_grpc.pb.go b/api/accounting/service_grpc.pb.go new file mode 100644 index 00000000..27f407f7 --- /dev/null +++ b/api/accounting/service_grpc.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: accounting/grpc/service.proto + +package accounting + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AccountingService_Balance_FullMethodName = "/neo.fs.v2.accounting.AccountingService/Balance" +) + +// AccountingServiceClient is the client API for AccountingService 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 AccountingServiceClient interface { + // Returns the amount of funds in GAS token for the requested NeoFS account. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // balance has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) +} + +type accountingServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountingServiceClient(cc grpc.ClientConnInterface) AccountingServiceClient { + return &accountingServiceClient{cc} +} + +func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) { + out := new(BalanceResponse) + err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountingServiceServer is the server API for AccountingService service. +// All implementations should embed UnimplementedAccountingServiceServer +// for forward compatibility +type AccountingServiceServer interface { + // Returns the amount of funds in GAS token for the requested NeoFS account. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // balance has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) +} + +// UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAccountingServiceServer struct { +} + +func (UnimplementedAccountingServiceServer) Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") +} + +// UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountingServiceServer will +// result in compilation errors. +type UnsafeAccountingServiceServer interface { + mustEmbedUnimplementedAccountingServiceServer() +} + +func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer) { + s.RegisterService(&AccountingService_ServiceDesc, srv) +} + +func _AccountingService_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountingServiceServer).Balance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountingService_Balance_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountingServiceServer).Balance(ctx, req.(*BalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AccountingService_ServiceDesc is the grpc.ServiceDesc for AccountingService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AccountingService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.accounting.AccountingService", + HandlerType: (*AccountingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Balance", + Handler: _AccountingService_Balance_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "accounting/grpc/service.proto", +} diff --git a/api/accounting/types.pb.go b/api/accounting/types.pb.go new file mode 100644 index 00000000..be4f2670 --- /dev/null +++ b/api/accounting/types.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: accounting/grpc/types.proto + +package accounting + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Standard floating point data type can't be used in NeoFS due to inexactness +// of the result when doing lots of small number operations. To solve the lost +// precision issue, special `Decimal` format is used for monetary computations. +// +// Please see [The General Decimal Arithmetic +// Specification](http://speleotrove.com/decimal/) for detailed problem +// description. +type Decimal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Number in the smallest Token fractions. + Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + // Precision value indicating how many smallest fractions can be in one + // integer. + Precision uint32 `protobuf:"varint,2,opt,name=precision,proto3" json:"precision,omitempty"` +} + +func (x *Decimal) Reset() { + *x = Decimal{} + if protoimpl.UnsafeEnabled { + mi := &file_accounting_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Decimal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Decimal) ProtoMessage() {} + +func (x *Decimal) ProtoReflect() protoreflect.Message { + mi := &file_accounting_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Decimal.ProtoReflect.Descriptor instead. +func (*Decimal) Descriptor() ([]byte, []int) { + return file_accounting_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Decimal) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *Decimal) GetPrecision() uint32 { + if x != nil { + return x.Precision + } + return 0 +} + +var File_accounting_grpc_types_proto protoreflect.FileDescriptor + +var file_accounting_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x42, 0x62, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_accounting_grpc_types_proto_rawDescOnce sync.Once + file_accounting_grpc_types_proto_rawDescData = file_accounting_grpc_types_proto_rawDesc +) + +func file_accounting_grpc_types_proto_rawDescGZIP() []byte { + file_accounting_grpc_types_proto_rawDescOnce.Do(func() { + file_accounting_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_types_proto_rawDescData) + }) + return file_accounting_grpc_types_proto_rawDescData +} + +var file_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_accounting_grpc_types_proto_goTypes = []interface{}{ + (*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal +} +var file_accounting_grpc_types_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_accounting_grpc_types_proto_init() } +func file_accounting_grpc_types_proto_init() { + if File_accounting_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_accounting_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Decimal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_accounting_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_accounting_grpc_types_proto_goTypes, + DependencyIndexes: file_accounting_grpc_types_proto_depIdxs, + MessageInfos: file_accounting_grpc_types_proto_msgTypes, + }.Build() + File_accounting_grpc_types_proto = out.File + file_accounting_grpc_types_proto_rawDesc = nil + file_accounting_grpc_types_proto_goTypes = nil + file_accounting_grpc_types_proto_depIdxs = nil +} diff --git a/api/acl/encoding.go b/api/acl/encoding.go new file mode 100644 index 00000000..cfda4154 --- /dev/null +++ b/api/acl/encoding.go @@ -0,0 +1,195 @@ +package acl + +import ( + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" +) + +const ( + _ = iota + fieldEACLVersion + fieldEACLContainer + fieldEACLRecords +) + +func (x *EACLTable) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldEACLVersion, x.Version) + + proto.SizeNested(fieldEACLContainer, x.ContainerId) + for i := range x.Records { + sz += proto.SizeNested(fieldEACLRecords, x.Records[i]) + } + } + return sz +} + +func (x *EACLTable) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldEACLVersion, x.Version) + off += proto.MarshalNested(b[off:], fieldEACLContainer, x.ContainerId) + for i := range x.Records { + off += proto.MarshalNested(b[off:], fieldEACLRecords, x.Records[i]) + } + } +} + +const ( + _ = iota + fieldEACLOp + fieldEACLAction + fieldEACLFilters + fieldEACLTargets +) + +func (x *EACLRecord) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldEACLOp, int32(x.Operation)) + + proto.SizeVarint(fieldEACLAction, int32(x.Action)) + for i := range x.Filters { + sz += proto.SizeNested(fieldEACLFilters, x.Filters[i]) + } + for i := range x.Targets { + sz += proto.SizeNested(fieldEACLTargets, x.Targets[i]) + } + } + return sz +} + +func (x *EACLRecord) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldEACLOp, int32(x.Operation)) + off += proto.MarshalVarint(b[off:], fieldEACLAction, int32(x.Action)) + for i := range x.Filters { + off += proto.MarshalNested(b[off:], fieldEACLFilters, x.Filters[i]) + } + for i := range x.Targets { + off += proto.MarshalNested(b[off:], fieldEACLTargets, x.Targets[i]) + } + } +} + +const ( + _ = iota + fieldEACLHeader + fieldEACLMatcher + fieldEACLKey + fieldEACLValue +) + +func (x *EACLRecord_Filter) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldEACLHeader, int32(x.HeaderType)) + + proto.SizeVarint(fieldEACLMatcher, int32(x.MatchType)) + + proto.SizeBytes(fieldEACLKey, x.Key) + + proto.SizeBytes(fieldEACLValue, x.Value) + } + return sz +} + +func (x *EACLRecord_Filter) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldEACLHeader, int32(x.HeaderType)) + off += proto.MarshalVarint(b[off:], fieldEACLMatcher, int32(x.MatchType)) + off += proto.MarshalBytes(b[off:], fieldEACLKey, x.Key) + proto.MarshalBytes(b[off:], fieldEACLValue, x.Value) + } +} + +const ( + _ = iota + fieldEACLRole + fieldEACLTargetKeys +) + +func (x *EACLRecord_Target) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldEACLRole, int32(x.Role)) + + proto.SizeRepeatedBytes(fieldEACLTargetKeys, x.Keys) + } + return sz +} + +func (x *EACLRecord_Target) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldEACLRole, int32(x.Role)) + proto.MarshalRepeatedBytes(b[off:], fieldEACLTargetKeys, x.Keys) + } +} + +const ( + _ = iota + fieldBearerExp + fieldBearerNbf + fieldBearerIat +) + +func (x *BearerToken_Body_TokenLifetime) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldBearerExp, x.Exp) + + proto.SizeVarint(fieldBearerNbf, x.Nbf) + + proto.SizeVarint(fieldBearerIat, x.Iat) + } + return sz +} + +func (x *BearerToken_Body_TokenLifetime) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldBearerExp, x.Exp) + off += proto.MarshalVarint(b[off:], fieldBearerNbf, x.Nbf) + proto.MarshalVarint(b[off:], fieldBearerIat, x.Iat) + } +} + +const ( + _ = iota + fieldBearerEACL + fieldBearerOwner + fieldBearerLifetime + fieldBearerIssuer +) + +func (x *BearerToken_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldBearerEACL, x.EaclTable) + + proto.SizeNested(fieldBearerOwner, x.OwnerId) + + proto.SizeNested(fieldBearerLifetime, x.Lifetime) + + proto.SizeNested(fieldBearerIssuer, x.Issuer) + } + return sz +} + +func (x *BearerToken_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldBearerEACL, x.EaclTable) + off += proto.MarshalNested(b[off:], fieldBearerOwner, x.OwnerId) + off += proto.MarshalNested(b[off:], fieldBearerLifetime, x.Lifetime) + proto.MarshalNested(b[off:], fieldBearerIssuer, x.Issuer) + } +} + +const ( + _ = iota + fieldBearerBody + fieldBearerSignature +) + +func (x *BearerToken) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldBearerBody, x.Body) + + proto.SizeNested(fieldBearerSignature, x.Signature) + } + return sz +} + +func (x *BearerToken) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldBearerBody, x.Body) + proto.MarshalNested(b[off:], fieldBearerSignature, x.Signature) + } +} diff --git a/api/acl/encoding_test.go b/api/acl/encoding_test.go new file mode 100644 index 00000000..f69992f8 --- /dev/null +++ b/api/acl/encoding_test.go @@ -0,0 +1,64 @@ +package acl_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/acl" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestBearerToken(t *testing.T) { + v := &acl.BearerToken{ + Body: &acl.BearerToken_Body{ + EaclTable: &acl.EACLTable{ + Version: &refs.Version{Major: 123, Minor: 456}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + Records: []*acl.EACLRecord{ + { + Operation: 1, Action: 2, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 3, MatchType: 4, Key: "key1", Value: "val1"}, + {HeaderType: 5, MatchType: 6, Key: "key2", Value: "val2"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 7, Keys: [][]byte{{0}, {1}}}, + {Role: 8, Keys: [][]byte{{2}, {3}}}, + }, + }, + { + Operation: 9, Action: 10, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 11, MatchType: 12, Key: "key3", Value: "val3"}, + {HeaderType: 13, MatchType: 14, Key: "key4", Value: "val4"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 15, Keys: [][]byte{{4}, {5}}}, + {Role: 16, Keys: [][]byte{{6}, {7}}}, + }, + }, + }, + }, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &acl.BearerToken_Body_TokenLifetime{Exp: 17, Nbf: 18, Iat: 19}, + Issuer: &refs.OwnerID{Value: []byte("any_issuer")}, + }, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 100, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res acl.BearerToken + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Body, res.Body) + require.Equal(t, v.Signature, res.Signature) +} diff --git a/api/acl/types.pb.go b/api/acl/types.pb.go new file mode 100644 index 00000000..6459a9a9 --- /dev/null +++ b/api/acl/types.pb.go @@ -0,0 +1,1155 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: acl/grpc/types.proto + +package acl + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Target role of the access control rule in access control list. +type Role int32 + +const ( + // Unspecified role, default value + Role_ROLE_UNSPECIFIED Role = 0 + // User target rule is applied if sender is the owner of the container + Role_USER Role = 1 + // System target rule is applied if sender is a storage node within the + // container or an inner ring node + Role_SYSTEM Role = 2 + // Others target rule is applied if sender is neither a user nor a system target + Role_OTHERS Role = 3 +) + +// Enum value maps for Role. +var ( + Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "USER", + 2: "SYSTEM", + 3: "OTHERS", + } + Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "USER": 1, + "SYSTEM": 2, + "OTHERS": 3, + } +) + +func (x Role) Enum() *Role { + p := new(Role) + *p = x + return p +} + +func (x Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Role) Descriptor() protoreflect.EnumDescriptor { + return file_acl_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Role) Type() protoreflect.EnumType { + return &file_acl_grpc_types_proto_enumTypes[0] +} + +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Role.Descriptor instead. +func (Role) EnumDescriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// MatchType is an enumeration of match types. +type MatchType int32 + +const ( + // Unspecified match type, default value. + MatchType_MATCH_TYPE_UNSPECIFIED MatchType = 0 + // Return true if strings are equal + MatchType_STRING_EQUAL MatchType = 1 + // Return true if strings are different + MatchType_STRING_NOT_EQUAL MatchType = 2 + // Absence of attribute + MatchType_NOT_PRESENT MatchType = 3 + // Numeric 'greater than' + MatchType_NUM_GT MatchType = 4 + // Numeric 'greater or equal than' + MatchType_NUM_GE MatchType = 5 + // Numeric 'less than' + MatchType_NUM_LT MatchType = 6 + // Numeric 'less or equal than' + MatchType_NUM_LE MatchType = 7 +) + +// Enum value maps for MatchType. +var ( + MatchType_name = map[int32]string{ + 0: "MATCH_TYPE_UNSPECIFIED", + 1: "STRING_EQUAL", + 2: "STRING_NOT_EQUAL", + 3: "NOT_PRESENT", + 4: "NUM_GT", + 5: "NUM_GE", + 6: "NUM_LT", + 7: "NUM_LE", + } + MatchType_value = map[string]int32{ + "MATCH_TYPE_UNSPECIFIED": 0, + "STRING_EQUAL": 1, + "STRING_NOT_EQUAL": 2, + "NOT_PRESENT": 3, + "NUM_GT": 4, + "NUM_GE": 5, + "NUM_LT": 6, + "NUM_LE": 7, + } +) + +func (x MatchType) Enum() *MatchType { + p := new(MatchType) + *p = x + return p +} + +func (x MatchType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MatchType) Descriptor() protoreflect.EnumDescriptor { + return file_acl_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_acl_grpc_types_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MatchType.Descriptor instead. +func (MatchType) EnumDescriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{1} +} + +// Request's operation type to match if the rule is applicable to a particular +// request. +type Operation int32 + +const ( + // Unspecified operation, default value + Operation_OPERATION_UNSPECIFIED Operation = 0 + // Get + Operation_GET Operation = 1 + // Head + Operation_HEAD Operation = 2 + // Put + Operation_PUT Operation = 3 + // Delete + Operation_DELETE Operation = 4 + // Search + Operation_SEARCH Operation = 5 + // GetRange + Operation_GETRANGE Operation = 6 + // GetRangeHash + Operation_GETRANGEHASH Operation = 7 +) + +// Enum value maps for Operation. +var ( + Operation_name = map[int32]string{ + 0: "OPERATION_UNSPECIFIED", + 1: "GET", + 2: "HEAD", + 3: "PUT", + 4: "DELETE", + 5: "SEARCH", + 6: "GETRANGE", + 7: "GETRANGEHASH", + } + Operation_value = map[string]int32{ + "OPERATION_UNSPECIFIED": 0, + "GET": 1, + "HEAD": 2, + "PUT": 3, + "DELETE": 4, + "SEARCH": 5, + "GETRANGE": 6, + "GETRANGEHASH": 7, + } +) + +func (x Operation) Enum() *Operation { + p := new(Operation) + *p = x + return p +} + +func (x Operation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Operation) Descriptor() protoreflect.EnumDescriptor { + return file_acl_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (Operation) Type() protoreflect.EnumType { + return &file_acl_grpc_types_proto_enumTypes[2] +} + +func (x Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Operation.Descriptor instead. +func (Operation) EnumDescriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{2} +} + +// Rule execution result action. Either allows or denies access if the rule's +// filters match. +type Action int32 + +const ( + // Unspecified action, default value + Action_ACTION_UNSPECIFIED Action = 0 + // Allow action + Action_ALLOW Action = 1 + // Deny action + Action_DENY Action = 2 +) + +// Enum value maps for Action. +var ( + Action_name = map[int32]string{ + 0: "ACTION_UNSPECIFIED", + 1: "ALLOW", + 2: "DENY", + } + Action_value = map[string]int32{ + "ACTION_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2, + } +) + +func (x Action) Enum() *Action { + p := new(Action) + *p = x + return p +} + +func (x Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Action) Descriptor() protoreflect.EnumDescriptor { + return file_acl_grpc_types_proto_enumTypes[3].Descriptor() +} + +func (Action) Type() protoreflect.EnumType { + return &file_acl_grpc_types_proto_enumTypes[3] +} + +func (x Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Action.Descriptor instead. +func (Action) EnumDescriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{3} +} + +// Enumeration of possible sources of Headers to apply filters. +type HeaderType int32 + +const ( + // Unspecified header, default value. + HeaderType_HEADER_UNSPECIFIED HeaderType = 0 + // Filter request headers + HeaderType_REQUEST HeaderType = 1 + // Filter object headers + HeaderType_OBJECT HeaderType = 2 + // Filter service headers. These are not processed by NeoFS nodes and + // exist for service use only. + HeaderType_SERVICE HeaderType = 3 +) + +// Enum value maps for HeaderType. +var ( + HeaderType_name = map[int32]string{ + 0: "HEADER_UNSPECIFIED", + 1: "REQUEST", + 2: "OBJECT", + 3: "SERVICE", + } + HeaderType_value = map[string]int32{ + "HEADER_UNSPECIFIED": 0, + "REQUEST": 1, + "OBJECT": 2, + "SERVICE": 3, + } +) + +func (x HeaderType) Enum() *HeaderType { + p := new(HeaderType) + *p = x + return p +} + +func (x HeaderType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HeaderType) Descriptor() protoreflect.EnumDescriptor { + return file_acl_grpc_types_proto_enumTypes[4].Descriptor() +} + +func (HeaderType) Type() protoreflect.EnumType { + return &file_acl_grpc_types_proto_enumTypes[4] +} + +func (x HeaderType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HeaderType.Descriptor instead. +func (HeaderType) EnumDescriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{4} +} + +// Describes a single eACL rule. +type EACLRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // NeoFS request Verb to match + Operation Operation `protobuf:"varint,1,opt,name=operation,proto3,enum=neo.fs.v2.acl.Operation" json:"operation,omitempty"` + // Rule execution result. Either allows or denies access if filters match. + Action Action `protobuf:"varint,2,opt,name=action,proto3,enum=neo.fs.v2.acl.Action" json:"action,omitempty"` + // List of filters to match and see if rule is applicable + Filters []*EACLRecord_Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` + // List of target subjects to apply ACL rule to + Targets []*EACLRecord_Target `protobuf:"bytes,4,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *EACLRecord) Reset() { + *x = EACLRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EACLRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EACLRecord) ProtoMessage() {} + +func (x *EACLRecord) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EACLRecord.ProtoReflect.Descriptor instead. +func (*EACLRecord) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *EACLRecord) GetOperation() Operation { + if x != nil { + return x.Operation + } + return Operation_OPERATION_UNSPECIFIED +} + +func (x *EACLRecord) GetAction() Action { + if x != nil { + return x.Action + } + return Action_ACTION_UNSPECIFIED +} + +func (x *EACLRecord) GetFilters() []*EACLRecord_Filter { + if x != nil { + return x.Filters + } + return nil +} + +func (x *EACLRecord) GetTargets() []*EACLRecord_Target { + if x != nil { + return x.Targets + } + return nil +} + +// Extended ACL rules table. A list of ACL rules defined additionally to Basic +// ACL. Extended ACL rules can be attached to a container and can be updated +// or may be defined in `BearerToken` structure. Please see the corresponding +// NeoFS Technical Specification section for detailed description. +type EACLTable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // eACL format version. Effectively, the version of API library used to create + // eACL Table. + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Identifier of the container that should use given access control rules + ContainerId *refs.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` + // List of Extended ACL rules + Records []*EACLRecord `protobuf:"bytes,3,rep,name=records,proto3" json:"records,omitempty"` +} + +func (x *EACLTable) Reset() { + *x = EACLTable{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EACLTable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EACLTable) ProtoMessage() {} + +func (x *EACLTable) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EACLTable.ProtoReflect.Descriptor instead. +func (*EACLTable) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (x *EACLTable) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *EACLTable) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *EACLTable) GetRecords() []*EACLRecord { + if x != nil { + return x.Records + } + return nil +} + +// BearerToken allows to attach signed Extended ACL rules to the request in +// `RequestMetaHeader`. If container's Basic ACL rules allow, the attached rule +// set will be checked instead of one attached to the container itself. Just +// like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be +// used in the similar use cases, like providing authorisation to externally +// authenticated party. +// +// BearerToken can be issued only by the container's owner and must be signed using +// the key associated with the container's `OwnerID`. +type BearerToken struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Bearer Token body + Body *BearerToken_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Signature of BearerToken body + Signature *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *BearerToken) Reset() { + *x = BearerToken{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BearerToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BearerToken) ProtoMessage() {} + +func (x *BearerToken) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BearerToken.ProtoReflect.Descriptor instead. +func (*BearerToken) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{2} +} + +func (x *BearerToken) GetBody() *BearerToken_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *BearerToken) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +// Filter to check particular properties of the request or the object. +// +// The `value` field must be empty if `match_type` is an unary operator +// (e.g. `NOT_PRESENT`). If `match_type` field is numeric (e.g. `NUM_GT`), +// the `value` field must be a base-10 integer. +// +// By default `key` field refers to the corresponding object's `Attribute`. +// Some Object's header fields can also be accessed by adding `$Object:` +// prefix to the name. For such attributes, field 'match_type' must not be +// 'NOT_PRESENT'. Here is the list of fields available via this prefix: +// +// - $Object:version \ +// version +// - $Object:objectID \ +// object_id +// - $Object:containerID \ +// container_id +// - $Object:ownerID \ +// owner_id +// - $Object:creationEpoch \ +// creation_epoch +// - $Object:payloadLength \ +// payload_length +// - $Object:payloadHash \ +// payload_hash +// - $Object:objectType \ +// object_type +// - $Object:homomorphicHash \ +// homomorphic_hash +// +// Numeric `match_type` field can only be used with `$Object:creationEpoch` +// and `$Object:payloadLength` system attributes. +// +// Please note, that if request or response does not have object's headers of +// full object (Range, RangeHash, Search, Delete), it will not be possible to +// filter by object header fields or user attributes. From the well-known list +// only `$Object:objectID` and `$Object:containerID` will be available, as +// it's possible to take that information from the requested address. +type EACLRecord_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Define if Object or Request header will be used + HeaderType HeaderType `protobuf:"varint,1,opt,name=header_type,json=headerType,proto3,enum=neo.fs.v2.acl.HeaderType" json:"header_type,omitempty"` + // Match operation type + MatchType MatchType `protobuf:"varint,2,opt,name=match_type,json=matchType,proto3,enum=neo.fs.v2.acl.MatchType" json:"match_type,omitempty"` + // Name of the Header to use + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + // Expected Header Value or pattern to match + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EACLRecord_Filter) Reset() { + *x = EACLRecord_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EACLRecord_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EACLRecord_Filter) ProtoMessage() {} + +func (x *EACLRecord_Filter) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EACLRecord_Filter.ProtoReflect.Descriptor instead. +func (*EACLRecord_Filter) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *EACLRecord_Filter) GetHeaderType() HeaderType { + if x != nil { + return x.HeaderType + } + return HeaderType_HEADER_UNSPECIFIED +} + +func (x *EACLRecord_Filter) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *EACLRecord_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EACLRecord_Filter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Target to apply ACL rule. Can be a subject's role class or a list of public +// keys to match. +type EACLRecord_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Target subject's role class + Role Role `protobuf:"varint,1,opt,name=role,proto3,enum=neo.fs.v2.acl.Role" json:"role,omitempty"` + // List of public keys to identify target subject + Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *EACLRecord_Target) Reset() { + *x = EACLRecord_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EACLRecord_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EACLRecord_Target) ProtoMessage() {} + +func (x *EACLRecord_Target) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EACLRecord_Target.ProtoReflect.Descriptor instead. +func (*EACLRecord_Target) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *EACLRecord_Target) GetRole() Role { + if x != nil { + return x.Role + } + return Role_ROLE_UNSPECIFIED +} + +func (x *EACLRecord_Target) GetKeys() [][]byte { + if x != nil { + return x.Keys + } + return nil +} + +// Bearer Token body structure contains Extended ACL table issued by the container +// owner with additional information preventing token abuse. +type BearerToken_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Table of Extended ACL rules to use instead of the ones attached to the + // container. If it contains `container_id` field, bearer token is only + // valid for this specific container. Otherwise, any container of the same owner + // is allowed. + EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable,proto3" json:"eacl_table,omitempty"` + // `OwnerID` defines to whom the token was issued. It must match the request + // originator's `OwnerID`. If empty, any token bearer will be accepted. + OwnerId *refs.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` + // Token expiration and valid time period parameters + Lifetime *BearerToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"` + // Token issuer's user ID in NeoFS. It must equal to the related + // container's owner. + Issuer *refs.OwnerID `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` +} + +func (x *BearerToken_Body) Reset() { + *x = BearerToken_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BearerToken_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BearerToken_Body) ProtoMessage() {} + +func (x *BearerToken_Body) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BearerToken_Body.ProtoReflect.Descriptor instead. +func (*BearerToken_Body) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *BearerToken_Body) GetEaclTable() *EACLTable { + if x != nil { + return x.EaclTable + } + return nil +} + +func (x *BearerToken_Body) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *BearerToken_Body) GetLifetime() *BearerToken_Body_TokenLifetime { + if x != nil { + return x.Lifetime + } + return nil +} + +func (x *BearerToken_Body) GetIssuer() *refs.OwnerID { + if x != nil { + return x.Issuer + } + return nil +} + +// Lifetime parameters of the token. Field names taken from +// [rfc7519](https://tools.ietf.org/html/rfc7519). +type BearerToken_Body_TokenLifetime struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *BearerToken_Body_TokenLifetime) Reset() { + *x = BearerToken_Body_TokenLifetime{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BearerToken_Body_TokenLifetime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BearerToken_Body_TokenLifetime) ProtoMessage() {} + +func (x *BearerToken_Body_TokenLifetime) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BearerToken_Body_TokenLifetime.ProtoReflect.Descriptor instead. +func (*BearerToken_Body_TokenLifetime) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{2, 0, 0} +} + +func (x *BearerToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil { + return x.Nbf + } + return 0 +} + +func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil { + return x.Iat + } + return 0 +} + +var File_acl_grpc_types_proto protoreflect.FileDescriptor + +var file_acl_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x03, 0x0a, + 0x0a, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x63, 0x6c, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3a, + 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, + 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0xa5, 0x01, 0x0a, 0x06, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x1a, 0x45, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x45, 0x41, + 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, + 0xb4, 0x03, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xb6, 0x02, + 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x0a, 0x65, 0x61, 0x63, 0x6c, 0x5f, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x09, 0x65, 0x61, 0x63, 0x6c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x49, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2f, + 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x1a, + 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, + 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, 0x2a, 0x3e, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, + 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x54, + 0x48, 0x45, 0x52, 0x53, 0x10, 0x03, 0x2a, 0x90, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, + 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, + 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, + 0x5f, 0x47, 0x54, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x5f, 0x47, 0x45, 0x10, + 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x5f, 0x4c, 0x54, 0x10, 0x06, 0x12, 0x0a, 0x0a, + 0x06, 0x4e, 0x55, 0x4d, 0x5f, 0x4c, 0x45, 0x10, 0x07, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, + 0x41, 0x44, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, + 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, + 0x52, 0x43, 0x48, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, + 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, + 0x41, 0x53, 0x48, 0x10, 0x07, 0x2a, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0a, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x48, 0x45, + 0x41, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, + 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x42, 0x4d, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, + 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, + 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x6c, 0xaa, 0x02, 0x17, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_acl_grpc_types_proto_rawDescOnce sync.Once + file_acl_grpc_types_proto_rawDescData = file_acl_grpc_types_proto_rawDesc +) + +func file_acl_grpc_types_proto_rawDescGZIP() []byte { + file_acl_grpc_types_proto_rawDescOnce.Do(func() { + file_acl_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_acl_grpc_types_proto_rawDescData) + }) + return file_acl_grpc_types_proto_rawDescData +} + +var file_acl_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_acl_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_acl_grpc_types_proto_goTypes = []interface{}{ + (Role)(0), // 0: neo.fs.v2.acl.Role + (MatchType)(0), // 1: neo.fs.v2.acl.MatchType + (Operation)(0), // 2: neo.fs.v2.acl.Operation + (Action)(0), // 3: neo.fs.v2.acl.Action + (HeaderType)(0), // 4: neo.fs.v2.acl.HeaderType + (*EACLRecord)(nil), // 5: neo.fs.v2.acl.EACLRecord + (*EACLTable)(nil), // 6: neo.fs.v2.acl.EACLTable + (*BearerToken)(nil), // 7: neo.fs.v2.acl.BearerToken + (*EACLRecord_Filter)(nil), // 8: neo.fs.v2.acl.EACLRecord.Filter + (*EACLRecord_Target)(nil), // 9: neo.fs.v2.acl.EACLRecord.Target + (*BearerToken_Body)(nil), // 10: neo.fs.v2.acl.BearerToken.Body + (*BearerToken_Body_TokenLifetime)(nil), // 11: neo.fs.v2.acl.BearerToken.Body.TokenLifetime + (*refs.Version)(nil), // 12: neo.fs.v2.refs.Version + (*refs.ContainerID)(nil), // 13: neo.fs.v2.refs.ContainerID + (*refs.Signature)(nil), // 14: neo.fs.v2.refs.Signature + (*refs.OwnerID)(nil), // 15: neo.fs.v2.refs.OwnerID +} +var file_acl_grpc_types_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.acl.EACLRecord.operation:type_name -> neo.fs.v2.acl.Operation + 3, // 1: neo.fs.v2.acl.EACLRecord.action:type_name -> neo.fs.v2.acl.Action + 8, // 2: neo.fs.v2.acl.EACLRecord.filters:type_name -> neo.fs.v2.acl.EACLRecord.Filter + 9, // 3: neo.fs.v2.acl.EACLRecord.targets:type_name -> neo.fs.v2.acl.EACLRecord.Target + 12, // 4: neo.fs.v2.acl.EACLTable.version:type_name -> neo.fs.v2.refs.Version + 13, // 5: neo.fs.v2.acl.EACLTable.container_id:type_name -> neo.fs.v2.refs.ContainerID + 5, // 6: neo.fs.v2.acl.EACLTable.records:type_name -> neo.fs.v2.acl.EACLRecord + 10, // 7: neo.fs.v2.acl.BearerToken.body:type_name -> neo.fs.v2.acl.BearerToken.Body + 14, // 8: neo.fs.v2.acl.BearerToken.signature:type_name -> neo.fs.v2.refs.Signature + 4, // 9: neo.fs.v2.acl.EACLRecord.Filter.header_type:type_name -> neo.fs.v2.acl.HeaderType + 1, // 10: neo.fs.v2.acl.EACLRecord.Filter.match_type:type_name -> neo.fs.v2.acl.MatchType + 0, // 11: neo.fs.v2.acl.EACLRecord.Target.role:type_name -> neo.fs.v2.acl.Role + 6, // 12: neo.fs.v2.acl.BearerToken.Body.eacl_table:type_name -> neo.fs.v2.acl.EACLTable + 15, // 13: neo.fs.v2.acl.BearerToken.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 11, // 14: neo.fs.v2.acl.BearerToken.Body.lifetime:type_name -> neo.fs.v2.acl.BearerToken.Body.TokenLifetime + 15, // 15: neo.fs.v2.acl.BearerToken.Body.issuer:type_name -> neo.fs.v2.refs.OwnerID + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name +} + +func init() { file_acl_grpc_types_proto_init() } +func file_acl_grpc_types_proto_init() { + if File_acl_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_acl_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EACLRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_acl_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EACLTable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_acl_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BearerToken); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_acl_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EACLRecord_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_acl_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EACLRecord_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_acl_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BearerToken_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_acl_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BearerToken_Body_TokenLifetime); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_acl_grpc_types_proto_rawDesc, + NumEnums: 5, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_acl_grpc_types_proto_goTypes, + DependencyIndexes: file_acl_grpc_types_proto_depIdxs, + EnumInfos: file_acl_grpc_types_proto_enumTypes, + MessageInfos: file_acl_grpc_types_proto_msgTypes, + }.Build() + File_acl_grpc_types_proto = out.File + file_acl_grpc_types_proto_rawDesc = nil + file_acl_grpc_types_proto_goTypes = nil + file_acl_grpc_types_proto_depIdxs = nil +} diff --git a/api/audit/types.pb.go b/api/audit/types.pb.go new file mode 100644 index 00000000..754764a0 --- /dev/null +++ b/api/audit/types.pb.go @@ -0,0 +1,312 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: audit/grpc/types.proto + +package audit + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// DataAuditResult keeps record of conducted Data Audits. The detailed report is +// generated separately. +type DataAuditResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Data Audit Result format version. Effectively, the version of API library + // used to report DataAuditResult structure. + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Epoch number when the Data Audit was conducted + AuditEpoch uint64 `protobuf:"fixed64,2,opt,name=audit_epoch,json=auditEpoch,proto3" json:"audit_epoch,omitempty"` + // Container under audit + ContainerId *refs.ContainerID `protobuf:"bytes,3,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` + // Public key of the auditing InnerRing node in a binary format + PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // Shows if Data Audit process was complete in time or if it was cancelled + Complete bool `protobuf:"varint,5,opt,name=complete,proto3" json:"complete,omitempty"` + // Number of request done at PoR stage + Requests uint32 `protobuf:"varint,6,opt,name=requests,proto3" json:"requests,omitempty"` + // Number of retries done at PoR stage + Retries uint32 `protobuf:"varint,7,opt,name=retries,proto3" json:"retries,omitempty"` + // List of Storage Groups that passed audit PoR stage + PassSg []*refs.ObjectID `protobuf:"bytes,8,rep,name=pass_sg,json=passSG,proto3" json:"pass_sg,omitempty"` + // List of Storage Groups that failed audit PoR stage + FailSg []*refs.ObjectID `protobuf:"bytes,9,rep,name=fail_sg,json=failSG,proto3" json:"fail_sg,omitempty"` + // Number of sampled objects under the audit placed in an optimal way according to + // the containers placement policy when checking PoP + Hit uint32 `protobuf:"varint,10,opt,name=hit,proto3" json:"hit,omitempty"` + // Number of sampled objects under the audit placed in suboptimal way according to + // the containers placement policy, but still at a satisfactory level when + // checking PoP + Miss uint32 `protobuf:"varint,11,opt,name=miss,proto3" json:"miss,omitempty"` + // Number of sampled objects under the audit stored inconsistently with the + // placement policy or not found at all when checking PoP + Fail uint32 `protobuf:"varint,12,opt,name=fail,proto3" json:"fail,omitempty"` + // List of storage node public keys that passed at least one PDP + PassNodes [][]byte `protobuf:"bytes,13,rep,name=pass_nodes,json=passNodes,proto3" json:"pass_nodes,omitempty"` + // List of storage node public keys that failed at least one PDP + FailNodes [][]byte `protobuf:"bytes,14,rep,name=fail_nodes,json=failNodes,proto3" json:"fail_nodes,omitempty"` +} + +func (x *DataAuditResult) Reset() { + *x = DataAuditResult{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataAuditResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataAuditResult) ProtoMessage() {} + +func (x *DataAuditResult) ProtoReflect() protoreflect.Message { + mi := &file_audit_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataAuditResult.ProtoReflect.Descriptor instead. +func (*DataAuditResult) Descriptor() ([]byte, []int) { + return file_audit_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *DataAuditResult) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *DataAuditResult) GetAuditEpoch() uint64 { + if x != nil { + return x.AuditEpoch + } + return 0 +} + +func (x *DataAuditResult) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *DataAuditResult) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *DataAuditResult) GetComplete() bool { + if x != nil { + return x.Complete + } + return false +} + +func (x *DataAuditResult) GetRequests() uint32 { + if x != nil { + return x.Requests + } + return 0 +} + +func (x *DataAuditResult) GetRetries() uint32 { + if x != nil { + return x.Retries + } + return 0 +} + +func (x *DataAuditResult) GetPassSg() []*refs.ObjectID { + if x != nil { + return x.PassSg + } + return nil +} + +func (x *DataAuditResult) GetFailSg() []*refs.ObjectID { + if x != nil { + return x.FailSg + } + return nil +} + +func (x *DataAuditResult) GetHit() uint32 { + if x != nil { + return x.Hit + } + return 0 +} + +func (x *DataAuditResult) GetMiss() uint32 { + if x != nil { + return x.Miss + } + return 0 +} + +func (x *DataAuditResult) GetFail() uint32 { + if x != nil { + return x.Fail + } + return 0 +} + +func (x *DataAuditResult) GetPassNodes() [][]byte { + if x != nil { + return x.PassNodes + } + return nil +} + +func (x *DataAuditResult) GetFailNodes() [][]byte { + if x != nil { + return x.FailNodes + } + return nil +} + +var File_audit_grpc_types_proto protoreflect.FileDescriptor + +var file_audit_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xf4, 0x03, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x41, 0x75, 0x64, 0x69, 0x74, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0a, 0x61, 0x75, + 0x64, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x70, 0x61, 0x73, + 0x73, 0x5f, 0x73, 0x67, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x53, 0x47, 0x12, 0x31, 0x0a, 0x07, + 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x73, 0x67, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x53, 0x47, 0x12, + 0x10, 0x0a, 0x03, 0x68, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x68, 0x69, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x69, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x04, 0x6d, 0x69, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x73, + 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x70, + 0x61, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c, + 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x61, + 0x69, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x53, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, + 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, + 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, + 0xaa, 0x02, 0x19, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_audit_grpc_types_proto_rawDescOnce sync.Once + file_audit_grpc_types_proto_rawDescData = file_audit_grpc_types_proto_rawDesc +) + +func file_audit_grpc_types_proto_rawDescGZIP() []byte { + file_audit_grpc_types_proto_rawDescOnce.Do(func() { + file_audit_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_audit_grpc_types_proto_rawDescData) + }) + return file_audit_grpc_types_proto_rawDescData +} + +var file_audit_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_audit_grpc_types_proto_goTypes = []interface{}{ + (*DataAuditResult)(nil), // 0: neo.fs.v2.audit.DataAuditResult + (*refs.Version)(nil), // 1: neo.fs.v2.refs.Version + (*refs.ContainerID)(nil), // 2: neo.fs.v2.refs.ContainerID + (*refs.ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID +} +var file_audit_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.audit.DataAuditResult.version:type_name -> neo.fs.v2.refs.Version + 2, // 1: neo.fs.v2.audit.DataAuditResult.container_id:type_name -> neo.fs.v2.refs.ContainerID + 3, // 2: neo.fs.v2.audit.DataAuditResult.pass_sg:type_name -> neo.fs.v2.refs.ObjectID + 3, // 3: neo.fs.v2.audit.DataAuditResult.fail_sg:type_name -> neo.fs.v2.refs.ObjectID + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_audit_grpc_types_proto_init() } +func file_audit_grpc_types_proto_init() { + if File_audit_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_audit_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataAuditResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_audit_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_audit_grpc_types_proto_goTypes, + DependencyIndexes: file_audit_grpc_types_proto_depIdxs, + MessageInfos: file_audit_grpc_types_proto_msgTypes, + }.Build() + File_audit_grpc_types_proto = out.File + file_audit_grpc_types_proto_rawDesc = nil + file_audit_grpc_types_proto_goTypes = nil + file_audit_grpc_types_proto_depIdxs = nil +} diff --git a/api/container/encoding.go b/api/container/encoding.go new file mode 100644 index 00000000..763212ec --- /dev/null +++ b/api/container/encoding.go @@ -0,0 +1,337 @@ +package container + +import "github.com/nspcc-dev/neofs-sdk-go/internal/proto" + +const ( + _ = iota + fieldContainerAttrKey + fieldContainerAttrVal +) + +func (x *Container_Attribute) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldContainerAttrKey, x.Key) + + proto.SizeBytes(fieldContainerAttrVal, x.Value) + } + return sz +} + +func (x *Container_Attribute) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldContainerAttrKey, x.Key) + proto.MarshalBytes(b[off:], fieldContainerAttrVal, x.Value) + } +} + +const ( + _ = iota + fieldContainerVersion + fieldContainerOwner + fieldContainerNonce + fieldContainerBasicACL + fieldContainerAttributes + fieldContainerPolicy +) + +func (x *Container) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldContainerVersion, x.Version) + + proto.SizeNested(fieldContainerOwner, x.OwnerId) + + proto.SizeBytes(fieldContainerNonce, x.Nonce) + + proto.SizeVarint(fieldContainerBasicACL, x.BasicAcl) + + proto.SizeNested(fieldContainerPolicy, x.PlacementPolicy) + for i := range x.Attributes { + sz += proto.SizeNested(fieldContainerAttributes, x.Attributes[i]) + } + } + return sz +} + +func (x *Container) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldContainerVersion, x.Version) + off += proto.MarshalNested(b[off:], fieldContainerOwner, x.OwnerId) + off += proto.MarshalBytes(b[off:], fieldContainerNonce, x.Nonce) + off += proto.MarshalVarint(b[off:], fieldContainerBasicACL, x.BasicAcl) + for i := range x.Attributes { + off += proto.MarshalNested(b[off:], fieldContainerAttributes, x.Attributes[i]) + } + proto.MarshalNested(b[off:], fieldContainerPolicy, x.PlacementPolicy) + } +} + +const ( + _ = iota + fieldPutReqContainer + fieldPutReqSignature +) + +func (x *PutRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldPutReqContainer, x.Container) + + proto.SizeNested(fieldPutReqSignature, x.Signature) + } + return sz +} + +func (x *PutRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldPutReqContainer, x.Container) + proto.MarshalNested(b[off:], fieldPutReqSignature, x.Signature) + } +} + +const ( + _ = iota + fieldPutRespID +) + +func (x *PutResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldPutRespID, x.ContainerId) + } + return sz +} + +func (x *PutResponse_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldPutRespID, x.ContainerId) + } +} + +const ( + _ = iota + fieldDeleteReqContainer + fieldDeleteReqSignature +) + +func (x *DeleteRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldDeleteReqContainer, x.ContainerId) + + proto.SizeNested(fieldDeleteReqSignature, x.Signature) + } + return sz +} + +func (x *DeleteRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldDeleteReqContainer, x.ContainerId) + proto.MarshalNested(b[off:], fieldDeleteReqSignature, x.Signature) + } +} + +func (x *DeleteResponse_Body) MarshaledSize() int { return 0 } +func (x *DeleteResponse_Body) MarshalStable([]byte) {} + +const ( + _ = iota + fieldGetReqContainer +) + +func (x *GetRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldGetReqContainer, x.ContainerId) + } + return sz +} + +func (x *GetRequest_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldGetReqContainer, x.ContainerId) + } +} + +const ( + _ = iota + fieldGetRespContainer + fieldGetRespSignature + fieldGetRespSession +) + +func (x *GetResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldGetRespContainer, x.Container) + + proto.SizeNested(fieldGetRespSignature, x.Signature) + + proto.SizeNested(fieldGetRespSession, x.SessionToken) + } + return sz +} + +func (x *GetResponse_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldGetRespContainer, x.Container) + off += proto.MarshalNested(b[off:], fieldGetRespSignature, x.Signature) + proto.MarshalNested(b[off:], fieldGetRespSession, x.SessionToken) + } +} + +const ( + _ = iota + fieldListReqOwner +) + +func (x *ListRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldListReqOwner, x.OwnerId) + } + return sz +} + +func (x *ListRequest_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldListReqOwner, x.OwnerId) + } +} + +const ( + _ = iota + fieldListRespIDs +) + +func (x *ListResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + for i := range x.ContainerIds { + sz += proto.SizeNested(fieldListRespIDs, x.ContainerIds[i]) + } + } + return sz +} + +func (x *ListResponse_Body) MarshalStable(b []byte) { + if x != nil { + var off int + for i := range x.ContainerIds { + off += proto.MarshalNested(b[off:], fieldListRespIDs, x.ContainerIds[i]) + } + } +} + +const ( + _ = iota + fieldSetEACLReqTable + fieldSetEACLReqSignature +) + +func (x *SetExtendedACLRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldSetEACLReqTable, x.Eacl) + + proto.SizeNested(fieldSetEACLReqSignature, x.Signature) + } + return sz +} + +func (x *SetExtendedACLRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldSetEACLReqTable, x.Eacl) + proto.MarshalNested(b[off:], fieldSetEACLReqSignature, x.Signature) + } +} + +func (x *SetExtendedACLResponse_Body) MarshaledSize() int { return 0 } +func (x *SetExtendedACLResponse_Body) MarshalStable([]byte) {} + +const ( + _ = iota + fieldGetEACLReqContainer +) + +func (x *GetExtendedACLRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldGetEACLReqContainer, x.ContainerId) + } + return sz +} + +func (x *GetExtendedACLRequest_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldGetEACLReqContainer, x.ContainerId) + } +} + +const ( + _ = iota + fieldGetEACLRespTable + fieldGetEACLRespSignature + fieldGetEACLRespSession +) + +func (x *GetExtendedACLResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldGetEACLRespTable, x.Eacl) + + proto.SizeNested(fieldGetEACLRespSignature, x.Signature) + + proto.SizeNested(fieldGetEACLRespSession, x.SessionToken) + } + return sz +} + +func (x *GetExtendedACLResponse_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldGetEACLRespTable, x.Eacl) + off += proto.MarshalNested(b[off:], fieldGetEACLRespSignature, x.Signature) + proto.MarshalNested(b[off:], fieldGetEACLRespSession, x.SessionToken) + } +} + +const ( + _ = iota + fieldUsedSpaceEpoch + fieldUsedSpaceContainer + fieldUsedSpaceValue +) + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldUsedSpaceEpoch, x.Epoch) + + proto.SizeNested(fieldUsedSpaceContainer, x.ContainerId) + + proto.SizeVarint(fieldUsedSpaceValue, x.UsedSpace) + } + return sz +} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldUsedSpaceEpoch, x.Epoch) + off += proto.MarshalNested(b[off:], fieldUsedSpaceContainer, x.ContainerId) + proto.MarshalVarint(b[off:], fieldUsedSpaceValue, x.UsedSpace) + } +} + +const ( + _ = iota + fieldAnnounceReqList +) + +func (x *AnnounceUsedSpaceRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + for i := range x.Announcements { + sz += proto.SizeNested(fieldAnnounceReqList, x.Announcements[i]) + } + } + return sz +} + +func (x *AnnounceUsedSpaceRequest_Body) MarshalStable(b []byte) { + if x != nil { + var off int + for i := range x.Announcements { + off += proto.MarshalNested(b[off:], fieldAnnounceReqList, x.Announcements[i]) + } + } +} + +func (x *AnnounceUsedSpaceResponse_Body) MarshaledSize() int { return 0 } +func (x *AnnounceUsedSpaceResponse_Body) MarshalStable([]byte) {} diff --git a/api/container/encoding_test.go b/api/container/encoding_test.go new file mode 100644 index 00000000..aa6a5eab --- /dev/null +++ b/api/container/encoding_test.go @@ -0,0 +1,422 @@ +package container_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/acl" + "github.com/nspcc-dev/neofs-sdk-go/api/container" + "github.com/nspcc-dev/neofs-sdk-go/api/netmap" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestPutRequest_Body(t *testing.T) { + v := &container.PutRequest_Body{ + Container: &container.Container{ + Version: &refs.Version{Major: 1, Minor: 2}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Nonce: []byte("any_nonce"), + BasicAcl: 3, + Attributes: []*container.Container_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + PlacementPolicy: &netmap.PlacementPolicy{ + Replicas: []*netmap.Replica{ + {Count: 4, Selector: "selector1"}, + {Count: 5, Selector: "selector2"}, + }, + ContainerBackupFactor: 6, + Selectors: []*netmap.Selector{ + {Name: "selector3", Count: 7, Clause: 8, Attribute: "attr1", Filter: "filter1"}, + {Name: "selector4", Count: 9, Clause: 10, Attribute: "attr2", Filter: "filter2"}, + }, + Filters: []*netmap.Filter{ + {Name: "filter3", Key: "filter_key1", Op: 11, Value: "filter_val1", Filters: []*netmap.Filter{ + {Name: "filter4", Key: "filter_key2", Op: 12, Value: "filter_val2"}, + {Name: "filter5", Key: "filter_key3", Op: 13, Value: "filter_val3"}, + }}, + {Name: "filter6", Key: "filter_key4", Op: 14, Value: "filter_val4", Filters: []*netmap.Filter{ + {Name: "filter7", Key: "filter_key5", Op: 15, Value: "filter_val5"}, + {Name: "filter8", Key: "filter_key6", Op: 16, Value: "filter_val6"}, + }}, + }, + SubnetId: &refs.SubnetID{Value: 17}, + }, + }, + Signature: &refs.SignatureRFC6979{Key: []byte("any_pubkey"), Sign: []byte("any_signature")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.PutRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Container, res.Container) + require.Equal(t, v.Signature, res.Signature) +} + +func TestPutResponse_Body(t *testing.T) { + v := &container.PutResponse_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.PutResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ContainerId, res.ContainerId) +} + +func TestDeleteRequest_Body(t *testing.T) { + v := &container.DeleteRequest_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + Signature: &refs.SignatureRFC6979{Key: []byte("any_pubkey"), Sign: []byte("any_signature")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.DeleteRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ContainerId, res.ContainerId) + require.Equal(t, v.Signature, res.Signature) +} + +func TestDeleteResponse_Body(t *testing.T) { + var v container.DeleteResponse_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} + +func TestGetRequest_Body(t *testing.T) { + v := &container.GetRequest_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.GetRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ContainerId, res.ContainerId) +} + +func TestGetResponse_Body(t *testing.T) { + v := &container.GetResponse_Body{ + Container: &container.Container{ + Version: &refs.Version{Major: 1, Minor: 2}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Nonce: []byte("any_nonce"), + BasicAcl: 3, + Attributes: []*container.Container_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + PlacementPolicy: &netmap.PlacementPolicy{ + Replicas: []*netmap.Replica{ + {Count: 4, Selector: "selector1"}, + {Count: 5, Selector: "selector2"}, + }, + ContainerBackupFactor: 6, + Selectors: []*netmap.Selector{ + {Name: "selector3", Count: 7, Clause: 8, Attribute: "attr1", Filter: "filter1"}, + {Name: "selector4", Count: 9, Clause: 10, Attribute: "attr2", Filter: "filter2"}, + }, + Filters: []*netmap.Filter{ + {Name: "filter3", Key: "filter_key1", Op: 11, Value: "filter_val1", Filters: []*netmap.Filter{ + {Name: "filter4", Key: "filter_key2", Op: 12, Value: "filter_val2"}, + {Name: "filter5", Key: "filter_key3", Op: 13, Value: "filter_val3"}, + }}, + {Name: "filter6", Key: "filter_key4", Op: 14, Value: "filter_val4", Filters: []*netmap.Filter{ + {Name: "filter7", Key: "filter_key5", Op: 15, Value: "filter_val5"}, + {Name: "filter8", Key: "filter_key6", Op: 16, Value: "filter_val6"}, + }}, + }, + SubnetId: &refs.SubnetID{Value: 17}, + }, + }, + Signature: &refs.SignatureRFC6979{Key: []byte("any_pubkey"), Sign: []byte("any_signature")}, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 18, Nbf: 19, Iat: 20}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 21}, + }, + } + + testWithSessionContext := func(setCtx func(*session.SessionToken_Body)) { + setCtx(v.SessionToken.Body) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.GetResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Container, res.Container) + require.Equal(t, v.Signature, res.Signature) + require.Equal(t, v.SessionToken, res.SessionToken) + } + + testWithSessionContext(func(body *session.SessionToken_Body) { body.Context = nil }) + testWithSessionContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Container{ + Container: &session.ContainerSessionContext{ + Verb: 1, Wildcard: true, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + }, + } + }) + testWithSessionContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Object{ + Object: &session.ObjectSessionContext{ + Verb: 1, + Target: &session.ObjectSessionContext_Target{ + Container: &refs.ContainerID{Value: []byte("any_container")}, + Objects: []*refs.ObjectID{ + {Value: []byte("any_object1")}, + {Value: []byte("any_object2")}, + }, + }, + }, + } + }) +} + +func TestListRequest_Body(t *testing.T) { + v := &container.ListRequest_Body{ + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.ListRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.OwnerId, res.OwnerId) +} + +func TestListResponse_Body(t *testing.T) { + v := &container.ListResponse_Body{ + ContainerIds: []*refs.ContainerID{ + {Value: []byte("any_container1")}, + {Value: []byte("any_container2")}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.ListResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ContainerIds, res.ContainerIds) +} + +func TestSetExtendedACLRequest_Body(t *testing.T) { + v := &container.SetExtendedACLRequest_Body{ + Eacl: &acl.EACLTable{ + Version: &refs.Version{Major: 123, Minor: 456}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + Records: []*acl.EACLRecord{ + { + Operation: 1, Action: 2, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 3, MatchType: 4, Key: "key1", Value: "val1"}, + {HeaderType: 5, MatchType: 6, Key: "key2", Value: "val2"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 7, Keys: [][]byte{{0}, {1}}}, + {Role: 8, Keys: [][]byte{{2}, {3}}}, + }, + }, + { + Operation: 9, Action: 10, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 11, MatchType: 12, Key: "key3", Value: "val3"}, + {HeaderType: 13, MatchType: 14, Key: "key4", Value: "val4"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 15, Keys: [][]byte{{4}, {5}}}, + {Role: 16, Keys: [][]byte{{6}, {7}}}, + }, + }, + }, + }, + Signature: &refs.SignatureRFC6979{Key: []byte("any_pubkey"), Sign: []byte("any_signature")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.SetExtendedACLRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Eacl, res.Eacl) + require.Equal(t, v.Signature, res.Signature) +} + +func TestSetExtendedACLResponse_Body(t *testing.T) { + var v container.SetExtendedACLResponse_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} + +func TestGetExtendedACLRequest_Body(t *testing.T) { + v := &container.GetExtendedACLRequest_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.GetExtendedACLRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ContainerId, res.ContainerId) +} + +func TestGetExtendedACLResponse(t *testing.T) { + v := &container.GetExtendedACLResponse_Body{ + Eacl: &acl.EACLTable{ + Version: &refs.Version{Major: 123, Minor: 456}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + Records: []*acl.EACLRecord{ + { + Operation: 1, Action: 2, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 3, MatchType: 4, Key: "key1", Value: "val1"}, + {HeaderType: 5, MatchType: 6, Key: "key2", Value: "val2"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 7, Keys: [][]byte{{0}, {1}}}, + {Role: 8, Keys: [][]byte{{2}, {3}}}, + }, + }, + { + Operation: 9, Action: 10, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 11, MatchType: 12, Key: "key3", Value: "val3"}, + {HeaderType: 13, MatchType: 14, Key: "key4", Value: "val4"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 15, Keys: [][]byte{{4}, {5}}}, + {Role: 16, Keys: [][]byte{{6}, {7}}}, + }, + }, + }, + }, + Signature: &refs.SignatureRFC6979{Key: []byte("any_pubkey"), Sign: []byte("any_signature")}, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 18, Nbf: 19, Iat: 20}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 21}, + }, + } + + testWithSessionContext := func(setCtx func(*session.SessionToken_Body)) { + setCtx(v.SessionToken.Body) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.GetExtendedACLResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Eacl, res.Eacl) + require.Equal(t, v.Signature, res.Signature) + require.Equal(t, v.SessionToken, res.SessionToken) + } + + testWithSessionContext(func(body *session.SessionToken_Body) { body.Context = nil }) + testWithSessionContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Container{ + Container: &session.ContainerSessionContext{ + Verb: 1, Wildcard: true, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + }, + } + }) + testWithSessionContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Object{ + Object: &session.ObjectSessionContext{ + Verb: 1, + Target: &session.ObjectSessionContext_Target{ + Container: &refs.ContainerID{Value: []byte("any_container")}, + Objects: []*refs.ObjectID{ + {Value: []byte("any_object1")}, + {Value: []byte("any_object2")}, + }, + }, + }, + } + }) +} + +func TestAnnounceUsedSpaceRequest_Body(t *testing.T) { + v := &container.AnnounceUsedSpaceRequest_Body{ + Announcements: []*container.AnnounceUsedSpaceRequest_Body_Announcement{ + {Epoch: 1, ContainerId: &refs.ContainerID{Value: []byte("any_container1")}, UsedSpace: 2}, + {Epoch: 3, ContainerId: &refs.ContainerID{Value: []byte("any_container2")}, UsedSpace: 4}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res container.AnnounceUsedSpaceRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Announcements, res.Announcements) +} + +func TestAnnounceUsedSpaceResponse_Body(t *testing.T) { + var v container.AnnounceUsedSpaceResponse_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} diff --git a/api/container/service.pb.go b/api/container/service.pb.go new file mode 100644 index 00000000..946c5c54 --- /dev/null +++ b/api/container/service.pb.go @@ -0,0 +1,2685 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: container/grpc/service.proto + +package container + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/acl" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// New NeoFS Container creation request +type PutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of container put request message. + Body *PutRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest) ProtoMessage() {} + +func (x *PutRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. +func (*PutRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *PutRequest) GetBody() *PutRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PutRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PutRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// New NeoFS Container creation response +type PutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of container put response message. + Body *PutResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutResponse) ProtoMessage() {} + +func (x *PutResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead. +func (*PutResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *PutResponse) GetBody() *PutResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PutResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PutResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Container removal request +type DeleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of container delete request message. + Body *DeleteRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteRequest) GetBody() *DeleteRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *DeleteRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *DeleteRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// `DeleteResponse` has an empty body because delete operation is asynchronous +// and done via consensus in Inner Ring nodes. +type DeleteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of container delete response message. + Body *DeleteResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteResponse) GetBody() *DeleteResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *DeleteResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *DeleteResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get container structure +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of container get request message. + Body *GetRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{4} +} + +func (x *GetRequest) GetBody() *GetRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get container structure +type GetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of container get response message. + Body *GetResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{5} +} + +func (x *GetResponse) GetBody() *GetResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// List containers +type ListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of list containers request message + Body *ListRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. +func (*ListRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{6} +} + +func (x *ListRequest) GetBody() *ListRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// List containers +type ListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of list containers response message. + Body *ListResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. +func (*ListResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{7} +} + +func (x *ListResponse) GetBody() *ListResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Set Extended ACL +type SetExtendedACLRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of set extended acl request message. + Body *SetExtendedACLRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *SetExtendedACLRequest) Reset() { + *x = SetExtendedACLRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetExtendedACLRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetExtendedACLRequest) ProtoMessage() {} + +func (x *SetExtendedACLRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetExtendedACLRequest.ProtoReflect.Descriptor instead. +func (*SetExtendedACLRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{8} +} + +func (x *SetExtendedACLRequest) GetBody() *SetExtendedACLRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *SetExtendedACLRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *SetExtendedACLRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Set Extended ACL +type SetExtendedACLResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of set extended acl response message. + Body *SetExtendedACLResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *SetExtendedACLResponse) Reset() { + *x = SetExtendedACLResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetExtendedACLResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetExtendedACLResponse) ProtoMessage() {} + +func (x *SetExtendedACLResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetExtendedACLResponse.ProtoReflect.Descriptor instead. +func (*SetExtendedACLResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{9} +} + +func (x *SetExtendedACLResponse) GetBody() *SetExtendedACLResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *SetExtendedACLResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *SetExtendedACLResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get Extended ACL +type GetExtendedACLRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get extended acl request message. + Body *GetExtendedACLRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetExtendedACLRequest) Reset() { + *x = GetExtendedACLRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExtendedACLRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExtendedACLRequest) ProtoMessage() {} + +func (x *GetExtendedACLRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExtendedACLRequest.ProtoReflect.Descriptor instead. +func (*GetExtendedACLRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{10} +} + +func (x *GetExtendedACLRequest) GetBody() *GetExtendedACLRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetExtendedACLRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetExtendedACLRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get Extended ACL +type GetExtendedACLResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get extended acl response message. + Body *GetExtendedACLResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetExtendedACLResponse) Reset() { + *x = GetExtendedACLResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExtendedACLResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExtendedACLResponse) ProtoMessage() {} + +func (x *GetExtendedACLResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExtendedACLResponse.ProtoReflect.Descriptor instead. +func (*GetExtendedACLResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{11} +} + +func (x *GetExtendedACLResponse) GetBody() *GetExtendedACLResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetExtendedACLResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetExtendedACLResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Announce container used space +type AnnounceUsedSpaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of announce used space request message. + Body *AnnounceUsedSpaceRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AnnounceUsedSpaceRequest) Reset() { + *x = AnnounceUsedSpaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceUsedSpaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceUsedSpaceRequest) ProtoMessage() {} + +func (x *AnnounceUsedSpaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceUsedSpaceRequest.ProtoReflect.Descriptor instead. +func (*AnnounceUsedSpaceRequest) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{12} +} + +func (x *AnnounceUsedSpaceRequest) GetBody() *AnnounceUsedSpaceRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AnnounceUsedSpaceRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AnnounceUsedSpaceRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Announce container used space +type AnnounceUsedSpaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of announce used space response message. + Body *AnnounceUsedSpaceResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AnnounceUsedSpaceResponse) Reset() { + *x = AnnounceUsedSpaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceUsedSpaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceUsedSpaceResponse) ProtoMessage() {} + +func (x *AnnounceUsedSpaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceUsedSpaceResponse.ProtoReflect.Descriptor instead. +func (*AnnounceUsedSpaceResponse) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{13} +} + +func (x *AnnounceUsedSpaceResponse) GetBody() *AnnounceUsedSpaceResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AnnounceUsedSpaceResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AnnounceUsedSpaceResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Container creation request has container structure's signature as a +// separate field. It's not stored in sidechain, just verified on container +// creation by `Container` smart contract. `ContainerID` is a SHA256 hash of +// the stable-marshalled container strucutre, hence there is no need for +// additional signature checks. +type PutRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Container structure to register in NeoFS + Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` + // Signature of a stable-marshalled container according to RFC-6979. + Signature *refs.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *PutRequest_Body) Reset() { + *x = PutRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest_Body) ProtoMessage() {} + +func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest_Body.ProtoReflect.Descriptor instead. +func (*PutRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *PutRequest_Body) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +func (x *PutRequest_Body) GetSignature() *refs.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} + +// Container put response body contains information about the newly registered +// container as seen by `Container` smart contract. `ContainerID` can be +// calculated beforehand from the container structure and compared to the one +// returned here to make sure everything has been done as expected. +type PutResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique identifier of the newly created container + ContainerId *refs.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (x *PutResponse_Body) Reset() { + *x = PutResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutResponse_Body) ProtoMessage() {} + +func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutResponse_Body.ProtoReflect.Descriptor instead. +func (*PutResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *PutResponse_Body) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +// Container removal request body has signed `ContainerID` as a proof of +// the container owner's intent. The signature will be verified by `Container` +// smart contract, so signing algorithm must be supported by NeoVM. +type DeleteRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the container to delete from NeoFS + ContainerId *refs.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + // `ContainerID` signed with the container owner's key according to RFC-6979. + Signature *refs.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *DeleteRequest_Body) Reset() { + *x = DeleteRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest_Body) ProtoMessage() {} + +func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest_Body.ProtoReflect.Descriptor instead. +func (*DeleteRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *DeleteRequest_Body) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *DeleteRequest_Body) GetSignature() *refs.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} + +// `DeleteResponse` has an empty body because delete operation is asynchronous +// and done via consensus in Inner Ring nodes. +type DeleteResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteResponse_Body) Reset() { + *x = DeleteResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse_Body) ProtoMessage() {} + +func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse_Body.ProtoReflect.Descriptor instead. +func (*DeleteResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{3, 0} +} + +// Get container structure request body. +type GetRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the container to get + ContainerId *refs.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (x *GetRequest_Body) Reset() { + *x = GetRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest_Body) ProtoMessage() {} + +func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest_Body.ProtoReflect.Descriptor instead. +func (*GetRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *GetRequest_Body) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +// Get container response body does not have container structure signature. It +// has been already verified upon container creation. +type GetResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested container structure + Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` + // Signature of a stable-marshalled container according to RFC-6979. + Signature *refs.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Session token if the container has been created within the session + SessionToken *session.SessionToken `protobuf:"bytes,3,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` +} + +func (x *GetResponse_Body) Reset() { + *x = GetResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse_Body) ProtoMessage() {} + +func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse_Body.ProtoReflect.Descriptor instead. +func (*GetResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *GetResponse_Body) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +func (x *GetResponse_Body) GetSignature() *refs.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} + +func (x *GetResponse_Body) GetSessionToken() *session.SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} + +// List containers request body. +type ListRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the container owner + OwnerId *refs.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` +} + +func (x *ListRequest_Body) Reset() { + *x = ListRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest_Body) ProtoMessage() {} + +func (x *ListRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest_Body.ProtoReflect.Descriptor instead. +func (*ListRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *ListRequest_Body) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +// List containers response body. +type ListResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of `ContainerID`s belonging to the requested `OwnerID` + ContainerIds []*refs.ContainerID `protobuf:"bytes,1,rep,name=container_ids,json=containerIds,proto3" json:"container_ids,omitempty"` +} + +func (x *ListResponse_Body) Reset() { + *x = ListResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse_Body) ProtoMessage() {} + +func (x *ListResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse_Body.ProtoReflect.Descriptor instead. +func (*ListResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *ListResponse_Body) GetContainerIds() []*refs.ContainerID { + if x != nil { + return x.ContainerIds + } + return nil +} + +// Set Extended ACL request body does not have separate `ContainerID` +// reference. It will be taken from `EACLTable.container_id` field. +type SetExtendedACLRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Extended ACL table to set for the container + Eacl *acl.EACLTable `protobuf:"bytes,1,opt,name=eacl,proto3" json:"eacl,omitempty"` + // Signature of stable-marshalled Extended ACL table according to RFC-6979. + Signature *refs.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SetExtendedACLRequest_Body) Reset() { + *x = SetExtendedACLRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetExtendedACLRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetExtendedACLRequest_Body) ProtoMessage() {} + +func (x *SetExtendedACLRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetExtendedACLRequest_Body.ProtoReflect.Descriptor instead. +func (*SetExtendedACLRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *SetExtendedACLRequest_Body) GetEacl() *acl.EACLTable { + if x != nil { + return x.Eacl + } + return nil +} + +func (x *SetExtendedACLRequest_Body) GetSignature() *refs.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} + +// `SetExtendedACLResponse` has an empty body because the operation is +// asynchronous and the update should be reflected in `Container` smart contract's +// storage after next block is issued in sidechain. +type SetExtendedACLResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetExtendedACLResponse_Body) Reset() { + *x = SetExtendedACLResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetExtendedACLResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetExtendedACLResponse_Body) ProtoMessage() {} + +func (x *SetExtendedACLResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetExtendedACLResponse_Body.ProtoReflect.Descriptor instead. +func (*SetExtendedACLResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{9, 0} +} + +// Get Extended ACL request body +type GetExtendedACLRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the container having Extended ACL + ContainerId *refs.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (x *GetExtendedACLRequest_Body) Reset() { + *x = GetExtendedACLRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExtendedACLRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExtendedACLRequest_Body) ProtoMessage() {} + +func (x *GetExtendedACLRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExtendedACLRequest_Body.ProtoReflect.Descriptor instead. +func (*GetExtendedACLRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *GetExtendedACLRequest_Body) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +// Get Extended ACL Response body can be empty if the requested container does +// not have Extended ACL Table attached or Extended ACL has not been allowed at +// the time of container creation. +type GetExtendedACLResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Extended ACL requested, if available + Eacl *acl.EACLTable `protobuf:"bytes,1,opt,name=eacl,proto3" json:"eacl,omitempty"` + // Signature of stable-marshalled Extended ACL according to RFC-6979. + Signature *refs.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Session token if Extended ACL was set within a session + SessionToken *session.SessionToken `protobuf:"bytes,3,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` +} + +func (x *GetExtendedACLResponse_Body) Reset() { + *x = GetExtendedACLResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExtendedACLResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExtendedACLResponse_Body) ProtoMessage() {} + +func (x *GetExtendedACLResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExtendedACLResponse_Body.ProtoReflect.Descriptor instead. +func (*GetExtendedACLResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *GetExtendedACLResponse_Body) GetEacl() *acl.EACLTable { + if x != nil { + return x.Eacl + } + return nil +} + +func (x *GetExtendedACLResponse_Body) GetSignature() *refs.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} + +func (x *GetExtendedACLResponse_Body) GetSessionToken() *session.SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} + +// Container used space announcement body. +type AnnounceUsedSpaceRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of announcements. If nodes share several containers, + // announcements are transferred in a batch. + Announcements []*AnnounceUsedSpaceRequest_Body_Announcement `protobuf:"bytes,1,rep,name=announcements,proto3" json:"announcements,omitempty"` +} + +func (x *AnnounceUsedSpaceRequest_Body) Reset() { + *x = AnnounceUsedSpaceRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceUsedSpaceRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceUsedSpaceRequest_Body) ProtoMessage() {} + +func (x *AnnounceUsedSpaceRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceUsedSpaceRequest_Body.ProtoReflect.Descriptor instead. +func (*AnnounceUsedSpaceRequest_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *AnnounceUsedSpaceRequest_Body) GetAnnouncements() []*AnnounceUsedSpaceRequest_Body_Announcement { + if x != nil { + return x.Announcements + } + return nil +} + +// Announcement contains used space information for a single container. +type AnnounceUsedSpaceRequest_Body_Announcement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Epoch number for which the container size estimation was produced. + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + // Identifier of the container. + ContainerId *refs.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + // Used space is a sum of object payload sizes of a specified + // container, stored in the node. It must not include inhumed objects. + UsedSpace uint64 `protobuf:"varint,3,opt,name=used_space,json=usedSpace,proto3" json:"used_space,omitempty"` +} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) Reset() { + *x = AnnounceUsedSpaceRequest_Body_Announcement{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceUsedSpaceRequest_Body_Announcement) ProtoMessage() {} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceUsedSpaceRequest_Body_Announcement.ProtoReflect.Descriptor instead. +func (*AnnounceUsedSpaceRequest_Body_Announcement) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{12, 0, 0} +} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *AnnounceUsedSpaceRequest_Body_Announcement) GetUsedSpace() uint64 { + if x != nil { + return x.UsedSpace + } + return 0 +} + +// `AnnounceUsedSpaceResponse` has an empty body because announcements are +// one way communication. +type AnnounceUsedSpaceResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AnnounceUsedSpaceResponse_Body) Reset() { + *x = AnnounceUsedSpaceResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_service_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceUsedSpaceResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceUsedSpaceResponse_Body) ProtoMessage() {} + +func (x *AnnounceUsedSpaceResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_service_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceUsedSpaceResponse_Body.ProtoReflect.Descriptor instead. +func (*AnnounceUsedSpaceResponse_Body) Descriptor() ([]byte, []int) { + return file_container_grpc_service_proto_rawDescGZIP(), []int{13, 0} +} + +var File_container_grpc_service_proto protoreflect.FileDescriptor + +var file_container_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x1a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x02, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x84, 0x01, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, + 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x22, 0xac, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, + 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, + 0xef, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, + 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x86, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, + 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x06, + 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xa8, 0x02, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x64, 0x22, 0xb1, 0x03, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, + 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xca, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, + 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, + 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9e, 0x02, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3a, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb0, 0x02, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, + 0x48, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x40, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0c, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0xec, 0x02, 0x0a, 0x15, 0x53, 0x65, + 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, + 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x1a, 0x74, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a, 0x04, 0x65, 0x61, + 0x63, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x53, 0x65, 0x74, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xbe, 0x02, + 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, + 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, + 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb7, + 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, + 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xba, 0x01, 0x0a, 0x04, + 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x04, 0x65, 0x61, + 0x63, 0x6c, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xf2, 0x03, 0x0a, 0x18, 0x41, 0x6e, 0x6e, + 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, + 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, + 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xf3, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x65, 0x0a, 0x0d, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x6e, + 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, + 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x83, 0x01, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, + 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x75, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0x88, 0x02, + 0x0a, 0x19, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0x90, 0x05, 0x0a, 0x10, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, + 0x03, 0x50, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65, + 0x74, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x69, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, + 0x41, 0x43, 0x4c, 0x12, 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x12, 0x2a, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, + 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x11, 0x41, 0x6e, 0x6e, 0x6f, 0x75, + 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5f, 0x5a, 0x3d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, + 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, + 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_container_grpc_service_proto_rawDescOnce sync.Once + file_container_grpc_service_proto_rawDescData = file_container_grpc_service_proto_rawDesc +) + +func file_container_grpc_service_proto_rawDescGZIP() []byte { + file_container_grpc_service_proto_rawDescOnce.Do(func() { + file_container_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_container_grpc_service_proto_rawDescData) + }) + return file_container_grpc_service_proto_rawDescData +} + +var file_container_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 29) +var file_container_grpc_service_proto_goTypes = []interface{}{ + (*PutRequest)(nil), // 0: neo.fs.v2.container.PutRequest + (*PutResponse)(nil), // 1: neo.fs.v2.container.PutResponse + (*DeleteRequest)(nil), // 2: neo.fs.v2.container.DeleteRequest + (*DeleteResponse)(nil), // 3: neo.fs.v2.container.DeleteResponse + (*GetRequest)(nil), // 4: neo.fs.v2.container.GetRequest + (*GetResponse)(nil), // 5: neo.fs.v2.container.GetResponse + (*ListRequest)(nil), // 6: neo.fs.v2.container.ListRequest + (*ListResponse)(nil), // 7: neo.fs.v2.container.ListResponse + (*SetExtendedACLRequest)(nil), // 8: neo.fs.v2.container.SetExtendedACLRequest + (*SetExtendedACLResponse)(nil), // 9: neo.fs.v2.container.SetExtendedACLResponse + (*GetExtendedACLRequest)(nil), // 10: neo.fs.v2.container.GetExtendedACLRequest + (*GetExtendedACLResponse)(nil), // 11: neo.fs.v2.container.GetExtendedACLResponse + (*AnnounceUsedSpaceRequest)(nil), // 12: neo.fs.v2.container.AnnounceUsedSpaceRequest + (*AnnounceUsedSpaceResponse)(nil), // 13: neo.fs.v2.container.AnnounceUsedSpaceResponse + (*PutRequest_Body)(nil), // 14: neo.fs.v2.container.PutRequest.Body + (*PutResponse_Body)(nil), // 15: neo.fs.v2.container.PutResponse.Body + (*DeleteRequest_Body)(nil), // 16: neo.fs.v2.container.DeleteRequest.Body + (*DeleteResponse_Body)(nil), // 17: neo.fs.v2.container.DeleteResponse.Body + (*GetRequest_Body)(nil), // 18: neo.fs.v2.container.GetRequest.Body + (*GetResponse_Body)(nil), // 19: neo.fs.v2.container.GetResponse.Body + (*ListRequest_Body)(nil), // 20: neo.fs.v2.container.ListRequest.Body + (*ListResponse_Body)(nil), // 21: neo.fs.v2.container.ListResponse.Body + (*SetExtendedACLRequest_Body)(nil), // 22: neo.fs.v2.container.SetExtendedACLRequest.Body + (*SetExtendedACLResponse_Body)(nil), // 23: neo.fs.v2.container.SetExtendedACLResponse.Body + (*GetExtendedACLRequest_Body)(nil), // 24: neo.fs.v2.container.GetExtendedACLRequest.Body + (*GetExtendedACLResponse_Body)(nil), // 25: neo.fs.v2.container.GetExtendedACLResponse.Body + (*AnnounceUsedSpaceRequest_Body)(nil), // 26: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body + (*AnnounceUsedSpaceRequest_Body_Announcement)(nil), // 27: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement + (*AnnounceUsedSpaceResponse_Body)(nil), // 28: neo.fs.v2.container.AnnounceUsedSpaceResponse.Body + (*session.RequestMetaHeader)(nil), // 29: neo.fs.v2.session.RequestMetaHeader + (*session.RequestVerificationHeader)(nil), // 30: neo.fs.v2.session.RequestVerificationHeader + (*session.ResponseMetaHeader)(nil), // 31: neo.fs.v2.session.ResponseMetaHeader + (*session.ResponseVerificationHeader)(nil), // 32: neo.fs.v2.session.ResponseVerificationHeader + (*Container)(nil), // 33: neo.fs.v2.container.Container + (*refs.SignatureRFC6979)(nil), // 34: neo.fs.v2.refs.SignatureRFC6979 + (*refs.ContainerID)(nil), // 35: neo.fs.v2.refs.ContainerID + (*session.SessionToken)(nil), // 36: neo.fs.v2.session.SessionToken + (*refs.OwnerID)(nil), // 37: neo.fs.v2.refs.OwnerID + (*acl.EACLTable)(nil), // 38: neo.fs.v2.acl.EACLTable +} +var file_container_grpc_service_proto_depIdxs = []int32{ + 14, // 0: neo.fs.v2.container.PutRequest.body:type_name -> neo.fs.v2.container.PutRequest.Body + 29, // 1: neo.fs.v2.container.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 2: neo.fs.v2.container.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 15, // 3: neo.fs.v2.container.PutResponse.body:type_name -> neo.fs.v2.container.PutResponse.Body + 31, // 4: neo.fs.v2.container.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 5: neo.fs.v2.container.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 16, // 6: neo.fs.v2.container.DeleteRequest.body:type_name -> neo.fs.v2.container.DeleteRequest.Body + 29, // 7: neo.fs.v2.container.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 8: neo.fs.v2.container.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 17, // 9: neo.fs.v2.container.DeleteResponse.body:type_name -> neo.fs.v2.container.DeleteResponse.Body + 31, // 10: neo.fs.v2.container.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 11: neo.fs.v2.container.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 18, // 12: neo.fs.v2.container.GetRequest.body:type_name -> neo.fs.v2.container.GetRequest.Body + 29, // 13: neo.fs.v2.container.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 14: neo.fs.v2.container.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 19, // 15: neo.fs.v2.container.GetResponse.body:type_name -> neo.fs.v2.container.GetResponse.Body + 31, // 16: neo.fs.v2.container.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 17: neo.fs.v2.container.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 20, // 18: neo.fs.v2.container.ListRequest.body:type_name -> neo.fs.v2.container.ListRequest.Body + 29, // 19: neo.fs.v2.container.ListRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 20: neo.fs.v2.container.ListRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 21, // 21: neo.fs.v2.container.ListResponse.body:type_name -> neo.fs.v2.container.ListResponse.Body + 31, // 22: neo.fs.v2.container.ListResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 23: neo.fs.v2.container.ListResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 22, // 24: neo.fs.v2.container.SetExtendedACLRequest.body:type_name -> neo.fs.v2.container.SetExtendedACLRequest.Body + 29, // 25: neo.fs.v2.container.SetExtendedACLRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 26: neo.fs.v2.container.SetExtendedACLRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 23, // 27: neo.fs.v2.container.SetExtendedACLResponse.body:type_name -> neo.fs.v2.container.SetExtendedACLResponse.Body + 31, // 28: neo.fs.v2.container.SetExtendedACLResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 29: neo.fs.v2.container.SetExtendedACLResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 24, // 30: neo.fs.v2.container.GetExtendedACLRequest.body:type_name -> neo.fs.v2.container.GetExtendedACLRequest.Body + 29, // 31: neo.fs.v2.container.GetExtendedACLRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 32: neo.fs.v2.container.GetExtendedACLRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 25, // 33: neo.fs.v2.container.GetExtendedACLResponse.body:type_name -> neo.fs.v2.container.GetExtendedACLResponse.Body + 31, // 34: neo.fs.v2.container.GetExtendedACLResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 35: neo.fs.v2.container.GetExtendedACLResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 26, // 36: neo.fs.v2.container.AnnounceUsedSpaceRequest.body:type_name -> neo.fs.v2.container.AnnounceUsedSpaceRequest.Body + 29, // 37: neo.fs.v2.container.AnnounceUsedSpaceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 30, // 38: neo.fs.v2.container.AnnounceUsedSpaceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 28, // 39: neo.fs.v2.container.AnnounceUsedSpaceResponse.body:type_name -> neo.fs.v2.container.AnnounceUsedSpaceResponse.Body + 31, // 40: neo.fs.v2.container.AnnounceUsedSpaceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 32, // 41: neo.fs.v2.container.AnnounceUsedSpaceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 33, // 42: neo.fs.v2.container.PutRequest.Body.container:type_name -> neo.fs.v2.container.Container + 34, // 43: neo.fs.v2.container.PutRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 35, // 44: neo.fs.v2.container.PutResponse.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 35, // 45: neo.fs.v2.container.DeleteRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 34, // 46: neo.fs.v2.container.DeleteRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 35, // 47: neo.fs.v2.container.GetRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 33, // 48: neo.fs.v2.container.GetResponse.Body.container:type_name -> neo.fs.v2.container.Container + 34, // 49: neo.fs.v2.container.GetResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 36, // 50: neo.fs.v2.container.GetResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken + 37, // 51: neo.fs.v2.container.ListRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 35, // 52: neo.fs.v2.container.ListResponse.Body.container_ids:type_name -> neo.fs.v2.refs.ContainerID + 38, // 53: neo.fs.v2.container.SetExtendedACLRequest.Body.eacl:type_name -> neo.fs.v2.acl.EACLTable + 34, // 54: neo.fs.v2.container.SetExtendedACLRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 35, // 55: neo.fs.v2.container.GetExtendedACLRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 38, // 56: neo.fs.v2.container.GetExtendedACLResponse.Body.eacl:type_name -> neo.fs.v2.acl.EACLTable + 34, // 57: neo.fs.v2.container.GetExtendedACLResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 36, // 58: neo.fs.v2.container.GetExtendedACLResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken + 27, // 59: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.announcements:type_name -> neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement + 35, // 60: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement.container_id:type_name -> neo.fs.v2.refs.ContainerID + 0, // 61: neo.fs.v2.container.ContainerService.Put:input_type -> neo.fs.v2.container.PutRequest + 2, // 62: neo.fs.v2.container.ContainerService.Delete:input_type -> neo.fs.v2.container.DeleteRequest + 4, // 63: neo.fs.v2.container.ContainerService.Get:input_type -> neo.fs.v2.container.GetRequest + 6, // 64: neo.fs.v2.container.ContainerService.List:input_type -> neo.fs.v2.container.ListRequest + 8, // 65: neo.fs.v2.container.ContainerService.SetExtendedACL:input_type -> neo.fs.v2.container.SetExtendedACLRequest + 10, // 66: neo.fs.v2.container.ContainerService.GetExtendedACL:input_type -> neo.fs.v2.container.GetExtendedACLRequest + 12, // 67: neo.fs.v2.container.ContainerService.AnnounceUsedSpace:input_type -> neo.fs.v2.container.AnnounceUsedSpaceRequest + 1, // 68: neo.fs.v2.container.ContainerService.Put:output_type -> neo.fs.v2.container.PutResponse + 3, // 69: neo.fs.v2.container.ContainerService.Delete:output_type -> neo.fs.v2.container.DeleteResponse + 5, // 70: neo.fs.v2.container.ContainerService.Get:output_type -> neo.fs.v2.container.GetResponse + 7, // 71: neo.fs.v2.container.ContainerService.List:output_type -> neo.fs.v2.container.ListResponse + 9, // 72: neo.fs.v2.container.ContainerService.SetExtendedACL:output_type -> neo.fs.v2.container.SetExtendedACLResponse + 11, // 73: neo.fs.v2.container.ContainerService.GetExtendedACL:output_type -> neo.fs.v2.container.GetExtendedACLResponse + 13, // 74: neo.fs.v2.container.ContainerService.AnnounceUsedSpace:output_type -> neo.fs.v2.container.AnnounceUsedSpaceResponse + 68, // [68:75] is the sub-list for method output_type + 61, // [61:68] is the sub-list for method input_type + 61, // [61:61] is the sub-list for extension type_name + 61, // [61:61] is the sub-list for extension extendee + 0, // [0:61] is the sub-list for field type_name +} + +func init() { file_container_grpc_service_proto_init() } +func file_container_grpc_service_proto_init() { + if File_container_grpc_service_proto != nil { + return + } + file_container_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_container_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetExtendedACLRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetExtendedACLResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExtendedACLRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExtendedACLResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceUsedSpaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceUsedSpaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetExtendedACLRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetExtendedACLResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExtendedACLRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExtendedACLResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceUsedSpaceRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceUsedSpaceRequest_Body_Announcement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceUsedSpaceResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_container_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 29, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_container_grpc_service_proto_goTypes, + DependencyIndexes: file_container_grpc_service_proto_depIdxs, + MessageInfos: file_container_grpc_service_proto_msgTypes, + }.Build() + File_container_grpc_service_proto = out.File + file_container_grpc_service_proto_rawDesc = nil + file_container_grpc_service_proto_goTypes = nil + file_container_grpc_service_proto_depIdxs = nil +} diff --git a/api/container/service_grpc.pb.go b/api/container/service_grpc.pb.go new file mode 100644 index 00000000..47cafc50 --- /dev/null +++ b/api/container/service_grpc.pb.go @@ -0,0 +1,449 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: container/grpc/service.proto + +package container + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" + ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete" + ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get" + ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List" + ContainerService_SetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/SetExtendedACL" + ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL" + ContainerService_AnnounceUsedSpace_FullMethodName = "/neo.fs.v2.container.ContainerService/AnnounceUsedSpace" +) + +// ContainerServiceClient is the client API for ContainerService 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 ContainerServiceClient interface { + // `Put` invokes `Container` smart contract's `Put` method and returns + // response immediately. After a new block is issued in sidechain, request is + // verified by Inner Ring nodes. After one more block in sidechain, the container + // is added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). + Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) + // `Delete` invokes `Container` smart contract's `Delete` method and returns + // response immediately. After a new block is issued in sidechain, request is + // verified by Inner Ring nodes. After one more block in sidechain, the container + // is added into smart contract storage. + // NOTE: a container deletion leads to the removal of every object in that + // container, regardless of any restrictions on the object removal (e.g. lock/locked + // object would be also removed). + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + // Returns container structure from `Container` smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + // Returns all owner's containers from 'Container` smart contract' storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + // Invokes 'SetEACL' method of 'Container` smart contract and returns response + // immediately. After one more block in sidechain, changes in an Extended ACL are + // added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). + SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) + // Returns Extended ACL table and signature from `Container` smart contract + // storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. + GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) + // Announces the space values used by the container for P2P synchronization. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). + AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) +} + +type containerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClient { + return &containerServiceClient{cc} +} + +func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { + out := new(PutResponse) + err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + out := new(ListResponse) + err := c.cc.Invoke(ctx, ContainerService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) { + out := new(SetExtendedACLResponse) + err := c.cc.Invoke(ctx, ContainerService_SetExtendedACL_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) { + out := new(GetExtendedACLResponse) + err := c.cc.Invoke(ctx, ContainerService_GetExtendedACL_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerServiceClient) AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) { + out := new(AnnounceUsedSpaceResponse) + err := c.cc.Invoke(ctx, ContainerService_AnnounceUsedSpace_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ContainerServiceServer is the server API for ContainerService service. +// All implementations should embed UnimplementedContainerServiceServer +// for forward compatibility +type ContainerServiceServer interface { + // `Put` invokes `Container` smart contract's `Put` method and returns + // response immediately. After a new block is issued in sidechain, request is + // verified by Inner Ring nodes. After one more block in sidechain, the container + // is added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). + Put(context.Context, *PutRequest) (*PutResponse, error) + // `Delete` invokes `Container` smart contract's `Delete` method and returns + // response immediately. After a new block is issued in sidechain, request is + // verified by Inner Ring nodes. After one more block in sidechain, the container + // is added into smart contract storage. + // NOTE: a container deletion leads to the removal of every object in that + // container, regardless of any restrictions on the object removal (e.g. lock/locked + // object would be also removed). + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) + // Returns container structure from `Container` smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. + Get(context.Context, *GetRequest) (*GetResponse, error) + // Returns all owner's containers from 'Container` smart contract' storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + List(context.Context, *ListRequest) (*ListResponse, error) + // Invokes 'SetEACL' method of 'Container` smart contract and returns response + // immediately. After one more block in sidechain, changes in an Extended ACL are + // added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). + SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) + // Returns Extended ACL table and signature from `Container` smart contract + // storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. + GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) + // Announces the space values used by the container for P2P synchronization. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). + AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) +} + +// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations. +type UnimplementedContainerServiceServer struct { +} + +func (UnimplementedContainerServiceServer) Put(context.Context, *PutRequest) (*PutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (UnimplementedContainerServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedContainerServiceServer) SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetExtendedACL not implemented") +} +func (UnimplementedContainerServiceServer) GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExtendedACL not implemented") +} +func (UnimplementedContainerServiceServer) AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AnnounceUsedSpace not implemented") +} + +// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ContainerServiceServer will +// result in compilation errors. +type UnsafeContainerServiceServer interface { + mustEmbedUnimplementedContainerServiceServer() +} + +func RegisterContainerServiceServer(s grpc.ServiceRegistrar, srv ContainerServiceServer) { + s.RegisterService(&ContainerService_ServiceDesc, srv) +} + +func _ContainerService_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Put(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_Put_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Put(ctx, req.(*PutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).List(ctx, req.(*ListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_SetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetExtendedACLRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).SetExtendedACL(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_SetExtendedACL_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).SetExtendedACL(ctx, req.(*SetExtendedACLRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetExtendedACLRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).GetExtendedACL(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_GetExtendedACL_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).GetExtendedACL(ctx, req.(*GetExtendedACLRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerService_AnnounceUsedSpace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnounceUsedSpaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContainerService_AnnounceUsedSpace_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, req.(*AnnounceUsedSpaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ContainerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.container.ContainerService", + HandlerType: (*ContainerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Put", + Handler: _ContainerService_Put_Handler, + }, + { + MethodName: "Delete", + Handler: _ContainerService_Delete_Handler, + }, + { + MethodName: "Get", + Handler: _ContainerService_Get_Handler, + }, + { + MethodName: "List", + Handler: _ContainerService_List_Handler, + }, + { + MethodName: "SetExtendedACL", + Handler: _ContainerService_SetExtendedACL_Handler, + }, + { + MethodName: "GetExtendedACL", + Handler: _ContainerService_GetExtendedACL_Handler, + }, + { + MethodName: "AnnounceUsedSpace", + Handler: _ContainerService_AnnounceUsedSpace_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "container/grpc/service.proto", +} diff --git a/api/container/types.pb.go b/api/container/types.pb.go new file mode 100644 index 00000000..5fcf2469 --- /dev/null +++ b/api/container/types.pb.go @@ -0,0 +1,336 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: container/grpc/types.proto + +package container + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/netmap" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Container is a structure that defines object placement behaviour. Objects can +// be stored only within containers. They define placement rule, attributes and +// access control information. An ID of a container is a 32 byte long SHA256 hash +// of stable-marshalled container message. +type Container struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Container format version. Effectively, the version of API library used to + // create the container. + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Identifier of the container owner + OwnerId *refs.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` + // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s + Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` + // `BasicACL` contains access control rules for the owner, system and others groups, + // as well as permission bits for `BearerToken` and `Extended ACL` + BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL,proto3" json:"basic_acl,omitempty"` + // Attributes represent immutable container's meta data + Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty"` + // Placement policy for the object inside the container + PlacementPolicy *netmap.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy,proto3" json:"placement_policy,omitempty"` +} + +func (x *Container) Reset() { + *x = Container{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Container.ProtoReflect.Descriptor instead. +func (*Container) Descriptor() ([]byte, []int) { + return file_container_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Container) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *Container) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *Container) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} + +func (x *Container) GetBasicAcl() uint32 { + if x != nil { + return x.BasicAcl + } + return 0 +} + +func (x *Container) GetAttributes() []*Container_Attribute { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Container) GetPlacementPolicy() *netmap.PlacementPolicy { + if x != nil { + return x.PlacementPolicy + } + return nil +} + +// `Attribute` is a user-defined Key-Value metadata pair attached to the +// container. Container attributes are immutable. They are set at the moment of +// container creation and can never be added or updated. +// +// Key name must be a container-unique valid UTF-8 string. Value can't be +// empty. Containers with duplicated attribute names or attributes with empty +// values will be considered invalid. +// +// There are some "well-known" attributes affecting system behaviour: +// +// - __NEOFS__SUBNET \ +// DEPRECATED. Was used for a string ID of a container's storage subnet. +// Currently doesn't affect anything. +// - __NEOFS__NAME \ +// String of a human-friendly container name registered as a domain in +// NNS contract. +// - __NEOFS__ZONE \ +// String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS +// contract. If no zone is specified, use default zone: `container`. +// - __NEOFS__DISABLE_HOMOMORPHIC_HASHING \ +// Disables homomorphic hashing for the container if the value equals "true" string. +// Any other values are interpreted as missing attribute. Container could be +// accepted in a NeoFS network only if the global network hashing configuration +// value corresponds with that attribute's value. After container inclusion, network +// setting is ignored. +// +// And some well-known attributes used by applications only: +// +// - Name \ +// Human-friendly name +// - Timestamp \ +// User-defined local time of container creation in Unix Timestamp format +type Container_Attribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Attribute name key + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Attribute value + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Container_Attribute) Reset() { + *x = Container_Attribute{} + if protoimpl.UnsafeEnabled { + mi := &file_container_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container_Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container_Attribute) ProtoMessage() {} + +func (x *Container_Attribute) ProtoReflect() protoreflect.Message { + mi := &file_container_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Container_Attribute.ProtoReflect.Descriptor instead. +func (*Container_Attribute) Descriptor() ([]byte, []int) { + return file_container_grpc_types_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Container_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Container_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_container_grpc_types_proto protoreflect.FileDescriptor + +var file_container_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x1a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xf2, 0x02, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x43, 0x4c, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, + 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x1a, 0x33, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x5f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, + 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_container_grpc_types_proto_rawDescOnce sync.Once + file_container_grpc_types_proto_rawDescData = file_container_grpc_types_proto_rawDesc +) + +func file_container_grpc_types_proto_rawDescGZIP() []byte { + file_container_grpc_types_proto_rawDescOnce.Do(func() { + file_container_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_container_grpc_types_proto_rawDescData) + }) + return file_container_grpc_types_proto_rawDescData +} + +var file_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_container_grpc_types_proto_goTypes = []interface{}{ + (*Container)(nil), // 0: neo.fs.v2.container.Container + (*Container_Attribute)(nil), // 1: neo.fs.v2.container.Container.Attribute + (*refs.Version)(nil), // 2: neo.fs.v2.refs.Version + (*refs.OwnerID)(nil), // 3: neo.fs.v2.refs.OwnerID + (*netmap.PlacementPolicy)(nil), // 4: neo.fs.v2.netmap.PlacementPolicy +} +var file_container_grpc_types_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.container.Container.version:type_name -> neo.fs.v2.refs.Version + 3, // 1: neo.fs.v2.container.Container.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 1, // 2: neo.fs.v2.container.Container.attributes:type_name -> neo.fs.v2.container.Container.Attribute + 4, // 3: neo.fs.v2.container.Container.placement_policy:type_name -> neo.fs.v2.netmap.PlacementPolicy + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_container_grpc_types_proto_init() } +func file_container_grpc_types_proto_init() { + if File_container_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_container_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_container_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container_Attribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_container_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_container_grpc_types_proto_goTypes, + DependencyIndexes: file_container_grpc_types_proto_depIdxs, + MessageInfos: file_container_grpc_types_proto_msgTypes, + }.Build() + File_container_grpc_types_proto = out.File + file_container_grpc_types_proto_rawDesc = nil + file_container_grpc_types_proto_goTypes = nil + file_container_grpc_types_proto_depIdxs = nil +} diff --git a/api/link/types.pb.go b/api/link/types.pb.go new file mode 100644 index 00000000..1f14252a --- /dev/null +++ b/api/link/types.pb.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: link/grpc/types.proto + +package link + +import ( + grpc "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Link is a payload of helper objects that contain the full list of the split +// chain objects' IDs. It is created only after the whole split chain is known +// and signed. This object is the only object that refers to every "child object" +// ID. It is NOT required for the original object assembling. It MUST have ALL +// the "child objects" IDs. Child objects MUST be ordered according to the +// original payload split, meaning the first payload part holder MUST be placed +// at the first place in the corresponding link object. Sizes MUST NOT be omitted +// and MUST be a real object payload size in bytes. +type Link struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Full list of the "child" object descriptors. + Children []*Link_MeasuredObject `protobuf:"bytes,1,rep,name=children,proto3" json:"children,omitempty"` +} + +func (x *Link) Reset() { + *x = Link{} + if protoimpl.UnsafeEnabled { + mi := &file_link_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Link) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Link) ProtoMessage() {} + +func (x *Link) ProtoReflect() protoreflect.Message { + mi := &file_link_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Link.ProtoReflect.Descriptor instead. +func (*Link) Descriptor() ([]byte, []int) { + return file_link_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Link) GetChildren() []*Link_MeasuredObject { + if x != nil { + return x.Children + } + return nil +} + +// Object ID with its object's payload size. +type Link_MeasuredObject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object ID. + Id *grpc.ObjectID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Object size in bytes. + Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *Link_MeasuredObject) Reset() { + *x = Link_MeasuredObject{} + if protoimpl.UnsafeEnabled { + mi := &file_link_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Link_MeasuredObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Link_MeasuredObject) ProtoMessage() {} + +func (x *Link_MeasuredObject) ProtoReflect() protoreflect.Message { + mi := &file_link_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Link_MeasuredObject.ProtoReflect.Descriptor instead. +func (*Link_MeasuredObject) Descriptor() ([]byte, []int) { + return file_link_grpc_types_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Link_MeasuredObject) GetId() *grpc.ObjectID { + if x != nil { + return x.Id + } + return nil +} + +func (x *Link_MeasuredObject) GetSize() uint32 { + if x != nil { + return x.Size + } + return 0 +} + +var File_link_grpc_types_proto protoreflect.FileDescriptor + +var file_link_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, + 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x3f, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x72, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x2e, + 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x1a, 0x4e, 0x0a, 0x0e, 0x4d, 0x65, 0x61, 0x73, + 0x75, 0x72, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x50, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, + 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, + 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6c, 0x69, 0x6e, 0x6b, 0xaa, + 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_link_grpc_types_proto_rawDescOnce sync.Once + file_link_grpc_types_proto_rawDescData = file_link_grpc_types_proto_rawDesc +) + +func file_link_grpc_types_proto_rawDescGZIP() []byte { + file_link_grpc_types_proto_rawDescOnce.Do(func() { + file_link_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_link_grpc_types_proto_rawDescData) + }) + return file_link_grpc_types_proto_rawDescData +} + +var file_link_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_link_grpc_types_proto_goTypes = []interface{}{ + (*Link)(nil), // 0: neo.fs.v2.link.Link + (*Link_MeasuredObject)(nil), // 1: neo.fs.v2.link.Link.MeasuredObject + (*grpc.ObjectID)(nil), // 2: neo.fs.v2.refs.ObjectID +} +var file_link_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.link.Link.children:type_name -> neo.fs.v2.link.Link.MeasuredObject + 2, // 1: neo.fs.v2.link.Link.MeasuredObject.id:type_name -> neo.fs.v2.refs.ObjectID + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_link_grpc_types_proto_init() } +func file_link_grpc_types_proto_init() { + if File_link_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_link_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Link); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_link_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Link_MeasuredObject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_link_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_link_grpc_types_proto_goTypes, + DependencyIndexes: file_link_grpc_types_proto_depIdxs, + MessageInfos: file_link_grpc_types_proto_msgTypes, + }.Build() + File_link_grpc_types_proto = out.File + file_link_grpc_types_proto_rawDesc = nil + file_link_grpc_types_proto_goTypes = nil + file_link_grpc_types_proto_depIdxs = nil +} diff --git a/api/lock/types.pb.go b/api/lock/types.pb.go new file mode 100644 index 00000000..c56e6d96 --- /dev/null +++ b/api/lock/types.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: lock/grpc/types.proto + +package lock + +import ( + grpc "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Lock objects protects a list of objects from being deleted. The lifetime of a +// lock object is limited similar to regular objects in +// `__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +// It is impossible to delete a lock object via ObjectService.Delete RPC call. +// Deleting a container containing lock/locked objects results in their removal +// too, regardless of their expiration epochs. +type Lock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of objects to lock. Must not be empty or carry empty IDs. + // All members must be of the `REGULAR` type. + Members []*grpc.ObjectID `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` +} + +func (x *Lock) Reset() { + *x = Lock{} + if protoimpl.UnsafeEnabled { + mi := &file_lock_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Lock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Lock) ProtoMessage() {} + +func (x *Lock) ProtoReflect() protoreflect.Message { + mi := &file_lock_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Lock.ProtoReflect.Descriptor instead. +func (*Lock) Descriptor() ([]byte, []int) { + return file_lock_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Lock) GetMembers() []*grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} + +var File_lock_grpc_types_proto protoreflect.FileDescriptor + +var file_lock_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, + 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x50, 0x5a, 0x33, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, + 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, + 0x76, 0x32, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6c, 0x6f, 0x63, + 0x6b, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_lock_grpc_types_proto_rawDescOnce sync.Once + file_lock_grpc_types_proto_rawDescData = file_lock_grpc_types_proto_rawDesc +) + +func file_lock_grpc_types_proto_rawDescGZIP() []byte { + file_lock_grpc_types_proto_rawDescOnce.Do(func() { + file_lock_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_lock_grpc_types_proto_rawDescData) + }) + return file_lock_grpc_types_proto_rawDescData +} + +var file_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_lock_grpc_types_proto_goTypes = []interface{}{ + (*Lock)(nil), // 0: neo.fs.v2.lock.Lock + (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID +} +var file_lock_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.lock.Lock.members:type_name -> neo.fs.v2.refs.ObjectID + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_lock_grpc_types_proto_init() } +func file_lock_grpc_types_proto_init() { + if File_lock_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_lock_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Lock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_lock_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_lock_grpc_types_proto_goTypes, + DependencyIndexes: file_lock_grpc_types_proto_depIdxs, + MessageInfos: file_lock_grpc_types_proto_msgTypes, + }.Build() + File_lock_grpc_types_proto = out.File + file_lock_grpc_types_proto_rawDesc = nil + file_lock_grpc_types_proto_goTypes = nil + file_lock_grpc_types_proto_depIdxs = nil +} diff --git a/api/netmap/encoding.go b/api/netmap/encoding.go new file mode 100644 index 00000000..62703da6 --- /dev/null +++ b/api/netmap/encoding.go @@ -0,0 +1,363 @@ +package netmap + +import ( + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" +) + +const ( + _ = iota + fieldReplicaCount + fieldReplicaSelector +) + +func (x *Replica) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldReplicaCount, x.Count) + + proto.SizeBytes(fieldReplicaSelector, x.Selector) + } + return sz +} + +func (x *Replica) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldReplicaCount, x.Count) + proto.MarshalBytes(b[off:], fieldReplicaSelector, x.Selector) + } +} + +const ( + _ = iota + fieldSelectorName + fieldSelectorCount + fieldSelectorClause + fieldSelectorAttribute + fieldSelectorFilter +) + +func (x *Selector) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldSelectorName, x.Name) + + proto.SizeVarint(fieldSelectorCount, x.Count) + + proto.SizeVarint(fieldSelectorClause, int32(x.Clause)) + + proto.SizeBytes(fieldSelectorAttribute, x.Attribute) + + proto.SizeBytes(fieldSelectorFilter, x.Filter) + } + return sz +} + +func (x *Selector) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldSelectorName, x.Name) + off += proto.MarshalVarint(b[off:], fieldSelectorCount, x.Count) + off += proto.MarshalVarint(b[off:], fieldSelectorClause, int32(x.Clause)) + off += proto.MarshalBytes(b[off:], fieldSelectorAttribute, x.Attribute) + proto.MarshalBytes(b[off:], fieldSelectorFilter, x.Filter) + } +} + +const ( + _ = iota + fieldFilterName + fieldFilterKey + fieldFilterOp + fieldFilterVal + fieldFilterSubs +) + +func (x *Filter) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldFilterName, x.Name) + + proto.SizeBytes(fieldFilterKey, x.Key) + + proto.SizeVarint(fieldFilterOp, int32(x.Op)) + + proto.SizeBytes(fieldFilterVal, x.Value) + for i := range x.Filters { + sz += proto.SizeNested(fieldFilterSubs, x.Filters[i]) + } + } + return sz +} + +func (x *Filter) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldFilterName, x.Name) + off += proto.MarshalBytes(b[off:], fieldFilterKey, x.Key) + off += proto.MarshalVarint(b[off:], fieldFilterOp, int32(x.Op)) + off += proto.MarshalBytes(b[off:], fieldFilterVal, x.Value) + for i := range x.Filters { + off += proto.MarshalNested(b[off:], fieldFilterSubs, x.Filters[i]) + } + } +} + +const ( + _ = iota + fieldPolicyReplicas + fieldPolicyBackupFactor + fieldPolicySelectors + fieldPolicyFilters + fieldPolicySubnet +) + +func (x *PlacementPolicy) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldPolicyBackupFactor, x.ContainerBackupFactor) + + proto.SizeNested(fieldPolicySubnet, x.SubnetId) + for i := range x.Replicas { + sz += proto.SizeNested(fieldPolicyReplicas, x.Replicas[i]) + } + for i := range x.Selectors { + sz += proto.SizeNested(fieldPolicySelectors, x.Selectors[i]) + } + for i := range x.Filters { + sz += proto.SizeNested(fieldPolicyFilters, x.Filters[i]) + } + } + return sz +} + +func (x *PlacementPolicy) MarshalStable(b []byte) { + if x != nil { + var off int + for i := range x.Replicas { + off += proto.MarshalNested(b[off:], fieldPolicyReplicas, x.Replicas[i]) + } + off += proto.MarshalVarint(b[off:], fieldPolicyBackupFactor, x.ContainerBackupFactor) + for i := range x.Selectors { + off += proto.MarshalNested(b[off:], fieldPolicySelectors, x.Selectors[i]) + } + for i := range x.Filters { + off += proto.MarshalNested(b[off:], fieldPolicyFilters, x.Filters[i]) + } + proto.MarshalNested(b[off:], fieldPolicySubnet, x.SubnetId) + } +} + +const ( + _ = iota + fieldNetPrmKey + fieldNetPrmVal +) + +func (x *NetworkConfig_Parameter) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldNetPrmKey, x.Key) + + proto.SizeBytes(fieldNetPrmVal, x.Value) + } + return sz +} + +func (x *NetworkConfig_Parameter) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldNetPrmKey, x.Key) + proto.MarshalBytes(b[off:], fieldNetPrmVal, x.Value) + } +} + +const ( + _ = iota + fieldNetConfigPrms +) + +func (x *NetworkConfig) MarshaledSize() int { + var sz int + if x != nil { + for i := range x.Parameters { + sz += proto.SizeNested(fieldNetConfigPrms, x.Parameters[i]) + } + } + return sz +} + +func (x *NetworkConfig) MarshalStable(b []byte) { + if x != nil { + var off int + for i := range x.Parameters { + off += proto.MarshalNested(b[off:], fieldNetConfigPrms, x.Parameters[i]) + } + } +} + +const ( + _ = iota + fieldNetInfoCurEpoch + fieldNetInfoMagic + fieldNetInfoMSPerBlock + fieldNetInfoConfig +) + +func (x *NetworkInfo) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldNetInfoCurEpoch, x.CurrentEpoch) + + proto.SizeVarint(fieldNetInfoMagic, x.MagicNumber) + + proto.SizeVarint(fieldNetInfoMSPerBlock, x.MsPerBlock) + + proto.SizeNested(fieldNetInfoConfig, x.NetworkConfig) + } + return sz +} + +func (x *NetworkInfo) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldNetInfoCurEpoch, x.CurrentEpoch) + off += proto.MarshalVarint(b[off:], fieldNetInfoMagic, x.MagicNumber) + off += proto.MarshalVarint(b[off:], fieldNetInfoMSPerBlock, x.MsPerBlock) + proto.MarshalNested(b[off:], fieldNetInfoConfig, x.NetworkConfig) + } +} + +const ( + _ = iota + fieldNumNodeAttrKey + fieldNumNodeAttrVal + fieldNumNodeAttrParents +) + +func (x *NodeInfo_Attribute) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldNumNodeAttrKey, x.Key) + + proto.SizeBytes(fieldNumNodeAttrVal, x.Value) + + proto.SizeRepeatedBytes(fieldNumNodeAttrParents, x.Parents) + } + return sz +} + +func (x *NodeInfo_Attribute) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldNumNodeAttrKey, x.Key) + off += proto.MarshalBytes(b[off:], fieldNumNodeAttrVal, x.Value) + proto.MarshalRepeatedBytes(b[off:], fieldNumNodeAttrParents, x.Parents) + } +} + +const ( + _ = iota + fieldNodeInfoPubKey + fieldNodeInfoAddresses + fieldNodeInfoAttributes + fieldNodeInfoState +) + +func (x *NodeInfo) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldNodeInfoPubKey, x.PublicKey) + + proto.SizeRepeatedBytes(fieldNodeInfoAddresses, x.Addresses) + + proto.SizeVarint(fieldNodeInfoState, int32(x.State)) + for i := range x.Attributes { + sz += proto.SizeNested(fieldNodeInfoAttributes, x.Attributes[i]) + } + } + return sz +} + +func (x *NodeInfo) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldNodeInfoPubKey, x.PublicKey) + off += proto.MarshalRepeatedBytes(b[off:], fieldNodeInfoAddresses, x.Addresses) + for i := range x.Attributes { + off += proto.MarshalNested(b[off:], fieldNodeInfoAttributes, x.Attributes[i]) + } + proto.MarshalVarint(b[off:], fieldNodeInfoState, int32(x.State)) + } +} + +const ( + _ = iota + fieldNetmapEpoch + fieldNetmapNodes +) + +func (x *Netmap) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldNetmapEpoch, x.Epoch) + for i := range x.Nodes { + sz += proto.SizeNested(fieldNetmapNodes, x.Nodes[i]) + } + } + return sz +} + +func (x *Netmap) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldNetmapEpoch, x.Epoch) + for i := range x.Nodes { + off += proto.MarshalNested(b[off:], fieldNetmapNodes, x.Nodes[i]) + } + } +} + +func (x *LocalNodeInfoRequest_Body) MarshaledSize() int { return 0 } +func (x *LocalNodeInfoRequest_Body) MarshalStable([]byte) {} + +const ( + _ = iota + fieldNodeInfoRespVersion + fieldNodeInfoRespInfo +) + +func (x *LocalNodeInfoResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldNodeInfoRespVersion, x.Version) + + proto.SizeNested(fieldNodeInfoRespInfo, x.NodeInfo) + } + return sz +} + +func (x *LocalNodeInfoResponse_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldNodeInfoRespVersion, x.Version) + proto.MarshalNested(b[off:], fieldNodeInfoRespInfo, x.NodeInfo) + } +} + +func (x *NetworkInfoRequest_Body) MarshaledSize() int { return 0 } +func (x *NetworkInfoRequest_Body) MarshalStable([]byte) {} + +const ( + _ = iota + fieldNetInfoRespInfo +) + +func (x *NetworkInfoResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldNetInfoRespInfo, x.NetworkInfo) + } + return sz +} + +func (x *NetworkInfoResponse_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldNetInfoRespInfo, x.NetworkInfo) + } +} + +func (x *NetmapSnapshotRequest_Body) MarshaledSize() int { return 0 } +func (x *NetmapSnapshotRequest_Body) MarshalStable([]byte) {} + +const ( + _ = iota + fieldNetmapRespNetmap +) + +func (x *NetmapSnapshotResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldNetmapRespNetmap, x.Netmap) + } + return sz +} + +func (x *NetmapSnapshotResponse_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldNetmapRespNetmap, x.Netmap) + } +} diff --git a/api/netmap/encoding_test.go b/api/netmap/encoding_test.go new file mode 100644 index 00000000..a213ab8e --- /dev/null +++ b/api/netmap/encoding_test.go @@ -0,0 +1,125 @@ +package netmap_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/netmap" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestLocalNodeInfoRequest_Body(t *testing.T) { + var v netmap.LocalNodeInfoRequest_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} + +func TestLocalNodeInfoResponse_Body(t *testing.T) { + v := &netmap.LocalNodeInfoResponse_Body{ + Version: &refs.Version{Major: 1, Minor: 2}, + NodeInfo: &netmap.NodeInfo{ + PublicKey: []byte("any_key"), + Addresses: []string{"addr1", "addr2"}, + Attributes: []*netmap.NodeInfo_Attribute{ + {Key: "key1", Value: "val1", Parents: []string{"par1", "par2"}}, + {Key: "key2", Value: "val2", Parents: []string{"par3", "par4"}}, + }, + State: 3, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res netmap.LocalNodeInfoResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Version, res.Version) + require.Equal(t, v.NodeInfo, res.NodeInfo) +} + +func TestNetworkInfoRequest_Body(t *testing.T) { + var v netmap.NetworkInfoRequest_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} + +func TestNetworkInfoResponse_Body(t *testing.T) { + v := &netmap.NetworkInfoResponse_Body{ + NetworkInfo: &netmap.NetworkInfo{ + CurrentEpoch: 1, MagicNumber: 2, MsPerBlock: 3, + NetworkConfig: &netmap.NetworkConfig{ + Parameters: []*netmap.NetworkConfig_Parameter{ + {Key: []byte("key1"), Value: []byte("val1")}, + {Key: []byte("key2"), Value: []byte("val2")}, + }, + }, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res netmap.NetworkInfoResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.NetworkInfo, res.NetworkInfo) +} + +func TestNetmapSnapshotRequest_Body(t *testing.T) { + var v netmap.NetworkInfoRequest_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} + +func TestNetmapSnapshotResponse_Body(t *testing.T) { + v := &netmap.NetmapSnapshotResponse_Body{ + Netmap: &netmap.Netmap{ + Epoch: 1, + Nodes: []*netmap.NodeInfo{ + { + PublicKey: []byte("any_key1"), + Addresses: []string{"addr1", "addr2"}, + Attributes: []*netmap.NodeInfo_Attribute{ + {Key: "key1", Value: "val1", Parents: []string{"par1", "par2"}}, + {Key: "key2", Value: "val2", Parents: []string{"par3", "par4"}}, + }, + State: 2, + }, + { + PublicKey: []byte("any_key2"), + Addresses: []string{"addr3", "addr4"}, + Attributes: []*netmap.NodeInfo_Attribute{ + {Key: "key3", Value: "val3", Parents: []string{"par5", "par6"}}, + {Key: "key4", Value: "val4", Parents: []string{"par7", "par8"}}, + }, + State: 3, + }, + }, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res netmap.NetmapSnapshotResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Netmap, res.Netmap) +} diff --git a/api/netmap/service.pb.go b/api/netmap/service.pb.go new file mode 100644 index 00000000..86fa6fb8 --- /dev/null +++ b/api/netmap/service.pb.go @@ -0,0 +1,1108 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: netmap/grpc/service.proto + +package netmap + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Get NodeInfo structure directly from a particular node +type LocalNodeInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the LocalNodeInfo request message + Body *LocalNodeInfoRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *LocalNodeInfoRequest) Reset() { + *x = LocalNodeInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalNodeInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalNodeInfoRequest) ProtoMessage() {} + +func (x *LocalNodeInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalNodeInfoRequest.ProtoReflect.Descriptor instead. +func (*LocalNodeInfoRequest) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *LocalNodeInfoRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *LocalNodeInfoRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Local Node Info, including API Version in use +type LocalNodeInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the balance response message. + Body *LocalNodeInfoResponse_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 response execution. + MetaHeader *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *LocalNodeInfoResponse) Reset() { + *x = LocalNodeInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalNodeInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalNodeInfoResponse) ProtoMessage() {} + +func (x *LocalNodeInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalNodeInfoResponse.ProtoReflect.Descriptor instead. +func (*LocalNodeInfoResponse) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *LocalNodeInfoResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *LocalNodeInfoResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get NetworkInfo structure with the network view from a particular node. +type NetworkInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the NetworkInfo request message + Body *NetworkInfoRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *NetworkInfoRequest) Reset() { + *x = NetworkInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfoRequest) ProtoMessage() {} + +func (x *NetworkInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfoRequest.ProtoReflect.Descriptor instead. +func (*NetworkInfoRequest) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{2} +} + +func (x *NetworkInfoRequest) GetBody() *NetworkInfoRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NetworkInfoRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *NetworkInfoRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Response with NetworkInfo structure including current epoch and +// sidechain magic number. +type NetworkInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the NetworkInfo response message. + Body *NetworkInfoResponse_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 response execution. + MetaHeader *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *NetworkInfoResponse) Reset() { + *x = NetworkInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfoResponse) ProtoMessage() {} + +func (x *NetworkInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfoResponse.ProtoReflect.Descriptor instead. +func (*NetworkInfoResponse) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{3} +} + +func (x *NetworkInfoResponse) GetBody() *NetworkInfoResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NetworkInfoResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *NetworkInfoResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get netmap snapshot request +type NetmapSnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get netmap snapshot request message. + Body *NetmapSnapshotRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *NetmapSnapshotRequest) Reset() { + *x = NetmapSnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetmapSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetmapSnapshotRequest) ProtoMessage() {} + +func (x *NetmapSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetmapSnapshotRequest.ProtoReflect.Descriptor instead. +func (*NetmapSnapshotRequest) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{4} +} + +func (x *NetmapSnapshotRequest) GetBody() *NetmapSnapshotRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NetmapSnapshotRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *NetmapSnapshotRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Response with current netmap snapshot +type NetmapSnapshotResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get netmap snapshot response message. + Body *NetmapSnapshotResponse_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 response execution. + MetaHeader *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *NetmapSnapshotResponse) Reset() { + *x = NetmapSnapshotResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetmapSnapshotResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetmapSnapshotResponse) ProtoMessage() {} + +func (x *NetmapSnapshotResponse) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetmapSnapshotResponse.ProtoReflect.Descriptor instead. +func (*NetmapSnapshotResponse) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{5} +} + +func (x *NetmapSnapshotResponse) GetBody() *NetmapSnapshotResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NetmapSnapshotResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *NetmapSnapshotResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// LocalNodeInfo request body is empty. +type LocalNodeInfoRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LocalNodeInfoRequest_Body) Reset() { + *x = LocalNodeInfoRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalNodeInfoRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalNodeInfoRequest_Body) ProtoMessage() {} + +func (x *LocalNodeInfoRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalNodeInfoRequest_Body.ProtoReflect.Descriptor instead. +func (*LocalNodeInfoRequest_Body) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +// Local Node Info, including API Version in use. +type LocalNodeInfoResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Latest NeoFS API version in use + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // NodeInfo structure with recent information from node itself + NodeInfo *NodeInfo `protobuf:"bytes,2,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` +} + +func (x *LocalNodeInfoResponse_Body) Reset() { + *x = LocalNodeInfoResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalNodeInfoResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalNodeInfoResponse_Body) ProtoMessage() {} + +func (x *LocalNodeInfoResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalNodeInfoResponse_Body.ProtoReflect.Descriptor instead. +func (*LocalNodeInfoResponse_Body) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *LocalNodeInfoResponse_Body) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *LocalNodeInfoResponse_Body) GetNodeInfo() *NodeInfo { + if x != nil { + return x.NodeInfo + } + return nil +} + +// NetworkInfo request body is empty. +type NetworkInfoRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NetworkInfoRequest_Body) Reset() { + *x = NetworkInfoRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfoRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfoRequest_Body) ProtoMessage() {} + +func (x *NetworkInfoRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfoRequest_Body.ProtoReflect.Descriptor instead. +func (*NetworkInfoRequest_Body) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{2, 0} +} + +// Information about the network. +type NetworkInfoResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // NetworkInfo structure with recent information. + NetworkInfo *NetworkInfo `protobuf:"bytes,1,opt,name=network_info,json=networkInfo,proto3" json:"network_info,omitempty"` +} + +func (x *NetworkInfoResponse_Body) Reset() { + *x = NetworkInfoResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfoResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfoResponse_Body) ProtoMessage() {} + +func (x *NetworkInfoResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfoResponse_Body.ProtoReflect.Descriptor instead. +func (*NetworkInfoResponse_Body) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *NetworkInfoResponse_Body) GetNetworkInfo() *NetworkInfo { + if x != nil { + return x.NetworkInfo + } + return nil +} + +// Get netmap snapshot request body. +type NetmapSnapshotRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NetmapSnapshotRequest_Body) Reset() { + *x = NetmapSnapshotRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetmapSnapshotRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetmapSnapshotRequest_Body) ProtoMessage() {} + +func (x *NetmapSnapshotRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetmapSnapshotRequest_Body.ProtoReflect.Descriptor instead. +func (*NetmapSnapshotRequest_Body) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{4, 0} +} + +// Get netmap snapshot response body +type NetmapSnapshotResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Structure of the requested network map. + Netmap *Netmap `protobuf:"bytes,1,opt,name=netmap,proto3" json:"netmap,omitempty"` +} + +func (x *NetmapSnapshotResponse_Body) Reset() { + *x = NetmapSnapshotResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetmapSnapshotResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetmapSnapshotResponse_Body) ProtoMessage() {} + +func (x *NetmapSnapshotResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetmapSnapshotResponse_Body.ProtoReflect.Descriptor instead. +func (*NetmapSnapshotResponse_Body) Descriptor() ([]byte, []int) { + return file_netmap_grpc_service_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *NetmapSnapshotResponse_Body) GetNetmap() *Netmap { + if x != nil { + return x.Netmap + } + return nil +} + +var File_netmap_grpc_service_proto protoreflect.FileDescriptor + +var file_netmap_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x1a, 0x17, 0x6e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf9, 0x01, 0x0a, 0x14, 0x4c, 0x6f, 0x63, 0x61, + 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x06, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x22, 0xe9, 0x02, 0x0a, 0x15, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x72, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, + 0xf5, 0x01, 0x0a, 0x12, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, + 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xbb, 0x02, 0x0a, 0x13, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, + 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x48, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x40, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xfb, 0x01, 0x0a, 0x15, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, + 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x06, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x22, 0xb1, 0x02, 0x0a, 0x16, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, + 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, + 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x38, 0x0a, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x52, + 0x06, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x32, 0xb2, 0x02, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x0d, 0x4c, 0x6f, 0x63, + 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4c, 0x6f, + 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0b, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, + 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0e, 0x4e, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, + 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x56, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, + 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, + 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, + 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_netmap_grpc_service_proto_rawDescOnce sync.Once + file_netmap_grpc_service_proto_rawDescData = file_netmap_grpc_service_proto_rawDesc +) + +func file_netmap_grpc_service_proto_rawDescGZIP() []byte { + file_netmap_grpc_service_proto_rawDescOnce.Do(func() { + file_netmap_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_netmap_grpc_service_proto_rawDescData) + }) + return file_netmap_grpc_service_proto_rawDescData +} + +var file_netmap_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_netmap_grpc_service_proto_goTypes = []interface{}{ + (*LocalNodeInfoRequest)(nil), // 0: neo.fs.v2.netmap.LocalNodeInfoRequest + (*LocalNodeInfoResponse)(nil), // 1: neo.fs.v2.netmap.LocalNodeInfoResponse + (*NetworkInfoRequest)(nil), // 2: neo.fs.v2.netmap.NetworkInfoRequest + (*NetworkInfoResponse)(nil), // 3: neo.fs.v2.netmap.NetworkInfoResponse + (*NetmapSnapshotRequest)(nil), // 4: neo.fs.v2.netmap.NetmapSnapshotRequest + (*NetmapSnapshotResponse)(nil), // 5: neo.fs.v2.netmap.NetmapSnapshotResponse + (*LocalNodeInfoRequest_Body)(nil), // 6: neo.fs.v2.netmap.LocalNodeInfoRequest.Body + (*LocalNodeInfoResponse_Body)(nil), // 7: neo.fs.v2.netmap.LocalNodeInfoResponse.Body + (*NetworkInfoRequest_Body)(nil), // 8: neo.fs.v2.netmap.NetworkInfoRequest.Body + (*NetworkInfoResponse_Body)(nil), // 9: neo.fs.v2.netmap.NetworkInfoResponse.Body + (*NetmapSnapshotRequest_Body)(nil), // 10: neo.fs.v2.netmap.NetmapSnapshotRequest.Body + (*NetmapSnapshotResponse_Body)(nil), // 11: neo.fs.v2.netmap.NetmapSnapshotResponse.Body + (*session.RequestMetaHeader)(nil), // 12: neo.fs.v2.session.RequestMetaHeader + (*session.RequestVerificationHeader)(nil), // 13: neo.fs.v2.session.RequestVerificationHeader + (*session.ResponseMetaHeader)(nil), // 14: neo.fs.v2.session.ResponseMetaHeader + (*session.ResponseVerificationHeader)(nil), // 15: neo.fs.v2.session.ResponseVerificationHeader + (*refs.Version)(nil), // 16: neo.fs.v2.refs.Version + (*NodeInfo)(nil), // 17: neo.fs.v2.netmap.NodeInfo + (*NetworkInfo)(nil), // 18: neo.fs.v2.netmap.NetworkInfo + (*Netmap)(nil), // 19: neo.fs.v2.netmap.Netmap +} +var file_netmap_grpc_service_proto_depIdxs = []int32{ + 6, // 0: neo.fs.v2.netmap.LocalNodeInfoRequest.body:type_name -> neo.fs.v2.netmap.LocalNodeInfoRequest.Body + 12, // 1: neo.fs.v2.netmap.LocalNodeInfoRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 2: neo.fs.v2.netmap.LocalNodeInfoRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 7, // 3: neo.fs.v2.netmap.LocalNodeInfoResponse.body:type_name -> neo.fs.v2.netmap.LocalNodeInfoResponse.Body + 14, // 4: neo.fs.v2.netmap.LocalNodeInfoResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 5: neo.fs.v2.netmap.LocalNodeInfoResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.netmap.NetworkInfoRequest.body:type_name -> neo.fs.v2.netmap.NetworkInfoRequest.Body + 12, // 7: neo.fs.v2.netmap.NetworkInfoRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 8: neo.fs.v2.netmap.NetworkInfoRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 9, // 9: neo.fs.v2.netmap.NetworkInfoResponse.body:type_name -> neo.fs.v2.netmap.NetworkInfoResponse.Body + 14, // 10: neo.fs.v2.netmap.NetworkInfoResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 11: neo.fs.v2.netmap.NetworkInfoResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 10, // 12: neo.fs.v2.netmap.NetmapSnapshotRequest.body:type_name -> neo.fs.v2.netmap.NetmapSnapshotRequest.Body + 12, // 13: neo.fs.v2.netmap.NetmapSnapshotRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 14: neo.fs.v2.netmap.NetmapSnapshotRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 11, // 15: neo.fs.v2.netmap.NetmapSnapshotResponse.body:type_name -> neo.fs.v2.netmap.NetmapSnapshotResponse.Body + 14, // 16: neo.fs.v2.netmap.NetmapSnapshotResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 17: neo.fs.v2.netmap.NetmapSnapshotResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 16, // 18: neo.fs.v2.netmap.LocalNodeInfoResponse.Body.version:type_name -> neo.fs.v2.refs.Version + 17, // 19: neo.fs.v2.netmap.LocalNodeInfoResponse.Body.node_info:type_name -> neo.fs.v2.netmap.NodeInfo + 18, // 20: neo.fs.v2.netmap.NetworkInfoResponse.Body.network_info:type_name -> neo.fs.v2.netmap.NetworkInfo + 19, // 21: neo.fs.v2.netmap.NetmapSnapshotResponse.Body.netmap:type_name -> neo.fs.v2.netmap.Netmap + 0, // 22: neo.fs.v2.netmap.NetmapService.LocalNodeInfo:input_type -> neo.fs.v2.netmap.LocalNodeInfoRequest + 2, // 23: neo.fs.v2.netmap.NetmapService.NetworkInfo:input_type -> neo.fs.v2.netmap.NetworkInfoRequest + 4, // 24: neo.fs.v2.netmap.NetmapService.NetmapSnapshot:input_type -> neo.fs.v2.netmap.NetmapSnapshotRequest + 1, // 25: neo.fs.v2.netmap.NetmapService.LocalNodeInfo:output_type -> neo.fs.v2.netmap.LocalNodeInfoResponse + 3, // 26: neo.fs.v2.netmap.NetmapService.NetworkInfo:output_type -> neo.fs.v2.netmap.NetworkInfoResponse + 5, // 27: neo.fs.v2.netmap.NetmapService.NetmapSnapshot:output_type -> neo.fs.v2.netmap.NetmapSnapshotResponse + 25, // [25:28] is the sub-list for method output_type + 22, // [22:25] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name +} + +func init() { file_netmap_grpc_service_proto_init() } +func file_netmap_grpc_service_proto_init() { + if File_netmap_grpc_service_proto != nil { + return + } + file_netmap_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_netmap_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalNodeInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalNodeInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetmapSnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetmapSnapshotResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalNodeInfoRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalNodeInfoResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfoRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfoResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetmapSnapshotRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetmapSnapshotResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_netmap_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_netmap_grpc_service_proto_goTypes, + DependencyIndexes: file_netmap_grpc_service_proto_depIdxs, + MessageInfos: file_netmap_grpc_service_proto_msgTypes, + }.Build() + File_netmap_grpc_service_proto = out.File + file_netmap_grpc_service_proto_rawDesc = nil + file_netmap_grpc_service_proto_goTypes = nil + file_netmap_grpc_service_proto_depIdxs = nil +} diff --git a/api/netmap/service_grpc.pb.go b/api/netmap/service_grpc.pb.go new file mode 100644 index 00000000..69c702e4 --- /dev/null +++ b/api/netmap/service_grpc.pb.go @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: netmap/grpc/service.proto + +package netmap + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + NetmapService_LocalNodeInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo" + NetmapService_NetworkInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/NetworkInfo" + NetmapService_NetmapSnapshot_FullMethodName = "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot" +) + +// NetmapServiceClient is the client API for NetmapService 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 NetmapServiceClient interface { + // Get NodeInfo structure from the particular node directly. + // Node information can be taken from `Netmap` smart contract. In some cases, though, + // one may want to get recent information directly or to talk to the node not yet + // present in the `Network Map` to find out what API version can be used for + // further communication. This can be also used to check if a node is up and running. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the server has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) + // Read recent information about the NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network state has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) + // Returns network map snapshot of the current NeoFS epoch. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network map has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) +} + +type netmapServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient { + return &netmapServiceClient{cc} +} + +func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) { + out := new(LocalNodeInfoResponse) + err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { + out := new(NetworkInfoResponse) + err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) { + out := new(NetmapSnapshotResponse) + err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetmapServiceServer is the server API for NetmapService service. +// All implementations should embed UnimplementedNetmapServiceServer +// for forward compatibility +type NetmapServiceServer interface { + // Get NodeInfo structure from the particular node directly. + // Node information can be taken from `Netmap` smart contract. In some cases, though, + // one may want to get recent information directly or to talk to the node not yet + // present in the `Network Map` to find out what API version can be used for + // further communication. This can be also used to check if a node is up and running. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the server has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) + // Read recent information about the NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network state has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) + // Returns network map snapshot of the current NeoFS epoch. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network map has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) +} + +// UnimplementedNetmapServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNetmapServiceServer struct { +} + +func (UnimplementedNetmapServiceServer) LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LocalNodeInfo not implemented") +} +func (UnimplementedNetmapServiceServer) NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NetworkInfo not implemented") +} +func (UnimplementedNetmapServiceServer) NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NetmapSnapshot not implemented") +} + +// UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NetmapServiceServer will +// result in compilation errors. +type UnsafeNetmapServiceServer interface { + mustEmbedUnimplementedNetmapServiceServer() +} + +func RegisterNetmapServiceServer(s grpc.ServiceRegistrar, srv NetmapServiceServer) { + s.RegisterService(&NetmapService_ServiceDesc, srv) +} + +func _NetmapService_LocalNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LocalNodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetmapServiceServer).LocalNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetmapService_LocalNodeInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetmapServiceServer).LocalNodeInfo(ctx, req.(*LocalNodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetmapService_NetworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NetworkInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetmapServiceServer).NetworkInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetmapService_NetworkInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetmapServiceServer).NetworkInfo(ctx, req.(*NetworkInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetmapService_NetmapSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NetmapSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetmapServiceServer).NetmapSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetmapService_NetmapSnapshot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetmapServiceServer).NetmapSnapshot(ctx, req.(*NetmapSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NetmapService_ServiceDesc is the grpc.ServiceDesc for NetmapService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NetmapService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.netmap.NetmapService", + HandlerType: (*NetmapServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "LocalNodeInfo", + Handler: _NetmapService_LocalNodeInfo_Handler, + }, + { + MethodName: "NetworkInfo", + Handler: _NetmapService_NetworkInfo_Handler, + }, + { + MethodName: "NetmapSnapshot", + Handler: _NetmapService_NetmapSnapshot_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "netmap/grpc/service.proto", +} diff --git a/api/netmap/types.pb.go b/api/netmap/types.pb.go new file mode 100644 index 00000000..aea6e632 --- /dev/null +++ b/api/netmap/types.pb.go @@ -0,0 +1,1367 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: netmap/grpc/types.proto + +package netmap + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Operations on filters +type Operation int32 + +const ( + // No Operation defined + Operation_OPERATION_UNSPECIFIED Operation = 0 + // Equal + Operation_EQ Operation = 1 + // Not Equal + Operation_NE Operation = 2 + // Greater then + Operation_GT Operation = 3 + // Greater or equal + Operation_GE Operation = 4 + // Less then + Operation_LT Operation = 5 + // Less or equal + Operation_LE Operation = 6 + // Logical OR + Operation_OR Operation = 7 + // Logical AND + Operation_AND Operation = 8 +) + +// Enum value maps for Operation. +var ( + Operation_name = map[int32]string{ + 0: "OPERATION_UNSPECIFIED", + 1: "EQ", + 2: "NE", + 3: "GT", + 4: "GE", + 5: "LT", + 6: "LE", + 7: "OR", + 8: "AND", + } + Operation_value = map[string]int32{ + "OPERATION_UNSPECIFIED": 0, + "EQ": 1, + "NE": 2, + "GT": 3, + "GE": 4, + "LT": 5, + "LE": 6, + "OR": 7, + "AND": 8, + } +) + +func (x Operation) Enum() *Operation { + p := new(Operation) + *p = x + return p +} + +func (x Operation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Operation) Descriptor() protoreflect.EnumDescriptor { + return file_netmap_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Operation) Type() protoreflect.EnumType { + return &file_netmap_grpc_types_proto_enumTypes[0] +} + +func (x Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Operation.Descriptor instead. +func (Operation) EnumDescriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// Selector modifier shows how the node set will be formed. By default selector +// just groups nodes into a bucket by attribute, selecting nodes only by their +// hash distance. +type Clause int32 + +const ( + // No modifier defined. Nodes will be selected from the bucket randomly + Clause_CLAUSE_UNSPECIFIED Clause = 0 + // SAME will select only nodes having the same value of bucket attribute + Clause_SAME Clause = 1 + // DISTINCT will select nodes having different values of bucket attribute + Clause_DISTINCT Clause = 2 +) + +// Enum value maps for Clause. +var ( + Clause_name = map[int32]string{ + 0: "CLAUSE_UNSPECIFIED", + 1: "SAME", + 2: "DISTINCT", + } + Clause_value = map[string]int32{ + "CLAUSE_UNSPECIFIED": 0, + "SAME": 1, + "DISTINCT": 2, + } +) + +func (x Clause) Enum() *Clause { + p := new(Clause) + *p = x + return p +} + +func (x Clause) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Clause) Descriptor() protoreflect.EnumDescriptor { + return file_netmap_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (Clause) Type() protoreflect.EnumType { + return &file_netmap_grpc_types_proto_enumTypes[1] +} + +func (x Clause) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Clause.Descriptor instead. +func (Clause) EnumDescriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{1} +} + +// Represents the enumeration of various states of the NeoFS node. +type NodeInfo_State int32 + +const ( + // Unknown state + NodeInfo_UNSPECIFIED NodeInfo_State = 0 + // Active state in the network + NodeInfo_ONLINE NodeInfo_State = 1 + // Network unavailable state + NodeInfo_OFFLINE NodeInfo_State = 2 + // Maintenance state + NodeInfo_MAINTENANCE NodeInfo_State = 3 +) + +// Enum value maps for NodeInfo_State. +var ( + NodeInfo_State_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "ONLINE", + 2: "OFFLINE", + 3: "MAINTENANCE", + } + NodeInfo_State_value = map[string]int32{ + "UNSPECIFIED": 0, + "ONLINE": 1, + "OFFLINE": 2, + "MAINTENANCE": 3, + } +) + +func (x NodeInfo_State) Enum() *NodeInfo_State { + p := new(NodeInfo_State) + *p = x + return p +} + +func (x NodeInfo_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NodeInfo_State) Descriptor() protoreflect.EnumDescriptor { + return file_netmap_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (NodeInfo_State) Type() protoreflect.EnumType { + return &file_netmap_grpc_types_proto_enumTypes[2] +} + +func (x NodeInfo_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use NodeInfo_State.Descriptor instead. +func (NodeInfo_State) EnumDescriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4, 0} +} + +// This filter will return the subset of nodes from `NetworkMap` or another filter's +// results that will satisfy filter's conditions. +type Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the filter or a reference to a named filter. '*' means + // application to the whole unfiltered NetworkMap. At top level it's used as a + // filter name. At lower levels it's considered to be a reference to another + // named filter + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Key to filter + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // Filtering operation + Op Operation `protobuf:"varint,3,opt,name=op,proto3,enum=neo.fs.v2.netmap.Operation" json:"op,omitempty"` + // Value to match + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + // List of inner filters. Top level operation will be applied to the whole + // list. + Filters []*Filter `protobuf:"bytes,5,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *Filter) Reset() { + *x = Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Filter) ProtoMessage() {} + +func (x *Filter) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Filter.ProtoReflect.Descriptor instead. +func (*Filter) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Filter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Filter) GetOp() Operation { + if x != nil { + return x.Op + } + return Operation_OPERATION_UNSPECIFIED +} + +func (x *Filter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Filter) GetFilters() []*Filter { + if x != nil { + return x.Filters + } + return nil +} + +// Selector chooses a number of nodes from the bucket taking the nearest nodes +// to the provided `ContainerID` by hash distance. +type Selector struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Selector name to reference in object placement section + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // How many nodes to select from the bucket + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + // Selector modifier showing how to form a bucket + Clause Clause `protobuf:"varint,3,opt,name=clause,proto3,enum=neo.fs.v2.netmap.Clause" json:"clause,omitempty"` + // Bucket attribute to select from + Attribute string `protobuf:"bytes,4,opt,name=attribute,proto3" json:"attribute,omitempty"` + // Filter reference to select from + Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *Selector) Reset() { + *x = Selector{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Selector) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Selector) ProtoMessage() {} + +func (x *Selector) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Selector.ProtoReflect.Descriptor instead. +func (*Selector) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Selector) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Selector) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *Selector) GetClause() Clause { + if x != nil { + return x.Clause + } + return Clause_CLAUSE_UNSPECIFIED +} + +func (x *Selector) GetAttribute() string { + if x != nil { + return x.Attribute + } + return "" +} + +func (x *Selector) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +// Number of object replicas in a set of nodes from the defined selector. If no +// selector set, the root bucket containing all possible nodes will be used by +// default. +type Replica struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // How many object replicas to put + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + // Named selector bucket to put replicas + Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` +} + +func (x *Replica) Reset() { + *x = Replica{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Replica) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Replica) ProtoMessage() {} + +func (x *Replica) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Replica.ProtoReflect.Descriptor instead. +func (*Replica) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{2} +} + +func (x *Replica) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *Replica) GetSelector() string { + if x != nil { + return x.Selector + } + return "" +} + +// Set of rules to select a subset of nodes from `NetworkMap` able to store +// container's objects. The format is simple enough to transpile from different +// storage policy definition languages. +type PlacementPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Rules to set number of object replicas and place each one into a named + // bucket + Replicas []*Replica `protobuf:"bytes,1,rep,name=replicas,proto3" json:"replicas,omitempty"` + // Container backup factor controls how deep NeoFS will search for nodes + // alternatives to include into container's nodes subset + ContainerBackupFactor uint32 `protobuf:"varint,2,opt,name=container_backup_factor,json=containerBackupFactor,proto3" json:"container_backup_factor,omitempty"` + // Set of Selectors to form the container's nodes subset + Selectors []*Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` + // List of named filters to reference in selectors + Filters []*Filter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` + // DEPRECATED. Was used for subnetwork ID to select nodes from, currently + // ignored. + // + // Deprecated: Marked as deprecated in netmap/grpc/types.proto. + SubnetId *refs.SubnetID `protobuf:"bytes,5,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` +} + +func (x *PlacementPolicy) Reset() { + *x = PlacementPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlacementPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlacementPolicy) ProtoMessage() {} + +func (x *PlacementPolicy) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlacementPolicy.ProtoReflect.Descriptor instead. +func (*PlacementPolicy) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{3} +} + +func (x *PlacementPolicy) GetReplicas() []*Replica { + if x != nil { + return x.Replicas + } + return nil +} + +func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { + if x != nil { + return x.ContainerBackupFactor + } + return 0 +} + +func (x *PlacementPolicy) GetSelectors() []*Selector { + if x != nil { + return x.Selectors + } + return nil +} + +func (x *PlacementPolicy) GetFilters() []*Filter { + if x != nil { + return x.Filters + } + return nil +} + +// Deprecated: Marked as deprecated in netmap/grpc/types.proto. +func (x *PlacementPolicy) GetSubnetId() *refs.SubnetID { + if x != nil { + return x.SubnetId + } + return nil +} + +// NeoFS node description +type NodeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Public key of the NeoFS node in a binary format + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // Ways to connect to a node + Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` + // Carries list of the NeoFS node attributes in a key-value form. Key name + // must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo + // structures with duplicated attribute names or attributes with empty values + // will be considered invalid. + Attributes []*NodeInfo_Attribute `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty"` + // Carries state of the NeoFS node + State NodeInfo_State `protobuf:"varint,4,opt,name=state,proto3,enum=neo.fs.v2.netmap.NodeInfo_State" json:"state,omitempty"` +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfo) ProtoMessage() {} + +func (x *NodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead. +func (*NodeInfo) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4} +} + +func (x *NodeInfo) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *NodeInfo) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +func (x *NodeInfo) GetAttributes() []*NodeInfo_Attribute { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *NodeInfo) GetState() NodeInfo_State { + if x != nil { + return x.State + } + return NodeInfo_UNSPECIFIED +} + +// Network map structure +type Netmap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Network map revision number. + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + // Nodes presented in network. + Nodes []*NodeInfo `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +func (x *Netmap) Reset() { + *x = Netmap{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Netmap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Netmap) ProtoMessage() {} + +func (x *Netmap) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Netmap.ProtoReflect.Descriptor instead. +func (*Netmap) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{5} +} + +func (x *Netmap) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *Netmap) GetNodes() []*NodeInfo { + if x != nil { + return x.Nodes + } + return nil +} + +// NeoFS network configuration +type NetworkConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of parameter values + Parameters []*NetworkConfig_Parameter `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty"` +} + +func (x *NetworkConfig) Reset() { + *x = NetworkConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkConfig) ProtoMessage() {} + +func (x *NetworkConfig) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkConfig.ProtoReflect.Descriptor instead. +func (*NetworkConfig) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{6} +} + +func (x *NetworkConfig) GetParameters() []*NetworkConfig_Parameter { + if x != nil { + return x.Parameters + } + return nil +} + +// Information about NeoFS network +type NetworkInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Number of the current epoch in the NeoFS network + CurrentEpoch uint64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // Magic number of the sidechain of the NeoFS network + MagicNumber uint64 `protobuf:"varint,2,opt,name=magic_number,json=magicNumber,proto3" json:"magic_number,omitempty"` + // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network + MsPerBlock int64 `protobuf:"varint,3,opt,name=ms_per_block,json=msPerBlock,proto3" json:"ms_per_block,omitempty"` + // NeoFS network configuration + NetworkConfig *NetworkConfig `protobuf:"bytes,4,opt,name=network_config,json=networkConfig,proto3" json:"network_config,omitempty"` +} + +func (x *NetworkInfo) Reset() { + *x = NetworkInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfo) ProtoMessage() {} + +func (x *NetworkInfo) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfo.ProtoReflect.Descriptor instead. +func (*NetworkInfo) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{7} +} + +func (x *NetworkInfo) GetCurrentEpoch() uint64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} + +func (x *NetworkInfo) GetMagicNumber() uint64 { + if x != nil { + return x.MagicNumber + } + return 0 +} + +func (x *NetworkInfo) GetMsPerBlock() int64 { + if x != nil { + return x.MsPerBlock + } + return 0 +} + +func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { + if x != nil { + return x.NetworkConfig + } + return nil +} + +// Administrator-defined Attributes of the NeoFS Storage Node. +// +// `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 +// string. Value can't be empty. +// +// Attributes can be constructed into a chain of attributes: any attribute can +// have a parent attribute and a child attribute (except the first and the last +// one). A string representation of the chain of attributes in NeoFS Storage +// Node configuration uses ":" and "/" symbols, e.g.: +// +// `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` +// +// Therefore the string attribute representation in the Node configuration must +// use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's +// key or value. +// +// Node's attributes are mostly used during Storage Policy evaluation to +// calculate object's placement and find a set of nodes satisfying policy +// requirements. There are some "well-known" node attributes common to all the +// Storage Nodes in the network and used implicitly with default values if not +// explicitly set: +// +// - Capacity \ +// Total available disk space in Gigabytes. +// - Price \ +// Price in GAS tokens for storing one GB of data during one Epoch. In node +// attributes it's a string presenting floating point number with comma or +// point delimiter for decimal part. In the Network Map it will be saved as +// 64-bit unsigned integer representing number of minimal token fractions. +// - __NEOFS__SUBNET_%s \ +// DEPRECATED. Defined if the node is included in the `%s` subnetwork +// or not. Currently ignored. +// - UN-LOCODE \ +// Node's geographic location in +// [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) +// format approximated to the nearest point defined in the standard. +// - CountryCode \ +// Country code in +// [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) +// format. Calculated automatically from `UN-LOCODE` attribute. +// - Country \ +// Country short name in English, as defined in +// [ISO-3166](https://www.iso.org/obp/ui/#search). Calculated automatically +// from `UN-LOCODE` attribute. +// - Location \ +// Place names are given, whenever possible, in their national language +// versions as expressed in the Roman alphabet using the 26 characters of +// the character set adopted for international trade data interchange, +// written without diacritics . Calculated automatically from `UN-LOCODE` +// attribute. +// - SubDivCode \ +// Country's administrative subdivision where node is located. Calculated +// automatically from `UN-LOCODE` attribute based on `SubDiv` field. +// Presented in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) +// format. +// - SubDiv \ +// Country's administrative subdivision name, as defined in +// [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). Calculated +// automatically from `UN-LOCODE` attribute. +// - Continent \ +// Node's continent name according to the [Seven-Continent model] +// (https://en.wikipedia.org/wiki/Continent#Number). Calculated +// automatically from `UN-LOCODE` attribute. +// - ExternalAddr +// Node's preferred way for communications with external clients. +// Clients SHOULD use these addresses if possible. +// Must contain a comma-separated list of multi-addresses. +// - Version +// Node implementation's version in a free string form. +// - VerifiedNodesDomain +// Confirmation of admission to a group of storage nodes. +// The value is the domain name registered in the NeoFS NNS. If attribute +// is specified, the storage node requesting entry into the NeoFS network +// map with this attribute must be included in the access list located on +// the specified domain. The access list is represented by a set of TXT +// records: Neo addresses resolved from public keys. To be admitted to the +// network, Neo address of the node's public key declared in 'public_key' +// field must be present in domain records. Otherwise, registration will be +// denied. +// Value must be a valid NeoFS NNS domain name. Note that if this attribute +// is absent, this check is not carried out. +// +// For detailed description of each well-known attribute please see the +// corresponding section in NeoFS Technical Specification. +type NodeInfo_Attribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Key of the node attribute + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Value of the node attribute + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // Parent keys, if any. For example for `City` it could be `Region` and + // `Country`. + Parents []string `protobuf:"bytes,3,rep,name=parents,proto3" json:"parents,omitempty"` +} + +func (x *NodeInfo_Attribute) Reset() { + *x = NodeInfo_Attribute{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfo_Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfo_Attribute) ProtoMessage() {} + +func (x *NodeInfo_Attribute) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeInfo_Attribute.ProtoReflect.Descriptor instead. +func (*NodeInfo_Attribute) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *NodeInfo_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *NodeInfo_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *NodeInfo_Attribute) GetParents() []string { + if x != nil { + return x.Parents + } + return nil +} + +// Single configuration parameter. Key MUST be network-unique. +// +// System parameters: +// - **AuditFee** \ +// Fee paid by the storage group owner to the Inner Ring member. +// Value: little-endian integer. Default: 0. +// - **BasicIncomeRate** \ +// Cost of storing one gigabyte of data for a period of one epoch. Paid by +// container owner to container nodes. +// Value: little-endian integer. Default: 0. +// - **ContainerAliasFee** \ +// Fee paid for named container's creation by the container owner. +// Value: little-endian integer. Default: 0. +// - **ContainerFee** \ +// Fee paid for container creation by the container owner. +// Value: little-endian integer. Default: 0. +// - **EigenTrustAlpha** \ +// Alpha parameter of EigenTrust algorithm used in the Reputation system. +// Value: decimal floating-point number in UTF-8 string representation. +// Default: 0. +// - **EigenTrustIterations** \ +// Number of EigenTrust algorithm iterations to pass in the Reputation system. +// Value: little-endian integer. Default: 0. +// - **EpochDuration** \ +// NeoFS epoch duration measured in Sidechain blocks. +// Value: little-endian integer. Default: 0. +// - **HomomorphicHashingDisabled** \ +// Flag of disabling the homomorphic hashing of objects' payload. +// Value: true if any byte != 0. Default: false. +// - **InnerRingCandidateFee** \ +// Fee for entrance to the Inner Ring paid by the candidate. +// Value: little-endian integer. Default: 0. +// - **MaintenanceModeAllowed** \ +// Flag allowing setting the MAINTENANCE state to storage nodes. +// Value: true if any byte != 0. Default: false. +// - **MaxObjectSize** \ +// Maximum size of physically stored NeoFS object measured in bytes. +// Value: little-endian integer. Default: 0. +// - **WithdrawFee** \ +// Fee paid for withdrawal of funds paid by the account owner. +// Value: little-endian integer. Default: 0. +type NetworkConfig_Parameter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Parameter key. UTF-8 encoded string + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Parameter value + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *NetworkConfig_Parameter) Reset() { + *x = NetworkConfig_Parameter{} + if protoimpl.UnsafeEnabled { + mi := &file_netmap_grpc_types_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkConfig_Parameter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkConfig_Parameter) ProtoMessage() {} + +func (x *NetworkConfig_Parameter) ProtoReflect() protoreflect.Message { + mi := &file_netmap_grpc_types_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkConfig_Parameter.ProtoReflect.Descriptor instead. +func (*NetworkConfig_Parameter) Descriptor() ([]byte, []int) { + return file_netmap_grpc_types_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *NetworkConfig_Parameter) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *NetworkConfig_Parameter) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +var File_netmap_grpc_types_proto protoreflect.FileDescriptor + +var file_netmap_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x1a, 0x15, 0x72, 0x65, 0x66, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, + 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x52, 0x06, 0x63, 0x6c, 0x61, + 0x75, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xa9, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, + 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x49, 0x44, 0x42, 0x02, 0x18, 0x01, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, + 0x49, 0x64, 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, + 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, + 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 0x0a, 0x09, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, + 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, + 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, + 0x06, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, + 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, + 0x8f, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, + 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2a, 0x67, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, + 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, + 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, + 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, + 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x2a, 0x38, 0x0a, 0x06, + 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, + 0x49, 0x4e, 0x43, 0x54, 0x10, 0x02, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, + 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_netmap_grpc_types_proto_rawDescOnce sync.Once + file_netmap_grpc_types_proto_rawDescData = file_netmap_grpc_types_proto_rawDesc +) + +func file_netmap_grpc_types_proto_rawDescGZIP() []byte { + file_netmap_grpc_types_proto_rawDescOnce.Do(func() { + file_netmap_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_netmap_grpc_types_proto_rawDescData) + }) + return file_netmap_grpc_types_proto_rawDescData +} + +var file_netmap_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_netmap_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_netmap_grpc_types_proto_goTypes = []interface{}{ + (Operation)(0), // 0: neo.fs.v2.netmap.Operation + (Clause)(0), // 1: neo.fs.v2.netmap.Clause + (NodeInfo_State)(0), // 2: neo.fs.v2.netmap.NodeInfo.State + (*Filter)(nil), // 3: neo.fs.v2.netmap.Filter + (*Selector)(nil), // 4: neo.fs.v2.netmap.Selector + (*Replica)(nil), // 5: neo.fs.v2.netmap.Replica + (*PlacementPolicy)(nil), // 6: neo.fs.v2.netmap.PlacementPolicy + (*NodeInfo)(nil), // 7: neo.fs.v2.netmap.NodeInfo + (*Netmap)(nil), // 8: neo.fs.v2.netmap.Netmap + (*NetworkConfig)(nil), // 9: neo.fs.v2.netmap.NetworkConfig + (*NetworkInfo)(nil), // 10: neo.fs.v2.netmap.NetworkInfo + (*NodeInfo_Attribute)(nil), // 11: neo.fs.v2.netmap.NodeInfo.Attribute + (*NetworkConfig_Parameter)(nil), // 12: neo.fs.v2.netmap.NetworkConfig.Parameter + (*refs.SubnetID)(nil), // 13: neo.fs.v2.refs.SubnetID +} +var file_netmap_grpc_types_proto_depIdxs = []int32{ + 0, // 0: neo.fs.v2.netmap.Filter.op:type_name -> neo.fs.v2.netmap.Operation + 3, // 1: neo.fs.v2.netmap.Filter.filters:type_name -> neo.fs.v2.netmap.Filter + 1, // 2: neo.fs.v2.netmap.Selector.clause:type_name -> neo.fs.v2.netmap.Clause + 5, // 3: neo.fs.v2.netmap.PlacementPolicy.replicas:type_name -> neo.fs.v2.netmap.Replica + 4, // 4: neo.fs.v2.netmap.PlacementPolicy.selectors:type_name -> neo.fs.v2.netmap.Selector + 3, // 5: neo.fs.v2.netmap.PlacementPolicy.filters:type_name -> neo.fs.v2.netmap.Filter + 13, // 6: neo.fs.v2.netmap.PlacementPolicy.subnet_id:type_name -> neo.fs.v2.refs.SubnetID + 11, // 7: neo.fs.v2.netmap.NodeInfo.attributes:type_name -> neo.fs.v2.netmap.NodeInfo.Attribute + 2, // 8: neo.fs.v2.netmap.NodeInfo.state:type_name -> neo.fs.v2.netmap.NodeInfo.State + 7, // 9: neo.fs.v2.netmap.Netmap.nodes:type_name -> neo.fs.v2.netmap.NodeInfo + 12, // 10: neo.fs.v2.netmap.NetworkConfig.parameters:type_name -> neo.fs.v2.netmap.NetworkConfig.Parameter + 9, // 11: neo.fs.v2.netmap.NetworkInfo.network_config:type_name -> neo.fs.v2.netmap.NetworkConfig + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_netmap_grpc_types_proto_init() } +func file_netmap_grpc_types_proto_init() { + if File_netmap_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_netmap_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Selector); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Replica); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlacementPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Netmap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfo_Attribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_netmap_grpc_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkConfig_Parameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_netmap_grpc_types_proto_rawDesc, + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_netmap_grpc_types_proto_goTypes, + DependencyIndexes: file_netmap_grpc_types_proto_depIdxs, + EnumInfos: file_netmap_grpc_types_proto_enumTypes, + MessageInfos: file_netmap_grpc_types_proto_msgTypes, + }.Build() + File_netmap_grpc_types_proto = out.File + file_netmap_grpc_types_proto_rawDesc = nil + file_netmap_grpc_types_proto_goTypes = nil + file_netmap_grpc_types_proto_depIdxs = nil +} diff --git a/api/object/encoding.go b/api/object/encoding.go new file mode 100644 index 00000000..edfd65e5 --- /dev/null +++ b/api/object/encoding.go @@ -0,0 +1,650 @@ +package object + +import ( + "fmt" + + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" +) + +const ( + _ = iota + fieldSplitParent + fieldSplitPrevious + fieldSplitParentSignature + fieldSplitParentHeader + fieldSplitChildren + fieldSplitID + fieldSplitFirst +) + +func (x *Header_Split) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldSplitParent, x.Parent) + + proto.SizeNested(fieldSplitPrevious, x.Previous) + + proto.SizeNested(fieldSplitParentSignature, x.ParentSignature) + + proto.SizeNested(fieldSplitParentHeader, x.ParentHeader) + + proto.SizeBytes(fieldSplitID, x.SplitId) + + proto.SizeNested(fieldSplitFirst, x.First) + for i := range x.Children { + sz += proto.SizeNested(fieldSplitChildren, x.Children[i]) + } + } + return sz +} + +func (x *Header_Split) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldSplitParent, x.Parent) + off += proto.MarshalNested(b[off:], fieldSplitPrevious, x.Previous) + off += proto.MarshalNested(b[off:], fieldSplitParentSignature, x.ParentSignature) + off += proto.MarshalNested(b[off:], fieldSplitParentHeader, x.ParentHeader) + off += proto.MarshalBytes(b[off:], fieldSplitID, x.SplitId) + for i := range x.Children { + off += proto.MarshalNested(b[off:], fieldSplitChildren, x.Children[i]) + } + proto.MarshalNested(b[off:], fieldSplitFirst, x.First) + } +} + +const ( + _ = iota + fieldAttributeKey + fieldAttributeValue +) + +func (x *Header_Attribute) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldAttributeKey, x.Key) + + proto.SizeBytes(fieldAttributeValue, x.Value) + } + return sz +} + +func (x *Header_Attribute) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldAttributeKey, x.Key) + proto.MarshalBytes(b[off:], fieldAttributeValue, x.Value) + } +} + +const ( + _ = iota + fieldShortHeaderVersion + fieldShortHeaderCreationEpoch + fieldShortHeaderOwner + fieldShortHeaderType + fieldShortHeaderLen + fieldShortHeaderChecksum + fieldShortHeaderHomomorphic +) + +func (x *ShortHeader) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldShortHeaderVersion, x.Version) + + proto.SizeVarint(fieldShortHeaderCreationEpoch, x.CreationEpoch) + + proto.SizeNested(fieldShortHeaderOwner, x.OwnerId) + + proto.SizeVarint(fieldShortHeaderType, int32(x.ObjectType)) + + proto.SizeVarint(fieldShortHeaderLen, x.PayloadLength) + + proto.SizeNested(fieldShortHeaderChecksum, x.PayloadHash) + + proto.SizeNested(fieldShortHeaderHomomorphic, x.HomomorphicHash) + } + return sz +} + +func (x *ShortHeader) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldShortHeaderVersion, x.Version) + off += proto.MarshalVarint(b[off:], fieldShortHeaderCreationEpoch, x.CreationEpoch) + off += proto.MarshalNested(b[off:], fieldShortHeaderOwner, x.OwnerId) + off += proto.MarshalVarint(b[off:], fieldShortHeaderType, int32(x.ObjectType)) + off += proto.MarshalVarint(b[off:], fieldShortHeaderLen, x.PayloadLength) + off += proto.MarshalNested(b[off:], fieldShortHeaderChecksum, x.PayloadHash) + off += proto.MarshalNested(b[off:], fieldShortHeaderHomomorphic, x.HomomorphicHash) + } +} + +const ( + _ = iota + fieldHeaderVersion + fieldHeaderContainer + fieldHeaderOwner + fieldHeaderCreationEpoch + fieldHeaderLen + fieldHeaderChecksum + fieldHeaderType + fieldHeaderHomomorphic + fieldHeaderSession + fieldHeaderAttributes + fieldHeaderSplit +) + +func (x *Header) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldHeaderVersion, x.Version) + + proto.SizeNested(fieldHeaderContainer, x.ContainerId) + + proto.SizeNested(fieldHeaderOwner, x.OwnerId) + + proto.SizeVarint(fieldHeaderCreationEpoch, x.CreationEpoch) + + proto.SizeVarint(fieldHeaderLen, x.PayloadLength) + + proto.SizeNested(fieldHeaderChecksum, x.PayloadHash) + + proto.SizeVarint(fieldHeaderType, int32(x.ObjectType)) + + proto.SizeNested(fieldHeaderHomomorphic, x.HomomorphicHash) + + proto.SizeNested(fieldHeaderSession, x.SessionToken) + + proto.SizeNested(fieldHeaderSplit, x.Split) + for i := range x.Attributes { + sz += proto.SizeNested(fieldHeaderAttributes, x.Attributes[i]) + } + } + return sz +} + +func (x *Header) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldHeaderVersion, x.Version) + off += proto.MarshalNested(b[off:], fieldHeaderContainer, x.ContainerId) + off += proto.MarshalNested(b[off:], fieldHeaderOwner, x.OwnerId) + off += proto.MarshalVarint(b[off:], fieldHeaderCreationEpoch, x.CreationEpoch) + off += proto.MarshalVarint(b[off:], fieldHeaderLen, x.PayloadLength) + off += proto.MarshalNested(b[off:], fieldHeaderChecksum, x.PayloadHash) + off += proto.MarshalVarint(b[off:], fieldHeaderType, int32(x.ObjectType)) + off += proto.MarshalNested(b[off:], fieldHeaderHomomorphic, x.HomomorphicHash) + off += proto.MarshalNested(b[off:], fieldHeaderSession, x.SessionToken) + for i := range x.Attributes { + off += proto.MarshalNested(b[off:], fieldHeaderAttributes, x.Attributes[i]) + } + proto.MarshalNested(b[off:], fieldHeaderSplit, x.Split) + } +} + +const ( + _ = iota + fieldObjectID + fieldObjectSignature + fieldObjectHeader + fieldObjectPayload +) + +func (x *Object) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldObjectID, x.ObjectId) + + proto.SizeNested(fieldObjectSignature, x.Signature) + + proto.SizeNested(fieldObjectHeader, x.Header) + + proto.SizeBytes(fieldObjectPayload, x.Payload) + } + return sz +} + +func (x *Object) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldObjectID, x.ObjectId) + off += proto.MarshalNested(b[off:], fieldObjectSignature, x.Signature) + off += proto.MarshalNested(b[off:], fieldObjectHeader, x.Header) + proto.MarshalBytes(b[off:], fieldObjectPayload, x.Payload) + } +} + +const ( + _ = iota + fieldSplitInfoID + fieldSplitInfoLast + fieldSplitInfoLink + fieldSplitInfoFirst +) + +func (x *SplitInfo) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldSplitInfoID, x.SplitId) + + proto.SizeNested(fieldSplitInfoLast, x.LastPart) + + proto.SizeNested(fieldSplitInfoLink, x.Link) + + proto.SizeNested(fieldSplitInfoFirst, x.FirstPart) + } + return sz +} + +func (x *SplitInfo) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldSplitInfoID, x.SplitId) + off += proto.MarshalNested(b[off:], fieldSplitInfoLast, x.LastPart) + off += proto.MarshalNested(b[off:], fieldSplitInfoLink, x.Link) + proto.MarshalNested(b[off:], fieldSplitInfoFirst, x.FirstPart) + } +} + +const ( + _ = iota + fieldGetReqAddress + fieldGetReqRaw +) + +func (x *GetRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldGetReqAddress, x.Address) + + proto.SizeBool(fieldGetReqRaw, x.Raw) + } + return sz +} + +func (x *GetRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldGetReqAddress, x.Address) + proto.MarshalBool(b[off:], fieldGetReqRaw, x.Raw) + } +} + +const ( + _ = iota + fieldGetRespInitID + fieldGetRespInitSignature + fieldGetRespInitHeader +) + +func (x *GetResponse_Body_Init) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldGetRespInitID, x.ObjectId) + + proto.SizeNested(fieldGetRespInitSignature, x.Signature) + + proto.SizeNested(fieldGetRespInitHeader, x.Header) + } + return sz +} + +func (x *GetResponse_Body_Init) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldGetRespInitID, x.ObjectId) + off += proto.MarshalNested(b[off:], fieldGetRespInitSignature, x.Signature) + proto.MarshalNested(b[off:], fieldGetRespInitHeader, x.Header) + } +} + +const ( + _ = iota + fieldGetRespInit + fieldGetRespChunk + fieldGetRespSplitInfo +) + +func (x *GetResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + switch p := x.ObjectPart.(type) { + default: + panic(fmt.Sprintf("unexpected object part %T", x.ObjectPart)) + case nil: + case *GetResponse_Body_Init_: + sz = proto.SizeNested(fieldGetRespInit, p.Init) + case *GetResponse_Body_Chunk: + sz = proto.SizeBytes(fieldGetRespChunk, p.Chunk) + case *GetResponse_Body_SplitInfo: + sz = proto.SizeNested(fieldGetRespSplitInfo, p.SplitInfo) + } + } + return sz +} + +func (x *GetResponse_Body) MarshalStable(b []byte) { + if x != nil { + switch p := x.ObjectPart.(type) { + default: + panic(fmt.Sprintf("unexpected object part %T", x.ObjectPart)) + case nil: + case *GetResponse_Body_Init_: + proto.MarshalNested(b, fieldGetRespInit, p.Init) + case *GetResponse_Body_Chunk: + proto.MarshalBytes(b, fieldGetRespChunk, p.Chunk) + case *GetResponse_Body_SplitInfo: + proto.MarshalNested(b, fieldGetRespSplitInfo, p.SplitInfo) + } + } +} + +const ( + _ = iota + fieldHeadReqAddress + fieldHeadReqMain + fieldHeadReqRaw +) + +func (x *HeadRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldHeadReqAddress, x.Address) + + proto.SizeBool(fieldHeadReqMain, x.MainOnly) + + proto.SizeBool(fieldHeadReqRaw, x.Raw) + } + return sz +} + +func (x *HeadRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldHeadReqAddress, x.Address) + off += proto.MarshalBool(b[off:], fieldHeadReqMain, x.MainOnly) + proto.MarshalBool(b[off:], fieldHeadReqRaw, x.Raw) + } +} + +const ( + _ = iota + fieldHeaderSignatureHdr + fieldHeaderSignatureSig +) + +func (x *HeaderWithSignature) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldHeaderSignatureHdr, x.Header) + + proto.SizeNested(fieldHeaderSignatureSig, x.Signature) + } + return sz +} + +func (x *HeaderWithSignature) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldHeaderSignatureHdr, x.Header) + proto.MarshalNested(b[off:], fieldHeaderSignatureSig, x.Signature) + } +} + +const ( + _ = iota + fieldHeadRespHeader + fieldHeadRespShort + fieldHeadRespSplitInfo +) + +func (x *HeadResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + switch h := x.Head.(type) { + default: + panic(fmt.Sprintf("unexpected head part %T", x.Head)) + case nil: + case *HeadResponse_Body_Header: + sz = proto.SizeNested(fieldHeadRespHeader, h.Header) + case *HeadResponse_Body_ShortHeader: + sz = proto.SizeNested(fieldHeadRespShort, h.ShortHeader) + case *HeadResponse_Body_SplitInfo: + sz = proto.SizeNested(fieldHeadRespSplitInfo, h.SplitInfo) + } + } + return sz +} + +func (x *HeadResponse_Body) MarshalStable(b []byte) { + if x != nil { + switch h := x.Head.(type) { + default: + panic(fmt.Sprintf("unexpected head part %T", x.Head)) + case nil: + case *HeadResponse_Body_Header: + proto.MarshalNested(b, fieldHeadRespHeader, h.Header) + case *HeadResponse_Body_ShortHeader: + proto.MarshalNested(b, fieldHeadRespShort, h.ShortHeader) + case *HeadResponse_Body_SplitInfo: + proto.MarshalNested(b, fieldHeadRespSplitInfo, h.SplitInfo) + } + } +} + +const ( + _ = iota + fieldRangeOff + fieldRangeLen +) + +func (x *Range) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldRangeOff, x.Offset) + + proto.SizeVarint(fieldRangeLen, x.Length) + } + return sz +} + +func (x *Range) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldRangeOff, x.Offset) + proto.MarshalVarint(b[off:], fieldRangeLen, x.Length) + } +} + +const ( + _ = iota + fieldRangeReqAddress + fieldRangeReqRange + fieldRangeReqRaw +) + +func (x *GetRangeRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldRangeReqAddress, x.Address) + + proto.SizeNested(fieldRangeReqRange, x.Range) + + proto.SizeBool(fieldRangeReqRaw, x.Raw) + } + return sz +} + +func (x *GetRangeRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldRangeReqAddress, x.Address) + off += proto.MarshalNested(b[off:], fieldRangeReqRange, x.Range) + proto.MarshalBool(b[off:], fieldRangeReqRaw, x.Raw) + } +} + +const ( + _ = iota + fieldPutReqInitID + fieldPutReqInitSignature + fieldPutReqInitHeader + fieldPutReqInitCopies +) + +const ( + _ = iota + fieldRangeRespChunk + fieldRangeRespSplitInfo +) + +func (x *GetRangeResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + switch p := x.RangePart.(type) { + default: + panic(fmt.Sprintf("unexpected range part %T", x.RangePart)) + case nil: + case *GetRangeResponse_Body_Chunk: + sz = proto.SizeBytes(fieldRangeRespChunk, p.Chunk) + case *GetRangeResponse_Body_SplitInfo: + sz = proto.SizeNested(fieldRangeRespSplitInfo, p.SplitInfo) + } + } + return sz +} + +func (x *GetRangeResponse_Body) MarshalStable(b []byte) { + if x != nil { + switch p := x.RangePart.(type) { + default: + panic(fmt.Sprintf("unexpected range part %T", x.RangePart)) + case nil: + case *GetRangeResponse_Body_Chunk: + proto.MarshalBytes(b, fieldRangeRespChunk, p.Chunk) + case *GetRangeResponse_Body_SplitInfo: + proto.MarshalNested(b, fieldRangeRespSplitInfo, p.SplitInfo) + } + } +} + +const ( + _ = iota + fieldRangeHashReqAddress + fieldRangeHashReqRanges + fieldRangeHashReqSalt + fieldRangeHashReqType +) + +func (x *GetRangeHashRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldRangeHashReqAddress, x.Address) + + proto.SizeBytes(fieldRangeHashReqSalt, x.Salt) + + proto.SizeVarint(fieldRangeHashReqType, int32(x.Type)) + for i := range x.Ranges { + sz += proto.SizeNested(fieldRangeHashReqRanges, x.Ranges[i]) + } + } + return sz +} + +func (x *GetRangeHashRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldRangeHashReqAddress, x.Address) + for i := range x.Ranges { + off += proto.MarshalNested(b[off:], fieldRangeHashReqRanges, x.Ranges[i]) + } + off += proto.MarshalBytes(b[off:], fieldRangeHashReqSalt, x.Salt) + proto.MarshalVarint(b[off:], fieldRangeHashReqType, int32(x.Type)) + } +} + +const ( + _ = iota + fieldRangeHashRespType + fieldRangeHashRespHashes +) + +func (x *GetRangeHashResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldRangeHashRespType, int32(x.Type)) + + proto.SizeRepeatedBytes(fieldRangeHashRespHashes, x.HashList) + } + return sz +} + +func (x *GetRangeHashResponse_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldRangeHashRespType, int32(x.Type)) + proto.MarshalRepeatedBytes(b[off:], fieldRangeHashRespHashes, x.HashList) + } +} + +func (x *PutRequest_Body_Init) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldPutReqInitID, x.ObjectId) + + proto.SizeNested(fieldPutReqInitSignature, x.Signature) + + proto.SizeNested(fieldPutReqInitHeader, x.Header) + + proto.SizeVarint(fieldPutReqInitCopies, x.CopiesNumber) + } + return sz +} + +func (x *PutRequest_Body_Init) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldPutReqInitID, x.ObjectId) + off += proto.MarshalNested(b[off:], fieldPutReqInitSignature, x.Signature) + off += proto.MarshalNested(b[off:], fieldPutReqInitHeader, x.Header) + proto.MarshalVarint(b[off:], fieldPutReqInitCopies, x.CopiesNumber) + } +} + +const ( + _ = iota + fieldPutReqInit + fieldPutReqChunk +) + +func (x *PutRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + switch p := x.ObjectPart.(type) { + default: + panic(fmt.Sprintf("unexpected object part %T", x.ObjectPart)) + case nil: + case *PutRequest_Body_Init_: + sz = proto.SizeNested(fieldPutReqInit, p.Init) + case *PutRequest_Body_Chunk: + sz = proto.SizeBytes(fieldPutReqChunk, p.Chunk) + } + } + return sz +} + +func (x *PutRequest_Body) MarshalStable(b []byte) { + if x != nil { + switch p := x.ObjectPart.(type) { + default: + panic(fmt.Sprintf("unexpected object part %T", x.ObjectPart)) + case nil: + case *PutRequest_Body_Init_: + proto.MarshalNested(b, fieldPutReqInit, p.Init) + case *PutRequest_Body_Chunk: + proto.MarshalBytes(b, fieldPutReqChunk, p.Chunk) + } + } +} + +const ( + _ = iota + fieldPutRespID +) + +func (x *PutResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldPutRespID, x.ObjectId) + } + return sz +} + +func (x *PutResponse_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldPutRespID, x.ObjectId) + } +} + +const ( + _ = iota + fieldDeleteReqAddress +) + +func (x *DeleteRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldDeleteReqAddress, x.Address) + } + return sz +} + +func (x *DeleteRequest_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldDeleteReqAddress, x.Address) + } +} + +const ( + _ = iota + fieldDeleteRespTombstone +) + +func (x *DeleteResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldDeleteRespTombstone, x.Tombstone) + } + return sz +} + +func (x *DeleteResponse_Body) MarshalStable(b []byte) { + if x != nil { + proto.MarshalNested(b, fieldDeleteRespTombstone, x.Tombstone) + } +} diff --git a/api/object/encoding_test.go b/api/object/encoding_test.go new file mode 100644 index 00000000..e65056a4 --- /dev/null +++ b/api/object/encoding_test.go @@ -0,0 +1,570 @@ +package object_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/object" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestObject(t *testing.T) { + v := &object.Object{ + ObjectId: &refs.ObjectID{Value: []byte("any_object_ID")}, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 1, + }, + Header: &object.Header{ + Version: &refs.Version{Major: 2, Minor: 3}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + CreationEpoch: 4, + PayloadLength: 5, + PayloadHash: &refs.Checksum{Type: 6, Sum: []byte("any_checksum")}, + ObjectType: 7, + HomomorphicHash: &refs.Checksum{Type: 8, Sum: []byte("any_homomorphic_checksum")}, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 9, Nbf: 10, Iat: 11}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 12}, + }, + Attributes: []*object.Header_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + Split: &object.Header_Split{ + Parent: &refs.ObjectID{Value: []byte("any_parent_ID")}, + Previous: &refs.ObjectID{Value: []byte("any_previous")}, + ParentSignature: &refs.Signature{ + Key: []byte("any_parent_public_key"), + Sign: []byte("any_parent_signature"), + Scheme: 13, + }, + ParentHeader: &object.Header{ + Version: &refs.Version{Major: 100, Minor: 101}, + ContainerId: &refs.ContainerID{Value: []byte("any_parent_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_parent_owner")}, + CreationEpoch: 102, + PayloadLength: 103, + PayloadHash: &refs.Checksum{Type: 104, Sum: []byte("any_parent_checksum")}, + ObjectType: 105, + HomomorphicHash: &refs.Checksum{Type: 106, Sum: []byte("any_parent_homomorphic_checksum")}, + Attributes: []*object.Header_Attribute{ + {Key: "parent_attr_key1", Value: "parent_attr_val2"}, + {Key: "parent_attr_key2", Value: "parent_attr_val2"}, + }, + }, + Children: []*refs.ObjectID{{Value: []byte("any_child1")}, {Value: []byte("any_child2")}}, + SplitId: []byte("any_split_ID"), + First: &refs.ObjectID{Value: []byte("any_first_ID")}, + }, + }, + Payload: []byte("any_payload"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.Object + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ObjectId, res.ObjectId) + require.Equal(t, v.Signature, res.Signature) + require.Equal(t, v.Header, res.Header) + require.Equal(t, v.Payload, res.Payload) +} + +func TestGetRequest_Body(t *testing.T) { + v := &object.GetRequest_Body{ + Address: &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + }, + Raw: true, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.GetRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Address, res.Address) + require.Equal(t, v.Raw, res.Raw) +} + +func TestGetResponse_Body(t *testing.T) { + var v object.GetResponse_Body + + testWithPart := func(setPart func(*object.GetResponse_Body)) { + setPart(&v) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.GetResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ObjectPart, res.ObjectPart) + } + + testWithPart(func(body *object.GetResponse_Body) { body.ObjectPart = nil }) + testWithPart(func(body *object.GetResponse_Body) { + body.ObjectPart = &object.GetResponse_Body_Chunk{Chunk: []byte("any_chunk")} + }) + testWithPart(func(body *object.GetResponse_Body) { + body.ObjectPart = &object.GetResponse_Body_SplitInfo{ + SplitInfo: &object.SplitInfo{ + SplitId: []byte("any_split_ID"), + LastPart: &refs.ObjectID{Value: []byte("any_last")}, + Link: &refs.ObjectID{Value: []byte("any_link")}, + FirstPart: &refs.ObjectID{Value: []byte("any_first")}, + }, + } + }) + testWithPart(func(body *object.GetResponse_Body) { + body.ObjectPart = &object.GetResponse_Body_Init_{ + Init: &object.GetResponse_Body_Init{ + ObjectId: &refs.ObjectID{Value: []byte("any_object_ID")}, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 1, + }, + Header: &object.Header{ + Version: &refs.Version{Major: 2, Minor: 3}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + CreationEpoch: 4, + PayloadLength: 5, + PayloadHash: &refs.Checksum{Type: 6, Sum: []byte("any_checksum")}, + ObjectType: 7, + HomomorphicHash: &refs.Checksum{Type: 8, Sum: []byte("any_homomorphic_checksum")}, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 9, Nbf: 10, Iat: 11}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 12}, + }, + Attributes: []*object.Header_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + Split: &object.Header_Split{ + Parent: &refs.ObjectID{Value: []byte("any_parent_ID")}, + Previous: &refs.ObjectID{Value: []byte("any_previous")}, + ParentSignature: &refs.Signature{ + Key: []byte("any_parent_public_key"), + Sign: []byte("any_parent_signature"), + Scheme: 13, + }, + ParentHeader: &object.Header{ + Version: &refs.Version{Major: 100, Minor: 101}, + ContainerId: &refs.ContainerID{Value: []byte("any_parent_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_parent_owner")}, + CreationEpoch: 102, + PayloadLength: 103, + PayloadHash: &refs.Checksum{Type: 104, Sum: []byte("any_parent_checksum")}, + ObjectType: 105, + HomomorphicHash: &refs.Checksum{Type: 106, Sum: []byte("any_parent_homomorphic_checksum")}, + Attributes: []*object.Header_Attribute{ + {Key: "parent_attr_key1", Value: "parent_attr_val2"}, + {Key: "parent_attr_key2", Value: "parent_attr_val2"}, + }, + }, + Children: []*refs.ObjectID{{Value: []byte("any_child1")}, {Value: []byte("any_child2")}}, + SplitId: []byte("any_split_ID"), + First: &refs.ObjectID{Value: []byte("any_first_ID")}, + }, + }, + }, + } + }) +} + +func TestHeadRequest_Body(t *testing.T) { + v := &object.HeadRequest_Body{ + Address: &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + }, + MainOnly: true, + Raw: true, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.HeadRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Address, res.Address) + require.Equal(t, v.MainOnly, res.MainOnly) + require.Equal(t, v.Raw, res.Raw) +} + +func TestHeadResponse_Body(t *testing.T) { + var v object.HeadResponse_Body + + testWithPart := func(setPart func(body *object.HeadResponse_Body)) { + setPart(&v) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.HeadResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Head, res.Head) + } + + testWithPart(func(body *object.HeadResponse_Body) { body.Head = nil }) + + testWithPart(func(body *object.HeadResponse_Body) { + body.Head = &object.HeadResponse_Body_ShortHeader{ + ShortHeader: &object.ShortHeader{ + Version: &refs.Version{Major: 2, Minor: 3}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + CreationEpoch: 4, + PayloadLength: 5, + PayloadHash: &refs.Checksum{Type: 6, Sum: []byte("any_checksum")}, + ObjectType: 7, + HomomorphicHash: &refs.Checksum{Type: 8, Sum: []byte("any_homomorphic_checksum")}, + }, + } + }) + + testWithPart(func(body *object.HeadResponse_Body) { + body.Head = &object.HeadResponse_Body_SplitInfo{ + SplitInfo: &object.SplitInfo{ + SplitId: []byte("any_split_ID"), + LastPart: &refs.ObjectID{Value: []byte("any_last")}, + Link: &refs.ObjectID{Value: []byte("any_link")}, + FirstPart: &refs.ObjectID{Value: []byte("any_first")}, + }, + } + }) + + testWithPart(func(body *object.HeadResponse_Body) { + body.Head = &object.HeadResponse_Body_Header{ + Header: &object.HeaderWithSignature{ + Header: &object.Header{ + Version: &refs.Version{Major: 2, Minor: 3}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + CreationEpoch: 4, + PayloadLength: 5, + PayloadHash: &refs.Checksum{Type: 6, Sum: []byte("any_checksum")}, + ObjectType: 7, + HomomorphicHash: &refs.Checksum{Type: 8, Sum: []byte("any_homomorphic_checksum")}, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 9, Nbf: 10, Iat: 11}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 12}, + }, + Attributes: []*object.Header_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + Split: &object.Header_Split{ + Parent: &refs.ObjectID{Value: []byte("any_parent_ID")}, + Previous: &refs.ObjectID{Value: []byte("any_previous")}, + ParentSignature: &refs.Signature{ + Key: []byte("any_parent_public_key"), + Sign: []byte("any_parent_signature"), + Scheme: 13, + }, + ParentHeader: &object.Header{ + Version: &refs.Version{Major: 100, Minor: 101}, + ContainerId: &refs.ContainerID{Value: []byte("any_parent_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_parent_owner")}, + CreationEpoch: 102, + PayloadLength: 103, + PayloadHash: &refs.Checksum{Type: 104, Sum: []byte("any_parent_checksum")}, + ObjectType: 105, + HomomorphicHash: &refs.Checksum{Type: 106, Sum: []byte("any_parent_homomorphic_checksum")}, + Attributes: []*object.Header_Attribute{ + {Key: "parent_attr_key1", Value: "parent_attr_val2"}, + {Key: "parent_attr_key2", Value: "parent_attr_val2"}, + }, + }, + Children: []*refs.ObjectID{{Value: []byte("any_child1")}, {Value: []byte("any_child2")}}, + SplitId: []byte("any_split_ID"), + First: &refs.ObjectID{Value: []byte("any_first_ID")}, + }, + }, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 987, + }, + }, + } + }) +} + +func TestGetRangeRequest_Body(t *testing.T) { + v := &object.GetRangeRequest_Body{ + Address: &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + }, + Range: &object.Range{Offset: 1, Length: 2}, + Raw: true, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.GetRangeRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Address, res.Address) + require.Equal(t, v.Range, res.Range) + require.Equal(t, v.Raw, res.Raw) +} + +func TestGetRangeResponse_Body(t *testing.T) { + var v object.GetRangeResponse_Body + + testWithPart := func(setPart func(body *object.GetRangeResponse_Body)) { + setPart(&v) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.GetRangeResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.RangePart, res.RangePart) + } + + testWithPart(func(body *object.GetRangeResponse_Body) { body.RangePart = nil }) + + testWithPart(func(body *object.GetRangeResponse_Body) { + body.RangePart = &object.GetRangeResponse_Body_Chunk{Chunk: []byte("any_chunk")} + }) + + testWithPart(func(body *object.GetRangeResponse_Body) { + body.RangePart = &object.GetRangeResponse_Body_SplitInfo{ + SplitInfo: &object.SplitInfo{ + SplitId: []byte("any_split_ID"), + LastPart: &refs.ObjectID{Value: []byte("any_last")}, + Link: &refs.ObjectID{Value: []byte("any_link")}, + FirstPart: &refs.ObjectID{Value: []byte("any_first")}, + }, + } + }) +} + +func TestGetRangeHashRequest_Body(t *testing.T) { + v := &object.GetRangeHashRequest_Body{ + Address: &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + }, + Ranges: []*object.Range{ + {Offset: 1, Length: 2}, + {Offset: 3, Length: 4}, + }, + Salt: []byte("any_salt"), + Type: 5, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.GetRangeHashRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Address, res.Address) + require.Equal(t, v.Ranges, res.Ranges) + require.Equal(t, v.Salt, res.Salt) + require.Equal(t, v.Type, res.Type) +} + +func TestGetRangeHashResponse_Body(t *testing.T) { + v := &object.GetRangeHashResponse_Body{ + Type: 1, + HashList: [][]byte{[]byte("any_hash1"), []byte("any_hash2")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.GetRangeHashResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Type, res.Type) + require.Equal(t, v.HashList, res.HashList) +} + +func TestDeleteRequest_Body(t *testing.T) { + v := &object.DeleteRequest_Body{ + Address: &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.DeleteRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Address, res.Address) +} + +func TestDeleteResponse_Body(t *testing.T) { + v := &object.DeleteResponse_Body{ + Tombstone: &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.DeleteResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Tombstone, res.Tombstone) +} + +func TestPutRequest_Body(t *testing.T) { + var v object.PutRequest_Body + + testWithPart := func(setPart func(body *object.PutRequest_Body)) { + setPart(&v) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.PutRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ObjectPart, res.ObjectPart) + } + + testWithPart(func(body *object.PutRequest_Body) { body.ObjectPart = nil }) + + testWithPart(func(body *object.PutRequest_Body) { + body.ObjectPart = &object.PutRequest_Body_Init_{ + Init: &object.PutRequest_Body_Init{ + ObjectId: &refs.ObjectID{Value: []byte("any_object_ID")}, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 1, + }, + Header: &object.Header{ + Version: &refs.Version{Major: 2, Minor: 3}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + CreationEpoch: 4, + PayloadLength: 5, + PayloadHash: &refs.Checksum{Type: 6, Sum: []byte("any_checksum")}, + ObjectType: 7, + HomomorphicHash: &refs.Checksum{Type: 8, Sum: []byte("any_homomorphic_checksum")}, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 9, Nbf: 10, Iat: 11}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 12}, + }, + Attributes: []*object.Header_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + Split: &object.Header_Split{ + Parent: &refs.ObjectID{Value: []byte("any_parent_ID")}, + Previous: &refs.ObjectID{Value: []byte("any_previous")}, + ParentSignature: &refs.Signature{ + Key: []byte("any_parent_public_key"), + Sign: []byte("any_parent_signature"), + Scheme: 13, + }, + ParentHeader: &object.Header{ + Version: &refs.Version{Major: 100, Minor: 101}, + ContainerId: &refs.ContainerID{Value: []byte("any_parent_container")}, + OwnerId: &refs.OwnerID{Value: []byte("any_parent_owner")}, + CreationEpoch: 102, + PayloadLength: 103, + PayloadHash: &refs.Checksum{Type: 104, Sum: []byte("any_parent_checksum")}, + ObjectType: 105, + HomomorphicHash: &refs.Checksum{Type: 106, Sum: []byte("any_parent_homomorphic_checksum")}, + Attributes: []*object.Header_Attribute{ + {Key: "parent_attr_key1", Value: "parent_attr_val2"}, + {Key: "parent_attr_key2", Value: "parent_attr_val2"}, + }, + }, + Children: []*refs.ObjectID{{Value: []byte("any_child1")}, {Value: []byte("any_child2")}}, + SplitId: []byte("any_split_ID"), + First: &refs.ObjectID{Value: []byte("any_first_ID")}, + }, + }, + CopiesNumber: 1, + }, + } + }) + + testWithPart(func(body *object.PutRequest_Body) { + body.ObjectPart = &object.PutRequest_Body_Chunk{Chunk: []byte("any_chunk")} + }) +} + +func TestPutResponse_Body(t *testing.T) { + v := &object.PutResponse_Body{ + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res object.PutResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ObjectId, res.ObjectId) +} diff --git a/api/object/service.pb.go b/api/object/service.pb.go new file mode 100644 index 00000000..7e39f344 --- /dev/null +++ b/api/object/service.pb.go @@ -0,0 +1,3525 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: object/grpc/service.proto + +package object + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + "github.com/nspcc-dev/neofs-sdk-go/api/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GET object request +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get object request message. + Body *GetRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *GetRequest) GetBody() *GetRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// GET object response +type GetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get object response message. + Body *GetResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetResponse) GetBody() *GetResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// PUT object request +type PutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of put object request message. + Body *PutRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest) ProtoMessage() {} + +func (x *PutRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. +func (*PutRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{2} +} + +func (x *PutRequest) GetBody() *PutRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PutRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PutRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// PUT Object response +type PutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of put object response message. + Body *PutResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutResponse) ProtoMessage() {} + +func (x *PutResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead. +func (*PutResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{3} +} + +func (x *PutResponse) GetBody() *PutResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PutResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PutResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Object DELETE request +type DeleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of delete object request message. + Body *DeleteRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteRequest) GetBody() *DeleteRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *DeleteRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *DeleteRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// DeleteResponse body is empty because we cannot guarantee permanent object +// removal in distributed system. +type DeleteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of delete object response message. + Body *DeleteResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteResponse) GetBody() *DeleteResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *DeleteResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *DeleteResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Object HEAD request +type HeadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of head object request message. + Body *HeadRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *HeadRequest) Reset() { + *x = HeadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadRequest) ProtoMessage() {} + +func (x *HeadRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadRequest.ProtoReflect.Descriptor instead. +func (*HeadRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{6} +} + +func (x *HeadRequest) GetBody() *HeadRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *HeadRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *HeadRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Tuple of a full object header and signature of an `ObjectID`. \ +// Signed `ObjectID` is present to verify full header's authenticity through the +// following steps: +// +// 1. Calculate `SHA-256` of the marshalled `Header` structure +// 2. Check if the resulting hash matches `ObjectID` +// 3. Check if `ObjectID` signature in `signature` field is correct +type HeaderWithSignature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Full object header + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Signed `ObjectID` to verify full header's authenticity + Signature *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *HeaderWithSignature) Reset() { + *x = HeaderWithSignature{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeaderWithSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderWithSignature) ProtoMessage() {} + +func (x *HeaderWithSignature) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeaderWithSignature.ProtoReflect.Descriptor instead. +func (*HeaderWithSignature) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{7} +} + +func (x *HeaderWithSignature) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} + +func (x *HeaderWithSignature) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +// Object HEAD response +type HeadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of head object response message. + Body *HeadResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *HeadResponse) Reset() { + *x = HeadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadResponse) ProtoMessage() {} + +func (x *HeadResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadResponse.ProtoReflect.Descriptor instead. +func (*HeadResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{8} +} + +func (x *HeadResponse) GetBody() *HeadResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *HeadResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *HeadResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Object Search request +type SearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of search object request message. + Body *SearchRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRequest) ProtoMessage() {} + +func (x *SearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. +func (*SearchRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{9} +} + +func (x *SearchRequest) GetBody() *SearchRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *SearchRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *SearchRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Search response +type SearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of search object response message. + Body *SearchResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *SearchResponse) Reset() { + *x = SearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse) ProtoMessage() {} + +func (x *SearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. +func (*SearchResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{10} +} + +func (x *SearchResponse) GetBody() *SearchResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *SearchResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *SearchResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Object payload range. Ranges of zero length SHOULD be considered as invalid. +type Range struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Offset of the range from the object payload start + Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + // Length in bytes of the object payload range + Length uint64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` +} + +func (x *Range) Reset() { + *x = Range{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Range) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Range) ProtoMessage() {} + +func (x *Range) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Range.ProtoReflect.Descriptor instead. +func (*Range) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{11} +} + +func (x *Range) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *Range) GetLength() uint64 { + if x != nil { + return x.Length + } + return 0 +} + +// Request part of object's payload +type GetRangeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get range object request message. + Body *GetRangeRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetRangeRequest) Reset() { + *x = GetRangeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeRequest) ProtoMessage() {} + +func (x *GetRangeRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeRequest.ProtoReflect.Descriptor instead. +func (*GetRangeRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{12} +} + +func (x *GetRangeRequest) GetBody() *GetRangeRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetRangeRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetRangeRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get part of object's payload +type GetRangeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get range object response message. + Body *GetRangeResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetRangeResponse) Reset() { + *x = GetRangeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeResponse) ProtoMessage() {} + +func (x *GetRangeResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeResponse.ProtoReflect.Descriptor instead. +func (*GetRangeResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{13} +} + +func (x *GetRangeResponse) GetBody() *GetRangeResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetRangeResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetRangeResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get hash of object's payload part +type GetRangeHashRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get range hash object request message. + Body *GetRangeHashRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetRangeHashRequest) Reset() { + *x = GetRangeHashRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeHashRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeHashRequest) ProtoMessage() {} + +func (x *GetRangeHashRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeHashRequest.ProtoReflect.Descriptor instead. +func (*GetRangeHashRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{14} +} + +func (x *GetRangeHashRequest) GetBody() *GetRangeHashRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetRangeHashRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetRangeHashRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Get hash of object's payload part +type GetRangeHashResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of get range hash object response message. + Body *GetRangeHashResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *GetRangeHashResponse) Reset() { + *x = GetRangeHashResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeHashResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeHashResponse) ProtoMessage() {} + +func (x *GetRangeHashResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeHashResponse.ProtoReflect.Descriptor instead. +func (*GetRangeHashResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{15} +} + +func (x *GetRangeHashResponse) GetBody() *GetRangeHashResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GetRangeHashResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *GetRangeHashResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Replicate RPC request +type ReplicateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object to be replicated. + Object *Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + // Signature of all other request fields serialized in Protocol Buffers v3 + // format in ascending order of fields. + Signature *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *ReplicateRequest) Reset() { + *x = ReplicateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplicateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplicateRequest) ProtoMessage() {} + +func (x *ReplicateRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReplicateRequest.ProtoReflect.Descriptor instead. +func (*ReplicateRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{16} +} + +func (x *ReplicateRequest) GetObject() *Object { + if x != nil { + return x.Object + } + return nil +} + +func (x *ReplicateRequest) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +// Replicate RPC response +type ReplicateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Operation execution status with one of the enumerated codes. + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *ReplicateResponse) Reset() { + *x = ReplicateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplicateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplicateResponse) ProtoMessage() {} + +func (x *ReplicateResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReplicateResponse.ProtoReflect.Descriptor instead. +func (*ReplicateResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{17} +} + +func (x *ReplicateResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +// GET Object request body +type GetRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the requested object + Address *refs.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node + Raw bool `protobuf:"varint,2,opt,name=raw,proto3" json:"raw,omitempty"` +} + +func (x *GetRequest_Body) Reset() { + *x = GetRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest_Body) ProtoMessage() {} + +func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest_Body.ProtoReflect.Descriptor instead. +func (*GetRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *GetRequest_Body) GetAddress() *refs.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *GetRequest_Body) GetRaw() bool { + if x != nil { + return x.Raw + } + return false +} + +// GET Object Response body +type GetResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Single message in the response stream. + // + // Types that are assignable to ObjectPart: + // + // *GetResponse_Body_Init_ + // *GetResponse_Body_Chunk + // *GetResponse_Body_SplitInfo + ObjectPart isGetResponse_Body_ObjectPart `protobuf_oneof:"object_part"` +} + +func (x *GetResponse_Body) Reset() { + *x = GetResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse_Body) ProtoMessage() {} + +func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse_Body.ProtoReflect.Descriptor instead. +func (*GetResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (m *GetResponse_Body) GetObjectPart() isGetResponse_Body_ObjectPart { + if m != nil { + return m.ObjectPart + } + return nil +} + +func (x *GetResponse_Body) GetInit() *GetResponse_Body_Init { + if x, ok := x.GetObjectPart().(*GetResponse_Body_Init_); ok { + return x.Init + } + return nil +} + +func (x *GetResponse_Body) GetChunk() []byte { + if x, ok := x.GetObjectPart().(*GetResponse_Body_Chunk); ok { + return x.Chunk + } + return nil +} + +func (x *GetResponse_Body) GetSplitInfo() *SplitInfo { + if x, ok := x.GetObjectPart().(*GetResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + return nil +} + +type isGetResponse_Body_ObjectPart interface { + isGetResponse_Body_ObjectPart() +} + +type GetResponse_Body_Init_ struct { + // Initial part of the object stream + Init *GetResponse_Body_Init `protobuf:"bytes,1,opt,name=init,proto3,oneof"` +} + +type GetResponse_Body_Chunk struct { + // Chunked object payload + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"` +} + +type GetResponse_Body_SplitInfo struct { + // Meta information of split hierarchy for object assembly. + SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,proto3,oneof"` +} + +func (*GetResponse_Body_Init_) isGetResponse_Body_ObjectPart() {} + +func (*GetResponse_Body_Chunk) isGetResponse_Body_ObjectPart() {} + +func (*GetResponse_Body_SplitInfo) isGetResponse_Body_ObjectPart() {} + +// Initial part of the `Object` structure stream. Technically it's a +// set of all `Object` structure's fields except `payload`. +type GetResponse_Body_Init struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object's unique identifier. + ObjectId *refs.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` + // Signed `ObjectID` + Signature *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Object metadata headers + Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` +} + +func (x *GetResponse_Body_Init) Reset() { + *x = GetResponse_Body_Init{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse_Body_Init) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse_Body_Init) ProtoMessage() {} + +func (x *GetResponse_Body_Init) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse_Body_Init.ProtoReflect.Descriptor instead. +func (*GetResponse_Body_Init) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{1, 0, 0} +} + +func (x *GetResponse_Body_Init) GetObjectId() *refs.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +func (x *GetResponse_Body_Init) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +func (x *GetResponse_Body_Init) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} + +// PUT request body +type PutRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Single message in the request stream. + // + // Types that are assignable to ObjectPart: + // + // *PutRequest_Body_Init_ + // *PutRequest_Body_Chunk + ObjectPart isPutRequest_Body_ObjectPart `protobuf_oneof:"object_part"` +} + +func (x *PutRequest_Body) Reset() { + *x = PutRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest_Body) ProtoMessage() {} + +func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest_Body.ProtoReflect.Descriptor instead. +func (*PutRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{2, 0} +} + +func (m *PutRequest_Body) GetObjectPart() isPutRequest_Body_ObjectPart { + if m != nil { + return m.ObjectPart + } + return nil +} + +func (x *PutRequest_Body) GetInit() *PutRequest_Body_Init { + if x, ok := x.GetObjectPart().(*PutRequest_Body_Init_); ok { + return x.Init + } + return nil +} + +func (x *PutRequest_Body) GetChunk() []byte { + if x, ok := x.GetObjectPart().(*PutRequest_Body_Chunk); ok { + return x.Chunk + } + return nil +} + +type isPutRequest_Body_ObjectPart interface { + isPutRequest_Body_ObjectPart() +} + +type PutRequest_Body_Init_ struct { + // Initial part of the object stream + Init *PutRequest_Body_Init `protobuf:"bytes,1,opt,name=init,proto3,oneof"` +} + +type PutRequest_Body_Chunk struct { + // Chunked object payload + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"` +} + +func (*PutRequest_Body_Init_) isPutRequest_Body_ObjectPart() {} + +func (*PutRequest_Body_Chunk) isPutRequest_Body_ObjectPart() {} + +// Newly created object structure parameters. If some optional parameters +// are not set, they will be calculated by a peer node. +type PutRequest_Body_Init struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ObjectID if available. + ObjectId *refs.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` + // Object signature if available + Signature *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Object's Header. The maximum length is 16KB. The only exclusion are + // replication requests, i.e. requests sent by container nodes with + // 'meta_header.ttl=1': for such cases the limit is 4MB. + Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` + // Number of the object copies to store within the RPC call. By default + // object is processed according to the container's placement policy. + CopiesNumber uint32 `protobuf:"varint,4,opt,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` +} + +func (x *PutRequest_Body_Init) Reset() { + *x = PutRequest_Body_Init{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest_Body_Init) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest_Body_Init) ProtoMessage() {} + +func (x *PutRequest_Body_Init) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest_Body_Init.ProtoReflect.Descriptor instead. +func (*PutRequest_Body_Init) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{2, 0, 0} +} + +func (x *PutRequest_Body_Init) GetObjectId() *refs.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +func (x *PutRequest_Body_Init) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +func (x *PutRequest_Body_Init) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} + +func (x *PutRequest_Body_Init) GetCopiesNumber() uint32 { + if x != nil { + return x.CopiesNumber + } + return 0 +} + +// PUT Object response body +type PutResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the saved object + ObjectId *refs.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` +} + +func (x *PutResponse_Body) Reset() { + *x = PutResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutResponse_Body) ProtoMessage() {} + +func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutResponse_Body.ProtoReflect.Descriptor instead. +func (*PutResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *PutResponse_Body) GetObjectId() *refs.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +// Object DELETE request body +type DeleteRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the object to be deleted + Address *refs.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *DeleteRequest_Body) Reset() { + *x = DeleteRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest_Body) ProtoMessage() {} + +func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest_Body.ProtoReflect.Descriptor instead. +func (*DeleteRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *DeleteRequest_Body) GetAddress() *refs.Address { + if x != nil { + return x.Address + } + return nil +} + +// Object DELETE Response has an empty body. +type DeleteResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the tombstone created for the deleted object + Tombstone *refs.Address `protobuf:"bytes,1,opt,name=tombstone,proto3" json:"tombstone,omitempty"` +} + +func (x *DeleteResponse_Body) Reset() { + *x = DeleteResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse_Body) ProtoMessage() {} + +func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse_Body.ProtoReflect.Descriptor instead. +func (*DeleteResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *DeleteResponse_Body) GetTombstone() *refs.Address { + if x != nil { + return x.Tombstone + } + return nil +} + +// Object HEAD request body +type HeadRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the object with the requested Header + Address *refs.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Return only minimal header subset + MainOnly bool `protobuf:"varint,2,opt,name=main_only,json=mainOnly,proto3" json:"main_only,omitempty"` + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node + Raw bool `protobuf:"varint,3,opt,name=raw,proto3" json:"raw,omitempty"` +} + +func (x *HeadRequest_Body) Reset() { + *x = HeadRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadRequest_Body) ProtoMessage() {} + +func (x *HeadRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadRequest_Body.ProtoReflect.Descriptor instead. +func (*HeadRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *HeadRequest_Body) GetAddress() *refs.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *HeadRequest_Body) GetMainOnly() bool { + if x != nil { + return x.MainOnly + } + return false +} + +func (x *HeadRequest_Body) GetRaw() bool { + if x != nil { + return x.Raw + } + return false +} + +// Object HEAD response body +type HeadResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested object header, it's part or meta information about split + // object. + // + // Types that are assignable to Head: + // + // *HeadResponse_Body_Header + // *HeadResponse_Body_ShortHeader + // *HeadResponse_Body_SplitInfo + Head isHeadResponse_Body_Head `protobuf_oneof:"head"` +} + +func (x *HeadResponse_Body) Reset() { + *x = HeadResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadResponse_Body) ProtoMessage() {} + +func (x *HeadResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadResponse_Body.ProtoReflect.Descriptor instead. +func (*HeadResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{8, 0} +} + +func (m *HeadResponse_Body) GetHead() isHeadResponse_Body_Head { + if m != nil { + return m.Head + } + return nil +} + +func (x *HeadResponse_Body) GetHeader() *HeaderWithSignature { + if x, ok := x.GetHead().(*HeadResponse_Body_Header); ok { + return x.Header + } + return nil +} + +func (x *HeadResponse_Body) GetShortHeader() *ShortHeader { + if x, ok := x.GetHead().(*HeadResponse_Body_ShortHeader); ok { + return x.ShortHeader + } + return nil +} + +func (x *HeadResponse_Body) GetSplitInfo() *SplitInfo { + if x, ok := x.GetHead().(*HeadResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + return nil +} + +type isHeadResponse_Body_Head interface { + isHeadResponse_Body_Head() +} + +type HeadResponse_Body_Header struct { + // Full object's `Header` with `ObjectID` signature + Header *HeaderWithSignature `protobuf:"bytes,1,opt,name=header,proto3,oneof"` +} + +type HeadResponse_Body_ShortHeader struct { + // Short object header + ShortHeader *ShortHeader `protobuf:"bytes,2,opt,name=short_header,json=shortHeader,proto3,oneof"` +} + +type HeadResponse_Body_SplitInfo struct { + // Meta information of split hierarchy. + SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,proto3,oneof"` +} + +func (*HeadResponse_Body_Header) isHeadResponse_Body_Head() {} + +func (*HeadResponse_Body_ShortHeader) isHeadResponse_Body_Head() {} + +func (*HeadResponse_Body_SplitInfo) isHeadResponse_Body_Head() {} + +// Object Search request body +type SearchRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Container identifier were to search + ContainerId *refs.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + // Version of the Query Language used + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // List of search expressions + Filters []*SearchRequest_Body_Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *SearchRequest_Body) Reset() { + *x = SearchRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRequest_Body) ProtoMessage() {} + +func (x *SearchRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRequest_Body.ProtoReflect.Descriptor instead. +func (*SearchRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *SearchRequest_Body) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *SearchRequest_Body) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { + if x != nil { + return x.Filters + } + return nil +} + +// Filter structure checks if the object header field or the attribute content +// matches a value. +// +// If no filters are set, search request will return all objects of the +// container, including Regular object, Tombstones and Storage Group +// objects. Most human users expect to get only object they can directly +// work with. In that case, `$Object:ROOT` filter should be used. +// +// If `match_type` field is numerical, both `value` field and object +// attribute MUST be base-10 integers. +// +// By default `key` field refers to the corresponding object's `Attribute`. +// Some Object's header fields can also be accessed by adding `$Object:` +// prefix to the name. Here is the list of fields available via this prefix: +// +// - $Object:version \ +// version +// - $Object:objectID \ +// object_id +// - $Object:containerID \ +// container_id +// - $Object:ownerID \ +// owner_id +// - $Object:creationEpoch \ +// creation_epoch +// - $Object:payloadLength \ +// payload_length +// - $Object:payloadHash \ +// payload_hash +// - $Object:objectType \ +// object_type +// - $Object:homomorphicHash \ +// homomorphic_hash +// - $Object:split.parent \ +// object_id of parent +// - $Object:split.splitID \ +// 16 byte UUIDv4 used to identify the split object hierarchy parts +// +// There are some well-known filter aliases to match objects by certain +// properties: +// +// - $Object:ROOT \ +// Returns only `REGULAR` type objects that are not split or that are the top +// level root objects in a split hierarchy. This includes objects not +// present physically, like large objects split into smaller objects +// without a separate top-level root object. Objects of other types like +// StorageGroups and Tombstones will not be shown. This filter may be +// useful for listing objects like `ls` command of some virtual file +// system. This filter is activated if the `key` exists, disregarding the +// value and matcher type. +// - $Object:PHY \ +// Returns only objects physically stored in the system. This filter is +// activated if the `key` exists, disregarding the value and matcher type. +// +// Note: using filters with a key with prefix `$Object:` and match type +// `NOT_PRESENT `is not recommended since this is not a cross-version approach. +// Behavior when processing this kind of filters is undefined. +type SearchRequest_Body_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Match type to use + MatchType MatchType `protobuf:"varint,1,opt,name=match_type,json=matchType,proto3,enum=neo.fs.v2.object.MatchType" json:"match_type,omitempty"` + // Attribute or Header fields to match + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // Value to match + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *SearchRequest_Body_Filter) Reset() { + *x = SearchRequest_Body_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRequest_Body_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRequest_Body_Filter) ProtoMessage() {} + +func (x *SearchRequest_Body_Filter) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRequest_Body_Filter.ProtoReflect.Descriptor instead. +func (*SearchRequest_Body_Filter) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{9, 0, 0} +} + +func (x *SearchRequest_Body_Filter) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return MatchType_MATCH_TYPE_UNSPECIFIED +} + +func (x *SearchRequest_Body_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *SearchRequest_Body_Filter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Object Search response body +type SearchResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of `ObjectID`s that match the search query + IdList []*refs.ObjectID `protobuf:"bytes,1,rep,name=id_list,json=idList,proto3" json:"id_list,omitempty"` +} + +func (x *SearchResponse_Body) Reset() { + *x = SearchResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse_Body) ProtoMessage() {} + +func (x *SearchResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchResponse_Body.ProtoReflect.Descriptor instead. +func (*SearchResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *SearchResponse_Body) GetIdList() []*refs.ObjectID { + if x != nil { + return x.IdList + } + return nil +} + +// Byte range of object's payload request body +type GetRangeRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the object containing the requested payload range + Address *refs.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Requested payload range + Range *Range `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"` + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node. + Raw bool `protobuf:"varint,3,opt,name=raw,proto3" json:"raw,omitempty"` +} + +func (x *GetRangeRequest_Body) Reset() { + *x = GetRangeRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeRequest_Body) ProtoMessage() {} + +func (x *GetRangeRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeRequest_Body.ProtoReflect.Descriptor instead. +func (*GetRangeRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *GetRangeRequest_Body) GetAddress() *refs.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *GetRangeRequest_Body) GetRange() *Range { + if x != nil { + return x.Range + } + return nil +} + +func (x *GetRangeRequest_Body) GetRaw() bool { + if x != nil { + return x.Raw + } + return false +} + +// Get Range response body uses streams to transfer the response. Because +// object payload considered a byte sequence, there is no need to have some +// initial preamble message. The requested byte range is sent as a series +// chunks. +type GetRangeResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested object range or meta information about split object. + // + // Types that are assignable to RangePart: + // + // *GetRangeResponse_Body_Chunk + // *GetRangeResponse_Body_SplitInfo + RangePart isGetRangeResponse_Body_RangePart `protobuf_oneof:"range_part"` +} + +func (x *GetRangeResponse_Body) Reset() { + *x = GetRangeResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeResponse_Body) ProtoMessage() {} + +func (x *GetRangeResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeResponse_Body.ProtoReflect.Descriptor instead. +func (*GetRangeResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{13, 0} +} + +func (m *GetRangeResponse_Body) GetRangePart() isGetRangeResponse_Body_RangePart { + if m != nil { + return m.RangePart + } + return nil +} + +func (x *GetRangeResponse_Body) GetChunk() []byte { + if x, ok := x.GetRangePart().(*GetRangeResponse_Body_Chunk); ok { + return x.Chunk + } + return nil +} + +func (x *GetRangeResponse_Body) GetSplitInfo() *SplitInfo { + if x, ok := x.GetRangePart().(*GetRangeResponse_Body_SplitInfo); ok { + return x.SplitInfo + } + return nil +} + +type isGetRangeResponse_Body_RangePart interface { + isGetRangeResponse_Body_RangePart() +} + +type GetRangeResponse_Body_Chunk struct { + // Chunked object payload's range. + Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3,oneof"` +} + +type GetRangeResponse_Body_SplitInfo struct { + // Meta information of split hierarchy. + SplitInfo *SplitInfo `protobuf:"bytes,2,opt,name=split_info,json=splitInfo,proto3,oneof"` +} + +func (*GetRangeResponse_Body_Chunk) isGetRangeResponse_Body_RangePart() {} + +func (*GetRangeResponse_Body_SplitInfo) isGetRangeResponse_Body_RangePart() {} + +// Get hash of object's payload part request body. +type GetRangeHashRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the object that containing the requested payload range + Address *refs.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // List of object's payload ranges to calculate homomorphic hash + Ranges []*Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` + // Binary salt to XOR object's payload ranges before hash calculation + Salt []byte `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"` + // Checksum algorithm type + Type refs.ChecksumType `protobuf:"varint,4,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` +} + +func (x *GetRangeHashRequest_Body) Reset() { + *x = GetRangeHashRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeHashRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeHashRequest_Body) ProtoMessage() {} + +func (x *GetRangeHashRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeHashRequest_Body.ProtoReflect.Descriptor instead. +func (*GetRangeHashRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *GetRangeHashRequest_Body) GetAddress() *refs.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *GetRangeHashRequest_Body) GetRanges() []*Range { + if x != nil { + return x.Ranges + } + return nil +} + +func (x *GetRangeHashRequest_Body) GetSalt() []byte { + if x != nil { + return x.Salt + } + return nil +} + +func (x *GetRangeHashRequest_Body) GetType() refs.ChecksumType { + if x != nil { + return x.Type + } + return refs.ChecksumType(0) +} + +// Get hash of object's payload part response body. +type GetRangeHashResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Checksum algorithm type + Type refs.ChecksumType `protobuf:"varint,1,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + // List of range hashes in a binary format + HashList [][]byte `protobuf:"bytes,2,rep,name=hash_list,json=hashList,proto3" json:"hash_list,omitempty"` +} + +func (x *GetRangeHashResponse_Body) Reset() { + *x = GetRangeHashResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRangeHashResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRangeHashResponse_Body) ProtoMessage() {} + +func (x *GetRangeHashResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRangeHashResponse_Body.ProtoReflect.Descriptor instead. +func (*GetRangeHashResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *GetRangeHashResponse_Body) GetType() refs.ChecksumType { + if x != nil { + return x.Type + } + return refs.ChecksumType(0) +} + +func (x *GetRangeHashResponse_Body) GetHashList() [][]byte { + if x != nil { + return x.HashList + } + return nil +} + +var File_object_grpc_service_proto protoreflect.FileDescriptor + +var file_object_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x17, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xaa, 0x02, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, + 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, + 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x1a, 0x4b, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, + 0x61, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0xb9, 0x04, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, + 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x1a, 0xd5, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x6e, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x49, 0x6e, 0x69, + 0x74, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, + 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, + 0x6b, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, + 0xa8, 0x01, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, + 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0x9b, 0x04, 0x0a, 0x0a, 0x50, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xbb, 0x02, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x3c, 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, + 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0xcd, 0x01, 0x0a, 0x04, 0x49, 0x6e, 0x69, + 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, + 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3d, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, + 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x9e, 0x02, 0x0a, 0x0d, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, + 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, + 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x1a, 0x39, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, + 0x09, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x74, 0x6f, 0x6d, 0x62, 0x73, + 0x74, 0x6f, 0x6e, 0x65, 0x22, 0xc9, 0x02, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, + 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x68, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, + 0x22, 0x80, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x22, 0xb7, 0x03, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, + 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xd1, 0x01, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x3f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x68, 0x6f, + 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x72, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, + 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, + 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0xfb, 0x03, + 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x1a, 0x95, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x0c, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x6c, 0x0a, + 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x0e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, + 0x07, 0x69, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x69, 0x64, 0x4c, 0x69, 0x73, 0x74, + 0x22, 0x37, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xe3, 0x02, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x1a, 0x7a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, + 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, + 0xd7, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, + 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x6a, 0x0a, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x3c, 0x0a, + 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, + 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x0c, 0x0a, 0x0a, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa2, 0x03, 0x0a, 0x13, 0x47, 0x65, + 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xb0, 0x01, 0x0a, 0x04, + 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x30, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xca, + 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, + 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x1a, 0x55, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x08, 0x68, 0x61, 0x73, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x7d, 0x0a, 0x10, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x30, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x45, 0x0a, 0x11, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x32, 0x88, 0x05, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x03, 0x50, 0x75, 0x74, + 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, + 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x04, + 0x48, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1f, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x30, 0x01, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x21, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x56, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, + 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, + 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_object_grpc_service_proto_rawDescOnce sync.Once + file_object_grpc_service_proto_rawDescData = file_object_grpc_service_proto_rawDesc +) + +func file_object_grpc_service_proto_rawDescGZIP() []byte { + file_object_grpc_service_proto_rawDescOnce.Do(func() { + file_object_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_object_grpc_service_proto_rawDescData) + }) + return file_object_grpc_service_proto_rawDescData +} + +var file_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_object_grpc_service_proto_goTypes = []interface{}{ + (*GetRequest)(nil), // 0: neo.fs.v2.object.GetRequest + (*GetResponse)(nil), // 1: neo.fs.v2.object.GetResponse + (*PutRequest)(nil), // 2: neo.fs.v2.object.PutRequest + (*PutResponse)(nil), // 3: neo.fs.v2.object.PutResponse + (*DeleteRequest)(nil), // 4: neo.fs.v2.object.DeleteRequest + (*DeleteResponse)(nil), // 5: neo.fs.v2.object.DeleteResponse + (*HeadRequest)(nil), // 6: neo.fs.v2.object.HeadRequest + (*HeaderWithSignature)(nil), // 7: neo.fs.v2.object.HeaderWithSignature + (*HeadResponse)(nil), // 8: neo.fs.v2.object.HeadResponse + (*SearchRequest)(nil), // 9: neo.fs.v2.object.SearchRequest + (*SearchResponse)(nil), // 10: neo.fs.v2.object.SearchResponse + (*Range)(nil), // 11: neo.fs.v2.object.Range + (*GetRangeRequest)(nil), // 12: neo.fs.v2.object.GetRangeRequest + (*GetRangeResponse)(nil), // 13: neo.fs.v2.object.GetRangeResponse + (*GetRangeHashRequest)(nil), // 14: neo.fs.v2.object.GetRangeHashRequest + (*GetRangeHashResponse)(nil), // 15: neo.fs.v2.object.GetRangeHashResponse + (*ReplicateRequest)(nil), // 16: neo.fs.v2.object.ReplicateRequest + (*ReplicateResponse)(nil), // 17: neo.fs.v2.object.ReplicateResponse + (*GetRequest_Body)(nil), // 18: neo.fs.v2.object.GetRequest.Body + (*GetResponse_Body)(nil), // 19: neo.fs.v2.object.GetResponse.Body + (*GetResponse_Body_Init)(nil), // 20: neo.fs.v2.object.GetResponse.Body.Init + (*PutRequest_Body)(nil), // 21: neo.fs.v2.object.PutRequest.Body + (*PutRequest_Body_Init)(nil), // 22: neo.fs.v2.object.PutRequest.Body.Init + (*PutResponse_Body)(nil), // 23: neo.fs.v2.object.PutResponse.Body + (*DeleteRequest_Body)(nil), // 24: neo.fs.v2.object.DeleteRequest.Body + (*DeleteResponse_Body)(nil), // 25: neo.fs.v2.object.DeleteResponse.Body + (*HeadRequest_Body)(nil), // 26: neo.fs.v2.object.HeadRequest.Body + (*HeadResponse_Body)(nil), // 27: neo.fs.v2.object.HeadResponse.Body + (*SearchRequest_Body)(nil), // 28: neo.fs.v2.object.SearchRequest.Body + (*SearchRequest_Body_Filter)(nil), // 29: neo.fs.v2.object.SearchRequest.Body.Filter + (*SearchResponse_Body)(nil), // 30: neo.fs.v2.object.SearchResponse.Body + (*GetRangeRequest_Body)(nil), // 31: neo.fs.v2.object.GetRangeRequest.Body + (*GetRangeResponse_Body)(nil), // 32: neo.fs.v2.object.GetRangeResponse.Body + (*GetRangeHashRequest_Body)(nil), // 33: neo.fs.v2.object.GetRangeHashRequest.Body + (*GetRangeHashResponse_Body)(nil), // 34: neo.fs.v2.object.GetRangeHashResponse.Body + (*session.RequestMetaHeader)(nil), // 35: neo.fs.v2.session.RequestMetaHeader + (*session.RequestVerificationHeader)(nil), // 36: neo.fs.v2.session.RequestVerificationHeader + (*session.ResponseMetaHeader)(nil), // 37: neo.fs.v2.session.ResponseMetaHeader + (*session.ResponseVerificationHeader)(nil), // 38: neo.fs.v2.session.ResponseVerificationHeader + (*Header)(nil), // 39: neo.fs.v2.object.Header + (*refs.Signature)(nil), // 40: neo.fs.v2.refs.Signature + (*Object)(nil), // 41: neo.fs.v2.object.Object + (*status.Status)(nil), // 42: neo.fs.v2.status.Status + (*refs.Address)(nil), // 43: neo.fs.v2.refs.Address + (*SplitInfo)(nil), // 44: neo.fs.v2.object.SplitInfo + (*refs.ObjectID)(nil), // 45: neo.fs.v2.refs.ObjectID + (*ShortHeader)(nil), // 46: neo.fs.v2.object.ShortHeader + (*refs.ContainerID)(nil), // 47: neo.fs.v2.refs.ContainerID + (MatchType)(0), // 48: neo.fs.v2.object.MatchType + (refs.ChecksumType)(0), // 49: neo.fs.v2.refs.ChecksumType +} +var file_object_grpc_service_proto_depIdxs = []int32{ + 18, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body + 35, // 1: neo.fs.v2.object.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 2: neo.fs.v2.object.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 19, // 3: neo.fs.v2.object.GetResponse.body:type_name -> neo.fs.v2.object.GetResponse.Body + 37, // 4: neo.fs.v2.object.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 5: neo.fs.v2.object.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 21, // 6: neo.fs.v2.object.PutRequest.body:type_name -> neo.fs.v2.object.PutRequest.Body + 35, // 7: neo.fs.v2.object.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 8: neo.fs.v2.object.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 23, // 9: neo.fs.v2.object.PutResponse.body:type_name -> neo.fs.v2.object.PutResponse.Body + 37, // 10: neo.fs.v2.object.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 11: neo.fs.v2.object.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 24, // 12: neo.fs.v2.object.DeleteRequest.body:type_name -> neo.fs.v2.object.DeleteRequest.Body + 35, // 13: neo.fs.v2.object.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 14: neo.fs.v2.object.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 25, // 15: neo.fs.v2.object.DeleteResponse.body:type_name -> neo.fs.v2.object.DeleteResponse.Body + 37, // 16: neo.fs.v2.object.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 17: neo.fs.v2.object.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 26, // 18: neo.fs.v2.object.HeadRequest.body:type_name -> neo.fs.v2.object.HeadRequest.Body + 35, // 19: neo.fs.v2.object.HeadRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 20: neo.fs.v2.object.HeadRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 39, // 21: neo.fs.v2.object.HeaderWithSignature.header:type_name -> neo.fs.v2.object.Header + 40, // 22: neo.fs.v2.object.HeaderWithSignature.signature:type_name -> neo.fs.v2.refs.Signature + 27, // 23: neo.fs.v2.object.HeadResponse.body:type_name -> neo.fs.v2.object.HeadResponse.Body + 37, // 24: neo.fs.v2.object.HeadResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 25: neo.fs.v2.object.HeadResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 28, // 26: neo.fs.v2.object.SearchRequest.body:type_name -> neo.fs.v2.object.SearchRequest.Body + 35, // 27: neo.fs.v2.object.SearchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 28: neo.fs.v2.object.SearchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 30, // 29: neo.fs.v2.object.SearchResponse.body:type_name -> neo.fs.v2.object.SearchResponse.Body + 37, // 30: neo.fs.v2.object.SearchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 31: neo.fs.v2.object.SearchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 31, // 32: neo.fs.v2.object.GetRangeRequest.body:type_name -> neo.fs.v2.object.GetRangeRequest.Body + 35, // 33: neo.fs.v2.object.GetRangeRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 34: neo.fs.v2.object.GetRangeRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 32, // 35: neo.fs.v2.object.GetRangeResponse.body:type_name -> neo.fs.v2.object.GetRangeResponse.Body + 37, // 36: neo.fs.v2.object.GetRangeResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 37: neo.fs.v2.object.GetRangeResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 33, // 38: neo.fs.v2.object.GetRangeHashRequest.body:type_name -> neo.fs.v2.object.GetRangeHashRequest.Body + 35, // 39: neo.fs.v2.object.GetRangeHashRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 36, // 40: neo.fs.v2.object.GetRangeHashRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 34, // 41: neo.fs.v2.object.GetRangeHashResponse.body:type_name -> neo.fs.v2.object.GetRangeHashResponse.Body + 37, // 42: neo.fs.v2.object.GetRangeHashResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 38, // 43: neo.fs.v2.object.GetRangeHashResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 41, // 44: neo.fs.v2.object.ReplicateRequest.object:type_name -> neo.fs.v2.object.Object + 40, // 45: neo.fs.v2.object.ReplicateRequest.signature:type_name -> neo.fs.v2.refs.Signature + 42, // 46: neo.fs.v2.object.ReplicateResponse.status:type_name -> neo.fs.v2.status.Status + 43, // 47: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 20, // 48: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init + 44, // 49: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 45, // 50: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 40, // 51: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 39, // 52: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header + 22, // 53: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init + 45, // 54: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 40, // 55: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 39, // 56: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header + 45, // 57: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 43, // 58: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 43, // 59: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address + 43, // 60: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 7, // 61: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature + 46, // 62: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader + 44, // 63: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 47, // 64: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 29, // 65: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter + 48, // 66: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType + 45, // 67: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID + 43, // 68: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 69: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range + 44, // 70: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 43, // 71: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 72: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range + 49, // 73: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 49, // 74: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 0, // 75: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest + 2, // 76: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest + 4, // 77: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest + 6, // 78: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest + 9, // 79: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest + 12, // 80: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest + 14, // 81: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest + 16, // 82: neo.fs.v2.object.ObjectService.Replicate:input_type -> neo.fs.v2.object.ReplicateRequest + 1, // 83: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse + 3, // 84: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse + 5, // 85: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse + 8, // 86: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse + 10, // 87: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse + 13, // 88: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse + 15, // 89: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse + 17, // 90: neo.fs.v2.object.ObjectService.Replicate:output_type -> neo.fs.v2.object.ReplicateResponse + 83, // [83:91] is the sub-list for method output_type + 75, // [75:83] is the sub-list for method input_type + 75, // [75:75] is the sub-list for extension type_name + 75, // [75:75] is the sub-list for extension extendee + 0, // [0:75] is the sub-list for field type_name +} + +func init() { file_object_grpc_service_proto_init() } +func file_object_grpc_service_proto_init() { + if File_object_grpc_service_proto != nil { + return + } + file_object_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_object_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderWithSignature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Range); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeHashRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeHashResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplicateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplicateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse_Body_Init); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest_Body_Init); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest_Body_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeHashRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeHashResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_object_grpc_service_proto_msgTypes[19].OneofWrappers = []interface{}{ + (*GetResponse_Body_Init_)(nil), + (*GetResponse_Body_Chunk)(nil), + (*GetResponse_Body_SplitInfo)(nil), + } + file_object_grpc_service_proto_msgTypes[21].OneofWrappers = []interface{}{ + (*PutRequest_Body_Init_)(nil), + (*PutRequest_Body_Chunk)(nil), + } + file_object_grpc_service_proto_msgTypes[27].OneofWrappers = []interface{}{ + (*HeadResponse_Body_Header)(nil), + (*HeadResponse_Body_ShortHeader)(nil), + (*HeadResponse_Body_SplitInfo)(nil), + } + file_object_grpc_service_proto_msgTypes[32].OneofWrappers = []interface{}{ + (*GetRangeResponse_Body_Chunk)(nil), + (*GetRangeResponse_Body_SplitInfo)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_object_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 35, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_object_grpc_service_proto_goTypes, + DependencyIndexes: file_object_grpc_service_proto_depIdxs, + MessageInfos: file_object_grpc_service_proto_msgTypes, + }.Build() + File_object_grpc_service_proto = out.File + file_object_grpc_service_proto_rawDesc = nil + file_object_grpc_service_proto_goTypes = nil + file_object_grpc_service_proto_depIdxs = nil +} diff --git a/api/object/service_grpc.pb.go b/api/object/service_grpc.pb.go new file mode 100644 index 00000000..bad2e0b1 --- /dev/null +++ b/api/object/service_grpc.pb.go @@ -0,0 +1,900 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: object/grpc/service.proto + +package object + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ObjectService_Get_FullMethodName = "/neo.fs.v2.object.ObjectService/Get" + ObjectService_Put_FullMethodName = "/neo.fs.v2.object.ObjectService/Put" + ObjectService_Delete_FullMethodName = "/neo.fs.v2.object.ObjectService/Delete" + ObjectService_Head_FullMethodName = "/neo.fs.v2.object.ObjectService/Head" + ObjectService_Search_FullMethodName = "/neo.fs.v2.object.ObjectService/Search" + ObjectService_GetRange_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRange" + ObjectService_GetRangeHash_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRangeHash" + ObjectService_Replicate_FullMethodName = "/neo.fs.v2.object.ObjectService/Replicate" +) + +// ObjectServiceClient is the client API for ObjectService 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 ObjectServiceClient interface { + // Receive full object structure, including Headers and payload. Response uses + // gRPC stream. First response message carries the object with the requested address. + // Chunk messages are parts of the object's payload if it is needed. All + // messages, except the first one, carry payload chunks. The requested object can + // be restored by concatenation of object message payload and all chunks + // keeping the receiving order. + // + // Extended headers can change `Get` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) + // Put the object into container. Request uses gRPC stream. First message + // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object + // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see + // session package). Chunk messages are considered by server as a part of an + // object payload. All messages, except first one, SHOULD be payload chunks. + // Chunk messages SHOULD be sent in the direct order of fragmentation. + // + // Extended headers can change `Put` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // + // been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) + // Delete the object from a container. There is no immediate removal + // guarantee. Object will be marked for removal and deleted eventually. + // + // Extended headers can change `Delete` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + // Returns the object Headers without data payload. By default full header is + // returned. If `main_only` request field is set, the short header with only + // the very minimal information will be returned instead. + // + // Extended headers can change `Head` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) + // Search objects in container. Search query allows to match by Object + // Header's filed values. Please see the corresponding NeoFS Technical + // Specification section for more details. + // + // Extended headers can change `Search` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error) + // Get byte range of data payload. Range is set as an (offset, length) tuple. + // Like in `Get` method, the response uses gRPC stream. Requested range can be + // restored by concatenation of all received payload chunks keeping the receiving + // order. + // + // Extended headers can change `GetRange` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) + // Returns homomorphic or regular hash of object's payload range after + // applying XOR operation with the provided `salt`. Ranges are set of (offset, + // length) tuples. Hashes order in response corresponds to the ranges order in + // the request. Note that hash is calculated for XORed data. + // + // Extended headers can change `GetRangeHash` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) + // Save replica of the object on the NeoFS storage node. Both client and + // server must authenticate NeoFS storage nodes matching storage policy of + // the container referenced by the replicated object. Thus, this operation is + // purely system: regular users should not pay attention to it but use Put. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the object has been successfully replicated; + // - **INTERNAL_SERVER_ERROR** (1024, SECTION_FAILURE_COMMON): \ + // internal server error described in the text message; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // the client does not authenticate any NeoFS storage node matching storage + // policy of the container referenced by the replicated object + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // the container to which the replicated object is associated was not found. + Replicate(ctx context.Context, in *ReplicateRequest, opts ...grpc.CallOption) (*ReplicateResponse, error) +} + +type objectServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient { + return &objectServiceClient{cc} +} + +func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServiceGetClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ObjectService_GetClient interface { + Recv() (*GetResponse, error) + grpc.ClientStream +} + +type objectServiceGetClient struct { + grpc.ClientStream +} + +func (x *objectServiceGetClient) Recv() (*GetResponse, error) { + m := new(GetResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServicePutClient{stream} + return x, nil +} + +type ObjectService_PutClient interface { + Send(*PutRequest) error + CloseAndRecv() (*PutResponse, error) + grpc.ClientStream +} + +type objectServicePutClient struct { + grpc.ClientStream +} + +func (x *objectServicePutClient) Send(m *PutRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *objectServicePutClient) CloseAndRecv() (*PutResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(PutResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) { + out := new(HeadResponse) + err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServiceSearchClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ObjectService_SearchClient interface { + Recv() (*SearchResponse, error) + grpc.ClientStream +} + +type objectServiceSearchClient struct { + grpc.ClientStream +} + +func (x *objectServiceSearchClient) Recv() (*SearchResponse, error) { + m := new(SearchResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) { + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &objectServiceGetRangeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ObjectService_GetRangeClient interface { + Recv() (*GetRangeResponse, error) + grpc.ClientStream +} + +type objectServiceGetRangeClient struct { + grpc.ClientStream +} + +func (x *objectServiceGetRangeClient) Recv() (*GetRangeResponse, error) { + m := new(GetRangeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) { + out := new(GetRangeHashResponse) + err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectServiceClient) Replicate(ctx context.Context, in *ReplicateRequest, opts ...grpc.CallOption) (*ReplicateResponse, error) { + out := new(ReplicateResponse) + err := c.cc.Invoke(ctx, ObjectService_Replicate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ObjectServiceServer is the server API for ObjectService service. +// All implementations should embed UnimplementedObjectServiceServer +// for forward compatibility +type ObjectServiceServer interface { + // Receive full object structure, including Headers and payload. Response uses + // gRPC stream. First response message carries the object with the requested address. + // Chunk messages are parts of the object's payload if it is needed. All + // messages, except the first one, carry payload chunks. The requested object can + // be restored by concatenation of object message payload and all chunks + // keeping the receiving order. + // + // Extended headers can change `Get` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Get(*GetRequest, ObjectService_GetServer) error + // Put the object into container. Request uses gRPC stream. First message + // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object + // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see + // session package). Chunk messages are considered by server as a part of an + // object payload. All messages, except first one, SHOULD be payload chunks. + // Chunk messages SHOULD be sent in the direct order of fragmentation. + // + // Extended headers can change `Put` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // + // been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Put(ObjectService_PutServer) error + // Delete the object from a container. There is no immediate removal + // guarantee. Object will be marked for removal and deleted eventually. + // + // Extended headers can change `Delete` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) + // Returns the object Headers without data payload. By default full header is + // returned. If `main_only` request field is set, the short header with only + // the very minimal information will be returned instead. + // + // Extended headers can change `Head` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Head(context.Context, *HeadRequest) (*HeadResponse, error) + // Search objects in container. Search query allows to match by Object + // Header's filed values. Please see the corresponding NeoFS Technical + // Specification section for more details. + // + // Extended headers can change `Search` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Search(*SearchRequest, ObjectService_SearchServer) error + // Get byte range of data payload. Range is set as an (offset, length) tuple. + // Like in `Get` method, the response uses gRPC stream. Requested range can be + // restored by concatenation of all received payload chunks keeping the receiving + // order. + // + // Extended headers can change `GetRange` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error + // Returns homomorphic or regular hash of object's payload range after + // applying XOR operation with the provided `salt`. Ranges are set of (offset, + // length) tuples. Hashes order in response corresponds to the ranges order in + // the request. Note that hash is calculated for XORed data. + // + // Extended headers can change `GetRangeHash` behaviour: + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. DEPRECATED: header ignored by servers. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. DEPRECATED: header ignored by servers. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) + // Save replica of the object on the NeoFS storage node. Both client and + // server must authenticate NeoFS storage nodes matching storage policy of + // the container referenced by the replicated object. Thus, this operation is + // purely system: regular users should not pay attention to it but use Put. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the object has been successfully replicated; + // - **INTERNAL_SERVER_ERROR** (1024, SECTION_FAILURE_COMMON): \ + // internal server error described in the text message; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // the client does not authenticate any NeoFS storage node matching storage + // policy of the container referenced by the replicated object + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // the container to which the replicated object is associated was not found. + Replicate(context.Context, *ReplicateRequest) (*ReplicateResponse, error) +} + +// UnimplementedObjectServiceServer should be embedded to have forward compatible implementations. +type UnimplementedObjectServiceServer struct { +} + +func (UnimplementedObjectServiceServer) Get(*GetRequest, ObjectService_GetServer) error { + return status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedObjectServiceServer) Put(ObjectService_PutServer) error { + return status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedObjectServiceServer) Head(context.Context, *HeadRequest) (*HeadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Head not implemented") +} +func (UnimplementedObjectServiceServer) Search(*SearchRequest, ObjectService_SearchServer) error { + return status.Errorf(codes.Unimplemented, "method Search not implemented") +} +func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error { + return status.Errorf(codes.Unimplemented, "method GetRange not implemented") +} +func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRangeHash not implemented") +} +func (UnimplementedObjectServiceServer) Replicate(context.Context, *ReplicateRequest) (*ReplicateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Replicate not implemented") +} + +// UnsafeObjectServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ObjectServiceServer will +// result in compilation errors. +type UnsafeObjectServiceServer interface { + mustEmbedUnimplementedObjectServiceServer() +} + +func RegisterObjectServiceServer(s grpc.ServiceRegistrar, srv ObjectServiceServer) { + s.RegisterService(&ObjectService_ServiceDesc, srv) +} + +func _ObjectService_Get_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ObjectServiceServer).Get(m, &objectServiceGetServer{stream}) +} + +type ObjectService_GetServer interface { + Send(*GetResponse) error + grpc.ServerStream +} + +type objectServiceGetServer struct { + grpc.ServerStream +} + +func (x *objectServiceGetServer) Send(m *GetResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ObjectService_Put_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ObjectServiceServer).Put(&objectServicePutServer{stream}) +} + +type ObjectService_PutServer interface { + SendAndClose(*PutResponse) error + Recv() (*PutRequest, error) + grpc.ServerStream +} + +type objectServicePutServer struct { + grpc.ServerStream +} + +func (x *objectServicePutServer) SendAndClose(m *PutResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *objectServicePutServer) Recv() (*PutRequest, error) { + m := new(PutRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _ObjectService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectService_Head_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).Head(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_Head_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).Head(ctx, req.(*HeadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectService_Search_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SearchRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ObjectServiceServer).Search(m, &objectServiceSearchServer{stream}) +} + +type ObjectService_SearchServer interface { + Send(*SearchResponse) error + grpc.ServerStream +} + +type objectServiceSearchServer struct { + grpc.ServerStream +} + +func (x *objectServiceSearchServer) Send(m *SearchResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ObjectService_GetRange_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetRangeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ObjectServiceServer).GetRange(m, &objectServiceGetRangeServer{stream}) +} + +type ObjectService_GetRangeServer interface { + Send(*GetRangeResponse) error + grpc.ServerStream +} + +type objectServiceGetRangeServer struct { + grpc.ServerStream +} + +func (x *objectServiceGetRangeServer) Send(m *GetRangeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRangeHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).GetRangeHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_GetRangeHash_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).GetRangeHash(ctx, req.(*GetRangeHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectService_Replicate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReplicateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).Replicate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_Replicate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).Replicate(ctx, req.(*ReplicateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ObjectService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.object.ObjectService", + HandlerType: (*ObjectServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Delete", + Handler: _ObjectService_Delete_Handler, + }, + { + MethodName: "Head", + Handler: _ObjectService_Head_Handler, + }, + { + MethodName: "GetRangeHash", + Handler: _ObjectService_GetRangeHash_Handler, + }, + { + MethodName: "Replicate", + Handler: _ObjectService_Replicate_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Get", + Handler: _ObjectService_Get_Handler, + ServerStreams: true, + }, + { + StreamName: "Put", + Handler: _ObjectService_Put_Handler, + ClientStreams: true, + }, + { + StreamName: "Search", + Handler: _ObjectService_Search_Handler, + ServerStreams: true, + }, + { + StreamName: "GetRange", + Handler: _ObjectService_GetRange_Handler, + ServerStreams: true, + }, + }, + Metadata: "object/grpc/service.proto", +} diff --git a/api/object/status.pb.go b/api/object/status.pb.go new file mode 100644 index 00000000..5094dd41 --- /dev/null +++ b/api/object/status.pb.go @@ -0,0 +1,251 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.0 +// source: v2/object/grpc/status.proto + +package object + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StatusCommon int32 + +const ( + StatusCommon_ACCESS_DENIED StatusCommon = 0 +) + +// Enum value maps for StatusCommon. +var ( + StatusCommon_name = map[int32]string{ + 0: "ACCESS_DENIED", + } + StatusCommon_value = map[string]int32{ + "ACCESS_DENIED": 0, + } +) + +func (x StatusCommon) Enum() *StatusCommon { + p := new(StatusCommon) + *p = x + return p +} + +func (x StatusCommon) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StatusCommon) Descriptor() protoreflect.EnumDescriptor { + return file_v2_object_grpc_status_proto_enumTypes[0].Descriptor() +} + +func (StatusCommon) Type() protoreflect.EnumType { + return &file_v2_object_grpc_status_proto_enumTypes[0] +} + +func (x StatusCommon) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StatusCommon.Descriptor instead. +func (StatusCommon) EnumDescriptor() ([]byte, []int) { + return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0} +} + +type StatusPut int32 + +const ( + StatusPut_STATUS_PUT_INCOMPLETE StatusPut = 0 +) + +// Enum value maps for StatusPut. +var ( + StatusPut_name = map[int32]string{ + 0: "STATUS_PUT_INCOMPLETE", + } + StatusPut_value = map[string]int32{ + "STATUS_PUT_INCOMPLETE": 0, + } +) + +func (x StatusPut) Enum() *StatusPut { + p := new(StatusPut) + *p = x + return p +} + +func (x StatusPut) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StatusPut) Descriptor() protoreflect.EnumDescriptor { + return file_v2_object_grpc_status_proto_enumTypes[1].Descriptor() +} + +func (StatusPut) Type() protoreflect.EnumType { + return &file_v2_object_grpc_status_proto_enumTypes[1] +} + +func (x StatusPut) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StatusPut.Descriptor instead. +func (StatusPut) EnumDescriptor() ([]byte, []int) { + return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{1} +} + +type PutIncompleteDetail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Statuses []*status.Status `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` +} + +func (x *PutIncompleteDetail) Reset() { + *x = PutIncompleteDetail{} + if protoimpl.UnsafeEnabled { + mi := &file_v2_object_grpc_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutIncompleteDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutIncompleteDetail) ProtoMessage() {} + +func (x *PutIncompleteDetail) ProtoReflect() protoreflect.Message { + mi := &file_v2_object_grpc_status_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutIncompleteDetail.ProtoReflect.Descriptor instead. +func (*PutIncompleteDetail) Descriptor() ([]byte, []int) { + return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0} +} + +func (x *PutIncompleteDetail) GetStatuses() []*status.Status { + if x != nil { + return x.Statuses + } + return nil +} + +var File_v2_object_grpc_status_proto protoreflect.FileDescriptor + +var file_v2_object_grpc_status_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, + 0x1a, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x50, + 0x75, 0x74, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x2a, 0x21, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x26, 0x0a, 0x09, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x50, 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, + 0x45, 0x10, 0x00, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, + 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, + 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_v2_object_grpc_status_proto_rawDescOnce sync.Once + file_v2_object_grpc_status_proto_rawDescData = file_v2_object_grpc_status_proto_rawDesc +) + +func file_v2_object_grpc_status_proto_rawDescGZIP() []byte { + file_v2_object_grpc_status_proto_rawDescOnce.Do(func() { + file_v2_object_grpc_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2_object_grpc_status_proto_rawDescData) + }) + return file_v2_object_grpc_status_proto_rawDescData +} + +var file_v2_object_grpc_status_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_v2_object_grpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_v2_object_grpc_status_proto_goTypes = []interface{}{ + (StatusCommon)(0), // 0: neo.fs.v2.object.StatusCommon + (StatusPut)(0), // 1: neo.fs.v2.object.StatusPut + (*PutIncompleteDetail)(nil), // 2: neo.fs.v2.object.PutIncompleteDetail + (*status.Status)(nil), // 3: neo.fs.v2.status.Status +} +var file_v2_object_grpc_status_proto_depIdxs = []int32{ + 3, // 0: neo.fs.v2.object.PutIncompleteDetail.statuses:type_name -> neo.fs.v2.status.Status + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_v2_object_grpc_status_proto_init() } +func file_v2_object_grpc_status_proto_init() { + if File_v2_object_grpc_status_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_v2_object_grpc_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutIncompleteDetail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v2_object_grpc_status_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v2_object_grpc_status_proto_goTypes, + DependencyIndexes: file_v2_object_grpc_status_proto_depIdxs, + EnumInfos: file_v2_object_grpc_status_proto_enumTypes, + MessageInfos: file_v2_object_grpc_status_proto_msgTypes, + }.Build() + File_v2_object_grpc_status_proto = out.File + file_v2_object_grpc_status_proto_rawDesc = nil + file_v2_object_grpc_status_proto_goTypes = nil + file_v2_object_grpc_status_proto_depIdxs = nil +} diff --git a/api/object/types.pb.go b/api/object/types.pb.go new file mode 100644 index 00000000..983dc0bb --- /dev/null +++ b/api/object/types.pb.go @@ -0,0 +1,1111 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: object/grpc/types.proto + +package object + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Type of the object payload content. Only `REGULAR` type objects can be split, +// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum +// object size. +// +// String presentation of object type is the same as definition: +// * REGULAR +// * TOMBSTONE +// * STORAGE_GROUP +// * LOCK +// * LINK +type ObjectType int32 + +const ( + // Just a normal object + ObjectType_REGULAR ObjectType = 0 + // Used internally to identify deleted objects + ObjectType_TOMBSTONE ObjectType = 1 + // StorageGroup information + ObjectType_STORAGE_GROUP ObjectType = 2 + // Object lock + ObjectType_LOCK ObjectType = 3 + // Object that stores child object IDs for the split objects. + ObjectType_LINK ObjectType = 4 +) + +// Enum value maps for ObjectType. +var ( + ObjectType_name = map[int32]string{ + 0: "REGULAR", + 1: "TOMBSTONE", + 2: "STORAGE_GROUP", + 3: "LOCK", + 4: "LINK", + } + ObjectType_value = map[string]int32{ + "REGULAR": 0, + "TOMBSTONE": 1, + "STORAGE_GROUP": 2, + "LOCK": 3, + "LINK": 4, + } +) + +func (x ObjectType) Enum() *ObjectType { + p := new(ObjectType) + *p = x + return p +} + +func (x ObjectType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ObjectType) Descriptor() protoreflect.EnumDescriptor { + return file_object_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (ObjectType) Type() protoreflect.EnumType { + return &file_object_grpc_types_proto_enumTypes[0] +} + +func (x ObjectType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ObjectType.Descriptor instead. +func (ObjectType) EnumDescriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// Type of match expression +type MatchType int32 + +const ( + // Unknown. Not used + MatchType_MATCH_TYPE_UNSPECIFIED MatchType = 0 + // Full string match + MatchType_STRING_EQUAL MatchType = 1 + // Full string mismatch + MatchType_STRING_NOT_EQUAL MatchType = 2 + // Lack of key + MatchType_NOT_PRESENT MatchType = 3 + // String prefix match + MatchType_COMMON_PREFIX MatchType = 4 + // Numerical 'greater than' + MatchType_NUM_GT MatchType = 5 + // Numerical 'greater or equal than' + MatchType_NUM_GE MatchType = 6 + // Numerical 'less than' + MatchType_NUM_LT MatchType = 7 + // Numerical 'less or equal than' + MatchType_NUM_LE MatchType = 8 +) + +// Enum value maps for MatchType. +var ( + MatchType_name = map[int32]string{ + 0: "MATCH_TYPE_UNSPECIFIED", + 1: "STRING_EQUAL", + 2: "STRING_NOT_EQUAL", + 3: "NOT_PRESENT", + 4: "COMMON_PREFIX", + 5: "NUM_GT", + 6: "NUM_GE", + 7: "NUM_LT", + 8: "NUM_LE", + } + MatchType_value = map[string]int32{ + "MATCH_TYPE_UNSPECIFIED": 0, + "STRING_EQUAL": 1, + "STRING_NOT_EQUAL": 2, + "NOT_PRESENT": 3, + "COMMON_PREFIX": 4, + "NUM_GT": 5, + "NUM_GE": 6, + "NUM_LT": 7, + "NUM_LE": 8, + } +) + +func (x MatchType) Enum() *MatchType { + p := new(MatchType) + *p = x + return p +} + +func (x MatchType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MatchType) Descriptor() protoreflect.EnumDescriptor { + return file_object_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (MatchType) Type() protoreflect.EnumType { + return &file_object_grpc_types_proto_enumTypes[1] +} + +func (x MatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MatchType.Descriptor instead. +func (MatchType) EnumDescriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{1} +} + +// Short header fields +type ShortHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object format version. Effectively, the version of API library used to + // create particular object. + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Epoch when the object was created + CreationEpoch uint64 `protobuf:"varint,2,opt,name=creation_epoch,json=creationEpoch,proto3" json:"creation_epoch,omitempty"` + // Object's owner + OwnerId *refs.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` + // Type of the object payload content + ObjectType ObjectType `protobuf:"varint,4,opt,name=object_type,json=objectType,proto3,enum=neo.fs.v2.object.ObjectType" json:"object_type,omitempty"` + // Size of payload in bytes. + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown + PayloadLength uint64 `protobuf:"varint,5,opt,name=payload_length,json=payloadLength,proto3" json:"payload_length,omitempty"` + // Hash of payload bytes + PayloadHash *refs.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` + // Homomorphic hash of the object payload + HomomorphicHash *refs.Checksum `protobuf:"bytes,7,opt,name=homomorphic_hash,json=homomorphicHash,proto3" json:"homomorphic_hash,omitempty"` +} + +func (x *ShortHeader) Reset() { + *x = ShortHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShortHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShortHeader) ProtoMessage() {} + +func (x *ShortHeader) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ShortHeader.ProtoReflect.Descriptor instead. +func (*ShortHeader) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *ShortHeader) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *ShortHeader) GetCreationEpoch() uint64 { + if x != nil { + return x.CreationEpoch + } + return 0 +} + +func (x *ShortHeader) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *ShortHeader) GetObjectType() ObjectType { + if x != nil { + return x.ObjectType + } + return ObjectType_REGULAR +} + +func (x *ShortHeader) GetPayloadLength() uint64 { + if x != nil { + return x.PayloadLength + } + return 0 +} + +func (x *ShortHeader) GetPayloadHash() *refs.Checksum { + if x != nil { + return x.PayloadHash + } + return nil +} + +func (x *ShortHeader) GetHomomorphicHash() *refs.Checksum { + if x != nil { + return x.HomomorphicHash + } + return nil +} + +// Object Header +type Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object format version. Effectively, the version of API library used to + // create particular object + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Object's container + ContainerId *refs.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` + // Object's owner + OwnerId *refs.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` + // Object creation Epoch + CreationEpoch uint64 `protobuf:"varint,4,opt,name=creation_epoch,json=creationEpoch,proto3" json:"creation_epoch,omitempty"` + // Size of payload in bytes. + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. + PayloadLength uint64 `protobuf:"varint,5,opt,name=payload_length,json=payloadLength,proto3" json:"payload_length,omitempty"` + // Hash of payload bytes + PayloadHash *refs.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` + // Type of the object payload content + ObjectType ObjectType `protobuf:"varint,7,opt,name=object_type,json=objectType,proto3,enum=neo.fs.v2.object.ObjectType" json:"object_type,omitempty"` + // Homomorphic hash of the object payload + HomomorphicHash *refs.Checksum `protobuf:"bytes,8,opt,name=homomorphic_hash,json=homomorphicHash,proto3" json:"homomorphic_hash,omitempty"` + // Session token, if it was used during Object creation. Need it to verify + // integrity and authenticity out of Request scope. + SessionToken *session.SessionToken `protobuf:"bytes,9,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` + // User-defined object attributes. Attributes vary in length from object to + // object, so keep an eye on the entire Header limit depending on the context. + Attributes []*Header_Attribute `protobuf:"bytes,10,rep,name=attributes,proto3" json:"attributes,omitempty"` + // Position of the object in the split hierarchy + Split *Header_Split `protobuf:"bytes,11,opt,name=split,proto3" json:"split,omitempty"` +} + +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Header) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *Header) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *Header) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *Header) GetCreationEpoch() uint64 { + if x != nil { + return x.CreationEpoch + } + return 0 +} + +func (x *Header) GetPayloadLength() uint64 { + if x != nil { + return x.PayloadLength + } + return 0 +} + +func (x *Header) GetPayloadHash() *refs.Checksum { + if x != nil { + return x.PayloadHash + } + return nil +} + +func (x *Header) GetObjectType() ObjectType { + if x != nil { + return x.ObjectType + } + return ObjectType_REGULAR +} + +func (x *Header) GetHomomorphicHash() *refs.Checksum { + if x != nil { + return x.HomomorphicHash + } + return nil +} + +func (x *Header) GetSessionToken() *session.SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} + +func (x *Header) GetAttributes() []*Header_Attribute { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Header) GetSplit() *Header_Split { + if x != nil { + return x.Split + } + return nil +} + +// Object structure. Object is immutable and content-addressed. It means +// `ObjectID` will change if the header or the payload changes. It's calculated as a +// hash of header field which contains hash of the object's payload. +// +// For non-regular object types payload format depends on object type specified +// in the header. +type Object struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object's unique identifier. + ObjectId *refs.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectID,proto3" json:"object_id,omitempty"` + // Signed object_id + Signature *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Object metadata headers + Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` + // Payload bytes + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Object) Reset() { + *x = Object{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Object) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Object) ProtoMessage() {} + +func (x *Object) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Object.ProtoReflect.Descriptor instead. +func (*Object) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{2} +} + +func (x *Object) GetObjectId() *refs.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +func (x *Object) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +func (x *Object) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} + +func (x *Object) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// Meta information of split hierarchy for object assembly. With the last part +// one can traverse linked list of split hierarchy back to the first part and +// assemble the original object. With a linking object one can assemble an object +// right from the object parts. +type SplitInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DEPRECATED. Was used as an identifier of a split chain. Use the first + // part ID instead. + // 16 byte UUID used to identify the split object hierarchy parts. + SplitId []byte `protobuf:"bytes,1,opt,name=split_id,json=splitId,proto3" json:"split_id,omitempty"` + // The identifier of the last object in split hierarchy parts. It contains + // split header with the original object header. + LastPart *refs.ObjectID `protobuf:"bytes,2,opt,name=last_part,json=lastPart,proto3" json:"last_part,omitempty"` + // The identifier of a linking object for split hierarchy parts. It contains + // split header with the original object header and a sorted list of + // object parts. + Link *refs.ObjectID `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` + // Identifier of the first part of the origin object. Known to all the split + // parts except the first one. Identifies the split and allows to differ them. + FirstPart *refs.ObjectID `protobuf:"bytes,4,opt,name=first_part,json=firstPart,proto3" json:"first_part,omitempty"` +} + +func (x *SplitInfo) Reset() { + *x = SplitInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SplitInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SplitInfo) ProtoMessage() {} + +func (x *SplitInfo) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SplitInfo.ProtoReflect.Descriptor instead. +func (*SplitInfo) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{3} +} + +func (x *SplitInfo) GetSplitId() []byte { + if x != nil { + return x.SplitId + } + return nil +} + +func (x *SplitInfo) GetLastPart() *refs.ObjectID { + if x != nil { + return x.LastPart + } + return nil +} + +func (x *SplitInfo) GetLink() *refs.ObjectID { + if x != nil { + return x.Link + } + return nil +} + +func (x *SplitInfo) GetFirstPart() *refs.ObjectID { + if x != nil { + return x.FirstPart + } + return nil +} + +// `Attribute` is a user-defined Key-Value metadata pair attached to an +// object. +// +// Key name must be an object-unique valid UTF-8 string. Value can't be empty. +// Objects with duplicated attribute names or attributes with empty values +// will be considered invalid. +// +// There are some "well-known" attributes starting with `__NEOFS__` prefix +// that affect system behaviour: +// +// - __NEOFS__EXPIRATION_EPOCH \ +// Tells GC to delete object after that epoch +// - __NEOFS__TICK_EPOCH \ +// Decimal number that defines what epoch must produce +// object notification with UTF-8 object address in a +// body (`0` value produces notification right after +// object put). +// DEPRECATED: attribute ignored by servers. +// - __NEOFS__TICK_TOPIC \ +// UTF-8 string topic ID that is used for object notification. +// DEPRECATED: attribute ignored by servers. +// +// And some well-known attributes used by applications only: +// +// - Name \ +// Human-friendly name +// - FileName \ +// File name to be associated with the object on saving +// - FilePath \ +// Full path to be associated with the object on saving. Should start with a +// '/' and use '/' as a delimiting symbol. Trailing '/' should be +// interpreted as a virtual directory marker. If an object has conflicting +// FilePath and FileName, FilePath should have higher priority, because it +// is used to construct the directory tree. FilePath with trailing '/' and +// non-empty FileName attribute should not be used together. +// - Timestamp \ +// User-defined local time of object creation in Unix Timestamp format +// - Content-Type \ +// MIME Content Type of object's payload +// +// For detailed description of each well-known attribute please see the +// corresponding section in NeoFS Technical Specification. +type Header_Attribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // string key to the object attribute + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // string value of the object attribute + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Header_Attribute) Reset() { + *x = Header_Attribute{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header_Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header_Attribute) ProtoMessage() {} + +func (x *Header_Attribute) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header_Attribute.ProtoReflect.Descriptor instead. +func (*Header_Attribute) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Header_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Header_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Bigger objects can be split into a chain of smaller objects. Information +// about inter-dependencies between spawned objects and how to re-construct +// the original one is in the `Split` headers. Parent and children objects +// must be within the same container. +type Header_Split struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the origin object. Known only to the minor child. + Parent *refs.ObjectID `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Identifier of the left split neighbor + Previous *refs.ObjectID `protobuf:"bytes,2,opt,name=previous,proto3" json:"previous,omitempty"` + // `signature` field of the parent object. Used to reconstruct parent. + ParentSignature *refs.Signature `protobuf:"bytes,3,opt,name=parent_signature,json=parentSignature,proto3" json:"parent_signature,omitempty"` + // `header` field of the parent object. Used to reconstruct parent. + ParentHeader *Header `protobuf:"bytes,4,opt,name=parent_header,json=parentHeader,proto3" json:"parent_header,omitempty"` + // DEPRECATED. Was used before creating the separate LINK object type. Keep + // child objects list in the LINK object's payload. + // List of identifiers of the objects generated by splitting current one. + Children []*refs.ObjectID `protobuf:"bytes,5,rep,name=children,proto3" json:"children,omitempty"` + // DEPRECATED. Was used as an identifier of a split chain. Use the first + // part ID instead. + // 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be + // unique inside container. All objects participating in the split must have + // the same `split_id` value. + SplitId []byte `protobuf:"bytes,6,opt,name=split_id,json=splitID,proto3" json:"split_id,omitempty"` + // Identifier of the first part of the origin object. Known to all the split + // parts except the first one. Identifies the split and allows to differ them. + First *refs.ObjectID `protobuf:"bytes,7,opt,name=first,proto3" json:"first,omitempty"` +} + +func (x *Header_Split) Reset() { + *x = Header_Split{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header_Split) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header_Split) ProtoMessage() {} + +func (x *Header_Split) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header_Split.ProtoReflect.Descriptor instead. +func (*Header_Split) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *Header_Split) GetParent() *refs.ObjectID { + if x != nil { + return x.Parent + } + return nil +} + +func (x *Header_Split) GetPrevious() *refs.ObjectID { + if x != nil { + return x.Previous + } + return nil +} + +func (x *Header_Split) GetParentSignature() *refs.Signature { + if x != nil { + return x.ParentSignature + } + return nil +} + +func (x *Header_Split) GetParentHeader() *Header { + if x != nil { + return x.ParentHeader + } + return nil +} + +func (x *Header_Split) GetChildren() []*refs.ObjectID { + if x != nil { + return x.Children + } + return nil +} + +func (x *Header_Split) GetSplitId() []byte { + if x != nil { + return x.SplitId + } + return nil +} + +func (x *Header_Split) GetFirst() *refs.ObjectID { + if x != nil { + return x.First + } + return nil +} + +var File_object_grpc_types_proto protoreflect.FileDescriptor + +var file_object_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x03, 0x0a, + 0x0b, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, + 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x3d, 0x0a, 0x0b, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x12, 0x3b, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x43, 0x0a, + 0x10, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, 0x61, + 0x73, 0x68, 0x22, 0xab, 0x08, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x12, 0x3b, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x3d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x43, + 0x0a, 0x10, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x42, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, + 0x05, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x52, 0x05, 0x73, 0x70, + 0x6c, 0x69, 0x74, 0x1a, 0x33, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0xf5, 0x02, 0x0a, 0x05, 0x53, 0x70, 0x6c, + 0x69, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, + 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x3d, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x34, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, + 0x12, 0x2e, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, + 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xc4, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, + 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, + 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, + 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x37, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x49, 0x44, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x2a, 0x4f, + 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, + 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x4f, 0x52, + 0x41, 0x47, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4c, + 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x04, 0x2a, + 0xa3, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, + 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, + 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, + 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, + 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, + 0x46, 0x49, 0x58, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x5f, 0x47, 0x54, 0x10, + 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x5f, 0x47, 0x45, 0x10, 0x06, 0x12, 0x0a, 0x0a, + 0x06, 0x4e, 0x55, 0x4d, 0x5f, 0x4c, 0x54, 0x10, 0x07, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, + 0x5f, 0x4c, 0x45, 0x10, 0x08, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, + 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_object_grpc_types_proto_rawDescOnce sync.Once + file_object_grpc_types_proto_rawDescData = file_object_grpc_types_proto_rawDesc +) + +func file_object_grpc_types_proto_rawDescGZIP() []byte { + file_object_grpc_types_proto_rawDescOnce.Do(func() { + file_object_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_object_grpc_types_proto_rawDescData) + }) + return file_object_grpc_types_proto_rawDescData +} + +var file_object_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_object_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_object_grpc_types_proto_goTypes = []interface{}{ + (ObjectType)(0), // 0: neo.fs.v2.object.ObjectType + (MatchType)(0), // 1: neo.fs.v2.object.MatchType + (*ShortHeader)(nil), // 2: neo.fs.v2.object.ShortHeader + (*Header)(nil), // 3: neo.fs.v2.object.Header + (*Object)(nil), // 4: neo.fs.v2.object.Object + (*SplitInfo)(nil), // 5: neo.fs.v2.object.SplitInfo + (*Header_Attribute)(nil), // 6: neo.fs.v2.object.Header.Attribute + (*Header_Split)(nil), // 7: neo.fs.v2.object.Header.Split + (*refs.Version)(nil), // 8: neo.fs.v2.refs.Version + (*refs.OwnerID)(nil), // 9: neo.fs.v2.refs.OwnerID + (*refs.Checksum)(nil), // 10: neo.fs.v2.refs.Checksum + (*refs.ContainerID)(nil), // 11: neo.fs.v2.refs.ContainerID + (*session.SessionToken)(nil), // 12: neo.fs.v2.session.SessionToken + (*refs.ObjectID)(nil), // 13: neo.fs.v2.refs.ObjectID + (*refs.Signature)(nil), // 14: neo.fs.v2.refs.Signature +} +var file_object_grpc_types_proto_depIdxs = []int32{ + 8, // 0: neo.fs.v2.object.ShortHeader.version:type_name -> neo.fs.v2.refs.Version + 9, // 1: neo.fs.v2.object.ShortHeader.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 0, // 2: neo.fs.v2.object.ShortHeader.object_type:type_name -> neo.fs.v2.object.ObjectType + 10, // 3: neo.fs.v2.object.ShortHeader.payload_hash:type_name -> neo.fs.v2.refs.Checksum + 10, // 4: neo.fs.v2.object.ShortHeader.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum + 8, // 5: neo.fs.v2.object.Header.version:type_name -> neo.fs.v2.refs.Version + 11, // 6: neo.fs.v2.object.Header.container_id:type_name -> neo.fs.v2.refs.ContainerID + 9, // 7: neo.fs.v2.object.Header.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 10, // 8: neo.fs.v2.object.Header.payload_hash:type_name -> neo.fs.v2.refs.Checksum + 0, // 9: neo.fs.v2.object.Header.object_type:type_name -> neo.fs.v2.object.ObjectType + 10, // 10: neo.fs.v2.object.Header.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum + 12, // 11: neo.fs.v2.object.Header.session_token:type_name -> neo.fs.v2.session.SessionToken + 6, // 12: neo.fs.v2.object.Header.attributes:type_name -> neo.fs.v2.object.Header.Attribute + 7, // 13: neo.fs.v2.object.Header.split:type_name -> neo.fs.v2.object.Header.Split + 13, // 14: neo.fs.v2.object.Object.object_id:type_name -> neo.fs.v2.refs.ObjectID + 14, // 15: neo.fs.v2.object.Object.signature:type_name -> neo.fs.v2.refs.Signature + 3, // 16: neo.fs.v2.object.Object.header:type_name -> neo.fs.v2.object.Header + 13, // 17: neo.fs.v2.object.SplitInfo.last_part:type_name -> neo.fs.v2.refs.ObjectID + 13, // 18: neo.fs.v2.object.SplitInfo.link:type_name -> neo.fs.v2.refs.ObjectID + 13, // 19: neo.fs.v2.object.SplitInfo.first_part:type_name -> neo.fs.v2.refs.ObjectID + 13, // 20: neo.fs.v2.object.Header.Split.parent:type_name -> neo.fs.v2.refs.ObjectID + 13, // 21: neo.fs.v2.object.Header.Split.previous:type_name -> neo.fs.v2.refs.ObjectID + 14, // 22: neo.fs.v2.object.Header.Split.parent_signature:type_name -> neo.fs.v2.refs.Signature + 3, // 23: neo.fs.v2.object.Header.Split.parent_header:type_name -> neo.fs.v2.object.Header + 13, // 24: neo.fs.v2.object.Header.Split.children:type_name -> neo.fs.v2.refs.ObjectID + 13, // 25: neo.fs.v2.object.Header.Split.first:type_name -> neo.fs.v2.refs.ObjectID + 26, // [26:26] is the sub-list for method output_type + 26, // [26:26] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name +} + +func init() { file_object_grpc_types_proto_init() } +func file_object_grpc_types_proto_init() { + if File_object_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_object_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShortHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Object); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SplitInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header_Attribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header_Split); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_object_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_object_grpc_types_proto_goTypes, + DependencyIndexes: file_object_grpc_types_proto_depIdxs, + EnumInfos: file_object_grpc_types_proto_enumTypes, + MessageInfos: file_object_grpc_types_proto_msgTypes, + }.Build() + File_object_grpc_types_proto = out.File + file_object_grpc_types_proto_rawDesc = nil + file_object_grpc_types_proto_goTypes = nil + file_object_grpc_types_proto_depIdxs = nil +} diff --git a/api/refs/encoding.go b/api/refs/encoding.go new file mode 100644 index 00000000..e9d0f6ec --- /dev/null +++ b/api/refs/encoding.go @@ -0,0 +1,192 @@ +package refs + +import "github.com/nspcc-dev/neofs-sdk-go/internal/proto" + +const ( + _ = iota + fieldOwnerIDValue +) + +func (x *OwnerID) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldOwnerIDValue, x.Value) + } + return sz +} + +func (x *OwnerID) MarshalStable(b []byte) { + if x != nil { + proto.MarshalBytes(b, fieldOwnerIDValue, x.Value) + } +} + +const ( + _ = iota + fieldVersionMajor + fieldVersionMinor +) + +func (x *Version) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldVersionMajor, x.Major) + + proto.SizeVarint(fieldVersionMinor, x.Minor) + } + return sz +} + +func (x *Version) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldVersionMajor, x.Major) + proto.MarshalVarint(b[off:], fieldVersionMinor, x.Minor) + } +} + +const ( + _ = iota + fieldContainerIDValue +) + +func (x *ContainerID) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldContainerIDValue, x.Value) + } + return sz +} + +func (x *ContainerID) MarshalStable(b []byte) { + if x != nil { + proto.MarshalBytes(b, fieldContainerIDValue, x.Value) + } +} + +const ( + _ = iota + fieldObjectIDValue +) + +func (x *ObjectID) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldObjectIDValue, x.Value) + } + return sz +} + +func (x *ObjectID) MarshalStable(b []byte) { + if x != nil { + proto.MarshalBytes(b, fieldObjectIDValue, x.Value) + } +} + +const ( + _ = iota + fieldAddressContainer + fieldAddressObject +) + +func (x *Address) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldAddressContainer, x.ContainerId) + + proto.SizeNested(fieldAddressObject, x.ObjectId) + } + return sz +} + +func (x *Address) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldAddressContainer, x.ContainerId) + proto.MarshalNested(b[off:], fieldAddressObject, x.ObjectId) + } +} + +const ( + _ = iota + fieldSubnetVal +) + +func (x *SubnetID) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeFixed32(fieldSubnetVal, x.Value) + } + return sz +} + +func (x *SubnetID) MarshalStable(b []byte) { + if x != nil { + proto.MarshalFixed32(b, fieldSubnetVal, x.Value) + } +} + +const ( + _ = iota + fieldSignatureKey + fieldSignatureVal + fieldSignatureScheme +) + +func (x *Signature) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldSignatureKey, x.Key) + + proto.SizeBytes(fieldSignatureVal, x.Sign) + + proto.SizeVarint(fieldSignatureScheme, int32(x.Scheme)) + } + return sz +} + +func (x *Signature) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldSignatureKey, x.Key) + off += proto.MarshalBytes(b[off:], fieldSignatureVal, x.Sign) + proto.MarshalVarint(b[off:], fieldSignatureScheme, int32(x.Scheme)) + } +} + +const ( + _ = iota + fieldSigRFC6979Key + fieldSigRFC6979Val +) + +func (x *SignatureRFC6979) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldSigRFC6979Key, x.Key) + + proto.SizeBytes(fieldSigRFC6979Val, x.Sign) + } + return sz +} + +func (x *SignatureRFC6979) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldSigRFC6979Key, x.Key) + proto.MarshalBytes(b[off:], fieldSigRFC6979Val, x.Sign) + } +} + +const ( + _ = iota + fieldChecksumType + fieldChecksumValue +) + +func (x *Checksum) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldChecksumType, int32(x.Type)) + + proto.SizeBytes(fieldChecksumValue, x.Sum) + } + return sz +} + +func (x *Checksum) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldChecksumType, int32(x.Type)) + proto.MarshalBytes(b[off:], fieldChecksumValue, x.Sum) + } +} diff --git a/api/refs/encoding_test.go b/api/refs/encoding_test.go new file mode 100644 index 00000000..765a2b87 --- /dev/null +++ b/api/refs/encoding_test.go @@ -0,0 +1,165 @@ +package refs_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestOwnerID(t *testing.T) { + v := &refs.OwnerID{ + Value: []byte("any_owner"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.OwnerID + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Value, res.Value) +} + +func TestVersion(t *testing.T) { + v := &refs.Version{ + Major: 123, + Minor: 456, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.Version + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.EqualValues(t, v.Major, res.Major) + require.EqualValues(t, v.Minor, res.Minor) +} + +func TestContainerID(t *testing.T) { + v := &refs.ContainerID{ + Value: []byte("any_container"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.ContainerID + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Value, res.Value) +} + +func TestObjectID(t *testing.T) { + v := &refs.ObjectID{ + Value: []byte("any_object"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.ObjectID + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Value, res.Value) +} + +func TestAddress(t *testing.T) { + v := &refs.Address{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + ObjectId: &refs.ObjectID{Value: []byte("any_object")}, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.Address + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.ContainerId, res.ContainerId) + require.Equal(t, v.ObjectId, res.ObjectId) +} + +func TestSubnetID(t *testing.T) { + v := &refs.SubnetID{ + Value: 123456, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.SubnetID + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Value, res.Value) +} + +func TestSignature(t *testing.T) { + v := &refs.Signature{ + Key: []byte("any_key"), + Sign: []byte("any_val"), + Scheme: 123, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.Signature + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Key, res.Key) + require.Equal(t, v.Sign, res.Sign) + require.Equal(t, v.Scheme, res.Scheme) +} + +func TestSignatureRFC6979(t *testing.T) { + v := &refs.SignatureRFC6979{ + Key: []byte("any_key"), + Sign: []byte("any_val"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.SignatureRFC6979 + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Key, res.Key) + require.Equal(t, v.Sign, res.Sign) +} + +func TestChecksum(t *testing.T) { + v := &refs.Checksum{ + Type: 321, + Sum: []byte("any_checksum"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res refs.Checksum + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Type, res.Type) + require.Equal(t, v.Sum, res.Sum) +} diff --git a/api/refs/types.pb.go b/api/refs/types.pb.go new file mode 100644 index 00000000..47c6b918 --- /dev/null +++ b/api/refs/types.pb.go @@ -0,0 +1,920 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: refs/grpc/types.proto + +package refs + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Signature scheme describes digital signing scheme used for (key, signature) pair. +type SignatureScheme int32 + +const ( + // ECDSA with SHA-512 hashing (FIPS 186-3) + SignatureScheme_ECDSA_SHA512 SignatureScheme = 0 + // Deterministic ECDSA with SHA-256 hashing (RFC 6979) + SignatureScheme_ECDSA_RFC6979_SHA256 SignatureScheme = 1 + // Deterministic ECDSA with SHA-256 hashing using WalletConnect API. + // Here the algorithm is the same, but the message format differs. + SignatureScheme_ECDSA_RFC6979_SHA256_WALLET_CONNECT SignatureScheme = 2 +) + +// Enum value maps for SignatureScheme. +var ( + SignatureScheme_name = map[int32]string{ + 0: "ECDSA_SHA512", + 1: "ECDSA_RFC6979_SHA256", + 2: "ECDSA_RFC6979_SHA256_WALLET_CONNECT", + } + SignatureScheme_value = map[string]int32{ + "ECDSA_SHA512": 0, + "ECDSA_RFC6979_SHA256": 1, + "ECDSA_RFC6979_SHA256_WALLET_CONNECT": 2, + } +) + +func (x SignatureScheme) Enum() *SignatureScheme { + p := new(SignatureScheme) + *p = x + return p +} + +func (x SignatureScheme) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SignatureScheme) Descriptor() protoreflect.EnumDescriptor { + return file_refs_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (SignatureScheme) Type() protoreflect.EnumType { + return &file_refs_grpc_types_proto_enumTypes[0] +} + +func (x SignatureScheme) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SignatureScheme.Descriptor instead. +func (SignatureScheme) EnumDescriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// Checksum algorithm type. +type ChecksumType int32 + +const ( + // Unknown. Not used + ChecksumType_CHECKSUM_TYPE_UNSPECIFIED ChecksumType = 0 + // Tillich-Zemor homomorphic hash function + ChecksumType_TZ ChecksumType = 1 + // SHA-256 + ChecksumType_SHA256 ChecksumType = 2 +) + +// Enum value maps for ChecksumType. +var ( + ChecksumType_name = map[int32]string{ + 0: "CHECKSUM_TYPE_UNSPECIFIED", + 1: "TZ", + 2: "SHA256", + } + ChecksumType_value = map[string]int32{ + "CHECKSUM_TYPE_UNSPECIFIED": 0, + "TZ": 1, + "SHA256": 2, + } +) + +func (x ChecksumType) Enum() *ChecksumType { + p := new(ChecksumType) + *p = x + return p +} + +func (x ChecksumType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChecksumType) Descriptor() protoreflect.EnumDescriptor { + return file_refs_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (ChecksumType) Type() protoreflect.EnumType { + return &file_refs_grpc_types_proto_enumTypes[1] +} + +func (x ChecksumType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChecksumType.Descriptor instead. +func (ChecksumType) EnumDescriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{1} +} + +// Objects in NeoFS are addressed by their ContainerID and ObjectID. +// +// String presentation of `Address` is a concatenation of string encoded +// `ContainerID` and `ObjectID` delimited by '/' character. +type Address struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Container identifier + ContainerId *ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` + // Object identifier + ObjectId *ObjectID `protobuf:"bytes,2,opt,name=object_id,json=objectID,proto3" json:"object_id,omitempty"` +} + +func (x *Address) Reset() { + *x = Address{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Address) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Address) ProtoMessage() {} + +func (x *Address) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Address.ProtoReflect.Descriptor instead. +func (*Address) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Address) GetContainerId() *ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +func (x *Address) GetObjectId() *ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + +// NeoFS Object unique identifier. Objects are immutable and content-addressed. +// It means `ObjectID` will change if the `header` or the `payload` changes. +// +// `ObjectID` is a 32 byte long +// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of +// the object's `header` field, which, in it's turn, contains the hash of the object's +// payload. +// +// String presentation is a +// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. +// +// JSON value will be data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. +type ObjectID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object identifier in a binary format + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ObjectID) Reset() { + *x = ObjectID{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectID) ProtoMessage() {} + +func (x *ObjectID) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectID.ProtoReflect.Descriptor instead. +func (*ObjectID) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (x *ObjectID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// NeoFS container identifier. Container structures are immutable and +// content-addressed. +// +// `ContainerID` is a 32 byte long +// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of +// stable-marshalled container message. +// +// String presentation is a +// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. +// +// JSON value will be data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. +type ContainerID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Container identifier in a binary format. + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ContainerID) Reset() { + *x = ContainerID{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerID) ProtoMessage() {} + +func (x *ContainerID) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerID.ProtoReflect.Descriptor instead. +func (*ContainerID) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{2} +} + +func (x *ContainerID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// `OwnerID` is a derivative of a user's main public key. The transformation +// algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can +// be directly used as `OwnerID`. +// +// `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte +// followed by 20 bytes of ScrptHash and 4 bytes of checksum. +// +// String presentation is a [Base58 +// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string. +// +// JSON value will be data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. +type OwnerID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the container owner in a binary format + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OwnerID) Reset() { + *x = OwnerID{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OwnerID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OwnerID) ProtoMessage() {} + +func (x *OwnerID) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OwnerID.ProtoReflect.Descriptor instead. +func (*OwnerID) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{3} +} + +func (x *OwnerID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// NeoFS subnetwork identifier. +// +// String representation of a value is base-10 integer. +// +// JSON representation is an object containing a single `value` number field. +// +// DEPRECATED. Kept for compatibility only. +type SubnetID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 4-byte integer subnetwork identifier. + Value uint32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *SubnetID) Reset() { + *x = SubnetID{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubnetID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubnetID) ProtoMessage() {} + +func (x *SubnetID) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubnetID.ProtoReflect.Descriptor instead. +func (*SubnetID) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{4} +} + +func (x *SubnetID) GetValue() uint32 { + if x != nil { + return x.Value + } + return 0 +} + +// API version used by a node. +// +// String presentation is a Semantic Versioning 2.0.0 compatible version string +// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. +type Version struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Major API version + Major uint32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` + // Minor API version + Minor uint32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` +} + +func (x *Version) Reset() { + *x = Version{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Version) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Version) ProtoMessage() {} + +func (x *Version) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Version.ProtoReflect.Descriptor instead. +func (*Version) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{5} +} + +func (x *Version) GetMajor() uint32 { + if x != nil { + return x.Major + } + return 0 +} + +func (x *Version) GetMinor() uint32 { + if x != nil { + return x.Minor + } + return 0 +} + +// Signature of something in NeoFS. +type Signature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Public key used for signing + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Signature + Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"` + // Scheme contains digital signature scheme identifier + Scheme SignatureScheme `protobuf:"varint,3,opt,name=scheme,proto3,enum=neo.fs.v2.refs.SignatureScheme" json:"scheme,omitempty"` +} + +func (x *Signature) Reset() { + *x = Signature{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Signature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Signature) ProtoMessage() {} + +func (x *Signature) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Signature.ProtoReflect.Descriptor instead. +func (*Signature) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{6} +} + +func (x *Signature) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *Signature) GetSign() []byte { + if x != nil { + return x.Sign + } + return nil +} + +func (x *Signature) GetScheme() SignatureScheme { + if x != nil { + return x.Scheme + } + return SignatureScheme_ECDSA_SHA512 +} + +// RFC 6979 signature. +type SignatureRFC6979 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Public key used for signing + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Deterministic ECDSA with SHA-256 hashing + Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"` +} + +func (x *SignatureRFC6979) Reset() { + *x = SignatureRFC6979{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignatureRFC6979) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignatureRFC6979) ProtoMessage() {} + +func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignatureRFC6979.ProtoReflect.Descriptor instead. +func (*SignatureRFC6979) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{7} +} + +func (x *SignatureRFC6979) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *SignatureRFC6979) GetSign() []byte { + if x != nil { + return x.Sign + } + return nil +} + +// Checksum message. +// Depending on checksum algorithm type, the string presentation may vary: +// +// - TZ \ +// Hex encoded string without `0x` prefix +// - SHA256 \ +// Hex encoded string without `0x` prefix +type Checksum struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Checksum algorithm type + Type ChecksumType `protobuf:"varint,1,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` + // Checksum itself + Sum []byte `protobuf:"bytes,2,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *Checksum) Reset() { + *x = Checksum{} + if protoimpl.UnsafeEnabled { + mi := &file_refs_grpc_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Checksum) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Checksum) ProtoMessage() {} + +func (x *Checksum) ProtoReflect() protoreflect.Message { + mi := &file_refs_grpc_types_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Checksum.ProtoReflect.Descriptor instead. +func (*Checksum) Descriptor() ([]byte, []int) { + return file_refs_grpc_types_proto_rawDescGZIP(), []int{8} +} + +func (x *Checksum) GetType() ChecksumType { + if x != nil { + return x.Type + } + return ChecksumType_CHECKSUM_TYPE_UNSPECIFIED +} + +func (x *Checksum) GetSum() []byte { + if x != nil { + return x.Sum + } + return nil +} + +var File_refs_grpc_types_proto protoreflect.FileDescriptor + +var file_refs_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, + 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x22, 0x20, 0x0a, 0x08, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0b, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x20, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, + 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x0c, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00, + 0x12, 0x18, 0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, + 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43, + 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, + 0x54, 0x10, 0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x42, 0x50, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, + 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, + 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_refs_grpc_types_proto_rawDescOnce sync.Once + file_refs_grpc_types_proto_rawDescData = file_refs_grpc_types_proto_rawDesc +) + +func file_refs_grpc_types_proto_rawDescGZIP() []byte { + file_refs_grpc_types_proto_rawDescOnce.Do(func() { + file_refs_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_refs_grpc_types_proto_rawDescData) + }) + return file_refs_grpc_types_proto_rawDescData +} + +var file_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_refs_grpc_types_proto_goTypes = []interface{}{ + (SignatureScheme)(0), // 0: neo.fs.v2.refs.SignatureScheme + (ChecksumType)(0), // 1: neo.fs.v2.refs.ChecksumType + (*Address)(nil), // 2: neo.fs.v2.refs.Address + (*ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID + (*ContainerID)(nil), // 4: neo.fs.v2.refs.ContainerID + (*OwnerID)(nil), // 5: neo.fs.v2.refs.OwnerID + (*SubnetID)(nil), // 6: neo.fs.v2.refs.SubnetID + (*Version)(nil), // 7: neo.fs.v2.refs.Version + (*Signature)(nil), // 8: neo.fs.v2.refs.Signature + (*SignatureRFC6979)(nil), // 9: neo.fs.v2.refs.SignatureRFC6979 + (*Checksum)(nil), // 10: neo.fs.v2.refs.Checksum +} +var file_refs_grpc_types_proto_depIdxs = []int32{ + 4, // 0: neo.fs.v2.refs.Address.container_id:type_name -> neo.fs.v2.refs.ContainerID + 3, // 1: neo.fs.v2.refs.Address.object_id:type_name -> neo.fs.v2.refs.ObjectID + 0, // 2: neo.fs.v2.refs.Signature.scheme:type_name -> neo.fs.v2.refs.SignatureScheme + 1, // 3: neo.fs.v2.refs.Checksum.type:type_name -> neo.fs.v2.refs.ChecksumType + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_refs_grpc_types_proto_init() } +func file_refs_grpc_types_proto_init() { + if File_refs_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_refs_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Address); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OwnerID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubnetID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Version); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Signature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignatureRFC6979); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_refs_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Checksum); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_refs_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_refs_grpc_types_proto_goTypes, + DependencyIndexes: file_refs_grpc_types_proto_depIdxs, + EnumInfos: file_refs_grpc_types_proto_enumTypes, + MessageInfos: file_refs_grpc_types_proto_msgTypes, + }.Build() + File_refs_grpc_types_proto = out.File + file_refs_grpc_types_proto_rawDesc = nil + file_refs_grpc_types_proto_goTypes = nil + file_refs_grpc_types_proto_depIdxs = nil +} diff --git a/api/reputation/encoding.go b/api/reputation/encoding.go new file mode 100644 index 00000000..dcad0073 --- /dev/null +++ b/api/reputation/encoding.go @@ -0,0 +1,123 @@ +package reputation + +import "github.com/nspcc-dev/neofs-sdk-go/internal/proto" + +const ( + _ = iota + fieldPeerPubKey +) + +func (x *PeerID) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldPeerPubKey, x.PublicKey) + } + return sz +} + +func (x *PeerID) MarshalStable(b []byte) { + if x != nil { + proto.MarshalBytes(b, fieldPeerPubKey, x.PublicKey) + } +} + +const ( + _ = iota + fieldTrustPeer + fieldTrustValue +) + +func (x *Trust) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldTrustPeer, x.Peer) + + proto.SizeFloat64(fieldTrustValue, x.Value) + } + return sz +} + +func (x *Trust) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldTrustPeer, x.Peer) + proto.MarshalFloat64(b[off:], fieldTrustValue, x.Value) + } +} + +const ( + _ = iota + fieldP2PTrustPeer + fieldP2PTrustValue +) + +func (x *PeerToPeerTrust) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldP2PTrustPeer, x.TrustingPeer) + + proto.SizeNested(fieldP2PTrustValue, x.Trust) + } + return sz +} + +func (x *PeerToPeerTrust) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldP2PTrustPeer, x.TrustingPeer) + proto.MarshalNested(b[off:], fieldP2PTrustValue, x.Trust) + } +} + +const ( + _ = iota + fieldAnnounceLocalReqEpoch + fieldAnnounceLocalReqTrusts +) + +func (x *AnnounceLocalTrustRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldAnnounceLocalReqEpoch, x.Epoch) + for i := range x.Trusts { + sz += proto.SizeNested(fieldAnnounceLocalReqTrusts, x.Trusts[i]) + } + } + return sz +} + +func (x *AnnounceLocalTrustRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldAnnounceLocalReqEpoch, x.Epoch) + for i := range x.Trusts { + off += proto.MarshalNested(b[off:], fieldAnnounceLocalReqTrusts, x.Trusts[i]) + } + } +} + +func (x *AnnounceLocalTrustResponse_Body) MarshaledSize() int { return 0 } +func (x *AnnounceLocalTrustResponse_Body) MarshalStable([]byte) {} + +const ( + _ = iota + fieldAnnounceIntermediateReqEpoch + fieldAnnounceIntermediateReqIter + fieldAnnounceIntermediateReqTrust +) + +func (x *AnnounceIntermediateResultRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldAnnounceIntermediateReqEpoch, x.Epoch) + + proto.SizeVarint(fieldAnnounceIntermediateReqIter, x.Iteration) + + proto.SizeNested(fieldAnnounceIntermediateReqTrust, x.Trust) + } + return sz +} + +func (x *AnnounceIntermediateResultRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldAnnounceIntermediateReqEpoch, x.Epoch) + off += proto.MarshalVarint(b[off:], fieldAnnounceIntermediateReqIter, x.Iteration) + proto.MarshalNested(b[off:], fieldAnnounceIntermediateReqIter, x.Trust) + } +} + +func (x *AnnounceIntermediateResultResponse_Body) MarshaledSize() int { return 0 } +func (x *AnnounceIntermediateResultResponse_Body) MarshalStable([]byte) {} diff --git a/api/reputation/encoding_test.go b/api/reputation/encoding_test.go new file mode 100644 index 00000000..ac77f24f --- /dev/null +++ b/api/reputation/encoding_test.go @@ -0,0 +1,74 @@ +package reputation_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/reputation" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestAnnounceLocalTrustRequest_Body(t *testing.T) { + v := &reputation.AnnounceLocalTrustRequest_Body{ + Epoch: 1, + Trusts: []*reputation.Trust{ + {Peer: &reputation.PeerID{PublicKey: []byte("any_public_key1")}, Value: 2.3}, + {Peer: &reputation.PeerID{PublicKey: []byte("any_public_key2")}, Value: 3.4}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res reputation.AnnounceLocalTrustRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Epoch, res.Epoch) + require.Equal(t, v.Trusts, res.Trusts) +} + +func TestAnnounceLocalTrustResponse_Body(t *testing.T) { + var v reputation.AnnounceLocalTrustResponse_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} + +func TestAnnounceIntermediateResultRequest_Body(t *testing.T) { + v := &reputation.AnnounceIntermediateResultRequest_Body{ + Epoch: 1, + Iteration: 2, + Trust: &reputation.PeerToPeerTrust{ + TrustingPeer: &reputation.PeerID{PublicKey: []byte("any_public_key1")}, + Trust: &reputation.Trust{ + Peer: &reputation.PeerID{PublicKey: []byte("any_public_key2")}, + Value: 3.4, + }, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res reputation.AnnounceIntermediateResultRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Epoch, res.Epoch) + require.Equal(t, v.Iteration, res.Iteration) + require.Equal(t, v.Trust, res.Trust) +} + +func TestAnnounceIntermediateResultResponse_Body(t *testing.T) { + var v reputation.AnnounceIntermediateResultResponse_Body + require.Zero(t, v.MarshaledSize()) + require.NotPanics(t, func() { v.MarshalStable(nil) }) + b := []byte("not_a_protobuf") + v.MarshalStable(b) + require.EqualValues(t, "not_a_protobuf", b) +} diff --git a/api/reputation/service.pb.go b/api/reputation/service.pb.go new file mode 100644 index 00000000..18879dbe --- /dev/null +++ b/api/reputation/service.pb.go @@ -0,0 +1,809 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: reputation/grpc/service.proto + +package reputation + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/session" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Announce node's local trust information. +type AnnounceLocalTrustRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the request message. + Body *AnnounceLocalTrustRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AnnounceLocalTrustRequest) Reset() { + *x = AnnounceLocalTrustRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceLocalTrustRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceLocalTrustRequest) ProtoMessage() {} + +func (x *AnnounceLocalTrustRequest) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceLocalTrustRequest.ProtoReflect.Descriptor instead. +func (*AnnounceLocalTrustRequest) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *AnnounceLocalTrustRequest) GetBody() *AnnounceLocalTrustRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AnnounceLocalTrustRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AnnounceLocalTrustRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Node's local trust information announcement response. +type AnnounceLocalTrustResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the response message. + Body *AnnounceLocalTrustResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AnnounceLocalTrustResponse) Reset() { + *x = AnnounceLocalTrustResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceLocalTrustResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceLocalTrustResponse) ProtoMessage() {} + +func (x *AnnounceLocalTrustResponse) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceLocalTrustResponse.ProtoReflect.Descriptor instead. +func (*AnnounceLocalTrustResponse) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *AnnounceLocalTrustResponse) GetBody() *AnnounceLocalTrustResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AnnounceLocalTrustResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AnnounceLocalTrustResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Announce intermediate global trust information. +type AnnounceIntermediateResultRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the request message. + Body *AnnounceIntermediateResultRequest_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 *session.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 *session.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AnnounceIntermediateResultRequest) Reset() { + *x = AnnounceIntermediateResultRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceIntermediateResultRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceIntermediateResultRequest) ProtoMessage() {} + +func (x *AnnounceIntermediateResultRequest) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceIntermediateResultRequest.ProtoReflect.Descriptor instead. +func (*AnnounceIntermediateResultRequest) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{2} +} + +func (x *AnnounceIntermediateResultRequest) GetBody() *AnnounceIntermediateResultRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AnnounceIntermediateResultRequest) GetMetaHeader() *session.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AnnounceIntermediateResultRequest) GetVerifyHeader() *session.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Intermediate global trust information announcement response. +type AnnounceIntermediateResultResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of the response message. + Body *AnnounceIntermediateResultResponse_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 *session.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 *session.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AnnounceIntermediateResultResponse) Reset() { + *x = AnnounceIntermediateResultResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceIntermediateResultResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceIntermediateResultResponse) ProtoMessage() {} + +func (x *AnnounceIntermediateResultResponse) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceIntermediateResultResponse.ProtoReflect.Descriptor instead. +func (*AnnounceIntermediateResultResponse) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{3} +} + +func (x *AnnounceIntermediateResultResponse) GetBody() *AnnounceIntermediateResultResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AnnounceIntermediateResultResponse) GetMetaHeader() *session.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AnnounceIntermediateResultResponse) GetVerifyHeader() *session.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Announce node's local trust information. +type AnnounceLocalTrustRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Trust assessment Epoch number + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + // List of normalized local trust values to other NeoFS nodes. The value + // is calculated according to EigenTrust++ algorithm and must be a + // floating point number in [0;1] range. + Trusts []*Trust `protobuf:"bytes,2,rep,name=trusts,proto3" json:"trusts,omitempty"` +} + +func (x *AnnounceLocalTrustRequest_Body) Reset() { + *x = AnnounceLocalTrustRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceLocalTrustRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceLocalTrustRequest_Body) ProtoMessage() {} + +func (x *AnnounceLocalTrustRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceLocalTrustRequest_Body.ProtoReflect.Descriptor instead. +func (*AnnounceLocalTrustRequest_Body) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *AnnounceLocalTrustRequest_Body) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *AnnounceLocalTrustRequest_Body) GetTrusts() []*Trust { + if x != nil { + return x.Trusts + } + return nil +} + +// Response to the node's local trust information announcement has an empty body +// because the trust exchange operation is asynchronous. If Trust information +// does not pass sanity checks, it is silently ignored. +type AnnounceLocalTrustResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AnnounceLocalTrustResponse_Body) Reset() { + *x = AnnounceLocalTrustResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceLocalTrustResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceLocalTrustResponse_Body) ProtoMessage() {} + +func (x *AnnounceLocalTrustResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceLocalTrustResponse_Body.ProtoReflect.Descriptor instead. +func (*AnnounceLocalTrustResponse_Body) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +// Announce intermediate global trust information. +type AnnounceIntermediateResultRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Iteration execution Epoch number + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + // Iteration sequence number + Iteration uint32 `protobuf:"varint,2,opt,name=iteration,proto3" json:"iteration,omitempty"` + // Current global trust value calculated at the specified iteration + Trust *PeerToPeerTrust `protobuf:"bytes,3,opt,name=trust,proto3" json:"trust,omitempty"` +} + +func (x *AnnounceIntermediateResultRequest_Body) Reset() { + *x = AnnounceIntermediateResultRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceIntermediateResultRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceIntermediateResultRequest_Body) ProtoMessage() {} + +func (x *AnnounceIntermediateResultRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceIntermediateResultRequest_Body.ProtoReflect.Descriptor instead. +func (*AnnounceIntermediateResultRequest_Body) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *AnnounceIntermediateResultRequest_Body) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *AnnounceIntermediateResultRequest_Body) GetIteration() uint32 { + if x != nil { + return x.Iteration + } + return 0 +} + +func (x *AnnounceIntermediateResultRequest_Body) GetTrust() *PeerToPeerTrust { + if x != nil { + return x.Trust + } + return nil +} + +// Response to the node's intermediate global trust information announcement has +// an empty body because the trust exchange operation is asynchronous. If +// Trust information does not pass sanity checks, it is silently ignored. +type AnnounceIntermediateResultResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AnnounceIntermediateResultResponse_Body) Reset() { + *x = AnnounceIntermediateResultResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnounceIntermediateResultResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnounceIntermediateResultResponse_Body) ProtoMessage() {} + +func (x *AnnounceIntermediateResultResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnnounceIntermediateResultResponse_Body.ProtoReflect.Descriptor instead. +func (*AnnounceIntermediateResultResponse_Body) Descriptor() ([]byte, []int) { + return file_reputation_grpc_service_proto_rawDescGZIP(), []int{3, 0} +} + +var File_reputation_grpc_service_proto protoreflect.FileDescriptor + +var file_reputation_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x02, 0x0a, + 0x19, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x51, + 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x33, 0x0a, 0x06, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x06, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x73, 0x22, 0x8b, 0x02, 0x0a, 0x1a, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, + 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x49, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, + 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, + 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, + 0x88, 0x03, 0x0a, 0x21, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, + 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, + 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, + 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x1a, 0x77, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x1c, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, + 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x6f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x22, 0x9b, 0x02, 0x0a, 0x22, 0x41, + 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x51, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0x9e, 0x02, 0x0a, 0x11, 0x52, 0x65, 0x70, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x77, + 0x0a, 0x12, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, + 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x1a, 0x41, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, + 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x38, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x62, 0x5a, 0x3f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, + 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, + 0x32, 0x2f, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1e, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x52, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_reputation_grpc_service_proto_rawDescOnce sync.Once + file_reputation_grpc_service_proto_rawDescData = file_reputation_grpc_service_proto_rawDesc +) + +func file_reputation_grpc_service_proto_rawDescGZIP() []byte { + file_reputation_grpc_service_proto_rawDescOnce.Do(func() { + file_reputation_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_reputation_grpc_service_proto_rawDescData) + }) + return file_reputation_grpc_service_proto_rawDescData +} + +var file_reputation_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_reputation_grpc_service_proto_goTypes = []interface{}{ + (*AnnounceLocalTrustRequest)(nil), // 0: neo.fs.v2.reputation.AnnounceLocalTrustRequest + (*AnnounceLocalTrustResponse)(nil), // 1: neo.fs.v2.reputation.AnnounceLocalTrustResponse + (*AnnounceIntermediateResultRequest)(nil), // 2: neo.fs.v2.reputation.AnnounceIntermediateResultRequest + (*AnnounceIntermediateResultResponse)(nil), // 3: neo.fs.v2.reputation.AnnounceIntermediateResultResponse + (*AnnounceLocalTrustRequest_Body)(nil), // 4: neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body + (*AnnounceLocalTrustResponse_Body)(nil), // 5: neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body + (*AnnounceIntermediateResultRequest_Body)(nil), // 6: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body + (*AnnounceIntermediateResultResponse_Body)(nil), // 7: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body + (*session.RequestMetaHeader)(nil), // 8: neo.fs.v2.session.RequestMetaHeader + (*session.RequestVerificationHeader)(nil), // 9: neo.fs.v2.session.RequestVerificationHeader + (*session.ResponseMetaHeader)(nil), // 10: neo.fs.v2.session.ResponseMetaHeader + (*session.ResponseVerificationHeader)(nil), // 11: neo.fs.v2.session.ResponseVerificationHeader + (*Trust)(nil), // 12: neo.fs.v2.reputation.Trust + (*PeerToPeerTrust)(nil), // 13: neo.fs.v2.reputation.PeerToPeerTrust +} +var file_reputation_grpc_service_proto_depIdxs = []int32{ + 4, // 0: neo.fs.v2.reputation.AnnounceLocalTrustRequest.body:type_name -> neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body + 8, // 1: neo.fs.v2.reputation.AnnounceLocalTrustRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 9, // 2: neo.fs.v2.reputation.AnnounceLocalTrustRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 5, // 3: neo.fs.v2.reputation.AnnounceLocalTrustResponse.body:type_name -> neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body + 10, // 4: neo.fs.v2.reputation.AnnounceLocalTrustResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 11, // 5: neo.fs.v2.reputation.AnnounceLocalTrustResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 6, // 6: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.body:type_name -> neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body + 8, // 7: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 9, // 8: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 7, // 9: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.body:type_name -> neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body + 10, // 10: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 11, // 11: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 12, // 12: neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body.trusts:type_name -> neo.fs.v2.reputation.Trust + 13, // 13: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body.trust:type_name -> neo.fs.v2.reputation.PeerToPeerTrust + 0, // 14: neo.fs.v2.reputation.ReputationService.AnnounceLocalTrust:input_type -> neo.fs.v2.reputation.AnnounceLocalTrustRequest + 2, // 15: neo.fs.v2.reputation.ReputationService.AnnounceIntermediateResult:input_type -> neo.fs.v2.reputation.AnnounceIntermediateResultRequest + 1, // 16: neo.fs.v2.reputation.ReputationService.AnnounceLocalTrust:output_type -> neo.fs.v2.reputation.AnnounceLocalTrustResponse + 3, // 17: neo.fs.v2.reputation.ReputationService.AnnounceIntermediateResult:output_type -> neo.fs.v2.reputation.AnnounceIntermediateResultResponse + 16, // [16:18] is the sub-list for method output_type + 14, // [14:16] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_reputation_grpc_service_proto_init() } +func file_reputation_grpc_service_proto_init() { + if File_reputation_grpc_service_proto != nil { + return + } + file_reputation_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_reputation_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceLocalTrustRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceLocalTrustResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceIntermediateResultRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceIntermediateResultResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceLocalTrustRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceLocalTrustResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceIntermediateResultRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnounceIntermediateResultResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reputation_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_reputation_grpc_service_proto_goTypes, + DependencyIndexes: file_reputation_grpc_service_proto_depIdxs, + MessageInfos: file_reputation_grpc_service_proto_msgTypes, + }.Build() + File_reputation_grpc_service_proto = out.File + file_reputation_grpc_service_proto_rawDesc = nil + file_reputation_grpc_service_proto_goTypes = nil + file_reputation_grpc_service_proto_depIdxs = nil +} diff --git a/api/reputation/service_grpc.pb.go b/api/reputation/service_grpc.pb.go new file mode 100644 index 00000000..61ac363e --- /dev/null +++ b/api/reputation/service_grpc.pb.go @@ -0,0 +1,170 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: reputation/grpc/service.proto + +package reputation + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ReputationService_AnnounceLocalTrust_FullMethodName = "/neo.fs.v2.reputation.ReputationService/AnnounceLocalTrust" + ReputationService_AnnounceIntermediateResult_FullMethodName = "/neo.fs.v2.reputation.ReputationService/AnnounceIntermediateResult" +) + +// ReputationServiceClient is the client API for ReputationService 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 ReputationServiceClient interface { + // Announce local client trust information to any node in NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // local trust has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). + AnnounceLocalTrust(ctx context.Context, in *AnnounceLocalTrustRequest, opts ...grpc.CallOption) (*AnnounceLocalTrustResponse, error) + // Announce the intermediate result of the iterative algorithm for + // calculating the global reputation of the node in NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // intermediate trust estimation has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). + AnnounceIntermediateResult(ctx context.Context, in *AnnounceIntermediateResultRequest, opts ...grpc.CallOption) (*AnnounceIntermediateResultResponse, error) +} + +type reputationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewReputationServiceClient(cc grpc.ClientConnInterface) ReputationServiceClient { + return &reputationServiceClient{cc} +} + +func (c *reputationServiceClient) AnnounceLocalTrust(ctx context.Context, in *AnnounceLocalTrustRequest, opts ...grpc.CallOption) (*AnnounceLocalTrustResponse, error) { + out := new(AnnounceLocalTrustResponse) + err := c.cc.Invoke(ctx, ReputationService_AnnounceLocalTrust_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reputationServiceClient) AnnounceIntermediateResult(ctx context.Context, in *AnnounceIntermediateResultRequest, opts ...grpc.CallOption) (*AnnounceIntermediateResultResponse, error) { + out := new(AnnounceIntermediateResultResponse) + err := c.cc.Invoke(ctx, ReputationService_AnnounceIntermediateResult_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReputationServiceServer is the server API for ReputationService service. +// All implementations should embed UnimplementedReputationServiceServer +// for forward compatibility +type ReputationServiceServer interface { + // Announce local client trust information to any node in NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // local trust has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). + AnnounceLocalTrust(context.Context, *AnnounceLocalTrustRequest) (*AnnounceLocalTrustResponse, error) + // Announce the intermediate result of the iterative algorithm for + // calculating the global reputation of the node in NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // intermediate trust estimation has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). + AnnounceIntermediateResult(context.Context, *AnnounceIntermediateResultRequest) (*AnnounceIntermediateResultResponse, error) +} + +// UnimplementedReputationServiceServer should be embedded to have forward compatible implementations. +type UnimplementedReputationServiceServer struct { +} + +func (UnimplementedReputationServiceServer) AnnounceLocalTrust(context.Context, *AnnounceLocalTrustRequest) (*AnnounceLocalTrustResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AnnounceLocalTrust not implemented") +} +func (UnimplementedReputationServiceServer) AnnounceIntermediateResult(context.Context, *AnnounceIntermediateResultRequest) (*AnnounceIntermediateResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AnnounceIntermediateResult not implemented") +} + +// UnsafeReputationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReputationServiceServer will +// result in compilation errors. +type UnsafeReputationServiceServer interface { + mustEmbedUnimplementedReputationServiceServer() +} + +func RegisterReputationServiceServer(s grpc.ServiceRegistrar, srv ReputationServiceServer) { + s.RegisterService(&ReputationService_ServiceDesc, srv) +} + +func _ReputationService_AnnounceLocalTrust_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnounceLocalTrustRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReputationServiceServer).AnnounceLocalTrust(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReputationService_AnnounceLocalTrust_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReputationServiceServer).AnnounceLocalTrust(ctx, req.(*AnnounceLocalTrustRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReputationService_AnnounceIntermediateResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnounceIntermediateResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReputationServiceServer).AnnounceIntermediateResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReputationService_AnnounceIntermediateResult_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReputationServiceServer).AnnounceIntermediateResult(ctx, req.(*AnnounceIntermediateResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ReputationService_ServiceDesc is the grpc.ServiceDesc for ReputationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ReputationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "neo.fs.v2.reputation.ReputationService", + HandlerType: (*ReputationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnnounceLocalTrust", + Handler: _ReputationService_AnnounceLocalTrust_Handler, + }, + { + MethodName: "AnnounceIntermediateResult", + Handler: _ReputationService_AnnounceIntermediateResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "reputation/grpc/service.proto", +} diff --git a/api/reputation/types.pb.go b/api/reputation/types.pb.go new file mode 100644 index 00000000..56f09902 --- /dev/null +++ b/api/reputation/types.pb.go @@ -0,0 +1,501 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: reputation/grpc/types.proto + +package reputation + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// NeoFS unique peer identifier is a 33 byte long compressed public key of the +// node, the same as the one stored in the network map. +// +// String presentation is a +// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. +// +// JSON value will be data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. +type PeerID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Peer node's public key + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *PeerID) Reset() { + *x = PeerID{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerID) ProtoMessage() {} + +func (x *PeerID) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerID.ProtoReflect.Descriptor instead. +func (*PeerID) Descriptor() ([]byte, []int) { + return file_reputation_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *PeerID) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +// Trust level to a NeoFS network peer. +type Trust struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the trusted peer + Peer *PeerID `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` + // Trust level in [0:1] range + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Trust) Reset() { + *x = Trust{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Trust) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Trust) ProtoMessage() {} + +func (x *Trust) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Trust.ProtoReflect.Descriptor instead. +func (*Trust) Descriptor() ([]byte, []int) { + return file_reputation_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Trust) GetPeer() *PeerID { + if x != nil { + return x.Peer + } + return nil +} + +func (x *Trust) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +// Trust level of a peer to a peer. +type PeerToPeerTrust struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the trusting peer + TrustingPeer *PeerID `protobuf:"bytes,1,opt,name=trusting_peer,json=trustingPeer,proto3" json:"trusting_peer,omitempty"` + // Trust level + Trust *Trust `protobuf:"bytes,2,opt,name=trust,proto3" json:"trust,omitempty"` +} + +func (x *PeerToPeerTrust) Reset() { + *x = PeerToPeerTrust{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerToPeerTrust) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerToPeerTrust) ProtoMessage() {} + +func (x *PeerToPeerTrust) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerToPeerTrust.ProtoReflect.Descriptor instead. +func (*PeerToPeerTrust) Descriptor() ([]byte, []int) { + return file_reputation_grpc_types_proto_rawDescGZIP(), []int{2} +} + +func (x *PeerToPeerTrust) GetTrustingPeer() *PeerID { + if x != nil { + return x.TrustingPeer + } + return nil +} + +func (x *PeerToPeerTrust) GetTrust() *Trust { + if x != nil { + return x.Trust + } + return nil +} + +// Global trust level to NeoFS node. +type GlobalTrust struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Message format version. Effectively, the version of API library used to create + // the message. + Version *refs.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Message body + Body *GlobalTrust_Body `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + // Signature of the binary `body` field by the manager. + Signature *refs.Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *GlobalTrust) Reset() { + *x = GlobalTrust{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GlobalTrust) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GlobalTrust) ProtoMessage() {} + +func (x *GlobalTrust) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GlobalTrust.ProtoReflect.Descriptor instead. +func (*GlobalTrust) Descriptor() ([]byte, []int) { + return file_reputation_grpc_types_proto_rawDescGZIP(), []int{3} +} + +func (x *GlobalTrust) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *GlobalTrust) GetBody() *GlobalTrust_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *GlobalTrust) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +// Message body structure. +type GlobalTrust_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Node manager ID + Manager *PeerID `protobuf:"bytes,1,opt,name=manager,proto3" json:"manager,omitempty"` + // Global trust level + Trust *Trust `protobuf:"bytes,2,opt,name=trust,proto3" json:"trust,omitempty"` +} + +func (x *GlobalTrust_Body) Reset() { + *x = GlobalTrust_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_reputation_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GlobalTrust_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GlobalTrust_Body) ProtoMessage() {} + +func (x *GlobalTrust_Body) ProtoReflect() protoreflect.Message { + mi := &file_reputation_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GlobalTrust_Body.ProtoReflect.Descriptor instead. +func (*GlobalTrust_Body) Descriptor() ([]byte, []int) { + return file_reputation_grpc_types_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *GlobalTrust_Body) GetManager() *PeerID { + if x != nil { + return x.Manager + } + return nil +} + +func (x *GlobalTrust_Body) GetTrust() *Trust { + if x != nil { + return x.Trust + } + return nil +} + +var File_reputation_grpc_types_proto protoreflect.FileDescriptor + +var file_reputation_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x27, 0x0a, 0x06, 0x50, 0x65, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x22, 0x4f, 0x0a, 0x05, 0x54, 0x72, 0x75, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x04, + 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x0f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x6f, 0x50, + 0x65, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x74, 0x72, 0x75, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0c, 0x74, + 0x72, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x74, + 0x72, 0x75, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x22, 0xa8, + 0x02, 0x0a, 0x0b, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x12, 0x31, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x71, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x36, + 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x42, 0x62, 0x5a, 0x3f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, + 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, + 0x32, 0x2f, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1e, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x52, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_reputation_grpc_types_proto_rawDescOnce sync.Once + file_reputation_grpc_types_proto_rawDescData = file_reputation_grpc_types_proto_rawDesc +) + +func file_reputation_grpc_types_proto_rawDescGZIP() []byte { + file_reputation_grpc_types_proto_rawDescOnce.Do(func() { + file_reputation_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_reputation_grpc_types_proto_rawDescData) + }) + return file_reputation_grpc_types_proto_rawDescData +} + +var file_reputation_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_reputation_grpc_types_proto_goTypes = []interface{}{ + (*PeerID)(nil), // 0: neo.fs.v2.reputation.PeerID + (*Trust)(nil), // 1: neo.fs.v2.reputation.Trust + (*PeerToPeerTrust)(nil), // 2: neo.fs.v2.reputation.PeerToPeerTrust + (*GlobalTrust)(nil), // 3: neo.fs.v2.reputation.GlobalTrust + (*GlobalTrust_Body)(nil), // 4: neo.fs.v2.reputation.GlobalTrust.Body + (*refs.Version)(nil), // 5: neo.fs.v2.refs.Version + (*refs.Signature)(nil), // 6: neo.fs.v2.refs.Signature +} +var file_reputation_grpc_types_proto_depIdxs = []int32{ + 0, // 0: neo.fs.v2.reputation.Trust.peer:type_name -> neo.fs.v2.reputation.PeerID + 0, // 1: neo.fs.v2.reputation.PeerToPeerTrust.trusting_peer:type_name -> neo.fs.v2.reputation.PeerID + 1, // 2: neo.fs.v2.reputation.PeerToPeerTrust.trust:type_name -> neo.fs.v2.reputation.Trust + 5, // 3: neo.fs.v2.reputation.GlobalTrust.version:type_name -> neo.fs.v2.refs.Version + 4, // 4: neo.fs.v2.reputation.GlobalTrust.body:type_name -> neo.fs.v2.reputation.GlobalTrust.Body + 6, // 5: neo.fs.v2.reputation.GlobalTrust.signature:type_name -> neo.fs.v2.refs.Signature + 0, // 6: neo.fs.v2.reputation.GlobalTrust.Body.manager:type_name -> neo.fs.v2.reputation.PeerID + 1, // 7: neo.fs.v2.reputation.GlobalTrust.Body.trust:type_name -> neo.fs.v2.reputation.Trust + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_reputation_grpc_types_proto_init() } +func file_reputation_grpc_types_proto_init() { + if File_reputation_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_reputation_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Trust); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerToPeerTrust); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GlobalTrust); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reputation_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GlobalTrust_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reputation_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_reputation_grpc_types_proto_goTypes, + DependencyIndexes: file_reputation_grpc_types_proto_depIdxs, + MessageInfos: file_reputation_grpc_types_proto_msgTypes, + }.Build() + File_reputation_grpc_types_proto = out.File + file_reputation_grpc_types_proto_rawDesc = nil + file_reputation_grpc_types_proto_goTypes = nil + file_reputation_grpc_types_proto_depIdxs = nil +} diff --git a/api/session/encoding.go b/api/session/encoding.go new file mode 100644 index 00000000..6c6459d0 --- /dev/null +++ b/api/session/encoding.go @@ -0,0 +1,380 @@ +package session + +import ( + "fmt" + + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" +) + +const ( + _ = iota + fieldTokenObjectTargetContainer + fieldTokenObjectTargetIDs +) + +func (x *ObjectSessionContext_Target) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldTokenObjectTargetContainer, x.Container) + for i := range x.Objects { + sz += proto.SizeNested(fieldTokenObjectTargetIDs, x.Objects[i]) + } + } + return sz +} + +func (x *ObjectSessionContext_Target) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldTokenObjectTargetContainer, x.Container) + for i := range x.Objects { + off += proto.MarshalNested(b[off:], fieldTokenObjectTargetIDs, x.Objects[i]) + } + } +} + +const ( + _ = iota + fieldTokenObjectVerb + fieldTokenObjectTarget +) + +func (x *ObjectSessionContext) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldTokenObjectVerb, int32(x.Verb)) + + proto.SizeNested(fieldTokenObjectTarget, x.Target) + } + return sz +} + +func (x *ObjectSessionContext) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldTokenObjectVerb, int32(x.Verb)) + proto.MarshalNested(b[off:], fieldTokenObjectTarget, x.Target) + } +} + +const ( + _ = iota + fieldTokenContainerVerb + fieldTokenContainerWildcard + fieldTokenContainerID +) + +func (x *ContainerSessionContext) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldTokenContainerVerb, int32(x.Verb)) + + proto.SizeBool(fieldTokenContainerWildcard, x.Wildcard) + + proto.SizeNested(fieldTokenContainerID, x.ContainerId) + } + return sz +} + +func (x *ContainerSessionContext) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldTokenContainerVerb, int32(x.Verb)) + off += proto.MarshalBool(b[off:], fieldTokenContainerWildcard, x.Wildcard) + proto.MarshalNested(b[off:], fieldTokenContainerID, x.ContainerId) + } +} + +const ( + _ = iota + fieldTokenExp + fieldTokenNbf + fieldTokenIat +) + +func (x *SessionToken_Body_TokenLifetime) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldTokenExp, x.Exp) + + proto.SizeVarint(fieldTokenNbf, x.Nbf) + + proto.SizeVarint(fieldTokenIat, x.Iat) + + } + return sz +} + +func (x *SessionToken_Body_TokenLifetime) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldTokenExp, x.Exp) + off += proto.MarshalVarint(b[off:], fieldTokenNbf, x.Nbf) + proto.MarshalVarint(b[off:], fieldTokenIat, x.Iat) + } +} + +const ( + _ = iota + fieldTokenID + fieldTokenOwner + fieldTokenLifetime + fieldTokenSessionKey + fieldTokenContextObject + fieldTokenContextContainer +) + +func (x *SessionToken_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldTokenID, x.Id) + + proto.SizeNested(fieldTokenOwner, x.OwnerId) + + proto.SizeNested(fieldTokenLifetime, x.Lifetime) + + proto.SizeBytes(fieldTokenSessionKey, x.SessionKey) + switch c := x.Context.(type) { + default: + panic(fmt.Sprintf("unexpected context %T", x.Context)) + case nil: + case *SessionToken_Body_Object: + sz += proto.SizeNested(fieldTokenContextObject, c.Object) + case *SessionToken_Body_Container: + sz += proto.SizeNested(fieldTokenContextContainer, c.Container) + } + } + return sz +} + +func (x *SessionToken_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldTokenID, x.Id) + off += proto.MarshalNested(b[off:], fieldTokenOwner, x.OwnerId) + off += proto.MarshalNested(b[off:], fieldTokenLifetime, x.Lifetime) + off += proto.MarshalBytes(b[off:], fieldTokenSessionKey, x.SessionKey) + switch c := x.Context.(type) { + default: + panic(fmt.Sprintf("unexpected context %T", x.Context)) + case nil: + case *SessionToken_Body_Object: + proto.MarshalNested(b[off:], fieldTokenContextObject, c.Object) + case *SessionToken_Body_Container: + proto.MarshalNested(b[off:], fieldTokenContextContainer, c.Container) + } + } +} + +const ( + _ = iota + fieldTokenBody + fieldTokenSignature +) + +func (x *SessionToken) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldTokenBody, x.Body) + + proto.SizeNested(fieldTokenSignature, x.Signature) + } + return sz +} + +func (x *SessionToken) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldTokenBody, x.Body) + proto.MarshalNested(b[off:], fieldTokenSignature, x.Signature) + } +} + +const ( + _ = iota + fieldCreateReqUser + fieldCreateReqExp +) + +func (x *CreateRequest_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldCreateReqUser, x.OwnerId) + + proto.SizeVarint(fieldCreateReqExp, x.Expiration) + } + return sz +} + +func (x *CreateRequest_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldCreateReqUser, x.OwnerId) + proto.MarshalVarint(b[off:], fieldCreateReqExp, x.Expiration) + } +} + +const ( + _ = iota + fieldCreateRespID + fieldCreateRespSessionKey +) + +func (x *CreateResponse_Body) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldCreateRespID, x.Id) + + proto.SizeBytes(fieldCreateRespSessionKey, x.SessionKey) + } + return sz +} + +func (x *CreateResponse_Body) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldCreateRespID, x.Id) + proto.MarshalBytes(b[off:], fieldCreateRespSessionKey, x.SessionKey) + } +} + +const ( + _ = iota + fieldXHeaderKey + fieldXHeaderValue +) + +func (x *XHeader) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeBytes(fieldXHeaderKey, x.Key) + + proto.SizeBytes(fieldXHeaderValue, x.Value) + } + return sz +} + +func (x *XHeader) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalBytes(b, fieldXHeaderKey, x.Key) + proto.MarshalBytes(b[off:], fieldXHeaderValue, x.Value) + } +} + +const ( + _ = iota + fieldReqMetaVersion + fieldReqMetaEpoch + fieldReqMetaTTL + fieldReqMetaXHeaders + fieldReqMetaSession + fieldReqMetaBearer + fieldReqMetaOrigin + fieldReqMetaNetMagic +) + +func (x *RequestMetaHeader) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldReqMetaVersion, x.Version) + + proto.SizeVarint(fieldReqMetaEpoch, x.Epoch) + + proto.SizeVarint(fieldReqMetaTTL, x.Ttl) + + proto.SizeNested(fieldReqMetaSession, x.SessionToken) + + proto.SizeNested(fieldReqMetaBearer, x.BearerToken) + + proto.SizeNested(fieldReqMetaOrigin, x.Origin) + + proto.SizeVarint(fieldReqMetaNetMagic, x.MagicNumber) + for i := range x.XHeaders { + sz += proto.SizeNested(fieldReqMetaXHeaders, x.XHeaders[i]) + } + } + return sz +} + +func (x *RequestMetaHeader) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldReqMetaVersion, x.Version) + off += proto.MarshalVarint(b[off:], fieldReqMetaEpoch, x.Epoch) + off += proto.MarshalVarint(b[off:], fieldReqMetaTTL, x.Ttl) + for i := range x.XHeaders { + off += proto.MarshalNested(b[off:], fieldReqMetaXHeaders, x.XHeaders[i]) + } + off += proto.MarshalNested(b[off:], fieldReqMetaSession, x.SessionToken) + off += proto.MarshalNested(b[off:], fieldReqMetaBearer, x.BearerToken) + off += proto.MarshalNested(b[off:], fieldReqMetaOrigin, x.Origin) + off += proto.MarshalVarint(b[off:], fieldReqMetaNetMagic, x.MagicNumber) + } +} + +const ( + _ = iota + fieldRespMetaVersion + fieldRespMetaEpoch + fieldRespMetaTTL + fieldRespMetaXHeaders + fieldRespMetaOrigin + fieldRespMetaStatus +) + +func (x *ResponseMetaHeader) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldRespMetaVersion, x.Version) + + proto.SizeVarint(fieldRespMetaEpoch, x.Epoch) + + proto.SizeVarint(fieldRespMetaTTL, x.Ttl) + + proto.SizeNested(fieldRespMetaOrigin, x.Origin) + + proto.SizeNested(fieldRespMetaStatus, x.Status) + for i := range x.XHeaders { + sz += proto.SizeNested(fieldRespMetaXHeaders, x.XHeaders[i]) + } + } + return sz +} + +func (x *ResponseMetaHeader) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldRespMetaVersion, x.Version) + off += proto.MarshalVarint(b[off:], fieldRespMetaEpoch, x.Epoch) + off += proto.MarshalVarint(b[off:], fieldRespMetaTTL, x.Ttl) + for i := range x.XHeaders { + off += proto.MarshalNested(b[off:], fieldRespMetaXHeaders, x.XHeaders[i]) + } + off += proto.MarshalNested(b[off:], fieldRespMetaOrigin, x.Origin) + off += proto.MarshalNested(b[off:], fieldRespMetaStatus, x.Status) + } +} + +const ( + _ = iota + fieldReqVerifyBodySignature + fieldReqVerifyMetaSignature + fieldReqVerifyOriginSignature + fieldReqVerifyOrigin +) + +func (x *RequestVerificationHeader) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldReqVerifyBodySignature, x.BodySignature) + + proto.SizeNested(fieldReqVerifyMetaSignature, x.MetaSignature) + + proto.SizeNested(fieldReqVerifyOriginSignature, x.OriginSignature) + + proto.SizeNested(fieldReqVerifyOrigin, x.Origin) + } + return sz +} + +func (x *RequestVerificationHeader) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldReqVerifyBodySignature, x.BodySignature) + off += proto.MarshalNested(b[off:], fieldReqVerifyMetaSignature, x.MetaSignature) + off += proto.MarshalNested(b[off:], fieldReqVerifyOriginSignature, x.OriginSignature) + proto.MarshalNested(b[off:], fieldReqVerifyOrigin, x.Origin) + } +} + +const ( + _ = iota + fieldRespVerifyBodySignature + fieldRespVerifyMetaSignature + fieldRespVerifyOriginSignature + fieldRespVerifyOrigin +) + +func (x *ResponseVerificationHeader) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeNested(fieldRespVerifyBodySignature, x.BodySignature) + + proto.SizeNested(fieldRespVerifyMetaSignature, x.MetaSignature) + + proto.SizeNested(fieldRespVerifyOriginSignature, x.OriginSignature) + + proto.SizeNested(fieldRespVerifyOrigin, x.Origin) + } + return sz +} + +func (x *ResponseVerificationHeader) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalNested(b, fieldRespVerifyBodySignature, x.BodySignature) + off += proto.MarshalNested(b[off:], fieldRespVerifyMetaSignature, x.MetaSignature) + off += proto.MarshalNested(b[off:], fieldRespVerifyOriginSignature, x.OriginSignature) + proto.MarshalNested(b[off:], fieldRespVerifyOrigin, x.Origin) + } +} diff --git a/api/session/encoding_test.go b/api/session/encoding_test.go new file mode 100644 index 00000000..55bf2ffc --- /dev/null +++ b/api/session/encoding_test.go @@ -0,0 +1,318 @@ +package session_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/acl" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + "github.com/nspcc-dev/neofs-sdk-go/api/status" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestSessionToken_Body(t *testing.T) { + v := &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 1, Nbf: 2, Iat: 3}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 4}, + } + + testWithContext := func(setCtx func(*session.SessionToken_Body)) { + setCtx(v.Body) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.SessionToken + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Body, res.Body) + require.Equal(t, v.Signature, res.Signature) + } + + testWithContext(func(body *session.SessionToken_Body) { body.Context = nil }) + testWithContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Container{ + Container: &session.ContainerSessionContext{ + Verb: 1, Wildcard: true, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + }, + } + }) + testWithContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Object{ + Object: &session.ObjectSessionContext{ + Verb: 1, + Target: &session.ObjectSessionContext_Target{ + Container: &refs.ContainerID{Value: []byte("any_container")}, + Objects: []*refs.ObjectID{ + {Value: []byte("any_object1")}, + {Value: []byte("any_object2")}, + }, + }, + }, + } + }) +} + +func TestCreateRequest_Body(t *testing.T) { + v := &session.CreateRequest_Body{ + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Expiration: 1, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.CreateRequest_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.OwnerId, res.OwnerId) + require.Equal(t, v.Expiration, res.Expiration) +} + +func TestCreateResponse_Body(t *testing.T) { + v := &session.CreateResponse_Body{ + Id: []byte("any_ID"), + SessionKey: []byte("any_public_key"), + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.CreateResponse_Body + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Id, res.Id) + require.Equal(t, v.SessionKey, res.SessionKey) +} + +func TestRequestMetaHeader(t *testing.T) { + v := &session.RequestMetaHeader{ + Version: &refs.Version{Major: 1, Minor: 2}, + Epoch: 3, + Ttl: 4, + XHeaders: []*session.XHeader{ + {Key: "any_key1", Value: "any_val1"}, + {Key: "any_key2", Value: "any_val2"}, + }, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 101, Nbf: 102, Iat: 103}, + SessionKey: []byte("any_key"), + }, + Signature: &refs.Signature{Key: []byte("any_key"), Sign: []byte("any_signature"), Scheme: 104}, + }, + BearerToken: &acl.BearerToken{ + Body: &acl.BearerToken_Body{ + EaclTable: &acl.EACLTable{ + Version: &refs.Version{Major: 200, Minor: 201}, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + Records: []*acl.EACLRecord{ + { + Operation: 203, Action: 204, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 205, MatchType: 206, Key: "key1", Value: "val1"}, + {HeaderType: 207, MatchType: 208, Key: "key2", Value: "val2"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 209, Keys: [][]byte{{0}, {1}}}, + {Role: 210, Keys: [][]byte{{2}, {3}}}, + }, + }, + { + Operation: 211, Action: 212, + Filters: []*acl.EACLRecord_Filter{ + {HeaderType: 213, MatchType: 12, Key: "key3", Value: "val3"}, + {HeaderType: 214, MatchType: 14, Key: "key4", Value: "val4"}, + }, + Targets: []*acl.EACLRecord_Target{ + {Role: 215, Keys: [][]byte{{4}, {5}}}, + {Role: 216, Keys: [][]byte{{6}, {7}}}, + }, + }, + }, + }, + OwnerId: &refs.OwnerID{Value: []byte("any_owner")}, + Lifetime: &acl.BearerToken_Body_TokenLifetime{Exp: 217, Nbf: 218, Iat: 219}, + Issuer: &refs.OwnerID{Value: []byte("any_issuer")}, + }, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 1, + }, + }, + Origin: &session.RequestMetaHeader{ + Version: &refs.Version{Major: 300, Minor: 301}, + Epoch: 302, + Ttl: 303, + XHeaders: []*session.XHeader{ + {Key: "any_key3", Value: "any_val3"}, + {Key: "any_key4", Value: "any_val4"}, + }, + MagicNumber: 304, + }, + MagicNumber: 5, + } + + testWithSessionContext := func(setCtx func(*session.SessionToken_Body)) { + setCtx(v.SessionToken.Body) + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.RequestMetaHeader + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Version, res.Version) + require.Equal(t, v.Epoch, res.Epoch) + require.Equal(t, v.Ttl, res.Ttl) + require.Equal(t, v.XHeaders, res.XHeaders) + require.Equal(t, v.SessionToken, res.SessionToken) + require.Equal(t, v.BearerToken, res.BearerToken) + require.Equal(t, v.Origin, res.Origin) + require.Equal(t, v.MagicNumber, res.MagicNumber) + } + + testWithSessionContext(func(body *session.SessionToken_Body) { body.Context = nil }) + testWithSessionContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Container{ + Container: &session.ContainerSessionContext{ + Verb: 1, Wildcard: true, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + }, + } + }) + testWithSessionContext(func(body *session.SessionToken_Body) { + body.Context = &session.SessionToken_Body_Object{ + Object: &session.ObjectSessionContext{ + Verb: 1, + Target: &session.ObjectSessionContext_Target{ + Container: &refs.ContainerID{Value: []byte("any_container")}, + Objects: []*refs.ObjectID{ + {Value: []byte("any_object1")}, + {Value: []byte("any_object2")}, + }, + }, + }, + } + }) +} + +func TestResponseMetaHeader(t *testing.T) { + v := &session.ResponseMetaHeader{ + Version: &refs.Version{Major: 1, Minor: 2}, + Epoch: 3, + Ttl: 4, + XHeaders: []*session.XHeader{ + {Key: "any_key1", Value: "any_val1"}, + {Key: "any_key2", Value: "any_val2"}, + }, + Origin: &session.ResponseMetaHeader{ + Version: &refs.Version{Major: 100, Minor: 101}, + Epoch: 102, + Ttl: 103, + XHeaders: []*session.XHeader{ + {Key: "any_key3", Value: "any_val3"}, + {Key: "any_key4", Value: "any_val4"}, + }, + Status: &status.Status{ + Code: 104, + Message: "any_message", + Details: []*status.Status_Detail{ + {Id: 105, Value: []byte("any_detail100")}, + {Id: 106, Value: []byte("any_detail101")}, + }, + }, + }, + Status: &status.Status{ + Code: 5, + Message: "any_message", + Details: []*status.Status_Detail{ + {Id: 6, Value: []byte("any_detail1")}, + {Id: 7, Value: []byte("any_detail2")}, + }, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.ResponseMetaHeader + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Version, res.Version) + require.Equal(t, v.Epoch, res.Epoch) + require.Equal(t, v.Ttl, res.Ttl) + require.Equal(t, v.XHeaders, res.XHeaders) + require.Equal(t, v.Origin, res.Origin) + require.Equal(t, v.Status, res.Status) +} + +func TestRequestVerificationHeader(t *testing.T) { + v := &session.RequestVerificationHeader{ + BodySignature: &refs.Signature{Key: []byte("any_pubkey1"), Sign: []byte("any_signature1"), Scheme: 1}, + MetaSignature: &refs.Signature{Key: []byte("any_pubkey2"), Sign: []byte("any_signature2"), Scheme: 2}, + OriginSignature: &refs.Signature{Key: []byte("any_pubkey3"), Sign: []byte("any_signature3"), Scheme: 3}, + Origin: &session.RequestVerificationHeader{ + BodySignature: &refs.Signature{Key: []byte("any_pubkey100"), Sign: []byte("any_signature100"), Scheme: 100}, + MetaSignature: &refs.Signature{Key: []byte("any_pubkey101"), Sign: []byte("any_signature101"), Scheme: 101}, + OriginSignature: &refs.Signature{Key: []byte("any_pubkey102"), Sign: []byte("any_signature102"), Scheme: 102}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.RequestVerificationHeader + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.BodySignature, res.BodySignature) + require.Equal(t, v.MetaSignature, res.MetaSignature) + require.Equal(t, v.OriginSignature, res.OriginSignature) + require.Equal(t, v.Origin, res.Origin) +} + +func TestResponseVerificationHeader(t *testing.T) { + v := &session.ResponseVerificationHeader{ + BodySignature: &refs.Signature{Key: []byte("any_pubkey1"), Sign: []byte("any_signature1"), Scheme: 1}, + MetaSignature: &refs.Signature{Key: []byte("any_pubkey2"), Sign: []byte("any_signature2"), Scheme: 2}, + OriginSignature: &refs.Signature{Key: []byte("any_pubkey3"), Sign: []byte("any_signature3"), Scheme: 3}, + Origin: &session.ResponseVerificationHeader{ + BodySignature: &refs.Signature{Key: []byte("any_pubkey100"), Sign: []byte("any_signature100"), Scheme: 100}, + MetaSignature: &refs.Signature{Key: []byte("any_pubkey101"), Sign: []byte("any_signature101"), Scheme: 101}, + OriginSignature: &refs.Signature{Key: []byte("any_pubkey102"), Sign: []byte("any_signature102"), Scheme: 102}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res session.ResponseVerificationHeader + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.BodySignature, res.BodySignature) + require.Equal(t, v.MetaSignature, res.MetaSignature) + require.Equal(t, v.OriginSignature, res.OriginSignature) + require.Equal(t, v.Origin, res.Origin) +} diff --git a/api/session/service.pb.go b/api/session/service.pb.go new file mode 100644 index 00000000..ff6b811f --- /dev/null +++ b/api/session/service.pb.go @@ -0,0 +1,458 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: session/grpc/service.proto + +package session + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Information necessary for opening a session. +type CreateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. +func (*CreateRequest) Descriptor() ([]byte, []int) { + return file_session_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateRequest) GetBody() *CreateRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Information about the opened session. +type CreateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *CreateResponse) Reset() { + *x = CreateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse) ProtoMessage() {} + +func (x *CreateResponse) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. +func (*CreateResponse) Descriptor() ([]byte, []int) { + return file_session_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateResponse) GetBody() *CreateResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Session creation request body +type CreateRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Session initiating user's or node's key derived `OwnerID` + OwnerId *refs.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"` +} + +func (x *CreateRequest_Body) Reset() { + *x = CreateRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest_Body) ProtoMessage() {} + +func (x *CreateRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRequest_Body.ProtoReflect.Descriptor instead. +func (*CreateRequest_Body) Descriptor() ([]byte, []int) { + return file_session_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *CreateRequest_Body) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *CreateRequest_Body) GetExpiration() uint64 { + if x != nil { + return x.Expiration + } + return 0 +} + +// Session creation response body +type CreateResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *CreateResponse_Body) Reset() { + *x = CreateResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse_Body) ProtoMessage() {} + +func (x *CreateResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResponse_Body.ProtoReflect.Descriptor instead. +func (*CreateResponse_Body) Descriptor() ([]byte, []int) { + return file_session_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *CreateResponse_Body) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *CreateResponse_Body) GetSessionKey() []byte { + if x != nil { + return x.SessionKey + } + return nil +} + +var File_session_grpc_service_proto protoreflect.FileDescriptor + +var file_session_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, + 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xc0, 0x02, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, + 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x5a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0xa1, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, + 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x37, + 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x32, 0x5f, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x59, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, + 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, + 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_session_grpc_service_proto_rawDescOnce sync.Once + file_session_grpc_service_proto_rawDescData = file_session_grpc_service_proto_rawDesc +) + +func file_session_grpc_service_proto_rawDescGZIP() []byte { + file_session_grpc_service_proto_rawDescOnce.Do(func() { + file_session_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_session_grpc_service_proto_rawDescData) + }) + return file_session_grpc_service_proto_rawDescData +} + +var file_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_session_grpc_service_proto_goTypes = []interface{}{ + (*CreateRequest)(nil), // 0: neo.fs.v2.session.CreateRequest + (*CreateResponse)(nil), // 1: neo.fs.v2.session.CreateResponse + (*CreateRequest_Body)(nil), // 2: neo.fs.v2.session.CreateRequest.Body + (*CreateResponse_Body)(nil), // 3: neo.fs.v2.session.CreateResponse.Body + (*RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader + (*RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader + (*ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader + (*ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader + (*refs.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID +} +var file_session_grpc_service_proto_depIdxs = []int32{ + 2, // 0: neo.fs.v2.session.CreateRequest.body:type_name -> neo.fs.v2.session.CreateRequest.Body + 4, // 1: neo.fs.v2.session.CreateRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 5, // 2: neo.fs.v2.session.CreateRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 3, // 3: neo.fs.v2.session.CreateResponse.body:type_name -> neo.fs.v2.session.CreateResponse.Body + 6, // 4: neo.fs.v2.session.CreateResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 7, // 5: neo.fs.v2.session.CreateResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: neo.fs.v2.session.CreateRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 0, // 7: neo.fs.v2.session.SessionService.Create:input_type -> neo.fs.v2.session.CreateRequest + 1, // 8: neo.fs.v2.session.SessionService.Create:output_type -> neo.fs.v2.session.CreateResponse + 8, // [8:9] is the sub-list for method output_type + 7, // [7:8] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_session_grpc_service_proto_init() } +func file_session_grpc_service_proto_init() { + if File_session_grpc_service_proto != nil { + return + } + file_session_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_session_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_session_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_session_grpc_service_proto_goTypes, + DependencyIndexes: file_session_grpc_service_proto_depIdxs, + MessageInfos: file_session_grpc_service_proto_msgTypes, + }.Build() + File_session_grpc_service_proto = out.File + file_session_grpc_service_proto_rawDesc = nil + file_session_grpc_service_proto_goTypes = nil + file_session_grpc_service_proto_depIdxs = nil +} diff --git a/api/session/service_grpc.pb.go b/api/session/service_grpc.pb.go new file mode 100644 index 00000000..041bdff6 --- /dev/null +++ b/api/session/service_grpc.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: session/grpc/service.proto + +package session + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + SessionService_Create_FullMethodName = "/neo.fs.v2.session.SessionService/Create" +) + +// 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 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) +} + +type sessionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient { + return &sessionServiceClient{cc} +} + +func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { + out := new(CreateResponse) + err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SessionServiceServer is the server API for SessionService service. +// All implementations should embed UnimplementedSessionServiceServer +// for forward compatibility +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) +} + +// UnimplementedSessionServiceServer should be embedded to have forward compatible implementations. +type UnimplementedSessionServiceServer struct { +} + +func (UnimplementedSessionServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} + +// 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 UnsafeSessionServiceServer interface { + mustEmbedUnimplementedSessionServiceServer() +} + +func RegisterSessionServiceServer(s grpc.ServiceRegistrar, srv SessionServiceServer) { + s.RegisterService(&SessionService_ServiceDesc, srv) +} + +func _SessionService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SessionServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SessionService_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SessionServiceServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// 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) +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", +} diff --git a/api/session/types.pb.go b/api/session/types.pb.go new file mode 100644 index 00000000..d4bdf62b --- /dev/null +++ b/api/session/types.pb.go @@ -0,0 +1,1444 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: session/grpc/types.proto + +package session + +import ( + reflect "reflect" + sync "sync" + + "github.com/nspcc-dev/neofs-sdk-go/api/acl" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Object request verbs +type ObjectSessionContext_Verb int32 + +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 +) + +// Enum value maps for ObjectSessionContext_Verb. +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, + } +) + +func (x ObjectSessionContext_Verb) Enum() *ObjectSessionContext_Verb { + p := new(ObjectSessionContext_Verb) + *p = x + return p +} + +func (x ObjectSessionContext_Verb) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ObjectSessionContext_Verb) Descriptor() protoreflect.EnumDescriptor { + return file_session_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (ObjectSessionContext_Verb) Type() protoreflect.EnumType { + return &file_session_grpc_types_proto_enumTypes[0] +} + +func (x ObjectSessionContext_Verb) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ObjectSessionContext_Verb.Descriptor instead. +func (ObjectSessionContext_Verb) EnumDescriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{0, 0} +} + +// Container request verbs +type ContainerSessionContext_Verb int32 + +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 +) + +// Enum value maps for ContainerSessionContext_Verb. +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, + } +) + +func (x ContainerSessionContext_Verb) Enum() *ContainerSessionContext_Verb { + p := new(ContainerSessionContext_Verb) + *p = x + return p +} + +func (x ContainerSessionContext_Verb) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ContainerSessionContext_Verb) Descriptor() protoreflect.EnumDescriptor { + return file_session_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (ContainerSessionContext_Verb) Type() protoreflect.EnumType { + return &file_session_grpc_types_proto_enumTypes[1] +} + +func (x ContainerSessionContext_Verb) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContainerSessionContext_Verb.Descriptor instead. +func (ContainerSessionContext_Verb) EnumDescriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{1, 0} +} + +// Context information for Session Tokens related to ObjectService requests +type ObjectSessionContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *ObjectSessionContext) Reset() { + *x = ObjectSessionContext{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectSessionContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectSessionContext) ProtoMessage() {} + +func (x *ObjectSessionContext) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectSessionContext.ProtoReflect.Descriptor instead. +func (*ObjectSessionContext) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *ObjectSessionContext) GetVerb() ObjectSessionContext_Verb { + if x != nil { + return x.Verb + } + return ObjectSessionContext_VERB_UNSPECIFIED +} + +func (x *ObjectSessionContext) GetTarget() *ObjectSessionContext_Target { + if x != nil { + return x.Target + } + return nil +} + +// Context information for Session Tokens related to ContainerService requests. +type ContainerSessionContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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 *refs.ContainerID `protobuf:"bytes,3,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` +} + +func (x *ContainerSessionContext) Reset() { + *x = ContainerSessionContext{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerSessionContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerSessionContext) ProtoMessage() {} + +func (x *ContainerSessionContext) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerSessionContext.ProtoReflect.Descriptor instead. +func (*ContainerSessionContext) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (x *ContainerSessionContext) GetVerb() ContainerSessionContext_Verb { + if x != nil { + return x.Verb + } + return ContainerSessionContext_VERB_UNSPECIFIED +} + +func (x *ContainerSessionContext) GetWildcard() bool { + if x != nil { + return x.Wildcard + } + return false +} + +func (x *ContainerSessionContext) GetContainerId() *refs.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} + +// NeoFS Session Token. +type SessionToken struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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 *refs.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SessionToken) Reset() { + *x = SessionToken{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionToken) ProtoMessage() {} + +func (x *SessionToken) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionToken.ProtoReflect.Descriptor instead. +func (*SessionToken) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{2} +} + +func (x *SessionToken) GetBody() *SessionToken_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *SessionToken) GetSignature() *refs.Signature { + if x != nil { + return x.Signature + } + return nil +} + +// 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. DEPRECATED: header ignored by servers. +// - __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. DEPRECATED: header ignored by servers. +type XHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *XHeader) Reset() { + *x = XHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *XHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*XHeader) ProtoMessage() {} + +func (x *XHeader) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use XHeader.ProtoReflect.Descriptor instead. +func (*XHeader) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{3} +} + +func (x *XHeader) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *XHeader) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Meta information attached to the request. When forwarded between peers, +// request meta headers are folded in matryoshka style. +type RequestMetaHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Peer's API version used + Version *refs.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 *acl.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"` +} + +func (x *RequestMetaHeader) Reset() { + *x = RequestMetaHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestMetaHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestMetaHeader) ProtoMessage() {} + +func (x *RequestMetaHeader) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestMetaHeader.ProtoReflect.Descriptor instead. +func (*RequestMetaHeader) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{4} +} + +func (x *RequestMetaHeader) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *RequestMetaHeader) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *RequestMetaHeader) GetTtl() uint32 { + if x != nil { + return x.Ttl + } + return 0 +} + +func (x *RequestMetaHeader) GetXHeaders() []*XHeader { + if x != nil { + return x.XHeaders + } + return nil +} + +func (x *RequestMetaHeader) GetSessionToken() *SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} + +func (x *RequestMetaHeader) GetBearerToken() *acl.BearerToken { + if x != nil { + return x.BearerToken + } + return nil +} + +func (x *RequestMetaHeader) GetOrigin() *RequestMetaHeader { + if x != nil { + return x.Origin + } + return nil +} + +func (x *RequestMetaHeader) GetMagicNumber() uint64 { + if x != nil { + return x.MagicNumber + } + return 0 +} + +// Information about the response +type ResponseMetaHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Peer's API version used + Version *refs.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 *status.Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *ResponseMetaHeader) Reset() { + *x = ResponseMetaHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResponseMetaHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseMetaHeader) ProtoMessage() {} + +func (x *ResponseMetaHeader) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResponseMetaHeader.ProtoReflect.Descriptor instead. +func (*ResponseMetaHeader) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{5} +} + +func (x *ResponseMetaHeader) GetVersion() *refs.Version { + if x != nil { + return x.Version + } + return nil +} + +func (x *ResponseMetaHeader) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *ResponseMetaHeader) GetTtl() uint32 { + if x != nil { + return x.Ttl + } + return 0 +} + +func (x *ResponseMetaHeader) GetXHeaders() []*XHeader { + if x != nil { + return x.XHeaders + } + return nil +} + +func (x *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { + if x != nil { + return x.Origin + } + return nil +} + +func (x *ResponseMetaHeader) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +// Verification info for the request signed by all intermediate nodes. +type RequestVerificationHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Request Body signature. Should be generated once by the request initiator. + BodySignature *refs.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 *refs.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"` + // Signature of previous hops + OriginSignature *refs.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"` +} + +func (x *RequestVerificationHeader) Reset() { + *x = RequestVerificationHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestVerificationHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestVerificationHeader) ProtoMessage() {} + +func (x *RequestVerificationHeader) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestVerificationHeader.ProtoReflect.Descriptor instead. +func (*RequestVerificationHeader) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{6} +} + +func (x *RequestVerificationHeader) GetBodySignature() *refs.Signature { + if x != nil { + return x.BodySignature + } + return nil +} + +func (x *RequestVerificationHeader) GetMetaSignature() *refs.Signature { + if x != nil { + return x.MetaSignature + } + return nil +} + +func (x *RequestVerificationHeader) GetOriginSignature() *refs.Signature { + if x != nil { + return x.OriginSignature + } + return nil +} + +func (x *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { + if x != nil { + return x.Origin + } + return nil +} + +// Verification info for the response signed by all intermediate nodes +type ResponseVerificationHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Response Body signature. Should be generated once by an answering node. + BodySignature *refs.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 *refs.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"` + // Signature of previous hops + OriginSignature *refs.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"` +} + +func (x *ResponseVerificationHeader) Reset() { + *x = ResponseVerificationHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResponseVerificationHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseVerificationHeader) ProtoMessage() {} + +func (x *ResponseVerificationHeader) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResponseVerificationHeader.ProtoReflect.Descriptor instead. +func (*ResponseVerificationHeader) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{7} +} + +func (x *ResponseVerificationHeader) GetBodySignature() *refs.Signature { + if x != nil { + return x.BodySignature + } + return nil +} + +func (x *ResponseVerificationHeader) GetMetaSignature() *refs.Signature { + if x != nil { + return x.MetaSignature + } + return nil +} + +func (x *ResponseVerificationHeader) GetOriginSignature() *refs.Signature { + if x != nil { + return x.OriginSignature + } + return nil +} + +func (x *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { + if x != nil { + return x.Origin + } + return nil +} + +// Carries objects involved in the object session. +type ObjectSessionContext_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Indicates which container the session is spread to. Field MUST be set + // and correct. + Container *refs.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 []*refs.ObjectID `protobuf:"bytes,2,rep,name=objects,proto3" json:"objects,omitempty"` +} + +func (x *ObjectSessionContext_Target) Reset() { + *x = ObjectSessionContext_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectSessionContext_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectSessionContext_Target) ProtoMessage() {} + +func (x *ObjectSessionContext_Target) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectSessionContext_Target.ProtoReflect.Descriptor instead. +func (*ObjectSessionContext_Target) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *ObjectSessionContext_Target) GetContainer() *refs.ContainerID { + if x != nil { + return x.Container + } + return nil +} + +func (x *ObjectSessionContext_Target) GetObjects() []*refs.ObjectID { + if x != nil { + return x.Objects + } + return nil +} + +// Session Token body +type SessionToken_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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 *refs.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"` +} + +func (x *SessionToken_Body) Reset() { + *x = SessionToken_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionToken_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionToken_Body) ProtoMessage() {} + +func (x *SessionToken_Body) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionToken_Body.ProtoReflect.Descriptor instead. +func (*SessionToken_Body) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *SessionToken_Body) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *SessionToken_Body) GetOwnerId() *refs.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *SessionToken_Body) GetLifetime() *SessionToken_Body_TokenLifetime { + if x != nil { + return x.Lifetime + } + return nil +} + +func (x *SessionToken_Body) GetSessionKey() []byte { + if x != nil { + return x.SessionKey + } + return nil +} + +func (m *SessionToken_Body) GetContext() isSessionToken_Body_Context { + if m != nil { + return m.Context + } + return nil +} + +func (x *SessionToken_Body) GetObject() *ObjectSessionContext { + if x, ok := x.GetContext().(*SessionToken_Body_Object); ok { + return x.Object + } + return nil +} + +func (x *SessionToken_Body) GetContainer() *ContainerSessionContext { + if x, ok := x.GetContext().(*SessionToken_Body_Container); ok { + return x.Container + } + return nil +} + +type isSessionToken_Body_Context interface { + isSessionToken_Body_Context() +} + +type SessionToken_Body_Object struct { + // ObjectService session context + Object *ObjectSessionContext `protobuf:"bytes,5,opt,name=object,proto3,oneof"` +} + +type SessionToken_Body_Container struct { + // ContainerService session context + Container *ContainerSessionContext `protobuf:"bytes,6,opt,name=container,proto3,oneof"` +} + +func (*SessionToken_Body_Object) isSessionToken_Body_Context() {} + +func (*SessionToken_Body_Container) isSessionToken_Body_Context() {} + +// Lifetime parameters of the token. Field names taken from rfc7519. +type SessionToken_Body_TokenLifetime struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` +} + +func (x *SessionToken_Body_TokenLifetime) Reset() { + *x = SessionToken_Body_TokenLifetime{} + if protoimpl.UnsafeEnabled { + mi := &file_session_grpc_types_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionToken_Body_TokenLifetime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionToken_Body_TokenLifetime) ProtoMessage() {} + +func (x *SessionToken_Body_TokenLifetime) ProtoReflect() protoreflect.Message { + mi := &file_session_grpc_types_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionToken_Body_TokenLifetime.ProtoReflect.Descriptor instead. +func (*SessionToken_Body_TokenLifetime) Descriptor() ([]byte, []int) { + return file_session_grpc_types_proto_rawDescGZIP(), []int{2, 0, 0} +} + +func (x *SessionToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil { + return x.Nbf + } + return 0 +} + +func (x *SessionToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil { + return x.Iat + } + return 0 +} + +var File_session_grpc_types_proto protoreflect.FileDescriptor + +var file_session_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x15, 0x72, + 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x03, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x40, 0x0a, 0x04, + 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x46, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x77, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x39, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, + 0x6a, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, + 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x02, 0x12, + 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, + 0x52, 0x43, 0x48, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, + 0x05, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, + 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x22, 0xfa, 0x01, 0x0a, 0x17, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x1a, 0x0a, 0x08, + 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x22, 0x3e, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, + 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, + 0x45, 0x54, 0x45, 0x41, 0x43, 0x4c, 0x10, 0x03, 0x22, 0xa0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x9c, 0x03, 0x0a, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, + 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x4e, 0x0a, 0x08, 0x6c, 0x69, 0x66, + 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, + 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, + 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4a, 0x0a, + 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, + 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, + 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x58, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8d, + 0x03, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, + 0x03, 0x74, 0x74, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, + 0x37, 0x0a, 0x09, 0x78, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, + 0x78, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d, + 0x0a, 0x0c, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, + 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x99, + 0x02, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, + 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, + 0x12, 0x37, 0x0a, 0x09, 0x78, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x08, 0x78, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x19, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, + 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, + 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, + 0x74, 0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, + 0x65, 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xad, 0x02, 0x0a, 0x1a, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, + 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x45, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x42, 0x59, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, + 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, + 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_session_grpc_types_proto_rawDescOnce sync.Once + file_session_grpc_types_proto_rawDescData = file_session_grpc_types_proto_rawDesc +) + +func file_session_grpc_types_proto_rawDescGZIP() []byte { + file_session_grpc_types_proto_rawDescOnce.Do(func() { + file_session_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_session_grpc_types_proto_rawDescData) + }) + return file_session_grpc_types_proto_rawDescData +} + +var file_session_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_session_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_session_grpc_types_proto_goTypes = []interface{}{ + (ObjectSessionContext_Verb)(0), // 0: neo.fs.v2.session.ObjectSessionContext.Verb + (ContainerSessionContext_Verb)(0), // 1: neo.fs.v2.session.ContainerSessionContext.Verb + (*ObjectSessionContext)(nil), // 2: neo.fs.v2.session.ObjectSessionContext + (*ContainerSessionContext)(nil), // 3: neo.fs.v2.session.ContainerSessionContext + (*SessionToken)(nil), // 4: neo.fs.v2.session.SessionToken + (*XHeader)(nil), // 5: neo.fs.v2.session.XHeader + (*RequestMetaHeader)(nil), // 6: neo.fs.v2.session.RequestMetaHeader + (*ResponseMetaHeader)(nil), // 7: neo.fs.v2.session.ResponseMetaHeader + (*RequestVerificationHeader)(nil), // 8: neo.fs.v2.session.RequestVerificationHeader + (*ResponseVerificationHeader)(nil), // 9: neo.fs.v2.session.ResponseVerificationHeader + (*ObjectSessionContext_Target)(nil), // 10: neo.fs.v2.session.ObjectSessionContext.Target + (*SessionToken_Body)(nil), // 11: neo.fs.v2.session.SessionToken.Body + (*SessionToken_Body_TokenLifetime)(nil), // 12: neo.fs.v2.session.SessionToken.Body.TokenLifetime + (*refs.ContainerID)(nil), // 13: neo.fs.v2.refs.ContainerID + (*refs.Signature)(nil), // 14: neo.fs.v2.refs.Signature + (*refs.Version)(nil), // 15: neo.fs.v2.refs.Version + (*acl.BearerToken)(nil), // 16: neo.fs.v2.acl.BearerToken + (*status.Status)(nil), // 17: neo.fs.v2.status.Status + (*refs.ObjectID)(nil), // 18: neo.fs.v2.refs.ObjectID + (*refs.OwnerID)(nil), // 19: neo.fs.v2.refs.OwnerID +} +var file_session_grpc_types_proto_depIdxs = []int32{ + 0, // 0: neo.fs.v2.session.ObjectSessionContext.verb:type_name -> neo.fs.v2.session.ObjectSessionContext.Verb + 10, // 1: neo.fs.v2.session.ObjectSessionContext.target:type_name -> neo.fs.v2.session.ObjectSessionContext.Target + 1, // 2: neo.fs.v2.session.ContainerSessionContext.verb:type_name -> neo.fs.v2.session.ContainerSessionContext.Verb + 13, // 3: neo.fs.v2.session.ContainerSessionContext.container_id:type_name -> neo.fs.v2.refs.ContainerID + 11, // 4: neo.fs.v2.session.SessionToken.body:type_name -> neo.fs.v2.session.SessionToken.Body + 14, // 5: neo.fs.v2.session.SessionToken.signature:type_name -> neo.fs.v2.refs.Signature + 15, // 6: neo.fs.v2.session.RequestMetaHeader.version:type_name -> neo.fs.v2.refs.Version + 5, // 7: neo.fs.v2.session.RequestMetaHeader.x_headers:type_name -> neo.fs.v2.session.XHeader + 4, // 8: neo.fs.v2.session.RequestMetaHeader.session_token:type_name -> neo.fs.v2.session.SessionToken + 16, // 9: neo.fs.v2.session.RequestMetaHeader.bearer_token:type_name -> neo.fs.v2.acl.BearerToken + 6, // 10: neo.fs.v2.session.RequestMetaHeader.origin:type_name -> neo.fs.v2.session.RequestMetaHeader + 15, // 11: neo.fs.v2.session.ResponseMetaHeader.version:type_name -> neo.fs.v2.refs.Version + 5, // 12: neo.fs.v2.session.ResponseMetaHeader.x_headers:type_name -> neo.fs.v2.session.XHeader + 7, // 13: neo.fs.v2.session.ResponseMetaHeader.origin:type_name -> neo.fs.v2.session.ResponseMetaHeader + 17, // 14: neo.fs.v2.session.ResponseMetaHeader.status:type_name -> neo.fs.v2.status.Status + 14, // 15: neo.fs.v2.session.RequestVerificationHeader.body_signature:type_name -> neo.fs.v2.refs.Signature + 14, // 16: neo.fs.v2.session.RequestVerificationHeader.meta_signature:type_name -> neo.fs.v2.refs.Signature + 14, // 17: neo.fs.v2.session.RequestVerificationHeader.origin_signature:type_name -> neo.fs.v2.refs.Signature + 8, // 18: neo.fs.v2.session.RequestVerificationHeader.origin:type_name -> neo.fs.v2.session.RequestVerificationHeader + 14, // 19: neo.fs.v2.session.ResponseVerificationHeader.body_signature:type_name -> neo.fs.v2.refs.Signature + 14, // 20: neo.fs.v2.session.ResponseVerificationHeader.meta_signature:type_name -> neo.fs.v2.refs.Signature + 14, // 21: neo.fs.v2.session.ResponseVerificationHeader.origin_signature:type_name -> neo.fs.v2.refs.Signature + 9, // 22: neo.fs.v2.session.ResponseVerificationHeader.origin:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 13, // 23: neo.fs.v2.session.ObjectSessionContext.Target.container:type_name -> neo.fs.v2.refs.ContainerID + 18, // 24: neo.fs.v2.session.ObjectSessionContext.Target.objects:type_name -> neo.fs.v2.refs.ObjectID + 19, // 25: neo.fs.v2.session.SessionToken.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 12, // 26: neo.fs.v2.session.SessionToken.Body.lifetime:type_name -> neo.fs.v2.session.SessionToken.Body.TokenLifetime + 2, // 27: neo.fs.v2.session.SessionToken.Body.object:type_name -> neo.fs.v2.session.ObjectSessionContext + 3, // 28: neo.fs.v2.session.SessionToken.Body.container:type_name -> neo.fs.v2.session.ContainerSessionContext + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name +} + +func init() { file_session_grpc_types_proto_init() } +func file_session_grpc_types_proto_init() { + if File_session_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_session_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectSessionContext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerSessionContext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionToken); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*XHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestMetaHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseMetaHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestVerificationHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseVerificationHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectSessionContext_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionToken_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_session_grpc_types_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionToken_Body_TokenLifetime); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_session_grpc_types_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*SessionToken_Body_Object)(nil), + (*SessionToken_Body_Container)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_session_grpc_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_session_grpc_types_proto_goTypes, + DependencyIndexes: file_session_grpc_types_proto_depIdxs, + EnumInfos: file_session_grpc_types_proto_enumTypes, + MessageInfos: file_session_grpc_types_proto_msgTypes, + }.Build() + File_session_grpc_types_proto = out.File + file_session_grpc_types_proto_rawDesc = nil + file_session_grpc_types_proto_goTypes = nil + file_session_grpc_types_proto_depIdxs = nil +} diff --git a/api/status/encoding.go b/api/status/encoding.go new file mode 100644 index 00000000..6236ad3e --- /dev/null +++ b/api/status/encoding.go @@ -0,0 +1,54 @@ +package status + +import "github.com/nspcc-dev/neofs-sdk-go/internal/proto" + +const ( + _ = iota + fieldDetailID + fieldDetailValue +) + +func (x *Status_Detail) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldDetailID, x.Id) + + proto.SizeBytes(fieldDetailValue, x.Value) + } + return sz +} + +func (x *Status_Detail) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldDetailID, x.Id) + proto.MarshalBytes(b[off:], fieldDetailValue, x.Value) + } +} + +const ( + _ = iota + fieldStatusCode + fieldStatusMessage + fieldStatusDetails +) + +func (x *Status) MarshaledSize() int { + var sz int + if x != nil { + sz = proto.SizeVarint(fieldStatusCode, x.Code) + + proto.SizeBytes(fieldStatusMessage, x.Message) + for i := range x.Details { + sz += proto.SizeNested(fieldStatusDetails, x.Details[i]) + } + } + return sz +} + +func (x *Status) MarshalStable(b []byte) { + if x != nil { + off := proto.MarshalVarint(b, fieldStatusCode, x.Code) + off += proto.MarshalBytes(b[off:], fieldStatusMessage, x.Message) + for i := range x.Details { + off += proto.MarshalNested(b[off:], fieldStatusDetails, x.Details[i]) + } + } +} diff --git a/api/status/encoding_test.go b/api/status/encoding_test.go new file mode 100644 index 00000000..87eece88 --- /dev/null +++ b/api/status/encoding_test.go @@ -0,0 +1,32 @@ +package status_test + +import ( + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/api/status" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +func TestStatus(t *testing.T) { + v := &status.Status{ + Code: 1, + Message: "any_message", + Details: []*status.Status_Detail{ + {Id: 2, Value: []byte("any_detail1")}, + {Id: 3, Value: []byte("any_detail2")}, + }, + } + + sz := v.MarshaledSize() + b := make([]byte, sz) + v.MarshalStable(b) + + var res status.Status + err := proto.Unmarshal(b, &res) + require.NoError(t, err) + require.Empty(t, res.ProtoReflect().GetUnknown()) + require.Equal(t, v.Code, res.Code) + require.Equal(t, v.Message, res.Message) + require.Equal(t, v.Details, res.Details) +} diff --git a/api/status/types.pb.go b/api/status/types.pb.go new file mode 100644 index 00000000..9e8e06b9 --- /dev/null +++ b/api/status/types.pb.go @@ -0,0 +1,654 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: status/grpc/types.proto + +package status + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Section identifiers. +type Section int32 + +const ( + // Successful return codes. + Section_SECTION_SUCCESS Section = 0 + // Failure codes regardless of the operation. + Section_SECTION_FAILURE_COMMON Section = 1 + // Object service-specific errors. + Section_SECTION_OBJECT Section = 2 + // Container service-specific errors. + Section_SECTION_CONTAINER Section = 3 + // Session service-specific errors. + Section_SECTION_SESSION Section = 4 +) + +// Enum value maps for Section. +var ( + Section_name = map[int32]string{ + 0: "SECTION_SUCCESS", + 1: "SECTION_FAILURE_COMMON", + 2: "SECTION_OBJECT", + 3: "SECTION_CONTAINER", + 4: "SECTION_SESSION", + } + Section_value = map[string]int32{ + "SECTION_SUCCESS": 0, + "SECTION_FAILURE_COMMON": 1, + "SECTION_OBJECT": 2, + "SECTION_CONTAINER": 3, + "SECTION_SESSION": 4, + } +) + +func (x Section) Enum() *Section { + p := new(Section) + *p = x + return p +} + +func (x Section) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Section) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (Section) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[0] +} + +func (x Section) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Section.Descriptor instead. +func (Section) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// Section of NeoFS successful return codes. +type Success int32 + +const ( + // [**0**] Default success. Not detailed. + // If the server cannot match successful outcome to the code, it should + // use this code. + Success_OK Success = 0 +) + +// Enum value maps for Success. +var ( + Success_name = map[int32]string{ + 0: "OK", + } + Success_value = map[string]int32{ + "OK": 0, + } +) + +func (x Success) Enum() *Success { + p := new(Success) + *p = x + return p +} + +func (x Success) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Success) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[1].Descriptor() +} + +func (Success) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[1] +} + +func (x Success) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Success.Descriptor instead. +func (Success) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{1} +} + +// Section of failed statuses independent of the operation. +type CommonFail int32 + +const ( + // [**1024**] Internal server error, default failure. Not detailed. + // If the server cannot match failed outcome to the code, it should + // use this code. + CommonFail_INTERNAL CommonFail = 0 + // [**1025**] Wrong magic of the NeoFS network. + // Details: + // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit + // unsigned integer). + CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1 + // [**1026**] Signature verification failure. + CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2 + // [**1027**] Node is under maintenance. + CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3 +) + +// Enum value maps for CommonFail. +var ( + CommonFail_name = map[int32]string{ + 0: "INTERNAL", + 1: "WRONG_MAGIC_NUMBER", + 2: "SIGNATURE_VERIFICATION_FAIL", + 3: "NODE_UNDER_MAINTENANCE", + } + CommonFail_value = map[string]int32{ + "INTERNAL": 0, + "WRONG_MAGIC_NUMBER": 1, + "SIGNATURE_VERIFICATION_FAIL": 2, + "NODE_UNDER_MAINTENANCE": 3, + } +) + +func (x CommonFail) Enum() *CommonFail { + p := new(CommonFail) + *p = x + return p +} + +func (x CommonFail) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommonFail) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[2].Descriptor() +} + +func (CommonFail) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[2] +} + +func (x CommonFail) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommonFail.Descriptor instead. +func (CommonFail) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{2} +} + +// Section of statuses for object-related operations. +type Object int32 + +const ( + // [**2048**] Access denied by ACL. + // Details: + // - [**0**] Human-readable description (UTF-8 encoded string). + Object_ACCESS_DENIED Object = 0 + // [**2049**] Object not found. + Object_OBJECT_NOT_FOUND Object = 1 + // [**2050**] Operation rejected by the object lock. + Object_LOCKED Object = 2 + // [**2051**] Locking an object with a non-REGULAR type rejected. + Object_LOCK_NON_REGULAR_OBJECT Object = 3 + // [**2052**] Object has been marked deleted. + Object_OBJECT_ALREADY_REMOVED Object = 4 + // [**2053**] Invalid range has been requested for an object. + Object_OUT_OF_RANGE Object = 5 +) + +// Enum value maps for Object. +var ( + Object_name = map[int32]string{ + 0: "ACCESS_DENIED", + 1: "OBJECT_NOT_FOUND", + 2: "LOCKED", + 3: "LOCK_NON_REGULAR_OBJECT", + 4: "OBJECT_ALREADY_REMOVED", + 5: "OUT_OF_RANGE", + } + Object_value = map[string]int32{ + "ACCESS_DENIED": 0, + "OBJECT_NOT_FOUND": 1, + "LOCKED": 2, + "LOCK_NON_REGULAR_OBJECT": 3, + "OBJECT_ALREADY_REMOVED": 4, + "OUT_OF_RANGE": 5, + } +) + +func (x Object) Enum() *Object { + p := new(Object) + *p = x + return p +} + +func (x Object) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Object) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[3].Descriptor() +} + +func (Object) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[3] +} + +func (x Object) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Object.Descriptor instead. +func (Object) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{3} +} + +// Section of statuses for container-related operations. +type Container int32 + +const ( + // [**3072**] Container not found. + Container_CONTAINER_NOT_FOUND Container = 0 + // [**3073**] eACL table not found. + Container_EACL_NOT_FOUND Container = 1 +) + +// Enum value maps for Container. +var ( + Container_name = map[int32]string{ + 0: "CONTAINER_NOT_FOUND", + 1: "EACL_NOT_FOUND", + } + Container_value = map[string]int32{ + "CONTAINER_NOT_FOUND": 0, + "EACL_NOT_FOUND": 1, + } +) + +func (x Container) Enum() *Container { + p := new(Container) + *p = x + return p +} + +func (x Container) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Container) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[4].Descriptor() +} + +func (Container) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[4] +} + +func (x Container) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Container.Descriptor instead. +func (Container) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{4} +} + +// Section of statuses for session-related operations. +type Session int32 + +const ( + // [**4096**] Token not found. + Session_TOKEN_NOT_FOUND Session = 0 + // [**4097**] Token has expired. + Session_TOKEN_EXPIRED Session = 1 +) + +// Enum value maps for Session. +var ( + Session_name = map[int32]string{ + 0: "TOKEN_NOT_FOUND", + 1: "TOKEN_EXPIRED", + } + Session_value = map[string]int32{ + "TOKEN_NOT_FOUND": 0, + "TOKEN_EXPIRED": 1, + } +) + +func (x Session) Enum() *Session { + p := new(Session) + *p = x + return p +} + +func (x Session) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Session) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[5].Descriptor() +} + +func (Session) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[5] +} + +func (x Session) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Session.Descriptor instead. +func (Session) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{5} +} + +// Declares the general format of the status returns of the NeoFS RPC protocol. +// Status is present in all response messages. Each RPC of NeoFS protocol +// describes the possible outcomes and details of the operation. +// +// Each status is assigned a one-to-one numeric code. Any unique result of an +// operation in NeoFS is unambiguously associated with the code value. +// +// Numerical set of codes is split into 1024-element sections. An enumeration +// is defined for each section. Values can be referred to in the following ways: +// +// * numerical value ranging from 0 to 4,294,967,295 (global code); +// +// - values from enumeration (local code). The formula for the ratio of the +// local code (`L`) of a defined section (`S`) to the global one (`G`): +// `G = 1024 * S + L`. +// +// All outcomes are divided into successful and failed, which corresponds +// to the success or failure of the operation. The definition of success +// follows the semantics of RPC and the description of its purpose. +// The server must not attach code that is the opposite of the outcome type. +// +// See the set of return codes in the description for calls. +// +// Each status can carry a developer-facing error message. It should be a human +// readable text in English. The server should not transmit (and the client +// should not expect) useful information in the message. Field `details` +// should make the return more detailed. +type Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The status code + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + // Developer-facing error message + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // Data detailing the outcome of the operation. Must be unique by ID. + Details []*Status_Detail `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` +} + +func (x *Status) Reset() { + *x = Status{} + if protoimpl.UnsafeEnabled { + mi := &file_status_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_status_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Status) GetCode() uint32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Status) GetDetails() []*Status_Detail { + if x != nil { + return x.Details + } + return nil +} + +// Return detail. It contains additional information that can be used to +// analyze the response. Each code defines a set of details that can be +// attached to a status. Client should not handle details that are not +// covered by the code. +type Status_Detail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Status_Detail) Reset() { + *x = Status_Detail{} + if protoimpl.UnsafeEnabled { + mi := &file_status_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Status_Detail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status_Detail) ProtoMessage() {} + +func (x *Status_Detail) ProtoReflect() protoreflect.Message { + mi := &file_status_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status_Detail.ProtoReflect.Descriptor instead. +func (*Status_Detail) Descriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Status_Detail) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Status_Detail) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +var File_status_grpc_types_proto protoreflect.FileDescriptor + +var file_status_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, + 0x2e, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, + 0x7a, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, + 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, + 0x52, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x53, + 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, + 0x15, 0x0a, 0x11, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, + 0x49, 0x4e, 0x45, 0x52, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0x11, 0x0a, 0x07, 0x53, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x6f, + 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x0c, 0x0a, 0x08, + 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x52, + 0x4f, 0x4e, 0x47, 0x5f, 0x4d, 0x41, 0x47, 0x49, 0x43, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, + 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, + 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, + 0x4c, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, + 0x52, 0x5f, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x2a, + 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, + 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, + 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, + 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, + 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x55, + 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, + 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x52, + 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, + 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, 0x38, 0x0a, 0x09, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, 0x41, + 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, + 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, + 0x4e, 0x44, 0x10, 0x01, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, + 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, + 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, + 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_status_grpc_types_proto_rawDescOnce sync.Once + file_status_grpc_types_proto_rawDescData = file_status_grpc_types_proto_rawDesc +) + +func file_status_grpc_types_proto_rawDescGZIP() []byte { + file_status_grpc_types_proto_rawDescOnce.Do(func() { + file_status_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_status_grpc_types_proto_rawDescData) + }) + return file_status_grpc_types_proto_rawDescData +} + +var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_status_grpc_types_proto_goTypes = []interface{}{ + (Section)(0), // 0: neo.fs.v2.status.Section + (Success)(0), // 1: neo.fs.v2.status.Success + (CommonFail)(0), // 2: neo.fs.v2.status.CommonFail + (Object)(0), // 3: neo.fs.v2.status.Object + (Container)(0), // 4: neo.fs.v2.status.Container + (Session)(0), // 5: neo.fs.v2.status.Session + (*Status)(nil), // 6: neo.fs.v2.status.Status + (*Status_Detail)(nil), // 7: neo.fs.v2.status.Status.Detail +} +var file_status_grpc_types_proto_depIdxs = []int32{ + 7, // 0: neo.fs.v2.status.Status.details:type_name -> neo.fs.v2.status.Status.Detail + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_status_grpc_types_proto_init() } +func file_status_grpc_types_proto_init() { + if File_status_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_status_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_status_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status_Detail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_status_grpc_types_proto_rawDesc, + NumEnums: 6, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_status_grpc_types_proto_goTypes, + DependencyIndexes: file_status_grpc_types_proto_depIdxs, + EnumInfos: file_status_grpc_types_proto_enumTypes, + MessageInfos: file_status_grpc_types_proto_msgTypes, + }.Build() + File_status_grpc_types_proto = out.File + file_status_grpc_types_proto_rawDesc = nil + file_status_grpc_types_proto_goTypes = nil + file_status_grpc_types_proto_depIdxs = nil +} diff --git a/api/storagegroup/types.pb.go b/api/storagegroup/types.pb.go new file mode 100644 index 00000000..de212480 --- /dev/null +++ b/api/storagegroup/types.pb.go @@ -0,0 +1,210 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: storagegroup/grpc/types.proto + +package storagegroup + +import ( + grpc "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// StorageGroup keeps verification information for Data Audit sessions. Objects +// that require paid storage guarantees are gathered in `StorageGroups` with +// additional information used for the proof of storage. `StorageGroup` only +// contains objects from the same container. +// +// Being an object payload, StorageGroup may have expiration Epoch set with +// `__NEOFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +// will be ignored by InnerRing nodes during Data Audit cycles and will be +// deleted by Storage Nodes. +type StorageGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Total size of the payloads of objects in the storage group + ValidationDataSize uint64 `protobuf:"varint,1,opt,name=validation_data_size,json=validationDataSize,proto3" json:"validation_data_size,omitempty"` + // Homomorphic hash from the concatenation of the payloads of the storage + // group members. The order of concatenation is the same as the order of the + // members in the `members` field. + ValidationHash *grpc.Checksum `protobuf:"bytes,2,opt,name=validation_hash,json=validationHash,proto3" json:"validation_hash,omitempty"` + // DEPRECATED. Last NeoFS epoch number of the storage group lifetime + // + // Deprecated: Marked as deprecated in storagegroup/grpc/types.proto. + ExpirationEpoch uint64 `protobuf:"varint,3,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` + // Strictly ordered list of storage group member objects. Members MUST be unique + Members []*grpc.ObjectID `protobuf:"bytes,4,rep,name=members,proto3" json:"members,omitempty"` +} + +func (x *StorageGroup) Reset() { + *x = StorageGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_storagegroup_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageGroup) ProtoMessage() {} + +func (x *StorageGroup) ProtoReflect() protoreflect.Message { + mi := &file_storagegroup_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StorageGroup.ProtoReflect.Descriptor instead. +func (*StorageGroup) Descriptor() ([]byte, []int) { + return file_storagegroup_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *StorageGroup) GetValidationDataSize() uint64 { + if x != nil { + return x.ValidationDataSize + } + return 0 +} + +func (x *StorageGroup) GetValidationHash() *grpc.Checksum { + if x != nil { + return x.ValidationHash + } + return nil +} + +// Deprecated: Marked as deprecated in storagegroup/grpc/types.proto. +func (x *StorageGroup) GetExpirationEpoch() uint64 { + if x != nil { + return x.ExpirationEpoch + } + return 0 +} + +func (x *StorageGroup) GetMembers() []*grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} + +var File_storagegroup_grpc_types_proto protoreflect.FileDescriptor + +var file_storagegroup_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x16, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, + 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, + 0x30, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a, + 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x68, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, + 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0xaa, 0x02, + 0x20, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_storagegroup_grpc_types_proto_rawDescOnce sync.Once + file_storagegroup_grpc_types_proto_rawDescData = file_storagegroup_grpc_types_proto_rawDesc +) + +func file_storagegroup_grpc_types_proto_rawDescGZIP() []byte { + file_storagegroup_grpc_types_proto_rawDescOnce.Do(func() { + file_storagegroup_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_storagegroup_grpc_types_proto_rawDescData) + }) + return file_storagegroup_grpc_types_proto_rawDescData +} + +var file_storagegroup_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_storagegroup_grpc_types_proto_goTypes = []interface{}{ + (*StorageGroup)(nil), // 0: neo.fs.v2.storagegroup.StorageGroup + (*grpc.Checksum)(nil), // 1: neo.fs.v2.refs.Checksum + (*grpc.ObjectID)(nil), // 2: neo.fs.v2.refs.ObjectID +} +var file_storagegroup_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.storagegroup.StorageGroup.validation_hash:type_name -> neo.fs.v2.refs.Checksum + 2, // 1: neo.fs.v2.storagegroup.StorageGroup.members:type_name -> neo.fs.v2.refs.ObjectID + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_storagegroup_grpc_types_proto_init() } +func file_storagegroup_grpc_types_proto_init() { + if File_storagegroup_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_storagegroup_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_storagegroup_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_storagegroup_grpc_types_proto_goTypes, + DependencyIndexes: file_storagegroup_grpc_types_proto_depIdxs, + MessageInfos: file_storagegroup_grpc_types_proto_msgTypes, + }.Build() + File_storagegroup_grpc_types_proto = out.File + file_storagegroup_grpc_types_proto_rawDesc = nil + file_storagegroup_grpc_types_proto_goTypes = nil + file_storagegroup_grpc_types_proto_depIdxs = nil +} diff --git a/api/subnet/types.pb.go b/api/subnet/types.pb.go new file mode 100644 index 00000000..6235c107 --- /dev/null +++ b/api/subnet/types.pb.go @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: subnet/grpc/types.proto + +package subnet + +import ( + grpc "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// NeoFS subnetwork description +// +// DEPRECATED. Ignored and kept for compatibility only. +type SubnetInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique subnet identifier. Missing ID is + // equivalent to zero (default subnetwork) ID. + Id *grpc.SubnetID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Identifier of the subnetwork owner + Owner *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (x *SubnetInfo) Reset() { + *x = SubnetInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_subnet_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubnetInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubnetInfo) ProtoMessage() {} + +func (x *SubnetInfo) ProtoReflect() protoreflect.Message { + mi := &file_subnet_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubnetInfo.ProtoReflect.Descriptor instead. +func (*SubnetInfo) Descriptor() ([]byte, []int) { + return file_subnet_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *SubnetInfo) GetId() *grpc.SubnetID { + if x != nil { + return x.Id + } + return nil +} + +func (x *SubnetInfo) GetOwner() *grpc.OwnerID { + if x != nil { + return x.Owner + } + return nil +} + +var File_subnet_grpc_types_proto protoreflect.FileDescriptor + +var file_subnet_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x75, + 0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, + 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, + 0x32, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x75, + 0x62, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_subnet_grpc_types_proto_rawDescOnce sync.Once + file_subnet_grpc_types_proto_rawDescData = file_subnet_grpc_types_proto_rawDesc +) + +func file_subnet_grpc_types_proto_rawDescGZIP() []byte { + file_subnet_grpc_types_proto_rawDescOnce.Do(func() { + file_subnet_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_subnet_grpc_types_proto_rawDescData) + }) + return file_subnet_grpc_types_proto_rawDescData +} + +var file_subnet_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_subnet_grpc_types_proto_goTypes = []interface{}{ + (*SubnetInfo)(nil), // 0: neo.fs.v2.subnet.SubnetInfo + (*grpc.SubnetID)(nil), // 1: neo.fs.v2.refs.SubnetID + (*grpc.OwnerID)(nil), // 2: neo.fs.v2.refs.OwnerID +} +var file_subnet_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.subnet.SubnetInfo.id:type_name -> neo.fs.v2.refs.SubnetID + 2, // 1: neo.fs.v2.subnet.SubnetInfo.owner:type_name -> neo.fs.v2.refs.OwnerID + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_subnet_grpc_types_proto_init() } +func file_subnet_grpc_types_proto_init() { + if File_subnet_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_subnet_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubnetInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_subnet_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_subnet_grpc_types_proto_goTypes, + DependencyIndexes: file_subnet_grpc_types_proto_depIdxs, + MessageInfos: file_subnet_grpc_types_proto_msgTypes, + }.Build() + File_subnet_grpc_types_proto = out.File + file_subnet_grpc_types_proto_rawDesc = nil + file_subnet_grpc_types_proto_goTypes = nil + file_subnet_grpc_types_proto_depIdxs = nil +} diff --git a/api/tombstone/types.pb.go b/api/tombstone/types.pb.go new file mode 100644 index 00000000..14bb1269 --- /dev/null +++ b/api/tombstone/types.pb.go @@ -0,0 +1,188 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: tombstone/grpc/types.proto + +package tombstone + +import ( + grpc "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Tombstone keeps record of deleted objects for a few epochs until they are +// purged from the NeoFS network. +type Tombstone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone + // creator depending on the current NeoFS network settings. + // DEPRECATED. Field ignored by servers, set corresponding object attribute + // `__NEOFS__EXPIRATION_EPOCH` only. + // + // Deprecated: Marked as deprecated in tombstone/grpc/types.proto. + ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` + // 16 byte UUID used to identify the split object hierarchy parts. Must be + // unique inside a container. All objects participating in the split must + // have the same `split_id` value. + SplitId []byte `protobuf:"bytes,2,opt,name=split_id,json=splitID,proto3" json:"split_id,omitempty"` + // List of objects to be deleted. + Members []*grpc.ObjectID `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` +} + +func (x *Tombstone) Reset() { + *x = Tombstone{} + if protoimpl.UnsafeEnabled { + mi := &file_tombstone_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tombstone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tombstone) ProtoMessage() {} + +func (x *Tombstone) ProtoReflect() protoreflect.Message { + mi := &file_tombstone_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tombstone.ProtoReflect.Descriptor instead. +func (*Tombstone) Descriptor() ([]byte, []int) { + return file_tombstone_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// Deprecated: Marked as deprecated in tombstone/grpc/types.proto. +func (x *Tombstone) GetExpirationEpoch() uint64 { + if x != nil { + return x.ExpirationEpoch + } + return 0 +} + +func (x *Tombstone) GetSplitId() []byte { + if x != nil { + return x.SplitId + } + return nil +} + +func (x *Tombstone) GetMembers() []*grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} + +var File_tombstone_grpc_types_proto protoreflect.FileDescriptor + +var file_tombstone_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, + 0x65, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6d, + 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x02, 0x18, 0x01, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, + 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x42, 0x5f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, + 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x6f, 0x6d, + 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x74, 0x6f, 0x6d, 0x62, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x54, 0x6f, 0x6d, 0x62, + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_tombstone_grpc_types_proto_rawDescOnce sync.Once + file_tombstone_grpc_types_proto_rawDescData = file_tombstone_grpc_types_proto_rawDesc +) + +func file_tombstone_grpc_types_proto_rawDescGZIP() []byte { + file_tombstone_grpc_types_proto_rawDescOnce.Do(func() { + file_tombstone_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_tombstone_grpc_types_proto_rawDescData) + }) + return file_tombstone_grpc_types_proto_rawDescData +} + +var file_tombstone_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_tombstone_grpc_types_proto_goTypes = []interface{}{ + (*Tombstone)(nil), // 0: neo.fs.v2.tombstone.Tombstone + (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID +} +var file_tombstone_grpc_types_proto_depIdxs = []int32{ + 1, // 0: neo.fs.v2.tombstone.Tombstone.members:type_name -> neo.fs.v2.refs.ObjectID + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_tombstone_grpc_types_proto_init() } +func file_tombstone_grpc_types_proto_init() { + if File_tombstone_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_tombstone_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tombstone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_tombstone_grpc_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_tombstone_grpc_types_proto_goTypes, + DependencyIndexes: file_tombstone_grpc_types_proto_depIdxs, + MessageInfos: file_tombstone_grpc_types_proto_msgTypes, + }.Build() + File_tombstone_grpc_types_proto = out.File + file_tombstone_grpc_types_proto_rawDesc = nil + file_tombstone_grpc_types_proto_goTypes = nil + file_tombstone_grpc_types_proto_depIdxs = nil +} diff --git a/audit/collect.go b/audit/collect.go index f9d38adc..d9a31b97 100644 --- a/audit/collect.go +++ b/audit/collect.go @@ -1,81 +1,68 @@ package audit -import ( - "context" - "fmt" - - "github.com/nspcc-dev/neofs-sdk-go/checksum" - "github.com/nspcc-dev/neofs-sdk-go/client" - cid "github.com/nspcc-dev/neofs-sdk-go/container/id" - oid "github.com/nspcc-dev/neofs-sdk-go/object/id" - "github.com/nspcc-dev/neofs-sdk-go/object/relations" - "github.com/nspcc-dev/neofs-sdk-go/storagegroup" - "github.com/nspcc-dev/neofs-sdk-go/user" - "github.com/nspcc-dev/tzhash/tz" -) - -// CollectMembers creates new storage group structure and fills it -// with information about members collected via HeadReceiver. // -// Resulting storage group consists of physically stored objects only. -func CollectMembers( - ctx context.Context, - collector relations.Executor, - cnr cid.ID, - members []oid.ID, - tokens relations.Tokens, - calcHomoHash bool, - signer user.Signer, -) (*storagegroup.StorageGroup, error) { - var ( - err error - sumPhySize uint64 - phyMembers []oid.ID - phyHashes [][]byte - addr oid.Address - sg storagegroup.StorageGroup - ) - - addr.SetContainer(cnr) - - for i := range members { - if phyMembers, _, err = relations.Get(ctx, collector, cnr, members[i], tokens, signer); err != nil { - return nil, err - } - - var prmHead client.PrmObjectHead - for _, phyMember := range phyMembers { - addr.SetObject(phyMember) - hdr, err := collector.ObjectHead(ctx, addr.Container(), addr.Object(), signer, prmHead) - if err != nil { - return nil, fmt.Errorf("head phy member '%s': %w", phyMember.EncodeToString(), err) - } - - sumPhySize += hdr.PayloadSize() - cs, _ := hdr.PayloadHomomorphicHash() - - if calcHomoHash { - phyHashes = append(phyHashes, cs.Value()) - } - } - } - - sg.SetMembers(phyMembers) - sg.SetValidationDataSize(sumPhySize) - - if calcHomoHash { - sumHash, err := tz.Concat(phyHashes) - if err != nil { - return nil, err - } - - var cs checksum.Checksum - tzHash := [64]byte{} - copy(tzHash[:], sumHash) - cs.SetTillichZemor(tzHash) - - sg.SetValidationDataHash(cs) - } - - return &sg, nil -} +// // CollectMembers creates new storage group structure and fills it +// // with information about members collected via HeadReceiver. +// // +// // Resulting storage group consists of physically stored objects only. +// func CollectMembers( +// ctx context.Context, +// collector relations.Executor, +// cnr cid.ID, +// members []oid.ID, +// tokens relations.Tokens, +// calcHomoHash bool, +// signer user.Signer, +// ) (*storagegroup.StorageGroup, error) { +// var ( +// err error +// sumPhySize uint64 +// phyMembers []oid.ID +// phyHashes [][]byte +// addr oid.Address +// sg storagegroup.StorageGroup +// ) +// +// addr.SetContainer(cnr) +// +// for i := range members { +// if phyMembers, _, err = relations.Get(ctx, collector, cnr, members[i], tokens, signer); err != nil { +// return nil, err +// } +// +// var prmHead client.PrmObjectHead +// for _, phyMember := range phyMembers { +// addr.SetObject(phyMember) +// hdr, err := collector.ObjectHead(ctx, addr.Container(), addr.Object(), signer, prmHead) +// if err != nil { +// return nil, fmt.Errorf("head phy member '%s': %w", phyMember.EncodeToString(), err) +// } +// +// sumPhySize += hdr.PayloadSize() +// cs, _ := hdr.PayloadHomomorphicHash() +// +// if calcHomoHash { +// phyHashes = append(phyHashes, cs.Value()) +// } +// } +// } +// +// sg.SetMembers(phyMembers) +// sg.SetValidationDataSize(sumPhySize) +// +// if calcHomoHash { +// sumHash, err := tz.Concat(phyHashes) +// if err != nil { +// return nil, err +// } +// +// var cs checksum.Checksum +// tzHash := [64]byte{} +// copy(tzHash[:], sumHash) +// cs.SetTillichZemor(tzHash) +// +// sg.SetValidationDataHash(cs) +// } +// +// return &sg, nil +// } diff --git a/audit/example_test.go b/audit/example_test.go index abd7ca1b..ad733d8c 100644 --- a/audit/example_test.go +++ b/audit/example_test.go @@ -12,7 +12,7 @@ func ExampleResult() { res.ForEpoch(32) res.ForContainer(cnr) // ... - res.Complete() + res.SetCompleted(true) // Result instances can be stored in a binary format on client side. data := res.Marshal() diff --git a/audit/result.go b/audit/result.go index d733de27..3a8bf69e 100644 --- a/audit/result.go +++ b/audit/result.go @@ -4,41 +4,89 @@ import ( "errors" "fmt" - "github.com/nspcc-dev/neofs-api-go/v2/audit" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/audit" + refs2 "github.com/nspcc-dev/neofs-sdk-go/api/refs" cid "github.com/nspcc-dev/neofs-sdk-go/container/id" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" "github.com/nspcc-dev/neofs-sdk-go/version" + "google.golang.org/protobuf/proto" ) // Result represents report on the results of the data audit in NeoFS system. // -// Result is mutually binary-compatible with github.com/nspcc-dev/neofs-api-go/v2/audit.DataAuditResult -// message. See Marshal / Unmarshal methods. -// // Instances can be created using built-in var declaration. type Result struct { - versionEncoded bool + decoded bool + + version version.Version + auditEpoch uint64 + auditorPubKey []byte + cnrSet bool + cnr cid.ID + + completed bool + + requestsPoR, retriesPoR uint32 + + hits, misses, fails uint32 + + passSG, failSG []oid.ID - v2 audit.DataAuditResult + passNodes, failNodes [][]byte } // Marshal encodes Result into a canonical NeoFS binary format (Protocol Buffers // with direct field order). // -// Writes version.Current() protocol version into the resulting message if Result -// hasn't been already decoded from such a message using Unmarshal. -// -// See also Unmarshal. -func (r *Result) Marshal() []byte { - if !r.versionEncoded { - var verV2 refs.Version - version.Current().WriteToV2(&verV2) - r.v2.SetVersion(&verV2) - r.versionEncoded = true +// Writes current protocol version into the resulting message if Result hasn't +// been already decoded from such a message. +// +// See also [Result.Unmarshal]. +func (r Result) Marshal() []byte { + m := &audit.DataAuditResult{ + Version: new(refs2.Version), + AuditEpoch: r.auditEpoch, + PublicKey: r.auditorPubKey, + Complete: r.completed, + Requests: r.requestsPoR, + Retries: r.retriesPoR, + Hit: r.hits, + Miss: r.misses, + Fail: r.fails, + PassNodes: r.passNodes, + FailNodes: r.failNodes, + } + if r.decoded { + r.version.WriteToV2(m.Version) + } else { + version.Current().WriteToV2(m.Version) + } + if r.cnrSet { + m.ContainerId = new(refs2.ContainerID) + r.cnr.WriteToV2(m.ContainerId) + } + if r.passSG != nil { + m.PassSg = make([]*refs2.ObjectID, len(r.passSG)) + for i := range r.passSG { + m.PassSg[i] = new(refs2.ObjectID) + r.passSG[i].WriteToV2(m.PassSg[i]) + } + } + if r.failSG != nil { + m.FailSg = make([]*refs2.ObjectID, len(r.failSG)) + for i := range r.failSG { + m.FailSg[i] = new(refs2.ObjectID) + r.failSG[i].WriteToV2(m.FailSg[i]) + } } - return r.v2.StableMarshal(nil) + b, err := proto.Marshal(m) + if err != nil { + // while it is bad to panic on external package return, we can do nothing better + // for this case: how can a normal message not be encoded? + panic(fmt.Errorf("unexpected marshal protobuf message failure: %w", err)) + } + return b } var errCIDNotSet = errors.New("container ID is not set") @@ -46,48 +94,67 @@ var errCIDNotSet = errors.New("container ID is not set") // Unmarshal decodes Result from its canonical NeoFS binary format (Protocol Buffers // with direct field order). Returns an error describing a format violation. // -// See also Marshal. +// See also [Result.Marshal]. func (r *Result) Unmarshal(data []byte) error { - err := r.v2.Unmarshal(data) + var m audit.DataAuditResult + err := proto.Unmarshal(data, &m) if err != nil { return err } - r.versionEncoded = true + r.decoded = true // format checks - - var cID cid.ID - - cidV2 := r.v2.GetContainerID() - if cidV2 == nil { + r.cnrSet = m.ContainerId != nil + if !r.cnrSet { return errCIDNotSet } - err = cID.ReadFromV2(*cidV2) + err = r.cnr.ReadFromV2(m.ContainerId) if err != nil { - return fmt.Errorf("could not convert V2 container ID: %w", err) + return fmt.Errorf("invalid container ID: %w", err) } - var ( - oID oid.ID - oidV2 refs.ObjectID - ) + err = r.version.ReadFromV2(m.Version) + if err != nil { + return fmt.Errorf("invalid protocol version: %w", err) + } - for _, oidV2 = range r.v2.GetPassSG() { - err = oID.ReadFromV2(oidV2) - if err != nil { - return fmt.Errorf("invalid passed storage group ID: %w", err) + if m.PassSg != nil { + r.passSG = make([]oid.ID, len(m.PassSg)) + for i := range m.PassSg { + err = r.passSG[i].ReadFromV2(m.PassSg[i]) + if err != nil { + return fmt.Errorf("invalid passed storage group ID #%d: %w", i, err) + } } + } else { + r.passSG = nil } - for _, oidV2 = range r.v2.GetFailSG() { - err = oID.ReadFromV2(oidV2) - if err != nil { - return fmt.Errorf("invalid failed storage group ID: %w", err) + if m.FailSg != nil { + r.failSG = make([]oid.ID, len(m.FailSg)) + for i := range m.FailSg { + err = r.failSG[i].ReadFromV2(m.FailSg[i]) + if err != nil { + return fmt.Errorf("invalid failed storage group ID #%d: %w", i, err) + } } + } else { + r.failSG = nil } + r.auditEpoch = m.AuditEpoch + r.auditorPubKey = m.PublicKey + r.completed = m.Complete + r.requestsPoR = m.Requests + r.retriesPoR = m.Retries + r.hits = m.Hit + r.misses = m.Miss + r.fails = m.Fail + r.passNodes = m.PassNodes + r.failNodes = m.FailNodes + return nil } @@ -95,16 +162,16 @@ func (r *Result) Unmarshal(data []byte) error { // // Zero Result has zero epoch. // -// See also ForEpoch. +// See also [Result.ForEpoch]. func (r Result) Epoch() uint64 { - return r.v2.GetAuditEpoch() + return r.auditEpoch } // ForEpoch specifies NeoFS epoch when the data associated with the Result was audited. // -// See also Epoch. +// See also [Result.Epoch]. func (r *Result) ForEpoch(epoch uint64) { - r.v2.SetAuditEpoch(epoch) + r.auditEpoch = epoch } // Container returns identifier of the container with which the data audit Result @@ -112,28 +179,17 @@ func (r *Result) ForEpoch(epoch uint64) { // // Zero Result does not have container ID. // -// See also ForContainer. +// See also [Result.ForContainer]. func (r Result) Container() (cid.ID, bool) { - var cID cid.ID - - cidV2 := r.v2.GetContainerID() - if cidV2 != nil { - _ = cID.ReadFromV2(*cidV2) - return cID, true - } - - return cID, false + return r.cnr, r.cnrSet } // ForContainer sets identifier of the container with which the data audit Result // is associated. // -// See also Container. +// See also [Result.Container]. func (r *Result) ForContainer(cnr cid.ID) { - var cidV2 refs.ContainerID - cnr.WriteToV2(&cidV2) - - r.v2.SetContainerID(&cidV2) + r.cnr, r.cnrSet = cnr, true } // AuditorKey returns public key of the auditing NeoFS Inner Ring node in @@ -149,7 +205,7 @@ func (r *Result) ForContainer(cnr cid.ID) { // // See also [Result.SetAuditorKey]. func (r Result) AuditorKey() []byte { - return r.v2.GetPublicKey() + return r.auditorPubKey } // SetAuditorKey specifies public key of the auditing NeoFS Inner Ring node in @@ -161,23 +217,23 @@ func (r Result) AuditorKey() []byte { // // See also [Result.AuditorKey]. func (r *Result) SetAuditorKey(key []byte) { - r.v2.SetPublicKey(key) + r.auditorPubKey = key } // Completed returns completion state of the data audit associated with the Result. // // Zero Result corresponds to incomplete data audit. // -// See also Complete. +// See also [Result.SetCompleted]. func (r Result) Completed() bool { - return r.v2.GetComplete() + return r.completed } -// Complete marks the data audit associated with the Result as completed. +// SetCompleted sets data audit completion flag. // -// See also Completed. -func (r *Result) Complete() { - r.v2.SetComplete(true) +// See also [Result.SetCompleted]. +func (r *Result) SetCompleted(completed bool) { + r.completed = completed } // RequestsPoR returns number of requests made by Proof-of-Retrievability @@ -185,17 +241,17 @@ func (r *Result) Complete() { // // Zero Result has zero requests. // -// See also SetRequestsPoR. +// See also [Result.SetRequestsPoR]. func (r Result) RequestsPoR() uint32 { - return r.v2.GetRequests() + return r.requestsPoR } // SetRequestsPoR sets number of requests made by Proof-of-Retrievability // audit check to get all headers of the objects inside storage groups. // -// See also RequestsPoR. +// See also [Result.RequestsPoR]. func (r *Result) SetRequestsPoR(v uint32) { - r.v2.SetRequests(v) + r.requestsPoR = v } // RetriesPoR returns number of retries made by Proof-of-Retrievability @@ -203,74 +259,54 @@ func (r *Result) SetRequestsPoR(v uint32) { // // Zero Result has zero retries. // -// See also SetRetriesPoR. +// See also [Result.SetRetriesPoR]. func (r Result) RetriesPoR() uint32 { - return r.v2.GetRetries() + return r.retriesPoR } // SetRetriesPoR sets number of retries made by Proof-of-Retrievability // audit check to get all headers of the objects inside storage groups. // -// See also RetriesPoR. +// See also [Result.RetriesPoR]. func (r *Result) SetRetriesPoR(v uint32) { - r.v2.SetRetries(v) + r.retriesPoR = v } -// IteratePassedStorageGroups iterates over all storage groups that passed -// Proof-of-Retrievability audit check and passes them into f. Breaks on f's -// false return, f MUST NOT be nil. +// PassedStorageGroups returns storage groups that passed +// Proof-of-Retrievability audit check. Breaks on f's false return, f MUST NOT +// be nil. // // Zero Result has no passed storage groups and doesn't call f. // -// See also SubmitPassedStorageGroup. -func (r Result) IteratePassedStorageGroups(f func(oid.ID) bool) { - r2 := r.v2.GetPassSG() - - var id oid.ID - - for i := range r2 { - _ = id.ReadFromV2(r2[i]) - - if !f(id) { - return - } - } +// Return value MUST NOT be mutated at least until the end of using the Result. +// +// See also [Result.SetPassedStorageGroups]. +func (r Result) PassedStorageGroups() []oid.ID { + return r.passSG } -// SubmitPassedStorageGroup marks storage group as passed Proof-of-Retrievability +// SetPassedStorageGroups sets storage groups that passed Proof-of-Retrievability // audit check. // -// See also IteratePassedStorageGroups. -func (r *Result) SubmitPassedStorageGroup(sg oid.ID) { - var idV2 refs.ObjectID - sg.WriteToV2(&idV2) - - r.v2.SetPassSG(append(r.v2.GetPassSG(), idV2)) +// Argument MUST NOT be mutated at least until the end of using the Result. +// +// See also [Result.PassedStorageGroups]. +func (r *Result) SetPassedStorageGroups(ids []oid.ID) { + r.passSG = ids } -// IterateFailedStorageGroups is similar to IteratePassedStorageGroups but for failed groups. +// FailedStorageGroups is similar to [Result.PassedStorageGroups] but for failed groups. // -// See also SubmitFailedStorageGroup. -func (r Result) IterateFailedStorageGroups(f func(oid.ID) bool) { - v := r.v2.GetFailSG() - var id oid.ID - - for i := range v { - _ = id.ReadFromV2(v[i]) - if !f(id) { - return - } - } +// See also [Result.SetFailedStorageGroups]. +func (r Result) FailedStorageGroups() []oid.ID { + return r.failSG } -// SubmitFailedStorageGroup is similar to SubmitPassedStorageGroup but for failed groups. +// SetFailedStorageGroups is similar to [Result.PassedStorageGroups] but for failed groups. // -// See also IterateFailedStorageGroups. -func (r *Result) SubmitFailedStorageGroup(sg oid.ID) { - var idV2 refs.ObjectID - sg.WriteToV2(&idV2) - - r.v2.SetFailSG(append(r.v2.GetFailSG(), idV2)) +// See also [Result.FailedStorageGroups]. +func (r *Result) SetFailedStorageGroups(ids []oid.ID) { + r.failSG = ids } // Hits returns number of sampled objects under audit placed @@ -279,18 +315,18 @@ func (r *Result) SubmitFailedStorageGroup(sg oid.ID) { // // Zero result has zero hits. // -// See also SetHits. +// See also [Result.SetHits]. func (r Result) Hits() uint32 { - return r.v2.GetHit() + return r.hits } // SetHits sets number of sampled objects under audit placed // in an optimal way according to the containers placement policy // when checking Proof-of-Placement. // -// See also Hits. -func (r *Result) SetHits(hit uint32) { - r.v2.SetHit(hit) +// See also [Result.Hits]. +func (r *Result) SetHits(hits uint32) { + r.hits = hits } // Misses returns number of sampled objects under audit placed @@ -299,18 +335,18 @@ func (r *Result) SetHits(hit uint32) { // // Zero Result has zero misses. // -// See also SetMisses. +// See also [Result.SetMisses]. func (r Result) Misses() uint32 { - return r.v2.GetMiss() + return r.misses } // SetMisses sets number of sampled objects under audit placed // in suboptimal way according to the container's placement policy, // but still at a satisfactory level when checking Proof-of-Placement. // -// See also Misses. -func (r *Result) SetMisses(miss uint32) { - r.v2.SetMiss(miss) +// See also [Result.Misses]. +func (r *Result) SetMisses(misses uint32) { + r.misses = misses } // Failures returns number of sampled objects under audit stored @@ -319,66 +355,55 @@ func (r *Result) SetMisses(miss uint32) { // // Zero result has zero failures. // -// See also SetFailures. +// See also [Result.SetFailures]. func (r Result) Failures() uint32 { - return r.v2.GetFail() + return r.fails } // SetFailures sets number of sampled objects under audit stored // in a way not confirming placement policy or not found at all // when checking Proof-of-Placement. // -// See also Failures. -func (r *Result) SetFailures(fail uint32) { - r.v2.SetFail(fail) +// See also [Result.Failures]. +func (r *Result) SetFailures(fails uint32) { + r.fails = fails } -// IteratePassedStorageNodes iterates over all storage nodes that passed at least one -// Proof-of-Data-Possession audit check and passes their public keys into f. Breaks on -// f's false return. +// PassedStorageNodes returns public keys of storage nodes that passed at least +// one Proof-of-Data-Possession audit check. Breaks on f's false return. // // f MUST NOT be nil and MUST NOT mutate parameter passed into it at least until // the end of using the Result. // // Zero Result has no passed storage nodes and doesn't call f. // -// See also SubmitPassedStorageNode. -func (r Result) IteratePassedStorageNodes(f func([]byte) bool) { - v := r.v2.GetPassNodes() - - for i := range v { - if !f(v[i]) { - return - } - } +// See also [Result.SetPassedStorageNodes]]. +func (r Result) PassedStorageNodes() [][]byte { + return r.passNodes } -// SubmitPassedStorageNodes marks storage node list as passed Proof-of-Data-Possession -// audit check. The list contains public keys. +// SetPassedStorageNodes sets public keys of storage nodes that passed at least +// one Proof-of-Data-Possession audit check. // // Argument and its elements MUST NOT be mutated at least until the end of using the Result. // -// See also IteratePassedStorageNodes. -func (r *Result) SubmitPassedStorageNodes(list [][]byte) { - r.v2.SetPassNodes(list) +// See also [Result.PassedStorageNodes]. +func (r *Result) SetPassedStorageNodes(list [][]byte) { + r.passNodes = list } -// IterateFailedStorageNodes is similar to IteratePassedStorageNodes but for failed nodes. +// FailedStorageNodes is similar to [Result.PassedStorageNodes] but for +// failures. // -// See also SubmitPassedStorageNodes. -func (r Result) IterateFailedStorageNodes(f func([]byte) bool) { - v := r.v2.GetFailNodes() - - for i := range v { - if !f(v[i]) { - return - } - } +// See also [Result.SetFailedStorageNodes]. +func (r Result) FailedStorageNodes() [][]byte { + return r.failNodes } -// SubmitFailedStorageNodes is similar to SubmitPassedStorageNodes but for failed nodes. +// SetFailedStorageNodes is similar to [Result.SetPassedStorageNodes] but for +// failures. // -// See also IterateFailedStorageNodes. -func (r *Result) SubmitFailedStorageNodes(list [][]byte) { - r.v2.SetFailNodes(list) +// See also [Result.SetFailedStorageNodes]. +func (r *Result) SetFailedStorageNodes(list [][]byte) { + r.failNodes = list } diff --git a/audit/result_test.go b/audit/result_test.go index 558cd4fd..935225de 100644 --- a/audit/result_test.go +++ b/audit/result_test.go @@ -4,188 +4,527 @@ import ( "bytes" "testing" + apiaudit "github.com/nspcc-dev/neofs-sdk-go/api/audit" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/nspcc-dev/neofs-sdk-go/audit" audittest "github.com/nspcc-dev/neofs-sdk-go/audit/test" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) -func TestResultData(t *testing.T) { +func TestResult_Version(t *testing.T) { var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + + b := r.Marshal() + err := proto.Unmarshal(b, &msg) + require.NoError(t, err) + require.Equal(t, &refs.Version{Major: 2, Minor: 13}, msg.Version) + + msg.Version.Major, msg.Version.Minor = 1234, 5678 + b, err = proto.Marshal(&msg) + require.NoError(t, err) + err = r.Unmarshal(b) + require.NoError(t, err) + + msg.Version = nil + err = proto.Unmarshal(r.Marshal(), &msg) + require.Equal(t, &refs.Version{Major: 1234, Minor: 5678}, msg.Version) +} - countSG := func(passed bool, f func(oid.ID)) int { - called := 0 +func TestResult_Marshal(t *testing.T) { + r := audittest.Result() - ff := func(arg oid.ID) bool { - called++ + data := r.Marshal() - if f != nil { - f(arg) - } + var r2 audit.Result + require.NoError(t, r2.Unmarshal(data)) - return true - } + require.Equal(t, r, r2) - if passed { - r.IteratePassedStorageGroups(ff) - } else { - r.IterateFailedStorageGroups(ff) - } + t.Run("invalid protobuf", func(t *testing.T) { + var r audit.Result + msg := []byte("definitely_not_protobuf") + err := r.Unmarshal(msg) + require.ErrorContains(t, err, "cannot parse invalid wire-format data") // no better way now + }) + t.Run("missing container", func(t *testing.T) { + var msg apiaudit.DataAuditResult + require.NoError(t, proto.Unmarshal(r.Marshal(), &msg)) + msg.ContainerId = nil + b, err := proto.Marshal(&msg) + require.NoError(t, err) + + err = r.Unmarshal(b) + require.ErrorContains(t, err, "container ID is not set") + }) + t.Run("invalid container", func(t *testing.T) { + var msg apiaudit.DataAuditResult + require.NoError(t, proto.Unmarshal(r.Marshal(), &msg)) + msg.ContainerId = &refs.ContainerID{Value: []byte("invalid_container")} + b, err := proto.Marshal(&msg) + require.NoError(t, err) + + err = r.Unmarshal(b) + require.ErrorContains(t, err, "invalid container") + }) + t.Run("invalid passed SG", func(t *testing.T) { + r := r + r.SetPassedStorageGroups([]oid.ID{oidtest.ID(), oidtest.ID()}) + var msg apiaudit.DataAuditResult + require.NoError(t, proto.Unmarshal(r.Marshal(), &msg)) + msg.PassSg[1].Value = []byte("invalid_object") + b, err := proto.Marshal(&msg) + require.NoError(t, err) + + err = r.Unmarshal(b) + require.ErrorContains(t, err, "invalid passed storage group ID #1") + }) + t.Run("invalid failed SG", func(t *testing.T) { + r := r + r.SetFailedStorageGroups([]oid.ID{oidtest.ID(), oidtest.ID()}) + var msg apiaudit.DataAuditResult + require.NoError(t, proto.Unmarshal(r.Marshal(), &msg)) + msg.FailSg[1].Value = []byte("invalid_object") + b, err := proto.Marshal(&msg) + require.NoError(t, err) + + err = r.Unmarshal(b) + require.ErrorContains(t, err, "invalid failed storage group ID #1") + }) +} - return called - } +func TestResult_Epoch(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult - countPassSG := func(f func(oid.ID)) int { return countSG(true, f) } - countFailSG := func(f func(oid.ID)) int { return countSG(false, f) } + require.Zero(t, r.Epoch()) - countNodes := func(passed bool, f func([]byte)) int { - called := 0 + r.ForEpoch(42) + require.EqualValues(t, 42, r.Epoch()) - ff := func(arg []byte) bool { - called++ + b := r.Marshal() + err := proto.Unmarshal(b, &msg) + require.NoError(t, err) - if f != nil { - f(arg) - } + b, err = proto.Marshal(&msg) + require.NoError(t, err) - return true - } + r.ForEpoch(43) // any other + require.EqualValues(t, 43, r.Epoch()) - if passed { - r.IteratePassedStorageNodes(ff) - } else { - r.IterateFailedStorageNodes(ff) - } + err = r.Unmarshal(b) + require.NoError(t, err) + require.EqualValues(t, 42, r.Epoch()) +} - return called - } +func TestResult_Container(t *testing.T) { + var r audit.Result + var msg apiaudit.DataAuditResult + cnr := cidtest.ID() - countPassNodes := func(f func([]byte)) int { return countNodes(true, f) } - countFailNodes := func(f func([]byte)) int { return countNodes(false, f) } + _, ok := r.Container() + require.False(t, ok) - require.Zero(t, r.Epoch()) - _, set := r.Container() - require.False(t, set) + r.ForContainer(cnr) + res, ok := r.Container() + require.True(t, ok) + require.Equal(t, cnr, res) + + b := r.Marshal() + err := proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + cnrOther := cidtest.ChangeID(cnr) + r.ForContainer(cnrOther) + require.True(t, ok) + require.Equal(t, cnr, res) + + err = r.Unmarshal(b) + require.NoError(t, err) + res, ok = r.Container() + require.True(t, ok) + require.Equal(t, cnr, res) +} + +func TestResult_AuditorKey(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + key := []byte("any_key") + + require.Zero(t, r.AuditorKey()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) require.Nil(t, r.AuditorKey()) + + r.SetAuditorKey(key) + require.Equal(t, key, r.AuditorKey()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + keyOther := bytes.Clone(key) + keyOther[0]++ + r.SetAuditorKey(keyOther) + require.Equal(t, keyOther, r.AuditorKey()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.Equal(t, key, r.AuditorKey()) +} + +func TestResult_Completed(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + + require.Zero(t, r.Completed()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) require.False(t, r.Completed()) + + r.SetCompleted(true) + require.True(t, r.Completed()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + r.SetCompleted(false) + require.False(t, r.Completed()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.True(t, r.Completed()) +} + +func TestResult_RequestsPoR(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + const val = 64304 + require.Zero(t, r.RequestsPoR()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.RequestsPoR()) + + r.SetRequestsPoR(val) + require.EqualValues(t, val, r.RequestsPoR()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + valOther := val + 1 + r.SetRequestsPoR(uint32(valOther)) + require.EqualValues(t, valOther, r.RequestsPoR()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.EqualValues(t, val, r.RequestsPoR()) +} + +func TestResult_RetriesPoR(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + const val = 984609 + require.Zero(t, r.RetriesPoR()) - require.Zero(t, countPassSG(nil)) - require.Zero(t, countFailSG(nil)) - require.Zero(t, countPassNodes(nil)) - require.Zero(t, countFailNodes(nil)) - epoch := uint64(13) - r.ForEpoch(epoch) - require.Equal(t, epoch, r.Epoch()) + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.RetriesPoR()) - cnr := cidtest.ID() - r.ForContainer(cnr) - cID, set := r.Container() - require.True(t, set) - require.Equal(t, cnr, cID) + r.SetRetriesPoR(val) + require.EqualValues(t, val, r.RetriesPoR()) - key := []byte{1, 2, 3} - r.SetAuditorKey(key) - require.Equal(t, key, r.AuditorKey()) + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) - r.Complete() - require.True(t, r.Completed()) + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + valOther := val + 1 + r.SetRetriesPoR(uint32(valOther)) + require.EqualValues(t, valOther, r.RetriesPoR()) - requests := uint32(2) - r.SetRequestsPoR(requests) - require.Equal(t, requests, r.RequestsPoR()) - - retries := uint32(1) - r.SetRetriesPoR(retries) - require.Equal(t, retries, r.RetriesPoR()) - - passSG1, passSG2 := oidtest.ID(), oidtest.ID() - r.SubmitPassedStorageGroup(passSG1) - r.SubmitPassedStorageGroup(passSG2) - - called1, called2 := false, false - - require.EqualValues(t, 2, countPassSG(func(id oid.ID) { - if id.Equals(passSG1) { - called1 = true - } else if id.Equals(passSG2) { - called2 = true - } - })) - require.True(t, called1) - require.True(t, called2) - - failSG1, failSG2 := oidtest.ID(), oidtest.ID() - r.SubmitFailedStorageGroup(failSG1) - r.SubmitFailedStorageGroup(failSG2) - - called1, called2 = false, false - - require.EqualValues(t, 2, countFailSG(func(id oid.ID) { - if id.Equals(failSG1) { - called1 = true - } else if id.Equals(failSG2) { - called2 = true - } - })) - require.True(t, called1) - require.True(t, called2) - - hit := uint32(1) - r.SetHits(hit) - require.Equal(t, hit, r.Hits()) - - miss := uint32(2) - r.SetMisses(miss) - require.Equal(t, miss, r.Misses()) - - fail := uint32(3) - r.SetFailures(fail) - require.Equal(t, fail, r.Failures()) - - passNodes := [][]byte{{1}, {2}} - r.SubmitPassedStorageNodes(passNodes) - - called1, called2 = false, false - - require.EqualValues(t, 2, countPassNodes(func(arg []byte) { - if bytes.Equal(arg, passNodes[0]) { - called1 = true - } else if bytes.Equal(arg, passNodes[1]) { - called2 = true - } - })) - require.True(t, called1) - require.True(t, called2) - - failNodes := [][]byte{{3}, {4}} - r.SubmitFailedStorageNodes(failNodes) - - called1, called2 = false, false - - require.EqualValues(t, 2, countFailNodes(func(arg []byte) { - if bytes.Equal(arg, failNodes[0]) { - called1 = true - } else if bytes.Equal(arg, failNodes[1]) { - called2 = true - } - })) - require.True(t, called1) - require.True(t, called2) + err = r.Unmarshal(b) + require.NoError(t, err) + require.EqualValues(t, val, r.RetriesPoR()) } -func TestResultEncoding(t *testing.T) { - r := audittest.Result() +func TestResult_Hits(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + const val = 23641 - t.Run("binary", func(t *testing.T) { - data := r.Marshal() + require.Zero(t, r.Hits()) - var r2 audit.Result - require.NoError(t, r2.Unmarshal(data)) + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.Hits()) - require.Equal(t, r, r2) - }) + r.SetHits(val) + require.EqualValues(t, val, r.Hits()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + valOther := val + 1 + r.SetHits(uint32(valOther)) + require.EqualValues(t, valOther, r.Hits()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.EqualValues(t, val, r.Hits()) +} + +func TestResult_Misses(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + const val = 684975 + + require.Zero(t, r.Misses()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.Misses()) + + r.SetMisses(val) + require.EqualValues(t, val, r.Misses()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + valOther := val + 1 + r.SetMisses(uint32(valOther)) + require.EqualValues(t, valOther, r.Misses()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.EqualValues(t, val, r.Misses()) +} + +func TestResult_Failures(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + const val = 25927509 + + require.Zero(t, r.Failures()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.Failures()) + + r.SetFailures(val) + require.EqualValues(t, val, r.Failures()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + valOther := val + 1 + r.SetFailures(uint32(valOther)) + require.EqualValues(t, valOther, r.Failures()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.EqualValues(t, val, r.Failures()) +} + +func TestResult_PassedStorageGroups(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + ids := []oid.ID{oidtest.ID(), oidtest.ID()} + + require.Zero(t, r.PassedStorageGroups()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.PassedStorageNodes()) + + r.SetPassedStorageGroups(ids) + require.Equal(t, ids, r.PassedStorageGroups()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + idsOther := make([]oid.ID, len(ids)) + for i := range idsOther { + idsOther[i] = oidtest.ChangeID(ids[i]) + } + + r.SetPassedStorageGroups(idsOther) + require.Equal(t, idsOther, r.PassedStorageGroups()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.Equal(t, ids, r.PassedStorageGroups()) +} + +func TestResult_FailedStorageGroups(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + ids := []oid.ID{oidtest.ID(), oidtest.ID()} + + require.Zero(t, r.FailedStorageGroups()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.FailedStorageGroups()) + + r.SetFailedStorageGroups(ids) + require.Equal(t, ids, r.FailedStorageGroups()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + idsOther := make([]oid.ID, len(ids)) + for i := range idsOther { + idsOther[i] = oidtest.ChangeID(ids[i]) + } + + r.SetFailedStorageGroups(idsOther) + require.Equal(t, idsOther, r.FailedStorageGroups()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.Equal(t, ids, r.FailedStorageGroups()) +} + +func TestResult_PassedStorageNodes(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + keys := [][]byte{ + []byte("any_key1"), + []byte("any_key2"), + } + + require.Zero(t, r.PassedStorageNodes()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.PassedStorageNodes()) + + r.SetPassedStorageNodes(keys) + require.Equal(t, keys, r.PassedStorageNodes()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + keysOther := make([][]byte, len(keys)) + for i := range keysOther { + keysOther[i] = bytes.Clone(keys[i]) + keysOther[i][0]++ + } + + r.SetPassedStorageNodes(keysOther) + require.Equal(t, keysOther, r.PassedStorageNodes()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.Equal(t, keys, r.PassedStorageNodes()) +} + +func TestResult_FailedStorageNodes(t *testing.T) { + var r audit.Result + r.ForContainer(cidtest.ID()) // just to satisfy Unmarshal + var msg apiaudit.DataAuditResult + keys := [][]byte{ + []byte("any_key1"), + []byte("any_key2"), + } + + require.Zero(t, r.FailedStorageNodes()) + + b := r.Marshal() + err := r.Unmarshal(b) + require.NoError(t, err) + require.Zero(t, r.FailedStorageNodes()) + + r.SetFailedStorageNodes(keys) + require.Equal(t, keys, r.FailedStorageNodes()) + + b = r.Marshal() + err = proto.Unmarshal(b, &msg) + require.NoError(t, err) + + b, err = proto.Marshal(&msg) + require.NoError(t, err) + + keysOther := make([][]byte, len(keys)) + for i := range keysOther { + keysOther[i] = bytes.Clone(keys[i]) + keysOther[i][0]++ + } + + r.SetFailedStorageNodes(keysOther) + require.Equal(t, keysOther, r.FailedStorageNodes()) + + err = r.Unmarshal(b) + require.NoError(t, err) + require.Equal(t, keys, r.FailedStorageNodes()) } diff --git a/audit/test/generate.go b/audit/test/generate.go index 9ce9c918..bc35ff70 100644 --- a/audit/test/generate.go +++ b/audit/test/generate.go @@ -1,8 +1,11 @@ package audittest import ( + "fmt" + "github.com/nspcc-dev/neofs-sdk-go/audit" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" + oid "github.com/nspcc-dev/neofs-sdk-go/object/id" oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" ) @@ -12,25 +15,27 @@ func Result() audit.Result { x.ForContainer(cidtest.ID()) x.SetAuditorKey([]byte("key")) - x.Complete() + x.SetCompleted(true) x.ForEpoch(44) x.SetHits(55) x.SetMisses(66) x.SetFailures(77) x.SetRequestsPoR(88) x.SetRequestsPoR(99) - x.SubmitFailedStorageNodes([][]byte{ + x.SetFailedStorageNodes([][]byte{ []byte("node1"), []byte("node2"), }) - x.SubmitPassedStorageNodes([][]byte{ + x.SetPassedStorageNodes([][]byte{ []byte("node3"), []byte("node4"), }) - x.SubmitPassedStorageGroup(oidtest.ID()) - x.SubmitPassedStorageGroup(oidtest.ID()) - x.SubmitFailedStorageGroup(oidtest.ID()) - x.SubmitFailedStorageGroup(oidtest.ID()) + x.SetPassedStorageGroups([]oid.ID{oidtest.ID(), oidtest.ID()}) + x.SetFailedStorageGroups([]oid.ID{oidtest.ID(), oidtest.ID()}) + + if err := x.Unmarshal(x.Marshal()); err != nil { // to set all defaults + panic(fmt.Errorf("unexpected encode-decode failure: %w", err)) + } return x } diff --git a/checksum/checksum.go b/checksum/checksum.go index 3f55c1c7..47eda036 100644 --- a/checksum/checksum.go +++ b/checksum/checksum.go @@ -6,24 +6,22 @@ import ( "errors" "fmt" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/nspcc-dev/tzhash/tz" ) // Checksum represents checksum of some digital data. // -// Checksum is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.Checksum -// message. See ReadFromV2 / WriteToV2 methods. +// Checksum is mutually compatible with [refs.Checksum] message. See +// [Checksum.ReadFromV2] / [Checksum.WriteToV2] methods. // // Instances can be created using built-in var declaration. -// -// Note that direct typecast is not safe and may result in loss of compatibility: -// -// _ = Checksum(refs.Checksum{}) // not recommended -type Checksum refs.Checksum +type Checksum struct { + typ Type + val []byte +} -// Type represents the enumeration -// of checksum types. +// Type represents the enumeration of checksum types. type Type uint8 const ( @@ -37,49 +35,52 @@ const ( TZ ) -// ReadFromV2 reads Checksum from the refs.Checksum message. Checks if the -// message conforms to NeoFS API V2 protocol. +// ReadFromV2 reads Checksum from the [refs.Checksum] message. Checks if the +// message conforms to NeoFS API V2 protocol. The message must not be nil. // -// See also WriteToV2. -func (c *Checksum) ReadFromV2(m refs.Checksum) error { - if len(m.GetSum()) == 0 { +// See also [Checksum.WriteToV2]. +func (c *Checksum) ReadFromV2(m *refs.Checksum) error { + if len(m.Sum) == 0 { return errors.New("missing value") } - switch m.GetType() { + switch m.Type { default: return fmt.Errorf("unsupported type %v", m.GetType()) - case refs.SHA256, refs.TillichZemor: + case refs.ChecksumType_SHA256: + c.typ = SHA256 + case refs.ChecksumType_TZ: + c.typ = TZ } - *c = Checksum(m) + c.val = m.Sum return nil } -// WriteToV2 writes Checksum to the refs.Checksum message. +// WriteToV2 writes Checksum to the [refs.Checksum] message. // The message must not be nil. // -// See also ReadFromV2. +// See also [Checksum.ReadFromV2]. func (c Checksum) WriteToV2(m *refs.Checksum) { - *m = (refs.Checksum)(c) + switch c.typ { + default: + m.Type = refs.ChecksumType(c.typ) + case SHA256: + m.Type = refs.ChecksumType_SHA256 + case TZ: + m.Type = refs.ChecksumType_TZ + } + m.Sum = c.val } // Type returns checksum type. // -// Zero Checksum has Unknown checksum type. +// Zero Checksum has [Unknown] checksum type. // -// See also SetTillichZemor and SetSHA256. +// See also [Checksum.SetTillichZemor] and [Checksum.SetSHA256]. func (c Checksum) Type() Type { - v2 := (refs.Checksum)(c) - switch v2.GetType() { - case refs.SHA256: - return SHA256 - case refs.TillichZemor: - return TZ - default: - return Unknown - } + return c.typ } // Value returns checksum bytes. Return value @@ -90,32 +91,29 @@ func (c Checksum) Type() Type { // The value returned shares memory with the structure itself, so changing it can lead to data corruption. // Make a copy if you need to change it. // -// See also SetTillichZemor and SetSHA256. +// See also [Checksum.SetTillichZemor] and [Checksum.SetSHA256]. func (c Checksum) Value() []byte { - v2 := (refs.Checksum)(c) - return v2.GetSum() + return c.val } -// SetSHA256 sets checksum to SHA256 hash. +// SetSHA256 sets checksum to SHA-256 hash. // -// See also Calculate. +// See also [Calculate]. func (c *Checksum) SetSHA256(v [sha256.Size]byte) { - v2 := (*refs.Checksum)(c) - - v2.SetType(refs.SHA256) - v2.SetSum(v[:]) + c.typ = SHA256 + c.val = v[:] } // Calculate calculates checksum and sets it // to the passed checksum. Checksum must not be nil. // // Does nothing if the passed type is not one of the: -// - SHA256; -// - TZ. +// - [SHA256]; +// - [TZ]. // // Does not mutate the passed value. // -// See also SetSHA256, SetTillichZemor. +// See also [Checksum.SetSHA256], [Checksum.SetTillichZemor]. func Calculate(c *Checksum, t Type, v []byte) { switch t { case SHA256: @@ -128,24 +126,21 @@ func Calculate(c *Checksum, t Type, v []byte) { // SetTillichZemor sets checksum to Tillich-Zémor hash. // -// See also Calculate. +// See also [Calculate]. func (c *Checksum) SetTillichZemor(v [tz.Size]byte) { - v2 := (*refs.Checksum)(c) - - v2.SetType(refs.TillichZemor) - v2.SetSum(v[:]) + c.typ = TZ + c.val = v[:] } -// String implements fmt.Stringer. +// String implements [fmt.Stringer]. // // String is designed to be human-readable, and its format MAY differ between // SDK versions. func (c Checksum) String() string { - v2 := (refs.Checksum)(c) - return fmt.Sprintf("%s:%s", c.Type(), hex.EncodeToString(v2.GetSum())) + return fmt.Sprintf("%s:%s", c.typ, hex.EncodeToString(c.val)) } -// String implements fmt.Stringer. +// String implements [fmt.Stringer]. // // String is designed to be human-readable, and its format MAY differ between // SDK versions. @@ -154,11 +149,11 @@ func (m Type) String() string { switch m { default: - m2 = refs.UnknownChecksum + m2 = refs.ChecksumType(m) case TZ: - m2 = refs.TillichZemor + m2 = refs.ChecksumType_TZ case SHA256: - m2 = refs.SHA256 + m2 = refs.ChecksumType_SHA256 } return m2.String() diff --git a/checksum/checksum_test.go b/checksum/checksum_test.go index f9d22c95..664d957e 100644 --- a/checksum/checksum_test.go +++ b/checksum/checksum_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/nspcc-dev/tzhash/tz" "github.com/stretchr/testify/require" ) @@ -24,7 +24,7 @@ func TestChecksum(t *testing.T) { var cV2 refs.Checksum c.WriteToV2(&cV2) - require.Equal(t, refs.SHA256, cV2.GetType()) + require.Equal(t, refs.ChecksumType_SHA256, cV2.GetType()) require.Equal(t, cSHA256[:], cV2.GetSum()) cTZ := [tz.Size]byte{} @@ -37,7 +37,7 @@ func TestChecksum(t *testing.T) { c.WriteToV2(&cV2) - require.Equal(t, refs.TillichZemor, cV2.GetType()) + require.Equal(t, refs.ChecksumType_TZ, cV2.GetType()) require.Equal(t, cTZ[:], cV2.GetSum()) } @@ -53,7 +53,7 @@ func TestNewChecksum(t *testing.T) { var chsV2 refs.Checksum chs.WriteToV2(&chsV2) - require.Equal(t, refs.UnknownChecksum, chsV2.GetType()) + require.Equal(t, refs.ChecksumType_CHECKSUM_TYPE_UNSPECIFIED, chsV2.GetType()) require.Nil(t, chsV2.GetSum()) }) } diff --git a/checksum/example_test.go b/checksum/example_test.go index 5a18a484..6641f003 100644 --- a/checksum/example_test.go +++ b/checksum/example_test.go @@ -6,7 +6,7 @@ import ( "fmt" "math/rand" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" ) func ExampleCalculate() { @@ -24,7 +24,7 @@ func ExampleCalculate() { func ExampleChecksum_marshalling() { var ( csRaw [sha256.Size]byte - csV2 refs.Checksum + msg refs.Checksum cs Checksum ) @@ -34,14 +34,14 @@ func ExampleChecksum_marshalling() { // On the client side. - cs.WriteToV2(&csV2) + cs.WriteToV2(&msg) - fmt.Println(bytes.Equal(cs.Value(), csV2.GetSum())) + fmt.Println(bytes.Equal(cs.Value(), msg.GetSum())) // Example output: true // *send message* // On the server side. - _ = cs.ReadFromV2(csV2) + _ = cs.ReadFromV2(&msg) } diff --git a/container/id/id.go b/container/id/id.go index fdedaf4b..c90a1473 100644 --- a/container/id/id.go +++ b/container/id/id.go @@ -5,13 +5,13 @@ import ( "fmt" "github.com/mr-tron/base58" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" ) // ID represents NeoFS container identifier. // -// ID is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.ContainerID -// message. See ReadFromV2 / WriteToV2 methods. +// ID is mutually compatible with [refs.ContainerID] message. See +// [ID.ReadFromV2] / [ID.WriteToV2] methods. // // Instances can be created using built-in var declaration. // @@ -20,21 +20,21 @@ import ( // _ = ID([32]byte) // not recommended type ID [sha256.Size]byte -// ReadFromV2 reads ID from the refs.ContainerID message. -// Returns an error if the message is malformed according -// to the NeoFS API V2 protocol. +// ReadFromV2 reads ID from the [refs.ContainerID] message. Returns an error if +// the message is malformed according to the NeoFS API V2 protocol. The message +// must not be nil. // -// See also WriteToV2. -func (id *ID) ReadFromV2(m refs.ContainerID) error { - return id.Decode(m.GetValue()) +// See also [ID.WriteToV2]. +func (id *ID) ReadFromV2(m *refs.ContainerID) error { + return id.Decode(m.Value) } // WriteToV2 writes ID to the refs.ContainerID message. // The message must not be nil. // -// See also ReadFromV2. +// See also [ID.ReadFromV2]. func (id ID) WriteToV2(m *refs.ContainerID) { - m.SetValue(id[:]) + m.Value = id[:] } // Encode encodes ID into 32 bytes of dst. Panics if diff --git a/container/id/id_test.go b/container/id/id_test.go index e1b07a0c..4bff0d9d 100644 --- a/container/id/id_test.go +++ b/container/id/id_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/mr-tron/base58" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" cid "github.com/nspcc-dev/neofs-sdk-go/container/id" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" "github.com/stretchr/testify/require" @@ -30,7 +30,7 @@ func TestID_ToV2(t *testing.T) { id.WriteToV2(&idV2) var newID cid.ID - require.NoError(t, newID.ReadFromV2(idV2)) + require.NoError(t, newID.ReadFromV2(&idV2)) require.Equal(t, id, newID) require.Equal(t, checksum[:], idV2.GetValue()) @@ -83,7 +83,7 @@ func TestNewFromV2(t *testing.T) { v2 refs.ContainerID ) - require.Error(t, x.ReadFromV2(v2)) + require.Error(t, x.ReadFromV2(&v2)) }) } diff --git a/container/id/test/id.go b/container/id/test/id.go index 0fa5197f..5107e3d5 100644 --- a/container/id/test/id.go +++ b/container/id/test/id.go @@ -24,3 +24,10 @@ func IDWithChecksum(cs [sha256.Size]byte) cid.ID { return id } + +// ChangeID returns container ID other than the given one. +func ChangeID(id cid.ID) cid.ID { + cp := id + cp[0]++ + return cp +} diff --git a/crypto/api.go b/crypto/api.go new file mode 100644 index 00000000..d5af2c5b --- /dev/null +++ b/crypto/api.go @@ -0,0 +1,302 @@ +package neofscrypto + +import ( + "errors" + "fmt" + + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" +) + +// Request is a common interface of NeoFS API requests. +type Request interface { + // GetMetaHeader returns meta header attached to the [Request]. + GetMetaHeader() *session.RequestMetaHeader + // GetVerifyHeader returns verification header of the [Request]. + GetVerifyHeader() *session.RequestVerificationHeader +} + +// Response is a common interface of NeoFS API responses. +type Response interface { + // GetMetaHeader returns meta header attached to the [Response]. + GetMetaHeader() *session.ResponseMetaHeader + // GetVerifyHeader returns verification header of the [Response]. + GetVerifyHeader() *session.ResponseVerificationHeader +} + +// SignRequest signs all verified parts of the request using provided +// [neofscrypto.Signer] and returns resulting verification header. Meta header +// must be set in advance if needed. +// +// Optional buffer is used for encoding if it has sufficient size. +func SignRequest(signer Signer, req Request, body proto.Message, buf []byte) (*session.RequestVerificationHeader, error) { + var bodySig []byte + var err error + originVerifyHdr := req.GetVerifyHeader() + if originVerifyHdr == nil { + // sign session message body + b := encodeMessage(body, buf) + bodySig, err = signer.Sign(b) + if err != nil { + return nil, fmt.Errorf("sign body: %w", err) + } + if len(b) > len(buf) { + buf = b + } + } + + // sign meta header + b := encodeMessage(req.GetMetaHeader(), buf) + metaSig, err := signer.Sign(b) + if err != nil { + return nil, fmt.Errorf("sign meta header: %w", err) + } + if len(b) > len(buf) { + buf = b + } + + // sign verification header origin + b = encodeMessage(originVerifyHdr, buf) + verifyOriginSig, err := signer.Sign(b) + if err != nil { + return nil, fmt.Errorf("sign origin of verification header: %w", err) + } + + scheme := refs.SignatureScheme(signer.Scheme()) + pubKey := PublicKeyBytes(signer.Public()) + res := &session.RequestVerificationHeader{ + MetaSignature: &refs.Signature{Key: pubKey, Sign: metaSig, Scheme: scheme}, + OriginSignature: &refs.Signature{Key: pubKey, Sign: verifyOriginSig, Scheme: scheme}, + Origin: originVerifyHdr, + } + if originVerifyHdr == nil { + res.BodySignature = &refs.Signature{Key: pubKey, Sign: bodySig, Scheme: scheme} + } + return res, nil +} + +// VerifyRequest verifies all signatures of given request and its extracted +// body. +func VerifyRequest(req Request, body proto.Message) error { + verifyHdr := req.GetVerifyHeader() + if verifyHdr == nil { + return errors.New("missing verification header") + } + + // pre-calculate max encoded size to allocate single buffer + maxSz := body.MarshaledSize() + metaHdr := req.GetMetaHeader() + for { + if metaHdr.GetOrigin() == nil != (verifyHdr.Origin == nil) { // metaHdr can be nil, verifyHdr cannot + return errors.New("different number of meta and verification headers") + } + + sz := verifyHdr.MarshaledSize() + if sz > maxSz { + maxSz = sz + } + sz = metaHdr.MarshaledSize() + if sz > maxSz { + maxSz = sz + } + + if verifyHdr.Origin == nil { + break + } + verifyHdr = verifyHdr.Origin + metaHdr = metaHdr.Origin + } + + var err error + var bodySig *refs.Signature + metaHdr = req.GetMetaHeader() + verifyHdr = req.GetVerifyHeader() + buf := make([]byte, maxSz) + for { + if verifyHdr.MetaSignature == nil { + return errors.New("missing signature of the meta header") + } + if err = verifyMessageSignature(metaHdr, verifyHdr.MetaSignature, buf); err != nil { + return fmt.Errorf("verify signature of the meta header: %w", err) + } + + if verifyHdr.Origin == nil { + bodySig = verifyHdr.BodySignature + break + } + + if verifyHdr.BodySignature != nil { + return errors.New("body signature is set for non-origin level") + } + if verifyHdr.OriginSignature == nil { + return errors.New("missing signature of the origin verification header") + } + if err = verifyMessageSignature(verifyHdr.Origin, verifyHdr.OriginSignature, buf); err != nil { + return fmt.Errorf("verify signature of the origin verification header: %w", err) + } + + verifyHdr = verifyHdr.Origin + metaHdr = metaHdr.Origin + } + + if bodySig == nil { + return errors.New("missing body signature") + } + if err = verifyMessageSignature(body, bodySig, buf); err != nil { + return fmt.Errorf("verify body signature: %w", err) + } + return nil +} + +// SignResponse signs all verified parts of the response using provided +// [neofscrypto.Signer] and returns resulting verification header. Meta header +// must be set in advance if needed. +// +// Optional buffer is used for encoding if it has sufficient size. +func SignResponse(signer Signer, resp Response, body proto.Message, buf []byte) (*session.ResponseVerificationHeader, error) { + var bodySig []byte + var err error + originVerifyHdr := resp.GetVerifyHeader() + if originVerifyHdr == nil { + // sign session message body + b := encodeMessage(body, buf) + bodySig, err = signer.Sign(b) + if err != nil { + return nil, fmt.Errorf("sign body: %w", err) + } + if len(b) > len(buf) { + buf = b + } + } + + // sign meta header + b := encodeMessage(resp.GetMetaHeader(), buf) + metaSig, err := signer.Sign(b) + if err != nil { + return nil, fmt.Errorf("sign meta header: %w", err) + } + if len(b) > len(buf) { + buf = b + } + + // sign verification header origin + b = encodeMessage(originVerifyHdr, buf) + verifyOriginSig, err := signer.Sign(b) + if err != nil { + return nil, fmt.Errorf("sign origin of verification header: %w", err) + } + + scheme := refs.SignatureScheme(signer.Scheme()) + pubKey := PublicKeyBytes(signer.Public()) + res := &session.ResponseVerificationHeader{ + MetaSignature: &refs.Signature{Key: pubKey, Sign: metaSig, Scheme: scheme}, + OriginSignature: &refs.Signature{Key: pubKey, Sign: verifyOriginSig, Scheme: scheme}, + Origin: originVerifyHdr, + } + if originVerifyHdr == nil { + res.BodySignature = &refs.Signature{Key: pubKey, Sign: bodySig, Scheme: scheme} + } + return res, nil +} + +// VerifyResponse verifies all signatures of given response and its extracted +// body. +func VerifyResponse(resp Response, body proto.Message) error { + verifyHdr := resp.GetVerifyHeader() + if verifyHdr == nil { + return errors.New("missing verification header") + } + + // pre-calculate max encoded size to allocate single buffer + maxSz := body.MarshaledSize() + metaHdr := resp.GetMetaHeader() + for { + if metaHdr.GetOrigin() == nil != (verifyHdr.Origin == nil) { // metaHdr can be nil, verifyHdr cannot + return errors.New("different number of meta and verification headers") + } + + sz := verifyHdr.MarshaledSize() + if sz > maxSz { + maxSz = sz + } + sz = metaHdr.MarshaledSize() + if sz > maxSz { + maxSz = sz + } + + if verifyHdr.Origin == nil { + break + } + verifyHdr = verifyHdr.Origin + metaHdr = metaHdr.Origin + } + + var err error + var bodySig *refs.Signature + metaHdr = resp.GetMetaHeader() + verifyHdr = resp.GetVerifyHeader() + buf := make([]byte, maxSz) + for { + if verifyHdr.MetaSignature == nil { + return errors.New("missing signature of the meta header") + } + if err = verifyMessageSignature(metaHdr, verifyHdr.MetaSignature, buf); err != nil { + return fmt.Errorf("verify signature of the meta header: %w", err) + } + + if verifyHdr.Origin == nil { + bodySig = verifyHdr.BodySignature + break + } + + if verifyHdr.BodySignature != nil { + return errors.New("body signature is set for non-origin level") + } + if verifyHdr.OriginSignature == nil { + return errors.New("missing signature of the origin verification header") + } + if err = verifyMessageSignature(verifyHdr.Origin, verifyHdr.OriginSignature, buf); err != nil { + return fmt.Errorf("verify signature of the origin verification header: %w", err) + } + + verifyHdr = verifyHdr.Origin + metaHdr = metaHdr.Origin + } + + if bodySig == nil { + return errors.New("missing body signature") + } + if err = verifyMessageSignature(body, bodySig, buf); err != nil { + return fmt.Errorf("verify body signature: %w", err) + } + return nil +} + +func verifyMessageSignature(msg proto.Message, sig *refs.Signature, buf []byte) error { + if len(sig.Key) == 0 { + return errors.New("missing public key") + } + + pubKey, err := decodePublicKey(Scheme(sig.Scheme), sig.Key) + if err != nil { + return err + } + + if !pubKey.Verify(encodeMessage(msg, buf), sig.Sign) { + return errors.New("signature mismatch") + } + return nil +} + +func encodeMessage(m proto.Message, buf []byte) []byte { + sz := m.MarshaledSize() + var b []byte + if len(buf) >= sz { + b = buf[:sz] + } else { + b = make([]byte, sz) + } + m.MarshalStable(b) + return b +} diff --git a/crypto/api_test.go b/crypto/api_test.go new file mode 100644 index 00000000..17946110 --- /dev/null +++ b/crypto/api_test.go @@ -0,0 +1,325 @@ +package neofscrypto_test + +import ( + "encoding/hex" + "os" + "path/filepath" + "strconv" + "testing" + + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" + "github.com/nspcc-dev/neofs-sdk-go/api/accounting" + "github.com/nspcc-dev/neofs-sdk-go/api/container" + "github.com/nspcc-dev/neofs-sdk-go/api/netmap" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/session" + "github.com/nspcc-dev/neofs-sdk-go/api/status" + neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" + neofsecdsa "github.com/nspcc-dev/neofs-sdk-go/crypto/ecdsa" + internalproto "github.com/nspcc-dev/neofs-sdk-go/internal/proto" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" +) + +type request interface { + proto.Message + neofscrypto.Request +} + +type response interface { + proto.Message + neofscrypto.Response +} + +func verifyRequestFromFile(t testing.TB, file string, req request, getBody func(request) internalproto.Message) { + b, err := os.ReadFile(filepath.Join(testDataDir, file)) + require.NoError(t, err) + b, err = hex.DecodeString(string(b)) + require.NoError(t, err) + require.NoError(t, proto.Unmarshal(b, req)) + require.NoError(t, neofscrypto.VerifyRequest(req, getBody(req))) +} + +func verifyResponseFromFile(t testing.TB, file string, resp response, getBody func(response) internalproto.Message) { + b, err := os.ReadFile(filepath.Join(testDataDir, file)) + require.NoError(t, err) + b, err = hex.DecodeString(string(b)) + require.NoError(t, err) + require.NoError(t, proto.Unmarshal(b, resp)) + require.NoError(t, neofscrypto.VerifyResponse(resp, getBody(resp))) +} + +func testSignRequest(t testing.TB, req request, body internalproto.Message, meta **session.RequestMetaHeader, verif **session.RequestVerificationHeader) { + require.Error(t, neofscrypto.VerifyRequest(req, body)) + + key1, err := keys.NewPrivateKey() + require.NoError(t, err) + key2, err := keys.NewPrivateKey() + require.NoError(t, err) + key3, err := keys.NewPrivateKey() + require.NoError(t, err) + + signers := []neofscrypto.Signer{ + neofsecdsa.Signer(key1.PrivateKey), + neofsecdsa.SignerRFC6979(key2.PrivateKey), + neofsecdsa.SignerWalletConnect(key3.PrivateKey), + } + + for i := range signers { + n := 100*i + 1 + *meta = &session.RequestMetaHeader{ + Version: &refs.Version{Major: uint32(n), Minor: uint32(n + 1)}, + Epoch: uint64(n + 3), + Ttl: uint32(n + 4), + MagicNumber: uint64(n + 5), + XHeaders: []*session.XHeader{ + {Key: "xheader_key" + strconv.Itoa(n), Value: "xheader_val" + strconv.Itoa(n)}, + {Key: "xheader_key" + strconv.Itoa(n+1), Value: "xheader_val" + strconv.Itoa(n+1)}, + }, + Origin: *meta, + } + + *verif, err = neofscrypto.SignRequest(signers[i], req, body, nil) + require.NoError(t, err) + } + + require.NoError(t, neofscrypto.VerifyRequest(req, body)) +} + +func testSignResponse(t testing.TB, resp response, body internalproto.Message, meta **session.ResponseMetaHeader, verif **session.ResponseVerificationHeader) { + require.Error(t, neofscrypto.VerifyResponse(resp, body)) + + key1, err := keys.NewPrivateKey() + require.NoError(t, err) + key2, err := keys.NewPrivateKey() + require.NoError(t, err) + key3, err := keys.NewPrivateKey() + require.NoError(t, err) + + signers := []neofscrypto.Signer{ + neofsecdsa.Signer(key1.PrivateKey), + neofsecdsa.SignerRFC6979(key2.PrivateKey), + neofsecdsa.SignerWalletConnect(key3.PrivateKey), + } + + for i := range signers { + n := 100*i + 1 + *meta = &session.ResponseMetaHeader{ + Version: &refs.Version{Major: uint32(n), Minor: uint32(n + 1)}, + Epoch: uint64(n + 3), + Ttl: uint32(n + 4), + XHeaders: []*session.XHeader{ + {Key: "xheader_key" + strconv.Itoa(n), Value: "xheader_val" + strconv.Itoa(n)}, + {Key: "xheader_key" + strconv.Itoa(n+1), Value: "xheader_val" + strconv.Itoa(n+1)}, + }, + Origin: *meta, + Status: &status.Status{Code: uint32(n + 6)}, + } + + *verif, err = neofscrypto.SignResponse(signers[i], resp, body, nil) + require.NoError(t, err) + } + + require.NoError(t, neofscrypto.VerifyResponse(resp, body)) +} + +func TestAPIVerify(t *testing.T) { + t.Run("accounting", func(t *testing.T) { + t.Run("balance", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + verifyRequestFromFile(t, "accounting_balance_request", new(accounting.BalanceRequest), func(r request) internalproto.Message { + return r.(*accounting.BalanceRequest).Body + }) + }) + t.Run("response", func(t *testing.T) { + verifyResponseFromFile(t, "accounting_balance_response", new(accounting.BalanceResponse), func(r response) internalproto.Message { + return r.(*accounting.BalanceResponse).Body + }) + }) + }) + }) + t.Run("container", func(t *testing.T) { + t.Run("put", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + verifyRequestFromFile(t, "container_put_request", new(container.PutRequest), func(r request) internalproto.Message { + return r.(*container.PutRequest).Body + }) + }) + t.Run("response", func(t *testing.T) { + verifyResponseFromFile(t, "container_put_response", new(container.PutResponse), func(r response) internalproto.Message { + return r.(*container.PutResponse).Body + }) + }) + }) + t.Run("get", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + verifyRequestFromFile(t, "container_get_request", new(container.GetRequest), func(r request) internalproto.Message { + return r.(*container.GetRequest).Body + }) + }) + t.Run("response", func(t *testing.T) { + verifyResponseFromFile(t, "container_get_response", new(container.GetResponse), func(r response) internalproto.Message { + return r.(*container.GetResponse).Body + }) + }) + }) + t.Run("delete", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + verifyRequestFromFile(t, "container_delete_request", new(container.DeleteRequest), func(r request) internalproto.Message { + return r.(*container.DeleteRequest).Body + }) + }) + t.Run("response", func(t *testing.T) { + verifyResponseFromFile(t, "container_delete_response", new(container.DeleteResponse), func(r response) internalproto.Message { + return r.(*container.DeleteResponse).Body + }) + }) + }) + t.Run("list", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + verifyRequestFromFile(t, "container_list_request", new(container.ListRequest), func(r request) internalproto.Message { + return r.(*container.ListRequest).Body + }) + }) + t.Run("response", func(t *testing.T) { + verifyResponseFromFile(t, "container_list_response", new(container.ListResponse), func(r response) internalproto.Message { + return r.(*container.ListResponse).Body + }) + }) + }) + }) +} + +func TestAPISign(t *testing.T) { + t.Run("accounting", func(t *testing.T) { + t.Run("balance", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + req := &accounting.BalanceRequest{Body: &accounting.BalanceRequest_Body{ + OwnerId: &refs.OwnerID{Value: []byte("any_user")}, + }} + testSignRequest(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + t.Run("response", func(t *testing.T) { + req := &accounting.BalanceResponse{Body: &accounting.BalanceResponse_Body{ + Balance: &accounting.Decimal{Value: 1, Precision: 2}, + }} + testSignResponse(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + }) + }) + t.Run("container", func(t *testing.T) { + t.Run("put", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + req := &container.PutRequest{Body: &container.PutRequest_Body{ + Container: &container.Container{ + Version: &refs.Version{Major: 1, Minor: 2}, + OwnerId: &refs.OwnerID{Value: []byte("any_user")}, + Nonce: []byte("any_nonce"), + BasicAcl: 3, + Attributes: []*container.Container_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + PlacementPolicy: &netmap.PlacementPolicy{ + Replicas: []*netmap.Replica{{Count: 4}}, + ContainerBackupFactor: 5, + }, + }, + Signature: &refs.SignatureRFC6979{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + }, + }} + testSignRequest(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + t.Run("response", func(t *testing.T) { + req := &container.PutResponse{Body: &container.PutResponse_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + }} + testSignResponse(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + }) + t.Run("get", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + req := &container.GetRequest{Body: &container.GetRequest_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container_id")}, + }} + testSignRequest(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + t.Run("response", func(t *testing.T) { + req := &container.GetResponse{Body: &container.GetResponse_Body{ + Container: &container.Container{ + Version: &refs.Version{Major: 1, Minor: 2}, + OwnerId: &refs.OwnerID{Value: []byte("any_user")}, + Nonce: []byte("any_nonce"), + BasicAcl: 3, + Attributes: []*container.Container_Attribute{ + {Key: "attr_key1", Value: "attr_val1"}, + {Key: "attr_key2", Value: "attr_val2"}, + }, + PlacementPolicy: &netmap.PlacementPolicy{ + Replicas: []*netmap.Replica{{Count: 4}}, + ContainerBackupFactor: 5, + }, + }, + Signature: &refs.SignatureRFC6979{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + }, + SessionToken: &session.SessionToken{ + Body: &session.SessionToken_Body{ + Id: []byte("any_ID"), + OwnerId: &refs.OwnerID{Value: []byte("any_user")}, + Lifetime: &session.SessionToken_Body_TokenLifetime{Exp: 101, Nbf: 102, Iat: 103}, + SessionKey: []byte("any_session_key"), + Context: &session.SessionToken_Body_Container{Container: &session.ContainerSessionContext{ + Verb: 200, + Wildcard: true, + ContainerId: &refs.ContainerID{Value: []byte("any_container")}, + }}, + }, + Signature: &refs.Signature{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + Scheme: 123, + }, + }, + }} + testSignResponse(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + }) + t.Run("delete", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + req := &container.DeleteRequest{Body: &container.DeleteRequest_Body{ + ContainerId: &refs.ContainerID{Value: []byte("any_container_id")}, + Signature: &refs.SignatureRFC6979{ + Key: []byte("any_public_key"), + Sign: []byte("any_signature"), + }, + }} + testSignRequest(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + t.Run("response", func(t *testing.T) { + req := &container.DeleteResponse{Body: &container.DeleteResponse_Body{}} + testSignResponse(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + }) + t.Run("list", func(t *testing.T) { + t.Run("request", func(t *testing.T) { + req := &container.ListRequest{Body: &container.ListRequest_Body{ + OwnerId: &refs.OwnerID{Value: []byte("any_user")}, + }} + testSignRequest(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + t.Run("response", func(t *testing.T) { + req := &container.ListResponse{Body: &container.ListResponse_Body{ + ContainerIds: []*refs.ContainerID{ + {Value: []byte("any_container1")}, + {Value: []byte("any_container2")}, + }, + }} + testSignResponse(t, req, req.Body, &req.MetaHeader, &req.VerifyHeader) + }) + }) + }) +} diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 4549cc55..2077a73e 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -5,12 +5,14 @@ import ( "testing" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" neofsecdsa "github.com/nspcc-dev/neofs-sdk-go/crypto/ecdsa" "github.com/stretchr/testify/require" ) +const testDataDir = "testdata" + func TestSignature(t *testing.T) { data := make([]byte, 512) //nolint:staticcheck @@ -40,7 +42,7 @@ func TestSignature(t *testing.T) { s.WriteToV2(&m) - require.NoError(t, s.ReadFromV2(m)) + require.NoError(t, s.ReadFromV2(&m)) valid := s.Verify(data) require.True(t, valid, "type %T", signer) diff --git a/crypto/ecdsa/wallet_connect.go b/crypto/ecdsa/wallet_connect.go index 5c46f69a..c65826a1 100644 --- a/crypto/ecdsa/wallet_connect.go +++ b/crypto/ecdsa/wallet_connect.go @@ -3,14 +3,20 @@ package neofsecdsa import ( "crypto/ecdsa" "crypto/elliptic" + "crypto/rand" + "crypto/sha256" "encoding/base64" + "encoding/hex" "fmt" + "math/big" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" - "github.com/nspcc-dev/neofs-api-go/v2/util/signature/walletconnect" + "github.com/nspcc-dev/neo-go/pkg/io" neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" ) +const saltLen = 16 + // SignerWalletConnect is similar to SignerRFC6979 with 2 changes: // 1. The data is base64 encoded before signing/verifying. // 2. The signature is a concatenation of the signature itself and 16-byte salt. @@ -29,7 +35,16 @@ func (x SignerWalletConnect) Scheme() neofscrypto.Scheme { func (x SignerWalletConnect) Sign(data []byte) ([]byte, error) { b64 := make([]byte, base64.StdEncoding.EncodedLen(len(data))) base64.StdEncoding.Encode(b64, data) - return walletconnect.Sign((*ecdsa.PrivateKey)(&x), b64) + var salt [saltLen]byte + _, err := rand.Read(salt[:]) + if err != nil { + return nil, fmt.Errorf("randomize salt: %w", err) + } + sig, err := SignerRFC6979(x).Sign(saltMessageWalletConnect(b64, salt[:])) + if err != nil { + return nil, err + } + return append(sig, salt[:]...), nil } // Public initializes PublicKey and returns it as neofscrypto.PublicKey. @@ -79,7 +94,41 @@ func (x *PublicKeyWalletConnect) Decode(data []byte) error { // Verify verifies data signature calculated by ECDSA algorithm with SHA-512 hashing. func (x PublicKeyWalletConnect) Verify(data, signature []byte) bool { + if len(signature) != keys.SignatureLen+saltLen { + return false + } b64 := make([]byte, base64.StdEncoding.EncodedLen(len(data))) base64.StdEncoding.Encode(b64, data) - return walletconnect.Verify((*ecdsa.PublicKey)(&x), b64, signature) + return verifyWalletConnect((*ecdsa.PublicKey)(&x), b64, signature[:keys.SignatureLen], signature[keys.SignatureLen:]) +} + +func verifyWalletConnect(key *ecdsa.PublicKey, data, sig, salt []byte) bool { + h := sha256.Sum256(saltMessageWalletConnect(data, salt)) + var r, s big.Int + r.SetBytes(sig[:keys.SignatureLen/2]) + s.SetBytes(sig[keys.SignatureLen/2:]) + return ecdsa.Verify(key, h[:], &r, &s) +} + +// saltMessageWalletConnect calculates signed message for given data and salt +// according to WalletConnect. +func saltMessageWalletConnect(data, salt []byte) []byte { + saltedLen := hex.EncodedLen(len(salt)) + len(data) + b := make([]byte, 4+getVarIntSize(saltedLen)+saltedLen+2) + b[0], b[1], b[2], b[3] = 0x01, 0x00, 0x01, 0xf0 + n := 4 + io.PutVarUint(b[4:], uint64(saltedLen)) + n += hex.Encode(b[n:], salt) + n += copy(b[n:], data) + b[n], b[n+1] = 0x00, 0x00 + return b +} + +// copy-paste from neo-go. +func getVarIntSize(value int) int { + if value < 0xFD { + return 1 + } else if value <= 0xFFFF { + return 3 + } + return 5 } diff --git a/crypto/ecdsa/wallet_connect_test.go b/crypto/ecdsa/wallet_connect_test.go new file mode 100644 index 00000000..b715214f --- /dev/null +++ b/crypto/ecdsa/wallet_connect_test.go @@ -0,0 +1,83 @@ +package neofsecdsa + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "encoding/hex" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestSignerWalletConnect_Sign(t *testing.T) { + key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + require.NoError(t, err) + signer := (*SignerWalletConnect)(key) + + data := []byte("some_message") + sig, err := signer.Sign(data) + require.NoError(t, err) + require.Len(t, sig, 64+16) + require.True(t, signer.Public().Verify(data, sig)) +} + +func TestPublicKey_Verify(t *testing.T) { + const data = "Hello, world!" + const pubKeyHex = "02b6027dffdc35e66d4469ae68c8382a8eb7e40b4dd01d812b0470a7d4864fb858" + const sigHex = "ae6ea59b2028f696d9c2626aba9677800a0fcd5441aa7f66d085c9c070de61faa11d6002e821d4407bb8b8690571d6ac7e79706510d6c89175705d156a234c53d3af772b1846f96034fd4fa740744553" + + b, err := hex.DecodeString(pubKeyHex) + require.NoError(t, err) + + var pubKey PublicKeyWalletConnect + require.NoError(t, pubKey.Decode(b)) + + sig, err := hex.DecodeString(sigHex) + require.NoError(t, err) + + require.True(t, pubKey.Verify([]byte(data), sig)) +} + +func TestVerifyWalletConnect(t *testing.T) { + for _, testCase := range []struct { + msgHex string + pubKeyHex string + sigHex string + saltHex string + }{ + { // Test values from this GIF https://github.com/CityOfZion/neon-wallet/pull/2390 . + msgHex: "436172616c686f2c206d756c65712c206f2062616775697520656820697373756d65726d6f2074616978206c696761646f206e61206d697373e36f3f", + pubKeyHex: "02ce6228ba2cb2fc235be93aff9cd5fc0851702eb9791552f60db062f01e3d83f6", + saltHex: "d41e348afccc2f3ee45cd9f5128b16dc", + sigHex: "90ab1886ca0bece59b982d9ade8f5598065d651362fb9ce45ad66d0474b89c0b80913c8f0118a282acbdf200a429ba2d81bc52534a53ab41a2c6dfe2f0b4fb1b", + }, + { // Test value from wallet connect integration test + msgHex: "313233343536", // ascii string "123456" + pubKeyHex: "03bd9108c0b49f657e9eee50d1399022bd1e436118e5b7529a1b7cd606652f578f", + saltHex: "2c5b189569e92cce12e1c640f23e83ba", + sigHex: "510caa8cb6db5dedf04d215a064208d64be7496916d890df59aee132db8f2b07532e06f7ea664c4a99e3bcb74b43a35eb9653891b5f8701d2aef9e7526703eaa", + }, + { // Test value from wallet connect integration test + msgHex: "", + pubKeyHex: "03bd9108c0b49f657e9eee50d1399022bd1e436118e5b7529a1b7cd606652f578f", + saltHex: "58c86b2e74215b4f36b47d731236be3b", + sigHex: "1e13f248962d8b3b60708b55ddf448d6d6a28c6b43887212a38b00bf6bab695e61261e54451c6e3d5f1f000e5534d166c7ca30f662a296d3a9aafa6d8c173c01", + }, + } { + pubKeyBin, err := hex.DecodeString(testCase.pubKeyHex) + require.NoError(t, err) + sig, err := hex.DecodeString(testCase.sigHex) + require.NoError(t, err) + salt, err := hex.DecodeString(testCase.saltHex) + require.NoError(t, err) + msg, err := hex.DecodeString(testCase.msgHex) + require.NoError(t, err) + + pubKey := ecdsa.PublicKey{Curve: elliptic.P256()} + pubKey.X, pubKey.Y = elliptic.UnmarshalCompressed(pubKey.Curve, pubKeyBin) + require.NotNil(t, pubKey.X) + require.True(t, verifyWalletConnect(&pubKey, msg, sig, salt), testCase) + } + +} diff --git a/crypto/example_test.go b/crypto/example_test.go index 38cfcf74..ddf6b1f8 100644 --- a/crypto/example_test.go +++ b/crypto/example_test.go @@ -1,7 +1,7 @@ package neofscrypto_test import ( - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" ) @@ -28,7 +28,7 @@ func ExampleSignature_Verify() { // Instances can be also used to process NeoFS API V2 protocol messages with [https://github.com/nspcc-dev/neofs-api] package. func ExampleSignature_marshalling() { - // import "github.com/nspcc-dev/neofs-api-go/v2/refs" + // import "github.com/nspcc-dev/neofs-sdk-go/api/refs" // On the client side. @@ -39,5 +39,5 @@ func ExampleSignature_marshalling() { // On the server side. - _ = sig.ReadFromV2(msg) + _ = sig.ReadFromV2(&msg) } diff --git a/crypto/signature.go b/crypto/signature.go index 28ec23c0..492a70b0 100644 --- a/crypto/signature.go +++ b/crypto/signature.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" ) // StablyMarshallable describes structs which can be marshalled transparently. @@ -16,13 +16,17 @@ type StablyMarshallable interface { // Signature represents a confirmation of data integrity received by the // digital signature mechanism. // -// Signature is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.Signature +// Signature is mutually compatible with github.com/nspcc-dev/neofs-sdk-go/api/refs.Signature // message. See ReadFromV2 / WriteToV2 methods. // // Note that direct typecast is not safe and may result in loss of compatibility: // // _ = Signature(refs.Signature{}) // not recommended -type Signature refs.Signature +type Signature struct { + scheme Scheme + pubKey []byte + val []byte +} // NewSignature is a Signature instance constructor. func NewSignature(scheme Scheme, publicKey PublicKey, value []byte) Signature { @@ -35,7 +39,7 @@ func NewSignature(scheme Scheme, publicKey PublicKey, value []byte) Signature { // message conforms to NeoFS API V2 protocol. // // See also WriteToV2. -func (x *Signature) ReadFromV2(m refs.Signature) error { +func (x *Signature) ReadFromV2(m *refs.Signature) error { bPubKey := m.GetKey() if len(bPubKey) == 0 { return errors.New("missing public key") @@ -46,12 +50,14 @@ func (x *Signature) ReadFromV2(m refs.Signature) error { return errors.New("missing signature") } - _, err := decodePublicKey(m) + _, err := decodePublicKey(Scheme(m.Scheme), m.Key) if err != nil { return err } - *x = Signature(m) + x.scheme = Scheme(m.Scheme) + x.pubKey = m.Key + x.val = m.Sign return nil } @@ -61,7 +67,9 @@ func (x *Signature) ReadFromV2(m refs.Signature) error { // // See also ReadFromV2. func (x Signature) WriteToV2(m *refs.Signature) { - *m = refs.Signature(x) + m.Scheme = refs.SignatureScheme(x.scheme) + m.Key = x.pubKey + m.Sign = x.val } // Calculate signs data using Signer and encodes public key for subsequent @@ -115,11 +123,9 @@ func (x *Signature) CalculateMarshalled(signer Signer, obj StablyMarshallable, b // // See also Calculate. func (x Signature) Verify(data []byte) bool { - m := refs.Signature(x) - - key, err := decodePublicKey(m) + key, err := decodePublicKey(x.scheme, x.pubKey) - return err == nil && key.Verify(data, m.GetSign()) + return err == nil && key.Verify(data, x.val) } func (x *Signature) fillSignature(signer Signer, signature []byte) { @@ -127,10 +133,9 @@ func (x *Signature) fillSignature(signer Signer, signature []byte) { } func (x *Signature) setFields(scheme Scheme, publicKey PublicKey, value []byte) { - m := (*refs.Signature)(x) - m.SetScheme(refs.SignatureScheme(scheme)) - m.SetSign(value) - m.SetKey(PublicKeyBytes(publicKey)) + x.scheme = scheme + x.val = value + x.pubKey = PublicKeyBytes(publicKey) } // Scheme returns signature scheme used by signer to calculate the signature. @@ -138,7 +143,7 @@ func (x *Signature) setFields(scheme Scheme, publicKey PublicKey, value []byte) // Scheme MUST NOT be called before [NewSignature], [Signature.ReadFromV2] or // [Signature.Calculate] methods. func (x Signature) Scheme() Scheme { - return Scheme((*refs.Signature)(&x).GetScheme()) + return x.scheme } // PublicKey returns public key of the signer which calculated the signature. @@ -148,7 +153,7 @@ func (x Signature) Scheme() Scheme { // // See also [Signature.PublicKeyBytes]. func (x Signature) PublicKey() PublicKey { - key, _ := decodePublicKey(refs.Signature(x)) + key, _ := decodePublicKey(x.scheme, x.pubKey) return key } @@ -163,7 +168,7 @@ func (x Signature) PublicKey() PublicKey { // // See also [Signature.PublicKey]. func (x Signature) PublicKeyBytes() []byte { - return (*refs.Signature)(&x).GetKey() + return x.pubKey } // Value returns calculated digital signature. @@ -174,12 +179,10 @@ func (x Signature) PublicKeyBytes() []byte { // Value MUST NOT be called before [NewSignature], [Signature.ReadFromV2] or // [Signature.Calculate] methods. func (x Signature) Value() []byte { - return (*refs.Signature)(&x).GetSign() + return x.val } -func decodePublicKey(m refs.Signature) (PublicKey, error) { - scheme := Scheme(m.GetScheme()) - +func decodePublicKey(scheme Scheme, b []byte) (PublicKey, error) { newPubKey, ok := publicKeys[scheme] if !ok { return nil, fmt.Errorf("unsupported scheme %d", scheme) @@ -187,7 +190,7 @@ func decodePublicKey(m refs.Signature) (PublicKey, error) { pubKey := newPubKey() - err := pubKey.Decode(m.GetKey()) + err := pubKey.Decode(b) if err != nil { return nil, fmt.Errorf("decode public key from binary: %w", err) } diff --git a/crypto/signature_test.go b/crypto/signature_test.go index 6e01fbe9..363296ee 100644 --- a/crypto/signature_test.go +++ b/crypto/signature_test.go @@ -3,10 +3,11 @@ package neofscrypto_test import ( "testing" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" "github.com/nspcc-dev/neofs-sdk-go/crypto/test" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) const anyUnsupportedScheme = neofscrypto.ECDSA_WALLETCONNECT + 1 @@ -33,34 +34,34 @@ func TestSignatureLifecycle(t *testing.T) { testSig(clientSig) - var sigV2 refs.Signature - clientSig.WriteToV2(&sigV2) + var apiSig refs.Signature + clientSig.WriteToV2(&apiSig) - require.Equal(t, refs.SignatureScheme(scheme), sigV2.GetScheme()) - require.Equal(t, bPubKey, sigV2.GetKey()) - require.Equal(t, clientSig.Value(), sigV2.GetSign()) + require.Equal(t, refs.SignatureScheme(scheme), apiSig.GetScheme()) + require.Equal(t, bPubKey, apiSig.GetKey()) + require.Equal(t, clientSig.Value(), apiSig.GetSign()) - // sigV2 transmitted to server over the network + // apiSig transmitted to server over the network var serverSig neofscrypto.Signature - err = serverSig.ReadFromV2(sigV2) + err = serverSig.ReadFromV2(&apiSig) require.NoError(t, err) testSig(serverSig) // break the message in different ways for i, breakSig := range []func(*refs.Signature){ - func(sigV2 *refs.Signature) { sigV2.SetScheme(refs.SignatureScheme(anyUnsupportedScheme)) }, - func(sigV2 *refs.Signature) { - key := sigV2.GetKey() - sigV2.SetKey(key[:len(key)-1]) + func(apiSig *refs.Signature) { apiSig.Scheme = refs.SignatureScheme(anyUnsupportedScheme) }, + func(apiSig *refs.Signature) { + key := apiSig.GetKey() + apiSig.Key = key[:len(key)-1] }, - func(sigV2 *refs.Signature) { sigV2.SetKey(append(sigV2.GetKey(), 1)) }, - func(sigV2 *refs.Signature) { sigV2.SetSign(nil) }, + func(apiSig *refs.Signature) { apiSig.Key = append(apiSig.GetKey(), 1) }, + func(apiSig *refs.Signature) { apiSig.Sign = nil }, } { - sigV2Cp := sigV2 - breakSig(&sigV2Cp) + sigV2Cp := proto.Clone(&apiSig).(*refs.Signature) + breakSig(sigV2Cp) err = serverSig.ReadFromV2(sigV2Cp) require.Errorf(t, err, "break func #%d", i) @@ -89,7 +90,7 @@ func TestNewSignature(t *testing.T) { var sig2 neofscrypto.Signature - err := sig2.ReadFromV2(sigMsg) + err := sig2.ReadFromV2(&sigMsg) require.NoError(t, err) checkFields(sig2) diff --git a/crypto/signer.go b/crypto/signer.go index 2fbe6ba1..ef7c7add 100644 --- a/crypto/signer.go +++ b/crypto/signer.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" ) // ErrIncorrectSigner is returned from function when the signer passed to it diff --git a/crypto/testdata/accounting_balance_request b/crypto/testdata/accounting_balance_request new file mode 100644 index 00000000..0773db66 --- /dev/null +++ b/crypto/testdata/accounting_balance_request @@ -0,0 +1 @@ +0a0c0a0a0a08616e795f7573657212ff010a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330323aa7010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230323a500a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c313032400540cd0140b1021a820612770a21037710bfe3582c41bce0326fbc7d2a776f3c5fefe383068903c1c3d22a56f54c921250b92988c699cbab9a4d4cdd4a28c1e2380dc537324f42f725976a7d94e01e71a88ea1add5e085b1767e64285025f60501f0273e53cf91b0db24777f6d8ac56eed6834d0b3d086f28730bdddce7335fd8018021a770a21037710bfe3582c41bce0326fbc7d2a776f3c5fefe383068903c1c3d22a56f54c921250c3d8fc6ae82b1dda808ef350eeb7e34f9e316992e87cec7b28cd16713d767f7325b552c8162cfb1fe70921a4d6b04649b5c32a68fd256e4390216102899066c7b14c28bb7419802d5744d2187a8a3fc91802228d0412670a21034e268fd0717614e4e96526d128a50ee6af517dc7a1bc6a4493f7940707001b52124005ce6e2974b937e072dc5753f78e38fb8dbbf9d5eb2cc4d4b0c16f55f84270ccd5dd88e6851f9ab8bcad3381bcf7358969d837c918fad97aa62dc0b7c31bc24718011a670a21034e268fd0717614e4e96526d128a50ee6af517dc7a1bc6a4493f7940707001b521240b35ebb18c95faa123935c378554d5fa82fdf451b4e511cf18c5c2c2feb34f8d680d11c060df16a921336e28653e96162dfbcff58e0e69d3dccad67f8869ed2d5180122b8020a660a210315068c68cca7f30f65fb6bfef343db13333b77c992d0c9231381f5f6337066df12410428acbcc836df64dbf4b3336908abc11f5f77ad84bf1a6efac149f18fca50632cbf4d8dadd75dc0dbbc288ef2706ed08b436799d81c993cd277ba4b095c7cafab12660a210315068c68cca7f30f65fb6bfef343db13333b77c992d0c9231381f5f6337066df1241045eae7facba8eb5664b2a1c9d6cb68b095749a1dd2bab6e11bb3247c3fef11ee12482820f2a2836110e98da657478b5d0d5fa1515ad2889202ddcdba6a3194aa91a660a210315068c68cca7f30f65fb6bfef343db13333b77c992d0c9231381f5f6337066df12410422e8e2e940089d1ac58002264773450e80090cb107950ba5b795f2fd4cdbac8491a7a1e7e52da558b3cf6a87d8d5f0044cd0919baa14068feb1f5ffdf094dbb2 \ No newline at end of file diff --git a/crypto/testdata/accounting_balance_request.json b/crypto/testdata/accounting_balance_request.json new file mode 100644 index 00000000..ddb7e9d1 --- /dev/null +++ b/crypto/testdata/accounting_balance_request.json @@ -0,0 +1,105 @@ +{ + "body": { + "ownerId": { + "value": "YW55X3VzZXI=" + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "magicNumber": "5" + }, + "magicNumber": "205" + }, + "magicNumber": "305" + }, + "verifyHeader": { + "metaSignature": { + "key": "A3cQv+NYLEG84DJvvH0qd288X+/jgwaJA8HD0ipW9UyS", + "signature": "uSmIxpnLq5pNTN1KKMHiOA3FNzJPQvcll2p9lOAecaiOoa3V4IWxdn5kKFAl9gUB8Cc+U8+RsNskd39tisVu7Wg00LPQhvKHML3dznM1/YA=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A3cQv+NYLEG84DJvvH0qd288X+/jgwaJA8HD0ipW9UyS", + "signature": "w9j8augrHdqAjvNQ7rfjT54xaZLofOx7KM0WcT12f3MltVLIFiz7H+cJIaTWsEZJtcMqaP0lbkOQIWECiZBmx7FMKLt0GYAtV0TSGHqKP8k=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "A04mj9BxdhTk6WUm0SilDuavUX3HobxqRJP3lAcHABtS", + "signature": "Bc5uKXS5N+By3FdT9444+427+dXrLMTUsMFvVfhCcMzV3YjmhR+auLytM4G89zWJadg3yRj62XqmLcC3wxvCRw==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "A04mj9BxdhTk6WUm0SilDuavUX3HobxqRJP3lAcHABtS", + "signature": "s167GMlfqhI5NcN4VU1fqC/fRRtOURzxjFwsL+s0+NaA0RwGDfFqkhM24oZT6WFi37z/WODmnT3MrWf4hp7S1Q==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AxUGjGjMp/MPZftr/vND2xMzO3fJktDJIxOB9fYzcGbf", + "signature": "BCisvMg232Tb9LMzaQirwR9fd62Evxpu+sFJ8Y/KUGMsv02NrdddwNu8KI7ycG7Qi0NnmdgcmTzSd7pLCVx8r6s=", + "scheme": "ECDSA_SHA512" + }, + "metaSignature": { + "key": "AxUGjGjMp/MPZftr/vND2xMzO3fJktDJIxOB9fYzcGbf", + "signature": "BF6uf6y6jrVmSyocnWy2iwlXSaHdK6tuEbsyR8P+8R7hJIKCDyooNhEOmNpldHi10NX6FRWtKIkgLdzbpqMZSqk=", + "scheme": "ECDSA_SHA512" + }, + "originSignature": { + "key": "AxUGjGjMp/MPZftr/vND2xMzO3fJktDJIxOB9fYzcGbf", + "signature": "BCLo4ulACJ0axYACJkdzRQ6ACQyxB5ULpbeV8v1M26yEkaeh5+UtpVizz2qH2NXwBEzQkZuqFAaP6x9f/fCU27I=", + "scheme": "ECDSA_SHA512" + } + } + } + } +} diff --git a/crypto/testdata/accounting_balance_response b/crypto/testdata/accounting_balance_response new file mode 100644 index 00000000..fdb82d6f --- /dev/null +++ b/crypto/testdata/accounting_balance_response @@ -0,0 +1 @@ +0a060a04080110021285020a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330322aab010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230322a520a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c3130323202086a320308ce01320308b2021a820612770a2102d4cd426ec4a20af51ef5a208cb259a5f77fd7f3996ac301952c5b810365cffc71250f4faef5e5f4a3e8e2becf57f8b9142a912fe1114b4c2b87bd3f0d7ecc2a6ab77db944eaf6e609dae35752a1fddef471456920bca530b3936c527fa0870b91f206a9b4314445430ef9fe66093491af52d18021a770a2102d4cd426ec4a20af51ef5a208cb259a5f77fd7f3996ac301952c5b810365cffc71250275c418648bd69d18cece9450c63f37b5e4ef2e2302f5b0d88c7d1b9c19932aa838323b1f50ea59a1e36a339c9db9533a1f105954b07f8597e1a4ff7aee6bc390b6143b21e04073e8c7aa7fe819d36af1802228d0412670a2103729ee725569a4edbb80e85969e1ea99ba85553886f12ad43eb740569e4234f55124098534a99b89f9670421916c4cde6ddedc8a846ed970158c2f0aafed8cfce64446793db9163cf9ca31eb70468aa1d8bace7181928a345e2620e64e8dc3252a03018011a670a2103729ee725569a4edbb80e85969e1ea99ba85553886f12ad43eb740569e4234f5512400e5e0f72c90a568f055d0dcb965741f2dedc4f7438e4804e5f64f07f5b71fe7036cf9b896b3bc68b8d8d81386cb0b365868db49807362bb36840eea02e22bd2b180122b8020a660a210331822bfb3c19a8d4718819af0430c28d6e4fa29f0d04eee92385c16838efbf2b124104eb4a0eb9c5f5883f55363b1057b5358263fdbdc21859d6768bc6be0869f704b72cc5ebc0ee5fb092b00a676de9172217355f1200f90770d306d22046b6d2ea7112660a210331822bfb3c19a8d4718819af0430c28d6e4fa29f0d04eee92385c16838efbf2b124104457428b27811eb7b900cbebdd2b70d7bd7509d460d41b955f02fc6a64bf9c8710dfa256731baaca1d014a6affb85485210e815914367b1b90753df1af8a4b2921a660a210331822bfb3c19a8d4718819af0430c28d6e4fa29f0d04eee92385c16838efbf2b124104592c0b604ea246611aa307b6fb35fa7d3e3eb4970e999a1706b22e2800f704216043d44525d7b8a7c0135ba2f32d7fcd443c5b34098d1dd0dd27da68f2b0abe4 \ No newline at end of file diff --git a/crypto/testdata/accounting_balance_response.json b/crypto/testdata/accounting_balance_response.json new file mode 100644 index 00000000..3435853d --- /dev/null +++ b/crypto/testdata/accounting_balance_response.json @@ -0,0 +1,118 @@ +{ + "body": { + "balance": { + "value": "1", + "precision": 2 + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "status": { + "code": 106, + "message": "", + "details": [] + } + }, + "status": { + "code": 206, + "message": "", + "details": [] + } + }, + "status": { + "code": 306, + "message": "", + "details": [] + } + }, + "verifyHeader": { + "metaSignature": { + "key": "AtTNQm7Eogr1HvWiCMslml93/X85lqwwGVLFuBA2XP/H", + "signature": "9PrvXl9KPo4r7PV/i5FCqRL+ERS0wrh70/DX7MKmq3fblE6vbmCdrjV1Kh/d70cUVpILylMLOTbFJ/oIcLkfIGqbQxREVDDvn+Zgk0ka9S0=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "AtTNQm7Eogr1HvWiCMslml93/X85lqwwGVLFuBA2XP/H", + "signature": "J1xBhki9adGM7OlFDGPze15O8uIwL1sNiMfRucGZMqqDgyOx9Q6lmh42oznJ25UzofEFlUsH+Fl+Gk/3rua8OQthQ7IeBAc+jHqn/oGdNq8=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "A3Ke5yVWmk7buA6Flp4eqZuoVVOIbxKtQ+t0BWnkI09V", + "signature": "mFNKmbiflnBCGRbEzebd7cioRu2XAVjC8Kr+2M/OZERnk9uRY8+cox63BGiqHYus5xgZKKNF4mIOZOjcMlKgMA==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "A3Ke5yVWmk7buA6Flp4eqZuoVVOIbxKtQ+t0BWnkI09V", + "signature": "Dl4PcskKVo8FXQ3LlldB8t7cT3Q45IBOX2Twf1tx/nA2z5uJazvGi42NgThssLNlho20mAc2K7NoQO6gLiK9Kw==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AzGCK/s8GajUcYgZrwQwwo1uT6KfDQTu6SOFwWg4778r", + "signature": "BOtKDrnF9Yg/VTY7EFe1NYJj/b3CGFnWdovGvghp9wS3LMXrwO5fsJKwCmdt6RciFzVfEgD5B3DTBtIgRrbS6nE=", + "scheme": "ECDSA_SHA512" + }, + "metaSignature": { + "key": "AzGCK/s8GajUcYgZrwQwwo1uT6KfDQTu6SOFwWg4778r", + "signature": "BEV0KLJ4Eet7kAy+vdK3DXvXUJ1GDUG5VfAvxqZL+chxDfolZzG6rKHQFKav+4VIUhDoFZFDZ7G5B1PfGvikspI=", + "scheme": "ECDSA_SHA512" + }, + "originSignature": { + "key": "AzGCK/s8GajUcYgZrwQwwo1uT6KfDQTu6SOFwWg4778r", + "signature": "BFksC2BOokZhGqMHtvs1+n0+PrSXDpmaFwayLigA9wQhYEPURSXXuKfAE1ui8y1/zUQ8WzQJjR3Q3SfaaPKwq+Q=", + "scheme": "ECDSA_SHA512" + } + } + } + } +} \ No newline at end of file diff --git a/crypto/testdata/container_delete_request b/crypto/testdata/container_delete_request new file mode 100644 index 00000000..ccbfc542 --- /dev/null +++ b/crypto/testdata/container_delete_request @@ -0,0 +1 @@ +0a320a0f0a0d616e795f636f6e7461696e6572121f0a0e616e795f7075626c69635f6b6579120d616e795f7369676e617475726512ff010a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330323aa7010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230323a500a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c313032400540cd0140b1021a820612770a210320e5e25693f53475c32f63b19313f1488467f1385a7d57a933020e67158373f31250968957299b6b9acc2e05a1fb59e272d7ccc9439970c854ecd9805be7775c7cb7159610544ecccd717c7d7ba26ad945c8fa3cebbbb66c2caf1c13e651aa3f3338d1caa410422175b358e9f032f5b38efc18021a770a210320e5e25693f53475c32f63b19313f1488467f1385a7d57a933020e67158373f312508c8765faf8fb59f85c8bb65bd8618a97afcee3f75bb5baab359967be723af9a133e3f4bca264510d90e7450a2faa0ecdbed3e0a41b92574a8c47a08f408e32a24deae3d3227f886921044b4b1f9839491802228d0412670a21033f3041fc93a73df665d0357d84721cdbbdaa40d0d2781a69e2ff29cd6ec29e941240c93564baafc5714e46c6e272946f0e4dcc7ec9d18f4423a202b66c811da38a27f6fcdca9d5f38f66a2b3ab27967559baf118952fbb0a44588120570a277cb88c18011a670a21033f3041fc93a73df665d0357d84721cdbbdaa40d0d2781a69e2ff29cd6ec29e941240e298f66d2b95a7321654d950165bcb1b1b977399add149ad22bf656c197397870574ece3941a597e1847470244cf11cac759c9a4e297b934209ccded8974eea5180122b8020a660a210291fa398b8447d5a5bc0b486e7cd2018df8d28f1ca96f1e138966bb644e418e3c12410418167800fb90e2fe9f3f8c2db45f26686300e43a34162837919bbb71d11e88e6388c9bc0a9edbe7079d9a9f4f2251eae9224fa93e2fc98e44d38f432ea23062d12660a210291fa398b8447d5a5bc0b486e7cd2018df8d28f1ca96f1e138966bb644e418e3c12410439a034a282e6ace2aa8157a18113fa19be554239756da800ba40fce2cc933fac7219212ce8cdd269ed67bbd7cf61966812548ece2c45cc028bf197705cfc7c021a660a210291fa398b8447d5a5bc0b486e7cd2018df8d28f1ca96f1e138966bb644e418e3c124104303d8eaa90a933f00b95fac2becf5d628c9b34f6ed5aeaf7976b757039b842130297f60cca0cd4150c071e1f964f3314089caff24f5ffc42a47ae07e37aed42f \ No newline at end of file diff --git a/crypto/testdata/container_delete_request.json b/crypto/testdata/container_delete_request.json new file mode 100644 index 00000000..477201b5 --- /dev/null +++ b/crypto/testdata/container_delete_request.json @@ -0,0 +1,106 @@ +{ + "body": { + "containerId": { + "value": "YW55X2NvbnRhaW5lcg==" + }, + "signature": { + "key": "YW55X3B1YmxpY19rZXk=", + "signature": "YW55X3NpZ25hdHVyZQ==" + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "magicNumber": "5" + }, + "magicNumber": "205" + }, + "magicNumber": "305" + }, + "verifyHeader": { + "metaSignature": { + "key": "AyDl4laT9TR1wy9jsZMT8UiEZ/E4Wn1XqTMCDmcVg3Pz", + "signature": "lolXKZtrmswuBaH7WeJy18zJQ5lwyFTs2YBb53dcfLcVlhBUTszNcXx9e6Jq2UXI+jzru7ZsLK8cE+ZRqj8zONHKpBBCIXWzWOnwMvWzjvw=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "AyDl4laT9TR1wy9jsZMT8UiEZ/E4Wn1XqTMCDmcVg3Pz", + "signature": "jIdl+vj7Wfhci7Zb2GGKl6/O4/dbtbqrNZlnvnI6+aEz4/S8omRRDZDnRQovqg7NvtPgpBuSV0qMR6CPQI4yok3q49Mif4hpIQRLSx+YOUk=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "Az8wQfyTpz32ZdA1fYRyHNu9qkDQ0ngaaeL/Kc1uwp6U", + "signature": "yTVkuq/FcU5GxuJylG8OTcx+ydGPRCOiArZsgR2jiif2/Nyp1fOPZqKzqyeWdVm68RiVL7sKRFiBIFcKJ3y4jA==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "Az8wQfyTpz32ZdA1fYRyHNu9qkDQ0ngaaeL/Kc1uwp6U", + "signature": "4pj2bSuVpzIWVNlQFlvLGxuXc5mt0UmtIr9lbBlzl4cFdOzjlBpZfhhHRwJEzxHKx1nJpOKXuTQgnM3tiXTupQ==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "ApH6OYuER9WlvAtIbnzSAY340o8cqW8eE4lmu2ROQY48", + "signature": "BBgWeAD7kOL+nz+MLbRfJmhjAOQ6NBYoN5Gbu3HRHojmOIybwKntvnB52an08iUerpIk+pPi/JjkTTj0MuojBi0=" + }, + "metaSignature": { + "key": "ApH6OYuER9WlvAtIbnzSAY340o8cqW8eE4lmu2ROQY48", + "signature": "BDmgNKKC5qziqoFXoYET+hm+VUI5dW2oALpA/OLMkz+schkhLOjN0mntZ7vXz2GWaBJUjs4sRcwCi/GXcFz8fAI=" + }, + "originSignature": { + "key": "ApH6OYuER9WlvAtIbnzSAY340o8cqW8eE4lmu2ROQY48", + "signature": "BDA9jqqQqTPwC5X6wr7PXWKMmzT27Vrq95drdXA5uEITApf2DMoM1BUMBx4flk8zFAicr/JPX/xCpHrgfjeu1C8=" + } + } + } + } +} diff --git a/crypto/testdata/container_delete_response b/crypto/testdata/container_delete_response new file mode 100644 index 00000000..9d89cef1 --- /dev/null +++ b/crypto/testdata/container_delete_response @@ -0,0 +1 @@ +0a001285020a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330322aab010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230322a520a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c3130323202086a320308ce01320308b2021a820612770a2103a28aaf53c37815e14401d76ffc6117334fab464771a5d6584ed1ebacdadc03ff1250354381a12221cef30c2dbc92c201759577570b02bb9d18d6779ff3363a0292a0159b3ba9d15a6e40e5f5ddaa64ae14a7f9b226a82e2f0032f83f7ac4df84a9e2eb1f04ea0bd5dde9ebac94b3f6d3266918021a770a2103a28aaf53c37815e14401d76ffc6117334fab464771a5d6584ed1ebacdadc03ff12507b94f1dd2db55a14a0947389b396fa24050bef4d2548e4487be4733fb2b217a2d5ce024190d49163b313e14342f3549e1d2ca0d28b8f61fc38e92a47f8869f6b071f323a32657d6d45e20aa1e30022241802228d0412670a210392e9e457de69ec7407bdc8d77981adb05a0d72481af75bfb36a0a162440b20e6124014391fb733992fe74a0fc094793184cebc236adf43ce7862a6185cd556065f9c40d302155a63fdcf9578a1b3113543810536652abccec1b0c9d7185a0abcf2d118011a670a210392e9e457de69ec7407bdc8d77981adb05a0d72481af75bfb36a0a162440b20e612402b54302a0d0b1c33048b428fb9e948585d408521a4d232c7e682bb1a41a8d9dea432575748a53784f363f0f8c3ec02db1d77fcb4382d2fe731acf30a00b71eda180122b8020a660a210313f29f29e4247595ee4669b15419eb2fa9137893d55b2b6b4aeeadf7f2903f04124104b08788dd722d3cf311fabd280a286c230a2f5aaca641a7dc41534c024cd6c19dd8fda82f85bda895ceaaa80ad0cf78ae5814355b448627ded9ec8f680aca5deb12660a210313f29f29e4247595ee4669b15419eb2fa9137893d55b2b6b4aeeadf7f2903f041241044cd0df8dc289d46bc758f45f4097727baad462f174354460628bddd172787f18d62aa3d944fe580b8d54731ecb37ec607049738c6fbcdf416110e973c158d6ed1a660a210313f29f29e4247595ee4669b15419eb2fa9137893d55b2b6b4aeeadf7f2903f041241048a3f26a23a546e2093d021cebad607c9c8c12c98dd78e31c0a6d3d92b2e7a47562ef74ccdbfe35db6723f2856a0f3bbfe5ff60fd5790f9b1e798870b8bf1683f \ No newline at end of file diff --git a/crypto/testdata/container_delete_response.json b/crypto/testdata/container_delete_response.json new file mode 100644 index 00000000..af509778 --- /dev/null +++ b/crypto/testdata/container_delete_response.json @@ -0,0 +1,104 @@ +{ + "body": {}, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "status": { + "code": 106 + } + }, + "status": { + "code": 206 + } + }, + "status": { + "code": 306 + } + }, + "verifyHeader": { + "metaSignature": { + "key": "A6KKr1PDeBXhRAHXb/xhFzNPq0ZHcaXWWE7R66za3AP/", + "signature": "NUOBoSIhzvMMLbySwgF1lXdXCwK7nRjWd5/zNjoCkqAVmzup0VpuQOX13apkrhSn+bImqC4vADL4P3rE34Sp4usfBOoL1d3p66yUs/bTJmk=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A6KKr1PDeBXhRAHXb/xhFzNPq0ZHcaXWWE7R66za3AP/", + "signature": "e5Tx3S21WhSglHOJs5b6JAUL700lSORIe+RzP7KyF6LVzgJBkNSRY7MT4UNC81SeHSyg0ouPYfw46SpH+IafawcfMjoyZX1tReIKoeMAIiQ=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "A5Lp5Ffeaex0B73I13mBrbBaDXJIGvdb+zagoWJECyDm", + "signature": "FDkftzOZL+dKD8CUeTGEzrwjat9Dznhiphhc1VYGX5xA0wIVWmP9z5V4obMRNUOBBTZlKrzOwbDJ1xhaCrzy0Q==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "A5Lp5Ffeaex0B73I13mBrbBaDXJIGvdb+zagoWJECyDm", + "signature": "K1QwKg0LHDMEi0KPuelIWF1AhSGk0jLH5oK7GkGo2d6kMldXSKU3hPNj8PjD7ALbHXf8tDgtL+cxrPMKALce2g==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AxPynynkJHWV7kZpsVQZ6y+pE3iT1Vsra0rurffykD8E", + "signature": "BLCHiN1yLTzzEfq9KAoobCMKL1qspkGn3EFTTAJM1sGd2P2oL4W9qJXOqqgK0M94rlgUNVtEhife2eyPaArKXes=" + }, + "metaSignature": { + "key": "AxPynynkJHWV7kZpsVQZ6y+pE3iT1Vsra0rurffykD8E", + "signature": "BEzQ343CidRrx1j0X0CXcnuq1GLxdDVEYGKL3dFyeH8Y1iqj2UT+WAuNVHMeyzfsYHBJc4xvvN9BYRDpc8FY1u0=" + }, + "originSignature": { + "key": "AxPynynkJHWV7kZpsVQZ6y+pE3iT1Vsra0rurffykD8E", + "signature": "BIo/JqI6VG4gk9AhzrrWB8nIwSyY3XjjHAptPZKy56R1Yu90zNv+NdtnI/KFag87v+X/YP1XkPmx55iHC4vxaD8=" + } + } + } + } +} diff --git a/crypto/testdata/container_get_request b/crypto/testdata/container_get_request new file mode 100644 index 00000000..1c426f89 --- /dev/null +++ b/crypto/testdata/container_get_request @@ -0,0 +1 @@ +0a110a0f0a0d616e795f636f6e7461696e657212ff010a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330323aa7010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230323a500a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c313032400540cd0140b1021a820612770a2103e941db649578ef4df430b629b2d6091687fefcc591b17751f4eb85e6b664a00712507bb90a4413daa29b4878e40158260f52d95f2f3430f4bcb53bbec40eeb1942f4f7bffb7f14dca889de5a93a6c55dfcca2470e4f1a1e10a85c683d3ffb480cc81edaa8150f8fcaa15d68df564d803989918021a770a2103e941db649578ef4df430b629b2d6091687fefcc591b17751f4eb85e6b664a0071250772ecadb7077d8f1c4ee76501ec1db3aa357066647d998bafcabbd6e97dffb8dd998d3d0f57e2af9b5b0a4becba0983e5cfef6c20f1c3f2e4a89242b9aaa4c2e562f203dbefee03e9056e7f02a236d6a1802228d0412670a210300752317890fd277093a38784f4a9574e4776221cd6307377a235eb179d40e961240bc333edb3c28ac4b8be83d78e4102eb4ff4f4f19a2a2461977558a173a3da92255bb2d49ae59028f550e3b7c23b4b6f1da0604e3f51b9fff4e97d98706ddcbbc18011a670a210300752317890fd277093a38784f4a9574e4776221cd6307377a235eb179d40e9612406537c4e03df2102c66105400d5b43ea602cbc8688ffccd988903e1d3a754a173f47562032d7ccc527a2b3f919cab16b6e9de79edc8a86ac9d4d29abf9b3c471a180122b8020a660a210395307dfab5efa6e5b4bcec2aaa2c166f2a80fa579161825620334b7ca5d7440c124104528fa129dc02833d0ec543d17ffc56b5fb93ada6250f417defe7e76103368aab6c6c6a10cc13ffbcf0975f0c7aba6dc38b603333ae5dc81071d37be207fdfb5412660a210395307dfab5efa6e5b4bcec2aaa2c166f2a80fa579161825620334b7ca5d7440c124104229b2877aee20aca6ce15d4bff2dd9b5ac6531f0061f3f46e5ec880baae7de49da320a544e9dff974c6eaaf8ffddfa47bed5d84ba88d38e9e37d00b4668bb5851a660a210395307dfab5efa6e5b4bcec2aaa2c166f2a80fa579161825620334b7ca5d7440c124104886ab600c56bf8ad0cc7c47774b82491697aa89d1940dcf08908e22361e480ada1f93942071c40f214e8b7d1fb357ac9b99ebf0db25e5bdb4375da393a2e8aec \ No newline at end of file diff --git a/crypto/testdata/container_get_request.json b/crypto/testdata/container_get_request.json new file mode 100644 index 00000000..8598f0fb --- /dev/null +++ b/crypto/testdata/container_get_request.json @@ -0,0 +1,105 @@ +{ + "body": { + "containerId": { + "value": "YW55X2NvbnRhaW5lcg==" + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "magicNumber": "5" + }, + "magicNumber": "205" + }, + "magicNumber": "305" + }, + "verifyHeader": { + "metaSignature": { + "key": "A+lB22SVeO9N9DC2KbLWCRaH/vzFkbF3UfTrhea2ZKAH", + "signature": "e7kKRBPaoptIeOQBWCYPUtlfLzQw9Ly1O77EDusZQvT3v/t/FNyoid5ak6bFXfzKJHDk8aHhCoXGg9P/tIDMge2qgVD4/KoV1o31ZNgDmJk=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A+lB22SVeO9N9DC2KbLWCRaH/vzFkbF3UfTrhea2ZKAH", + "signature": "dy7K23B32PHE7nZQHsHbOqNXBmZH2Zi6/Ku9bpff+43ZmNPQ9X4q+bWwpL7LoJg+XP72wg8cPy5KiSQrmqpMLlYvID2+/uA+kFbn8CojbWo=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "AwB1IxeJD9J3CTo4eE9KlXTkd2IhzWMHN3ojXrF51A6W", + "signature": "vDM+2zworEuL6D145BAutP9PTxmiokYZd1WKFzo9qSJVuy1JrlkCj1UOO3wjtLbx2gYE4/Ubn/9Ol9mHBt3LvA==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "AwB1IxeJD9J3CTo4eE9KlXTkd2IhzWMHN3ojXrF51A6W", + "signature": "ZTfE4D3yECxmEFQA1bQ+pgLLyGiP/M2YiQPh06dUoXP0dWIDLXzMUnorP5Gcqxa26d557cioasnU0pq/mzxHGg==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "A5Uwffq176bltLzsKqosFm8qgPpXkWGCViAzS3yl10QM", + "signature": "BFKPoSncAoM9DsVD0X/8VrX7k62mJQ9Bfe/n52EDNoqrbGxqEMwT/7zwl18Merptw4tgMzOuXcgQcdN74gf9+1Q=", + "scheme": "ECDSA_SHA512" + }, + "metaSignature": { + "key": "A5Uwffq176bltLzsKqosFm8qgPpXkWGCViAzS3yl10QM", + "signature": "BCKbKHeu4grKbOFdS/8t2bWsZTHwBh8/RuXsiAuq595J2jIKVE6d/5dMbqr4/936R77V2EuojTjp430AtGaLtYU=", + "scheme": "ECDSA_SHA512" + }, + "originSignature": { + "key": "A5Uwffq176bltLzsKqosFm8qgPpXkWGCViAzS3yl10QM", + "signature": "BIhqtgDFa/itDMfEd3S4JJFpeqidGUDc8IkI4iNh5ICtofk5QgccQPIU6LfR+zV6ybmevw2yXlvbQ3XaOTouiuw=", + "scheme": "ECDSA_SHA512" + } + } + } + } +} diff --git a/crypto/testdata/container_get_response b/crypto/testdata/container_get_response new file mode 100644 index 00000000..1088fcc4 --- /dev/null +++ b/crypto/testdata/container_get_response @@ -0,0 +1 @@ +0ac7010a570a0408011002120a0a08616e795f757365721a09616e795f6e6f6e636520032a160a09617474725f6b6579311209617474725f76616c312a160a09617474725f6b6579321209617474725f76616c3232060a0208041005121f0a0e616e795f7075626c69635f6b6579120d616e795f7369676e61747572651a4b0a360a09616e795f746f6b656e120a0a08616e795f757365721a06080310021801220f616e795f73657373696f6e5f6b657932040802100112110a0d616e795f7369676e617475726518011285020a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330322aab010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230322a520a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c3130323202086a320308ce01320308b2021a820612770a210347e61f7befaa29e2946f8258fd1b0594172a5bb5f018531225e01150110dfde212508cd23e926cc95b03904d7d9ef616c9ea63acf5c33e1a35f3697f7555bea75b09593307827b9a8fafdd7c682d58e51f1120d7ea0a0969c66c1e29942f6e84104b2b171091686a9f25dfc1b6843697a5f918021a770a210347e61f7befaa29e2946f8258fd1b0594172a5bb5f018531225e01150110dfde2125068c8f55582ed44ef5903cff7eb087ecb322787cc1bea3f06de6c17d0986f1ebfb0a1c52d24c9d99eea7b0a11185abb056fde633ba277d8ad2e991a7c7fd17d980b8b15b08c712c0afb86be6bd3fc76851802228d0412670a2102ba46a641eea026deed3ebf826b9da36beef49198bee6c90b671b403361d4c5c1124084b540a86f07ff0741f13603f02be764480322474fc32776588013b1e0cceaecb2dc73514a23d50280942df4e94c7c13d16e7ff1f15c0d0865e7d1099a20295418011a670a2102ba46a641eea026deed3ebf826b9da36beef49198bee6c90b671b403361d4c5c1124037fe07c4b6019e64c0f65a03ab1596cb6d1ed2b151ccb8aa6fda4395426e8fb9ad7706378bff11d986e4fe39b245041ef374e35f36c846a165bc3aa7929ac26f180122b8020a660a2103eea345b5ab9b84e208996e097221fa0c02d771cae877463fd13c04da4686a97a1241048302ad6712ca68c7766b7cb0175d6a1a1fc7052b890c6ff8cc7693dc3c8cfdd963970aae0e7e370234edfaae2d5b4d41d2087c157a4cf00270f4d8fa92b2a0b112660a2103eea345b5ab9b84e208996e097221fa0c02d771cae877463fd13c04da4686a97a1241047af1b1cf600fec4d7ce2be597ed6c0f44e5ad16818e0410ef1bdacb3df8c4a9851e1a09948628ada51f98d0f8ef9bc2736a20c6bbfbdefea19ae6c5efd49f4f41a660a2103eea345b5ab9b84e208996e097221fa0c02d771cae877463fd13c04da4686a97a124104f7471aa5ab60b92bb17944477c302eeb26b0eee53ecd347b8c7cca4dcd8d30ee962d541f6dd6a69fae63407fccbc4c6446facf9eb273ca39102979db04f917df \ No newline at end of file diff --git a/crypto/testdata/container_get_response.json b/crypto/testdata/container_get_response.json new file mode 100644 index 00000000..aecaa4be --- /dev/null +++ b/crypto/testdata/container_get_response.json @@ -0,0 +1,163 @@ +{ + "body": { + "container": { + "version": { + "major": 1, + "minor": 2 + }, + "ownerID": { + "value": "YW55X3VzZXI=" + }, + "nonce": "YW55X25vbmNl", + "basicACL": 3, + "attributes": [ + { + "key": "attr_key1", + "value": "attr_val1" + }, + { + "key": "attr_key2", + "value": "attr_val2" + } + ], + "placementPolicy": { + "replicas": [ + { + "count": 4 + } + ], + "containerBackupFactor": 5 + } + }, + "signature": { + "key": "YW55X3B1YmxpY19rZXk=", + "signature": "YW55X3NpZ25hdHVyZQ==" + }, + "sessionToken": { + "body": { + "id": "YW55X3Rva2Vu", + "ownerID": { + "value": "YW55X3VzZXI=" + }, + "lifetime": { + "exp": "3", + "nbf": "2", + "iat": "1" + }, + "sessionKey": "YW55X3Nlc3Npb25fa2V5", + "container": { + "verb": "DELETE", + "wildcard": true + } + }, + "signature": { + "key": "YW55X3NpZ25hdHVyZQ==", + "scheme": "ECDSA_RFC6979_SHA256" + } + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "status": { + "code": 106 + } + }, + "status": { + "code": 206 + } + }, + "status": { + "code": 306 + } + }, + "verifyHeader": { + "metaSignature": { + "key": "A0fmH3vvqinilG+CWP0bBZQXKlu18BhTEiXgEVARDf3i", + "signature": "jNI+kmzJWwOQTX2e9hbJ6mOs9cM+GjXzaX91Vb6nWwlZMweCe5qPr918aC1Y5R8RINfqCglpxmweKZQvboQQSysXEJFoap8l38G2hDaXpfk=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A0fmH3vvqinilG+CWP0bBZQXKlu18BhTEiXgEVARDf3i", + "signature": "aMj1VYLtRO9ZA8/36wh+yzInh8wb6j8G3mwX0JhvHr+wocUtJMnZnup7ChEYWrsFb95jO6J32K0umRp8f9F9mAuLFbCMcSwK+4a+a9P8doU=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "ArpGpkHuoCbe7T6/gmudo2vu9JGYvubJC2cbQDNh1MXB", + "signature": "hLVAqG8H/wdB8TYD8CvnZEgDIkdPwyd2WIATseDM6uyy3HNRSiPVAoCULfTpTHwT0W5/8fFcDQhl59EJmiApVA==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "ArpGpkHuoCbe7T6/gmudo2vu9JGYvubJC2cbQDNh1MXB", + "signature": "N/4HxLYBnmTA9loDqxWWy20e0rFRzLiqb9pDlUJuj7mtdwY3i/8R2Ybk/jmyRQQe83TjXzbIRqFlvDqnkprCbw==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "A+6jRbWrm4TiCJluCXIh+gwC13HK6HdGP9E8BNpGhql6", + "signature": "BIMCrWcSymjHdmt8sBddahofxwUriQxv+Mx2k9w8jP3ZY5cKrg5+NwI07fquLVtNQdIIfBV6TPACcPTY+pKyoLE=", + "scheme": "ECDSA_SHA512" + }, + "metaSignature": { + "key": "A+6jRbWrm4TiCJluCXIh+gwC13HK6HdGP9E8BNpGhql6", + "signature": "BHrxsc9gD+xNfOK+WX7WwPROWtFoGOBBDvG9rLPfjEqYUeGgmUhiitpR+Y0Pjvm8JzaiDGu/ve/qGa5sXv1J9PQ=", + "scheme": "ECDSA_SHA512" + }, + "originSignature": { + "key": "A+6jRbWrm4TiCJluCXIh+gwC13HK6HdGP9E8BNpGhql6", + "signature": "BPdHGqWrYLkrsXlER3wwLusmsO7lPs00e4x8yk3NjTDuli1UH23Wpp+uY0B/zLxMZEb6z56yc8o5ECl52wT5F98=", + "scheme": "ECDSA_SHA512" + } + } + } + } +} diff --git a/crypto/testdata/container_list_request b/crypto/testdata/container_list_request new file mode 100644 index 00000000..190dc779 --- /dev/null +++ b/crypto/testdata/container_list_request @@ -0,0 +1 @@ +0a0c0a0a0a08616e795f7573657212ff010a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330323aa7010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230323a500a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c313032400540cd0140b1021a820612770a2103c420d89f7325239189821b60afd8ab4ab8e45214b202c05ee49e398238360f1612501d9ad4c7e5e9f624630db81ab26afa330bfae69d65c9c7e3da796eb3d026361e4a09d9b83451e53eff279d7105c7b04034a4d8766d0f6d8cd964936565c9252ffa8ccd8d1ac3a304bef22eb6515ce53518021a770a2103c420d89f7325239189821b60afd8ab4ab8e45214b202c05ee49e398238360f1612507e4dee13f5808ea031e17a1938cdb8992f68e0282636c8394b04a40f85f2ef67384558b1af9a0b2f918caf5877dfc567b1ee40c24901f31bd8d8e1411e1bd685014f499d6ca4ed5bbbfa04c6c8da18f41802228d0412670a210374d42c725011c485560c9e7e31435d1f0cd2d23db88a2da14871f42b6de89a6f12400b0238f6c5cf08086fdaf909eb1b52c99cd4b3b9f05fcd9da911b08073747aa9530ac42d6975e15071ad85b37abecc919a84077211301712c8332b64894f9e0918011a670a210374d42c725011c485560c9e7e31435d1f0cd2d23db88a2da14871f42b6de89a6f124078eae8d07060dd06f1ed054950fed38f16ec29ec0ed3ddc9982cef690348d58172ae0874360c7e998c7738d0912c67a1d90419200487704f0546f1491a3c3e93180122b8020a660a2102f686952ddf9d3f05f29bd42c5b0a521f89fc32ffd44a91efe16e6a803829d851124104fcf6c3a0fcd6db22778633c21e76898c7991259abe1d4884eaeb78a760944d320af23e0f68f8315f47e63513aac97dc32a83a6834d8436b7aa77b35cbc8f395912660a2102f686952ddf9d3f05f29bd42c5b0a521f89fc32ffd44a91efe16e6a803829d851124104c3b0eb9eea365a9f1f052d674d69d403cf79354c96e63469b2a52ff43802eca36635903eade660492fea6820de4836cefde92d15120a5b44efacebaae5437b401a660a2102f686952ddf9d3f05f29bd42c5b0a521f89fc32ffd44a91efe16e6a803829d85112410489d53accd6109009734b1f8684b30254c9418635843a823f4808f386cb0e169a8d7e1c4d23d9b23289826bafacb498aa76a4bc52f1860288ed951cf732f42672 \ No newline at end of file diff --git a/crypto/testdata/container_list_request.json b/crypto/testdata/container_list_request.json new file mode 100644 index 00000000..f0b89e90 --- /dev/null +++ b/crypto/testdata/container_list_request.json @@ -0,0 +1,102 @@ +{ + "body": { + "ownerId": { + "value": "YW55X3VzZXI=" + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "magicNumber": "5" + }, + "magicNumber": "205" + }, + "magicNumber": "305" + }, + "verifyHeader": { + "metaSignature": { + "key": "A8Qg2J9zJSORiYIbYK/Yq0q45FIUsgLAXuSeOYI4Ng8W", + "signature": "HZrUx+Xp9iRjDbgasmr6Mwv65p1lycfj2nlus9AmNh5KCdm4NFHlPv8nnXEFx7BANKTYdm0PbYzZZJNlZcklL/qMzY0aw6MEvvIutlFc5TU=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A8Qg2J9zJSORiYIbYK/Yq0q45FIUsgLAXuSeOYI4Ng8W", + "signature": "fk3uE/WAjqAx4XoZOM24mS9o4CgmNsg5SwSkD4Xy72c4RVixr5oLL5GMr1h338Vnse5AwkkB8xvY2OFBHhvWhQFPSZ1spO1bu/oExsjaGPQ=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "A3TULHJQEcSFVgyefjFDXR8M0tI9uIotoUhx9Ctt6Jpv", + "signature": "CwI49sXPCAhv2vkJ6xtSyZzUs7nwX82dqRGwgHN0eqlTCsQtaXXhUHGthbN6vsyRmoQHchEwFxLIMytkiU+eCQ==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "A3TULHJQEcSFVgyefjFDXR8M0tI9uIotoUhx9Ctt6Jpv", + "signature": "eOro0HBg3Qbx7QVJUP7TjxbsKewO093JmCzvaQNI1YFyrgh0Ngx+mYx3ONCRLGeh2QQZIASHcE8FRvFJGjw+kw==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AvaGlS3fnT8F8pvULFsKUh+J/DL/1EqR7+FuaoA4KdhR", + "signature": "BPz2w6D81tsid4Yzwh52iYx5kSWavh1IhOrreKdglE0yCvI+D2j4MV9H5jUTqsl9wyqDpoNNhDa3qnezXLyPOVk=" + }, + "metaSignature": { + "key": "AvaGlS3fnT8F8pvULFsKUh+J/DL/1EqR7+FuaoA4KdhR", + "signature": "BMOw657qNlqfHwUtZ01p1APPeTVMluY0abKlL/Q4AuyjZjWQPq3mYEkv6mgg3kg2zv3pLRUSCltE76zrquVDe0A=" + }, + "originSignature": { + "key": "AvaGlS3fnT8F8pvULFsKUh+J/DL/1EqR7+FuaoA4KdhR", + "signature": "BInVOszWEJAJc0sfhoSzAlTJQYY1hDqCP0gI84bLDhaajX4cTSPZsjKJgmuvrLSYqnakvFLxhgKI7ZUc9zL0JnI=" + } + } + } + } +} diff --git a/crypto/testdata/container_list_response b/crypto/testdata/container_list_response new file mode 100644 index 00000000..10f4043b --- /dev/null +++ b/crypto/testdata/container_list_response @@ -0,0 +1 @@ +0a240a100a0e616e795f636f6e7461696e6572310a100a0e616e795f636f6e7461696e6572321285020a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330322aab010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230322a520a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c3130323202086a320308ce01320308b2021a820612770a2102b571f51f3d32899c0abe04d71d0ce9d0a1d08b8730d858b345b1062d3ad7028e12502c601646b1ff9da95568540bb5c3079c8687bac21c60fa9a872e17369579b0f546826d7bb5993b7a64f438997446b7107c10d845bc44b1a4bdc49fcdcd86ef4093dc2d2805596831ab8ce3e83a0c8ccb18021a770a2102b571f51f3d32899c0abe04d71d0ce9d0a1d08b8730d858b345b1062d3ad7028e1250c72a0453c9fec7a3a971b2ae3bf5881cdca4b304ccf1d371c21d7bbe5639d3dbbb4f200549eb04d9caf832b4844929c6e88e187acf1a57df41cb754ae12ff1a62adad5cf35d28725982cc6d3520870fc1802228d0412670a210313a6a1e5cd92d204e2ec553e08077d2a565bf6d5e5e4c840b61d6aa5f93725de12400eb2612fe349a7d5c3d1bfe10c832107ca7c0245b5d96cc7fd53b813362032247a596c3842551a538952cdf48ce2cf27380a7dab689e3d8d4f184135621a9e3818011a670a210313a6a1e5cd92d204e2ec553e08077d2a565bf6d5e5e4c840b61d6aa5f93725de1240b1ac2bd53b80e6639381d11a27366dbde4e836c4086e14c00de5d4fdce7e09312894102b8e61c912218ddf8c6fe7ebd921e127091f05a7e02f0960bab7507265180122b8020a660a2102c0d65517cb51b16d67183e6590cf20baaa45a14a8177f52ce8776fa45f18fba0124104a83146819265d9661cff0862b1a9bc2871910b24adf7df4211c5c5d1dc8f170233f1cffef8c4dd1440e7bcd9c1c0bfdaeb3a2ecccff63fdac48ed0c7730822eb12660a2102c0d65517cb51b16d67183e6590cf20baaa45a14a8177f52ce8776fa45f18fba012410466a9060251ff155eb16060e295be2304f981f49f2f7d66b49096662086c0a31724a7155dce21f763c6abcda38d99d8c9557aced3503abaf6c213edf8c94be6db1a660a2102c0d65517cb51b16d67183e6590cf20baaa45a14a8177f52ce8776fa45f18fba0124104ab0d6e479628e899b943ac7556f95780fd29457b41e40700d0600012e14117d6a0bcfd1fb55e9dc805eba128819d05c60b2f5aaf371a5fd58bc578a0896244ee \ No newline at end of file diff --git a/crypto/testdata/container_list_response.json b/crypto/testdata/container_list_response.json new file mode 100644 index 00000000..ab907af0 --- /dev/null +++ b/crypto/testdata/container_list_response.json @@ -0,0 +1,113 @@ +{ + "body": { + "containerIds": [ + { + "value": "YW55X2NvbnRhaW5lcjE=" + }, + { + "value": "YW55X2NvbnRhaW5lcjI=" + } + ] + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "status": { + "code": 106 + } + }, + "status": { + "code": 206 + } + }, + "status": { + "code": 306 + } + }, + "verifyHeader": { + "metaSignature": { + "key": "ArVx9R89MomcCr4E1x0M6dCh0IuHMNhYs0WxBi061wKO", + "signature": "LGAWRrH/nalVaFQLtcMHnIaHusIcYPqahy4XNpV5sPVGgm17tZk7emT0OJl0RrcQfBDYRbxEsaS9xJ/NzYbvQJPcLSgFWWgxq4zj6DoMjMs=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "ArVx9R89MomcCr4E1x0M6dCh0IuHMNhYs0WxBi061wKO", + "signature": "xyoEU8n+x6OpcbKuO/WIHNykswTM8dNxwh17vlY509u7TyAFSesE2cr4MrSESSnG6I4Yes8aV99By3VK4S/xpira1c810oclmCzG01IIcPw=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "AxOmoeXNktIE4uxVPggHfSpWW/bV5eTIQLYdaqX5NyXe", + "signature": "DrJhL+NJp9XD0b/hDIMhB8p8AkW12WzH/VO4EzYgMiR6WWw4QlUaU4lSzfSM4s8nOAp9q2iePY1PGEE1YhqeOA==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "AxOmoeXNktIE4uxVPggHfSpWW/bV5eTIQLYdaqX5NyXe", + "signature": "sawr1TuA5mOTgdEaJzZtveToNsQIbhTADeXU/c5+CTEolBArjmHJEiGN34xv5+vZIeEnCR8Fp+AvCWC6t1ByZQ==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AsDWVRfLUbFtZxg+ZZDPILqqRaFKgXf1LOh3b6RfGPug", + "signature": "BKgxRoGSZdlmHP8IYrGpvChxkQskrfffQhHFxdHcjxcCM/HP/vjE3RRA57zZwcC/2us6LszP9j/axI7Qx3MIIus=" + }, + "metaSignature": { + "key": "AsDWVRfLUbFtZxg+ZZDPILqqRaFKgXf1LOh3b6RfGPug", + "signature": "BGapBgJR/xVesWBg4pW+IwT5gfSfL31mtJCWZiCGwKMXJKcVXc4h92PGq82jjZnYyVV6ztNQOrr2whPt+MlL5ts=" + }, + "originSignature": { + "key": "AsDWVRfLUbFtZxg+ZZDPILqqRaFKgXf1LOh3b6RfGPug", + "signature": "BKsNbkeWKOiZuUOsdVb5V4D9KUV7QeQHANBgABLhQRfWoLz9H7VencgF66EogZ0FxgsvWq83Gl/Vi8V4oIliRO4=" + } + } + } + } +} diff --git a/crypto/testdata/container_put_request b/crypto/testdata/container_put_request new file mode 100644 index 00000000..cf7c4073 --- /dev/null +++ b/crypto/testdata/container_put_request @@ -0,0 +1 @@ +0a7a0a570a0408011002120a0a08616e795f757365721a09616e795f6e6f6e636520032a160a09617474725f6b6579311209617474725f76616c312a160a09617474725f6b6579321209617474725f76616c3232060a0208041005121f0a0e616e795f7075626c69635f6b6579120d616e795f7369676e617475726512ff010a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330323aa7010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230323a500a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c313032406940cd0140b1021a820612770a2103ddabfc510d599fdcb3c21318cb2d680d99fa44c27ed2a1a8ee310e6193fc1e5f1250a9e87d1470818eeed2ddefa0e1cd01c0b7f6d1e0301dca3c7f2de6c07e26dcb236ebbe5e131eceda54f3936ea6db364ce59d464bb83674f25c26ac491591659279c956eeb4c15875fbca7cd69779183018021a770a2103ddabfc510d599fdcb3c21318cb2d680d99fa44c27ed2a1a8ee310e6193fc1e5f1250a9dcdc33b992706efff69dab9165d675db3a6f491b49ab5f29d87dc3ace5903bd97fd1dc213ea4c1ee30ac02ffca1dbc49047ac84b9448c83e5ab7425206ec364ffdc095ef625a470abaf058ef79cdda1802228d0412670a21025a7f21f36f86933c8d1bc7d3699f93eecde7ad6696f49d418cc66fd413d16b1c124095a28864d922ab91e8596904d2cae02b60d336c135b9a494b8d293c872370529d115d75e29d00c9795605874274a1e1f5d2353a239cc9f20a5c6cab0c9987a5118011a670a21025a7f21f36f86933c8d1bc7d3699f93eecde7ad6696f49d418cc66fd413d16b1c124069df0fd9f22d50181a2a1ba12ba90ac8c55c1874c88b3ee81fcc37cfc31e0310a8ccd015a79b0f28078ea2de454614e28676ef91d48db9868839e7940513417a180122b8020a660a21021b30214fb6dd011fe7d24699f881f3dde86356aded366c268af280c78a9441d0124104ec203c99e715eadae3ecdef6431d74ec88e93f37120b94b0adb57602cf19662e64212434b48a006787dd13beff6a56f767dd5482fb33424b67e3ca96bb26fe8b12660a21021b30214fb6dd011fe7d24699f881f3dde86356aded366c268af280c78a9441d0124104719bcf576a6aabcddd75aa17cb5c50f299cdf713b03eb4e4597cf90472966b9f6717eca14936bb3e500ef0f02464babada5d0b6eaa1b2a19f8bf05049192b6be1a660a21021b30214fb6dd011fe7d24699f881f3dde86356aded366c268af280c78a9441d0124104288e9800ef86f69c2342020cfa5e59be040b81044b6fdf29bb7c35056152e9bad6487cfa97643d43fe24a12a70bae0d3bc68ddfb2ad732b9a0028c4e3a4f8d35 \ No newline at end of file diff --git a/crypto/testdata/container_put_request.json b/crypto/testdata/container_put_request.json new file mode 100644 index 00000000..cec45cd1 --- /dev/null +++ b/crypto/testdata/container_put_request.json @@ -0,0 +1,135 @@ +{ + "body": { + "container": { + "version": { + "major": 1, + "minor": 2 + }, + "ownerID": { + "value": "YW55X3VzZXI=" + }, + "nonce": "YW55X25vbmNl", + "basicACL": 3, + "attributes": [ + { + "key": "attr_key1", + "value": "attr_val1" + }, + { + "key": "attr_key2", + "value": "attr_val2" + } + ], + "placementPolicy": { + "replicas": [ + { + "count": 4 + } + ], + "containerBackupFactor": 5 + } + }, + "signature": { + "key": "YW55X3B1YmxpY19rZXk=", + "signature": "YW55X3NpZ25hdHVyZQ==" + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "magicNumber": "105" + }, + "magicNumber": "205" + }, + "magicNumber": "305" + }, + "verifyHeader": { + "metaSignature": { + "key": "A92r/FENWZ/cs8ITGMstaA2Z+kTCftKhqO4xDmGT/B5f", + "signature": "qeh9FHCBju7S3e+g4c0BwLf20eAwHco8fy3mwH4m3LI2675eEx7O2lTzk26m2zZM5Z1GS7g2dPJcJqxJFZFlknnJVu60wVh1+8p81pd5GDA=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A92r/FENWZ/cs8ITGMstaA2Z+kTCftKhqO4xDmGT/B5f", + "signature": "qdzcM7mScG7/9p2rkWXWdds6b0kbSatfKdh9w6zlkDvZf9HcIT6kwe4wrAL/yh28SQR6yEuUSMg+WrdCUgbsNk/9wJXvYlpHCrrwWO95zdo=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "Alp/IfNvhpM8jRvH02mfk+7N561mlvSdQYzGb9QT0Wsc", + "signature": "laKIZNkiq5HoWWkE0srgK2DTNsE1uaSUuNKTyHI3BSnRFddeKdAMl5VgWHQnSh4fXSNTojnMnyClxsqwyZh6UQ==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "Alp/IfNvhpM8jRvH02mfk+7N561mlvSdQYzGb9QT0Wsc", + "signature": "ad8P2fItUBgaKhuhK6kKyMVcGHTIiz7oH8w3z8MeAxCozNAVp5sPKAeOot5FRhTihnbvkdSNuYaIOeeUBRNBeg==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AhswIU+23QEf59JGmfiB893oY1at7TZsJorygMeKlEHQ", + "signature": "BOwgPJnnFera4+ze9kMddOyI6T83EguUsK21dgLPGWYuZCEkNLSKAGeH3RO+/2pW92fdVIL7M0JLZ+PKlrsm/os=", + "scheme": "ECDSA_SHA512" + }, + "metaSignature": { + "key": "AhswIU+23QEf59JGmfiB893oY1at7TZsJorygMeKlEHQ", + "signature": "BHGbz1dqaqvN3XWqF8tcUPKZzfcTsD605Fl8+QRylmufZxfsoUk2uz5QDvDwJGS6utpdC26qGyoZ+L8FBJGStr4=", + "scheme": "ECDSA_SHA512" + }, + "originSignature": { + "key": "AhswIU+23QEf59JGmfiB893oY1at7TZsJorygMeKlEHQ", + "signature": "BCiOmADvhvacI0ICDPpeWb4EC4EES2/fKbt8NQVhUum61kh8+pdkPUP+JKEqcLrg07xo3fsq1zK5oAKMTjpPjTU=", + "scheme": "ECDSA_SHA512" + } + } + } + } +} diff --git a/crypto/testdata/container_put_response b/crypto/testdata/container_put_response new file mode 100644 index 00000000..6f39e40d --- /dev/null +++ b/crypto/testdata/container_put_response @@ -0,0 +1 @@ +0a110a0f0a0d616e795f636f6e7461696e65721285020a0608c90110ca0110b00218af0222200a0e786865616465725f6b6579333031120e786865616465725f76616c33303122200a0e786865616465725f6b6579333032120e786865616465725f76616c3330322aab010a0608c90110ca0110cc0118cb0122200a0e786865616465725f6b6579323031120e786865616465725f76616c32303122200a0e786865616465725f6b6579323032120e786865616465725f76616c3230322a520a04086510661068186722200a0e786865616465725f6b6579313031120e786865616465725f76616c31303122200a0e786865616465725f6b6579313032120e786865616465725f76616c3130323202086a320308ce01320308b2021a820612770a2103ff7443d4dd5fb61adac51c69c4d5893c1fce0de01e8405aff855d7c8111ef2c612501767dd91f6a0caf8aabefb15d798f886682cbd3172c41c95a6bb8642491a9f19ade074d46c97095051bef309f34a945d490db363b900e9dc1fef24660f34ec023a3881ec2be0133fd4b9f5aa5d16bae218021a770a2103ff7443d4dd5fb61adac51c69c4d5893c1fce0de01e8405aff855d7c8111ef2c61250852a9fb2862efa8b169f6ef442c071e41f37aead6932c20abb01a0a3e250513cbbfe7d50a770141ded35b01a62ce398c188a26afcb03ab54cac5dfd9675b3bc20d8732b9077749bd8bc32ab7b6f7452a1802228d0412670a2103c5ca01b42cb0a5f2b63d6c118a9c77ceae0f44649aafb5bfbca83d3f42849c671240cb1846293c4af56e006c31c1c35ce7031605a3c07a7638a7af94e92e328f38da20d0d2216ffae2944d3778cde5d4dccf2ba7ab5f162473e0d79790ea2ff01f8918011a670a2103c5ca01b42cb0a5f2b63d6c118a9c77ceae0f44649aafb5bfbca83d3f42849c6712407469c3fd54c983eb6fe05008a361605b1145728fdd15488c3b87b43d1e0362a3bbadf2b10f4dfaf2f11bf3c9339eaad7748616686971502aa4871b42dd4373fd180122b8020a660a21030051cba06f3b20eeb79c2c9e06eafa34e1645fae74c754b122fa4f19e2b981c1124104c51052dff592a0e5268ccb60693424b9df6a606c83f7afece94c8b4ba590541243807080d9b40ee56dc4884906fbfdbaaa1aa4af25992e620e2f84d4d75c09f812660a21030051cba06f3b20eeb79c2c9e06eafa34e1645fae74c754b122fa4f19e2b981c11241047238c8809d9037efd3166d3229758ada31b7ccc4d4e5a3396185725e83b0ed9cfa325d193115a412b4d307ec3d54daf13cd46b26aa8d695e2dde33dc0887d9ea1a660a21030051cba06f3b20eeb79c2c9e06eafa34e1645fae74c754b122fa4f19e2b981c1124104e6731f361f0fc8e101c8cdee724bf49a7595ad1b8478e83940c10d1e6513f169d68d0fd210af2cf331ee1b3a64bcca761d2d99ae2b5b74c1f2d5f42e86564e5f \ No newline at end of file diff --git a/crypto/testdata/container_put_response.json b/crypto/testdata/container_put_response.json new file mode 100644 index 00000000..f5dba139 --- /dev/null +++ b/crypto/testdata/container_put_response.json @@ -0,0 +1,108 @@ +{ + "body": { + "containerId": { + "value": "YW55X2NvbnRhaW5lcg==" + } + }, + "metaHeader": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "304", + "ttl": 303, + "xHeaders": [ + { + "key": "xheader_key301", + "value": "xheader_val301" + }, + { + "key": "xheader_key302", + "value": "xheader_val302" + } + ], + "origin": { + "version": { + "major": 201, + "minor": 202 + }, + "epoch": "204", + "ttl": 203, + "xHeaders": [ + { + "key": "xheader_key201", + "value": "xheader_val201" + }, + { + "key": "xheader_key202", + "value": "xheader_val202" + } + ], + "origin": { + "version": { + "major": 101, + "minor": 102 + }, + "epoch": "104", + "ttl": 103, + "xHeaders": [ + { + "key": "xheader_key101", + "value": "xheader_val101" + }, + { + "key": "xheader_key102", + "value": "xheader_val102" + } + ], + "status": { + "code": 106 + } + }, + "status": { + "code": 206 + } + }, + "status": { + "code": 306 + } + }, + "verifyHeader": { + "metaSignature": { + "key": "A/90Q9TdX7Ya2sUcacTViTwfzg3gHoQFr/hV18gRHvLG", + "signature": "F2fdkfagyviqvvsV15j4hmgsvTFyxByVpruGQkkanxmt4HTUbJcJUFG+8wnzSpRdSQ2zY7kA6dwf7yRmDzTsAjo4gewr4BM/1Ln1ql0WuuI=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "originSignature": { + "key": "A/90Q9TdX7Ya2sUcacTViTwfzg3gHoQFr/hV18gRHvLG", + "signature": "hSqfsoYu+osWn270QsBx5B83rq1pMsIKuwGgo+JQUTy7/n1Qp3AUHe01sBpizjmMGIomr8sDq1TKxd/ZZ1s7wg2HMrkHd0m9i8Mqt7b3RSo=", + "scheme": "ECDSA_RFC6979_SHA256_WALLET_CONNECT" + }, + "origin": { + "metaSignature": { + "key": "A8XKAbQssKXytj1sEYqcd86uD0Rkmq+1v7yoPT9ChJxn", + "signature": "yxhGKTxK9W4AbDHBw1znAxYFo8B6djinr5TpLjKPONog0NIhb/rilE03eM3l1NzPK6erXxYkc+DXl5DqL/AfiQ==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "originSignature": { + "key": "A8XKAbQssKXytj1sEYqcd86uD0Rkmq+1v7yoPT9ChJxn", + "signature": "dGnD/VTJg+tv4FAIo2FgWxFFco/dFUiMO4e0PR4DYqO7rfKxD0368vEb88kznqrXdIYWaGlxUCqkhxtC3UNz/Q==", + "scheme": "ECDSA_RFC6979_SHA256" + }, + "origin": { + "bodySignature": { + "key": "AwBRy6BvOyDut5wsngbq+jThZF+udMdUsSL6TxniuYHB", + "signature": "BMUQUt/1kqDlJozLYGk0JLnfamBsg/ev7OlMi0ulkFQSQ4BwgNm0DuVtxIhJBvv9uqoapK8lmS5iDi+E1NdcCfg=" + }, + "metaSignature": { + "key": "AwBRy6BvOyDut5wsngbq+jThZF+udMdUsSL6TxniuYHB", + "signature": "BHI4yICdkDfv0xZtMil1itoxt8zE1OWjOWGFcl6DsO2c+jJdGTEVpBK00wfsPVTa8TzUayaqjWleLd4z3AiH2eo=" + }, + "originSignature": { + "key": "AwBRy6BvOyDut5wsngbq+jThZF+udMdUsSL6TxniuYHB", + "signature": "BOZzHzYfD8jhAcjN7nJL9Jp1la0bhHjoOUDBDR5lE/Fp1o0P0hCvLPMx7hs6ZLzKdh0tma4rW3TB8tX0LoZWTl8=" + } + } + } + } +} diff --git a/internal/proto/encoding.go b/internal/proto/encoding.go new file mode 100644 index 00000000..934f5cbc --- /dev/null +++ b/internal/proto/encoding.go @@ -0,0 +1,185 @@ +/* +Package proto contains helper functions in addition to the ones from +[google.golang.org/protobuf/encoding/protowire]. +*/ + +package proto + +import ( + "encoding/binary" + "math" + "reflect" + + "google.golang.org/protobuf/encoding/protowire" +) + +// TODO: docs +type Message interface { + MarshaledSize() int + MarshalStable(b []byte) +} + +func SizeVarint[integer uint64 | int64 | uint32 | int32](num protowire.Number, v integer) int { + if v == 0 { + return 0 + } + return protowire.SizeTag(num) + protowire.SizeVarint(uint64(v)) +} + +func MarshalVarint[integer uint64 | int64 | uint32 | int32](b []byte, num protowire.Number, v integer) int { + if v == 0 { + return 0 + } + off := binary.PutUvarint(b, protowire.EncodeTag(num, protowire.VarintType)) + return off + binary.PutUvarint(b[off:], uint64(v)) +} + +func SizeBool(num protowire.Number, v bool) int { + return SizeVarint(num, protowire.EncodeBool(v)) +} + +func MarshalBool(b []byte, num protowire.Number, v bool) int { + return MarshalVarint(b, num, protowire.EncodeBool(v)) +} + +func SizeBytes[bytesOrString []byte | string](num protowire.Number, v bytesOrString) int { + ln := len(v) + if ln == 0 { + return 0 + } + return protowire.SizeTag(num) + protowire.SizeBytes(ln) +} + +func MarshalBytes[bytesOrString []byte | string](b []byte, num protowire.Number, v bytesOrString) int { + if len(v) == 0 { + return 0 + } + off := binary.PutUvarint(b, protowire.EncodeTag(num, protowire.BytesType)) + off += binary.PutUvarint(b[off:], uint64(len(v))) + return off + copy(b[off:], v) +} + +func SizeFixed32(num protowire.Number, v uint32) int { + if v == 0 { + return 0 + } + return protowire.SizeTag(num) + protowire.SizeFixed32() +} + +func MarshalFixed32(b []byte, num protowire.Number, v uint32) int { + if v == 0 { + return 0 + } + off := binary.PutUvarint(b, protowire.EncodeTag(num, protowire.Fixed32Type)) + binary.LittleEndian.PutUint32(b[off:], v) + return off + protowire.SizeFixed32() +} + +func SizeFloat32(num protowire.Number, v float32) int { + return SizeFixed32(num, math.Float32bits(v)) +} + +func MarshalFloat32(b []byte, num protowire.Number, v float32) int { + return MarshalFixed32(b, num, math.Float32bits(v)) +} + +func SizeFixed64(num protowire.Number, v uint64) int { + if v == 0 { + return 0 + } + return protowire.SizeTag(num) + protowire.SizeFixed64() +} + +func MarshalFixed64(b []byte, num protowire.Number, v uint64) int { + if v == 0 { + return 0 + } + off := binary.PutUvarint(b, protowire.EncodeTag(num, protowire.Fixed64Type)) + binary.LittleEndian.PutUint64(b[off:], v) + return off + protowire.SizeFixed64() +} + +func SizeFloat64(num protowire.Number, v float64) int { + return SizeFixed64(num, math.Float64bits(v)) +} + +func MarshalFloat64(b []byte, num protowire.Number, v float64) int { + return MarshalFixed64(b, num, math.Float64bits(v)) +} + +func SizeNested(num protowire.Number, v Message) int { + if v == nil || reflect.ValueOf(v).IsNil() { + return 0 + } + return protowire.SizeTag(num) + protowire.SizeBytes(v.MarshaledSize()) +} + +func MarshalNested(b []byte, num protowire.Number, v Message) int { + if v == nil || reflect.ValueOf(v).IsNil() { + return 0 + } + off := binary.PutUvarint(b, protowire.EncodeTag(num, protowire.BytesType)) + sz := v.MarshaledSize() + off += binary.PutUvarint(b[off:], uint64(sz)) + v.MarshalStable(b[off:]) + return off + sz +} + +func sizeRepeatedVarint(v []uint64) int { + var sz int + for i := range v { + // packed https://protobuf.dev/programming-guides/encoding/#packed + sz += protowire.SizeVarint(v[i]) + } + return sz +} + +func SizeRepeatedVarint(num protowire.Number, v []uint64) int { + if len(v) == 0 { + return 0 + } + return protowire.SizeTag(num) + protowire.SizeBytes(sizeRepeatedVarint(v)) +} + +func MarshalRepeatedVarint(b []byte, num protowire.Number, v []uint64) int { + if len(v) == 0 { + return 0 + } + off := binary.PutUvarint(b, protowire.EncodeTag(num, protowire.BytesType)) + off += binary.PutUvarint(b[off:], uint64(sizeRepeatedVarint(v))) + for i := range v { + off += binary.PutUvarint(b[off:], v[i]) + } + return off +} + +func sizeRepeatedBytes[bytesOrString []byte | string](num protowire.Number, v []bytesOrString) int { + var sz int + tagSz := protowire.SizeTag(num) + for i := range v { + // non-packed https://protobuf.dev/programming-guides/encoding/#packed + sz += tagSz + protowire.SizeBytes(len(v[i])) + } + return sz +} + +func SizeRepeatedBytes[bytesOrString []byte | string](num protowire.Number, v []bytesOrString) int { + if len(v) == 0 { + return 0 + } + return sizeRepeatedBytes(num, v) +} + +func MarshalRepeatedBytes[bytesOrString []byte | string](b []byte, num protowire.Number, v []bytesOrString) int { + if len(v) == 0 { + return 0 + } + var off int + tag := protowire.EncodeTag(num, protowire.BytesType) + for i := range v { + off += binary.PutUvarint(b[off:], tag) + off += binary.PutUvarint(b[off:], uint64(len(v[i]))) + off += copy(b[off:], v[i]) + } + return off +} diff --git a/internal/proto/encoding_test.go b/internal/proto/encoding_test.go new file mode 100644 index 00000000..7f70310d --- /dev/null +++ b/internal/proto/encoding_test.go @@ -0,0 +1,232 @@ +package proto_test + +import ( + "math" + "testing" + + "github.com/nspcc-dev/neofs-sdk-go/internal/proto" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/protowire" +) + +func TestVarint(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeVarint(anyFieldNum, int32(0))) + require.Zero(t, proto.MarshalVarint(nil, anyFieldNum, int32(0))) + + const v = int32(42) + sz := proto.SizeVarint(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalVarint(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.VarintType, typ) + + res, _ := protowire.ConsumeVarint(b[tagLn:]) + require.EqualValues(t, v, res) +} + +func TestBool(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeBool(anyFieldNum, false)) + require.Zero(t, proto.MarshalBool(nil, anyFieldNum, false)) + + const v = true + sz := proto.SizeBool(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalBool(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.VarintType, typ) + + res, _ := protowire.ConsumeVarint(b[tagLn:]) + require.EqualValues(t, 1, res) +} + +func TestFixed32(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeFixed32(anyFieldNum, 0)) + require.Zero(t, proto.MarshalFixed32(nil, anyFieldNum, 0)) + + const v = 42 + sz := proto.SizeFixed32(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalFixed32(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.Fixed32Type, typ) + + res, _ := protowire.ConsumeFixed32(b[tagLn:]) + require.EqualValues(t, v, res) +} + +func TestFloat32(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeFloat32(anyFieldNum, 0.0)) + require.Zero(t, proto.MarshalFloat32(nil, anyFieldNum, 0.0)) + + const v = 1234.5678 + sz := proto.SizeFloat32(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalFloat32(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.Fixed32Type, typ) + + res, _ := protowire.ConsumeFixed32(b[tagLn:]) + require.EqualValues(t, v, math.Float32frombits(res)) +} + +func TestFixed64(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeFixed64(anyFieldNum, 0)) + require.Zero(t, proto.MarshalFixed64(nil, anyFieldNum, 0)) + + const v = 42 + sz := proto.SizeFixed64(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalFixed64(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.Fixed64Type, typ) + + res, _ := protowire.ConsumeFixed64(b[tagLn:]) + require.EqualValues(t, v, res) +} + +func TestFloat64(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeFloat64(anyFieldNum, 0.0)) + require.Zero(t, proto.MarshalFloat64(nil, anyFieldNum, 0.0)) + + const v = 1234.5678 + sz := proto.SizeFloat64(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalFloat64(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.Fixed64Type, typ) + + res, _ := protowire.ConsumeFixed64(b[tagLn:]) + require.EqualValues(t, v, math.Float64frombits(res)) +} + +func TestBytes(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeBytes(anyFieldNum, []byte(nil))) + require.Zero(t, proto.MarshalBytes(nil, anyFieldNum, []byte(nil))) + require.Zero(t, proto.SizeBytes(anyFieldNum, []byte{})) + require.Zero(t, proto.MarshalBytes(nil, anyFieldNum, []byte{})) + require.Zero(t, proto.SizeBytes(anyFieldNum, "")) + require.Zero(t, proto.MarshalBytes(nil, anyFieldNum, "")) + + const v = "Hello, world!" + sz := proto.SizeBytes(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalBytes(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.BytesType, typ) + + res, _ := protowire.ConsumeBytes(b[tagLn:]) + require.EqualValues(t, v, res) +} + +type nestedMessageStub string + +func (x *nestedMessageStub) MarshaledSize() int { return len(*x) } +func (x *nestedMessageStub) MarshalStable(b []byte) { copy(b, *x) } + +func TestNested(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeNested(anyFieldNum, nil)) + require.Zero(t, proto.MarshalNested(nil, anyFieldNum, nil)) + require.Zero(t, proto.SizeNested(anyFieldNum, (*nestedMessageStub)(nil))) + require.Zero(t, proto.MarshalNested(nil, anyFieldNum, (*nestedMessageStub)(nil))) + + v := nestedMessageStub("Hello, world!") + sz := proto.SizeNested(anyFieldNum, &v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalNested(b, anyFieldNum, &v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.BytesType, typ) + + res, _ := protowire.ConsumeBytes(b[tagLn:]) + require.EqualValues(t, v, res) +} + +func TestRepeatedVarint(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeRepeatedVarint(anyFieldNum, nil)) + require.Zero(t, proto.MarshalRepeatedVarint(nil, anyFieldNum, nil)) + require.Zero(t, proto.SizeRepeatedVarint(anyFieldNum, []uint64{})) + require.Zero(t, proto.MarshalRepeatedVarint(nil, anyFieldNum, []uint64{})) + + v := []uint64{12, 345, 0, 67890} // unlike single varint, zero must be explicitly encoded + sz := proto.SizeRepeatedVarint(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalRepeatedVarint(b, anyFieldNum, v)) + + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.BytesType, typ) + + b, _ = protowire.ConsumeBytes(b[tagLn:]) + var res []uint64 + for len(b) > 0 { + i, ln := protowire.ConsumeVarint(b) + require.Positive(t, tagLn, protowire.ParseError(ln)) + res = append(res, i) + b = b[ln:] + } + require.Equal(t, v, res) +} + +func TestRepeatedBytes(t *testing.T) { + const anyFieldNum = 123 + require.Zero(t, proto.SizeRepeatedBytes(anyFieldNum, [][]byte(nil))) + require.Zero(t, proto.MarshalRepeatedBytes(nil, anyFieldNum, [][]byte(nil))) + require.Zero(t, proto.SizeRepeatedBytes(anyFieldNum, [][]byte{})) + require.Zero(t, proto.MarshalRepeatedBytes(nil, anyFieldNum, [][]byte{})) + require.Zero(t, proto.SizeRepeatedBytes(anyFieldNum, []string(nil))) + require.Zero(t, proto.MarshalRepeatedBytes(nil, anyFieldNum, []string(nil))) + require.Zero(t, proto.SizeRepeatedBytes(anyFieldNum, []string{})) + require.Zero(t, proto.MarshalRepeatedBytes(nil, anyFieldNum, []string{})) + + v := []string{"Hello", "World", "", "Bob", "Alice"} // unlike single byte array, zero must be explicitly encoded + sz := proto.SizeRepeatedBytes(anyFieldNum, v) + b := make([]byte, sz) + require.EqualValues(t, sz, proto.MarshalRepeatedBytes(b, anyFieldNum, v)) + + var res []string + for len(b) > 0 { + num, typ, tagLn := protowire.ConsumeTag(b) + require.Positive(t, tagLn, protowire.ParseError(tagLn)) + require.EqualValues(t, anyFieldNum, num) + require.EqualValues(t, protowire.BytesType, typ) + + bs, ln := protowire.ConsumeBytes(b[tagLn:]) + require.Positive(t, tagLn, protowire.ParseError(ln)) + res = append(res, string(bs)) + b = b[tagLn+ln:] + } + require.Equal(t, v, res) +} diff --git a/object/id/address.go b/object/id/address.go index 1b07d0b6..b243fb9f 100644 --- a/object/id/address.go +++ b/object/id/address.go @@ -5,15 +5,16 @@ import ( "fmt" "strings" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" cid "github.com/nspcc-dev/neofs-sdk-go/container/id" + "google.golang.org/protobuf/encoding/protojson" ) // Address represents global object identifier in NeoFS network. Each object // belongs to exactly one container and is uniquely addressed within the container. // -// Address is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.Address -// message. See ReadFromV2 / WriteToV2 methods. +// Address is mutually compatible with [refs.Address] message. See +// [Address.ReadFromV2] / [Address.WriteToV2] methods. // // Instances can be created using built-in var declaration. type Address struct { @@ -22,27 +23,26 @@ type Address struct { obj ID } -// ReadFromV2 reads Address from the refs.Address message. Returns an error if -// the message is malformed according to the NeoFS API V2 protocol. +// ReadFromV2 reads Address from the [refs.Address] message. Returns an error if +// the message is malformed according to the NeoFS API V2 protocol. The message +// must not be nil. // -// See also WriteToV2. -func (x *Address) ReadFromV2(m refs.Address) error { - cnr := m.GetContainerID() - if cnr == nil { +// See also [Address.WriteToV2]. +func (x *Address) ReadFromV2(m *refs.Address) error { + if m.ContainerId == nil { return errors.New("missing container ID") } - obj := m.GetObjectID() - if obj == nil { + if m.ObjectId == nil { return errors.New("missing object ID") } - err := x.cnr.ReadFromV2(*cnr) + err := x.cnr.ReadFromV2(m.ContainerId) if err != nil { return fmt.Errorf("invalid container ID: %w", err) } - err = x.obj.ReadFromV2(*obj) + err = x.obj.ReadFromV2(m.ObjectId) if err != nil { return fmt.Errorf("invalid object ID: %w", err) } @@ -50,45 +50,41 @@ func (x *Address) ReadFromV2(m refs.Address) error { return nil } -// WriteToV2 writes Address to the refs.Address message. -// The message must not be nil. +// WriteToV2 writes Address to the [refs.Address] message. The message must not +// be nil. // -// See also ReadFromV2. +// See also [Address.ReadFromV2]. func (x Address) WriteToV2(m *refs.Address) { - var obj refs.ObjectID - x.obj.WriteToV2(&obj) - - var cnr refs.ContainerID - x.cnr.WriteToV2(&cnr) - - m.SetObjectID(&obj) - m.SetContainerID(&cnr) + m.ObjectId = new(refs.ObjectID) + x.obj.WriteToV2(m.ObjectId) + m.ContainerId = new(refs.ContainerID) + x.cnr.WriteToV2(m.ContainerId) } // MarshalJSON encodes Address into a JSON format of the NeoFS API protocol // (Protocol Buffers JSON). // -// See also UnmarshalJSON. +// See also [Address.UnmarshalJSON]. func (x Address) MarshalJSON() ([]byte, error) { var m refs.Address x.WriteToV2(&m) - return m.MarshalJSON() + return protojson.Marshal(&m) } // UnmarshalJSON decodes NeoFS API protocol JSON format into the Address // (Protocol Buffers JSON). Returns an error describing a format violation. // -// See also MarshalJSON. +// See also [Address.MarshalJSON]. func (x *Address) UnmarshalJSON(data []byte) error { var m refs.Address - err := m.UnmarshalJSON(data) + err := protojson.Unmarshal(data, &m) if err != nil { return err } - return x.ReadFromV2(m) + return x.ReadFromV2(&m) } // Container returns unique identifier of the NeoFS object container. diff --git a/object/id/address_test.go b/object/id/address_test.go index 3c47cdbd..02895efe 100644 --- a/object/id/address_test.go +++ b/object/id/address_test.go @@ -3,7 +3,7 @@ package oid_test import ( "testing" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" @@ -36,34 +36,32 @@ func TestAddress_ReadFromV2(t *testing.T) { var x oid.Address var xV2 refs.Address - require.Error(t, x.ReadFromV2(xV2)) + require.Error(t, x.ReadFromV2(&xV2)) - var cnrV2 refs.ContainerID - xV2.SetContainerID(&cnrV2) + xV2.ContainerId = new(refs.ContainerID) - require.Error(t, x.ReadFromV2(xV2)) + require.Error(t, x.ReadFromV2(&xV2)) cnr := cidtest.ID() - cnr.WriteToV2(&cnrV2) + cnr.WriteToV2(xV2.ContainerId) - require.Error(t, x.ReadFromV2(xV2)) + require.Error(t, x.ReadFromV2(&xV2)) - var objV2 refs.ObjectID - xV2.SetObjectID(&objV2) + xV2.ObjectId = new(refs.ObjectID) - require.Error(t, x.ReadFromV2(xV2)) + require.Error(t, x.ReadFromV2(&xV2)) obj := oidtest.ID() - obj.WriteToV2(&objV2) + obj.WriteToV2(xV2.ObjectId) - require.NoError(t, x.ReadFromV2(xV2)) + require.NoError(t, x.ReadFromV2(&xV2)) require.Equal(t, cnr, x.Container()) require.Equal(t, obj, x.Object()) var xV2To refs.Address x.WriteToV2(&xV2To) - require.Equal(t, xV2, xV2To) + require.Equal(t, &xV2, &xV2To) } func TestAddress_DecodeString(t *testing.T) { diff --git a/object/id/id.go b/object/id/id.go index c3436b56..84b482f0 100644 --- a/object/id/id.go +++ b/object/id/id.go @@ -5,14 +5,14 @@ import ( "fmt" "github.com/mr-tron/base58" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" ) // ID represents NeoFS object identifier in a container. // -// ID is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.ObjectID -// message. See ReadFromV2 / WriteToV2 methods. +// ID is mutually compatible with [refs.ObjectID] message. See [ID.ReadFromV2] / +// [ID.WriteToV2] methods. // // Instances can be created using built-in var declaration. // @@ -21,20 +21,21 @@ import ( // _ = ID([32]byte{}) // not recommended type ID [sha256.Size]byte -// ReadFromV2 reads ID from the refs.ObjectID message. Returns an error if -// the message is malformed according to the NeoFS API V2 protocol. +// ReadFromV2 reads ID from the [refs.ObjectID] message. Returns an error if the +// message is malformed according to the NeoFS API V2 protocol. The message must +// not be nil. // -// See also WriteToV2. -func (id *ID) ReadFromV2(m refs.ObjectID) error { - return id.Decode(m.GetValue()) +// See also [ID.WriteToV2]. +func (id *ID) ReadFromV2(m *refs.ObjectID) error { + return id.Decode(m.Value) } -// WriteToV2 writes ID to the refs.ObjectID message. -// The message must not be nil. +// WriteToV2 writes ID to the [refs.ObjectID] message. The message must not be +// nil. // -// See also ReadFromV2. +// See also [ID.ReadFromV2]. func (id ID) WriteToV2(m *refs.ObjectID) { - m.SetValue(id[:]) + m.Value = id[:] } // Encode encodes ID into 32 bytes of dst. Panics if @@ -116,52 +117,12 @@ func (id ID) String() string { // CalculateIDSignature signs object id with provided key. func (id ID) CalculateIDSignature(signer neofscrypto.Signer) (neofscrypto.Signature, error) { - data, err := id.Marshal() - if err != nil { - return neofscrypto.Signature{}, fmt.Errorf("marshal ID: %w", err) - } + var m refs.ObjectID + id.WriteToV2(&m) + data := make([]byte, m.MarshaledSize()) + m.MarshalStable(data) var sig neofscrypto.Signature return sig, sig.Calculate(signer, data) } - -// Marshal marshals ID into a protobuf binary form. -func (id ID) Marshal() ([]byte, error) { - var v2 refs.ObjectID - v2.SetValue(id[:]) - - return v2.StableMarshal(nil), nil -} - -// Unmarshal unmarshals protobuf binary representation of ID. -func (id *ID) Unmarshal(data []byte) error { - var v2 refs.ObjectID - if err := v2.Unmarshal(data); err != nil { - return err - } - - copy(id[:], v2.GetValue()) - - return nil -} - -// MarshalJSON encodes ID to protobuf JSON format. -func (id ID) MarshalJSON() ([]byte, error) { - var v2 refs.ObjectID - v2.SetValue(id[:]) - - return v2.MarshalJSON() -} - -// UnmarshalJSON decodes ID from protobuf JSON format. -func (id *ID) UnmarshalJSON(data []byte) error { - var v2 refs.ObjectID - if err := v2.UnmarshalJSON(data); err != nil { - return err - } - - copy(id[:], v2.GetValue()) - - return nil -} diff --git a/object/id/id_test.go b/object/id/id_test.go index baa1b221..f003a79c 100644 --- a/object/id/id_test.go +++ b/object/id/id_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/mr-tron/base58" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/stretchr/testify/require" ) @@ -111,30 +111,6 @@ func TestID_String(t *testing.T) { }) } -func TestObjectIDEncoding(t *testing.T) { - id := randID(t) - - t.Run("binary", func(t *testing.T) { - data, err := id.Marshal() - require.NoError(t, err) - - var id2 ID - require.NoError(t, id2.Unmarshal(data)) - - require.Equal(t, id, id2) - }) - - t.Run("json", func(t *testing.T) { - data, err := id.MarshalJSON() - require.NoError(t, err) - - var id2 ID - require.NoError(t, id2.UnmarshalJSON(data)) - - require.Equal(t, id, id2) - }) -} - func TestNewIDFromV2(t *testing.T) { t.Run("from zero", func(t *testing.T) { var ( @@ -142,7 +118,7 @@ func TestNewIDFromV2(t *testing.T) { v2 refs.ObjectID ) - require.Error(t, x.ReadFromV2(v2)) + require.Error(t, x.ReadFromV2(&v2)) }) } diff --git a/object/id/test/generate.go b/object/id/test/generate.go index 75fa0780..08557a66 100644 --- a/object/id/test/generate.go +++ b/object/id/test/generate.go @@ -35,3 +35,18 @@ func Address() oid.Address { return x } + +// ChangeID returns object ID other than the given one. +func ChangeID(id oid.ID) oid.ID { + cp := id + cp[0]++ + return cp +} + +// ChangeAddress returns object address other than the given one. +func ChangeAddress(addr oid.Address) oid.Address { + var res oid.Address + res.SetObject(ChangeID(addr.Object())) + res.SetContainer(cidtest.ChangeID(addr.Container())) + return res +} diff --git a/storagegroup/storagegroup.go b/storagegroup/storagegroup.go index d9d89dea..b20472e5 100644 --- a/storagegroup/storagegroup.go +++ b/storagegroup/storagegroup.go @@ -7,7 +7,7 @@ import ( objectV2 "github.com/nspcc-dev/neofs-api-go/v2/object" "github.com/nspcc-dev/neofs-api-go/v2/refs" - "github.com/nspcc-dev/neofs-api-go/v2/storagegroup" + "github.com/nspcc-dev/neofs-sdk-go/api/storagegroup" "github.com/nspcc-dev/neofs-sdk-go/checksum" objectSDK "github.com/nspcc-dev/neofs-sdk-go/object" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" @@ -15,24 +15,25 @@ import ( // StorageGroup represents storage group of the NeoFS objects. // -// StorageGroup is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/storagegroup.StorageGroup -// message. See ReadFromMessageV2 / WriteToMessageV2 methods. +// StorageGroup is mutually compatible with [storagegroup.StorageGroup] message. +// See [StorageGroup.ReadFromV2] / [StorageGroup.WriteToV2] methods. // // Instances can be created using built-in var declaration. -// -// Note that direct typecast is not safe and may result in loss of compatibility: -// -// _ = StorageGroup(storagegroup.StorageGroup) // not recommended -type StorageGroup storagegroup.StorageGroup +type StorageGroup struct { + sz uint64 + cs checksum.Checksum + exp uint64 + ids []oid.ID +} // reads StorageGroup from the storagegroup.StorageGroup message. If checkFieldPresence is set, // returns an error on absence of any protocol-required field. -func (sg *StorageGroup) readFromV2(m storagegroup.StorageGroup, checkFieldPresence bool) error { +func (sg *StorageGroup) readFromV2(m *storagegroup.StorageGroup, checkFieldPresence bool) error { var err error h := m.GetValidationHash() if h != nil { - err = new(checksum.Checksum).ReadFromV2(*h) + err = new(checksum.Checksum).ReadFromV2(h) if err != nil { return fmt.Errorf("invalid hash: %w", err) } diff --git a/user/example_test.go b/user/example_test.go index 246407af..e171115e 100644 --- a/user/example_test.go +++ b/user/example_test.go @@ -2,7 +2,7 @@ package user_test import ( "github.com/nspcc-dev/neo-go/pkg/util" - apiGoRefs "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/nspcc-dev/neofs-sdk-go/user" ) @@ -45,16 +45,14 @@ func ExampleID_DecodeString() { // Instances can be also used to process NeoFS API V2 protocol messages with [https://github.com/nspcc-dev/neofs-api] package. func ExampleID_marshalling() { - // import apiGoRefs "github.com/nspcc-dev/neofs-api-go/v2/refs" - // On the client side. var id user.ID - var msg apiGoRefs.OwnerID + var msg refs.OwnerID id.WriteToV2(&msg) // *send message* // On the server side. - _ = id.ReadFromV2(msg) + _ = id.ReadFromV2(&msg) } diff --git a/user/id.go b/user/id.go index f706e0ea..bc106c89 100644 --- a/user/id.go +++ b/user/id.go @@ -9,49 +9,49 @@ import ( "github.com/nspcc-dev/neo-go/pkg/crypto/hash" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/util" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" ) // ID identifies users of the NeoFS system. // -// ID is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.OwnerID -// message. See ReadFromV2 / WriteToV2 methods. +// ID is mutually compatible with [refs.OwnerID] message. See [ID.ReadFromV2] / +// [ID.WriteToV2] methods. // // Instances can be created using built-in var declaration. Zero ID is not valid, -// so it MUST be initialized using some modifying function (e.g. SetScriptHash, etc.). +// so it MUST be initialized using some modifying function (e.g. [ID.SetScriptHash], etc.). type ID struct { w []byte } -// ReadFromV2 reads ID from the refs.OwnerID message. Returns an error if -// the message is malformed according to the NeoFS API V2 protocol. +// ReadFromV2 reads ID from the [refs.OwnerID] message. Returns an error if the +// message is malformed according to the NeoFS API V2 protocol. The message must +// not be nil. // -// See also WriteToV2. -func (x *ID) ReadFromV2(m refs.OwnerID) error { - w := m.GetValue() - if len(w) != 25 { - return fmt.Errorf("invalid length %d, expected 25", len(w)) +// See also [ID.WriteToV2]. +func (x *ID) ReadFromV2(m *refs.OwnerID) error { + if len(m.Value) != 25 { + return fmt.Errorf("invalid length %d, expected 25", len(m.Value)) } - if w[0] != address.NEO3Prefix { - return fmt.Errorf("invalid prefix byte 0x%X, expected 0x%X", w[0], address.NEO3Prefix) + if m.Value[0] != address.NEO3Prefix { + return fmt.Errorf("invalid prefix byte 0x%X, expected 0x%X", m.Value[0], address.NEO3Prefix) } - if !bytes.Equal(w[21:], hash.Checksum(w[:21])) { + if !bytes.Equal(m.Value[21:], hash.Checksum(m.Value[:21])) { return errors.New("checksum mismatch") } - x.w = w + x.w = m.Value return nil } -// WriteToV2 writes ID to the refs.OwnerID message. +// WriteToV2 writes ID to the [refs.OwnerID] message. // The message must not be nil. // -// See also ReadFromV2. +// See also [ID.ReadFromV2]. func (x ID) WriteToV2(m *refs.OwnerID) { - m.SetValue(x.w) + m.Value = x.w } // SetScriptHash forms user ID from wallet address scripthash. diff --git a/user/id_test.go b/user/id_test.go index 97db311c..45f37329 100644 --- a/user/id_test.go +++ b/user/id_test.go @@ -7,7 +7,7 @@ import ( "github.com/mr-tron/base58" "github.com/nspcc-dev/neo-go/pkg/util" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/nspcc-dev/neofs-sdk-go/user" usertest "github.com/nspcc-dev/neofs-sdk-go/user/test" "github.com/stretchr/testify/require" @@ -24,9 +24,9 @@ func TestID_WalletBytes(t *testing.T) { w := id.WalletBytes() var m refs.OwnerID - m.SetValue(w) + m.Value = w - err := id.ReadFromV2(m) + err := id.ReadFromV2(&m) require.NoError(t, err) } @@ -43,7 +43,7 @@ func TestID_SetScriptHash(t *testing.T) { var id2 user.ID - err := id2.ReadFromV2(m) + err := id2.ReadFromV2(&m) require.NoError(t, err) require.True(t, id2.Equals(id)) @@ -57,7 +57,7 @@ func TestV2_ID(t *testing.T) { t.Run("OK", func(t *testing.T) { id.WriteToV2(&m) - err := id2.ReadFromV2(m) + err := id2.ReadFromV2(&m) require.NoError(t, err) require.True(t, id2.Equals(id)) }) @@ -65,9 +65,9 @@ func TestV2_ID(t *testing.T) { val := m.GetValue() t.Run("invalid size", func(t *testing.T) { - m.SetValue(val[:24]) + m.Value = val[:24] - err := id2.ReadFromV2(m) + err := id2.ReadFromV2(&m) require.Error(t, err) }) @@ -75,9 +75,9 @@ func TestV2_ID(t *testing.T) { val := bytes.Clone(val) val[0]++ - m.SetValue(val) + m.Value = val - err := id2.ReadFromV2(m) + err := id2.ReadFromV2(&m) require.Error(t, err) }) @@ -85,9 +85,9 @@ func TestV2_ID(t *testing.T) { val := bytes.Clone(val) val[21]++ - m.SetValue(val) + m.Value = val - err := id2.ReadFromV2(m) + err := id2.ReadFromV2(&m) require.Error(t, err) }) } diff --git a/version/version.go b/version/version.go index ded56b35..1221d286 100644 --- a/version/version.go +++ b/version/version.go @@ -3,20 +3,17 @@ package version import ( "fmt" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" + "google.golang.org/protobuf/encoding/protojson" ) // Version represents revision number in SemVer scheme. // -// Version is mutually compatible with github.com/nspcc-dev/neofs-api-go/v2/refs.Version -// message. See ReadFromV2 / WriteToV2 methods. +// Version is mutually compatible with [refs.Version] message. See +// [Version.ReadFromV2] / [Version.WriteToV2] methods. // // Instances can be created using built-in var declaration. -// -// Note that direct typecast is not safe and may result in loss of compatibility: -// -// _ = Version(refs.Version{}) // not recommended -type Version refs.Version +type Version struct{ mjr, mnr uint32 } const sdkMjr, sdkMnr = 2, 13 @@ -29,43 +26,43 @@ func Current() (v Version) { } // Major returns major number of the revision. -func (v *Version) Major() uint32 { - return (*refs.Version)(v).GetMajor() +func (v Version) Major() uint32 { + return v.mjr } // SetMajor sets major number of the revision. func (v *Version) SetMajor(val uint32) { - (*refs.Version)(v).SetMajor(val) + v.mjr = val } // Minor returns minor number of the revision. -func (v *Version) Minor() uint32 { - return (*refs.Version)(v).GetMinor() +func (v Version) Minor() uint32 { + return v.mnr } // SetMinor sets minor number of the revision. func (v *Version) SetMinor(val uint32) { - (*refs.Version)(v).SetMinor(val) + v.mnr = val } -// WriteToV2 writes Version to the refs.Version message. +// WriteToV2 writes Version to the [refs.Version] message. // The message must not be nil. // -// See also ReadFromV2. +// See also [Version.ReadFromV2]. func (v Version) WriteToV2(m *refs.Version) { - *m = (refs.Version)(v) + m.Major, m.Minor = v.mjr, v.mnr } -// ReadFromV2 reads Version from the refs.Version message. Checks if the message -// conforms to NeoFS API V2 protocol. +// ReadFromV2 reads Version from the [refs.Version] message. Checks if the +// message conforms to NeoFS API V2 protocol. The message must not be nil. // -// See also WriteToV2. -func (v *Version) ReadFromV2(m refs.Version) error { - *v = Version(m) +// See also [Version.WriteToV2]. +func (v *Version) ReadFromV2(m *refs.Version) error { + v.mjr, v.mnr = m.Major, m.Minor return nil } -// String implements fmt.Stringer. +// String implements [fmt.Stringer]. // // String is designed to be human-readable, and its format MAY differ between // SDK versions. @@ -88,25 +85,25 @@ func (v Version) Equal(v2 Version) bool { // MarshalJSON encodes Version into a JSON format of the NeoFS API // protocol (Protocol Buffers JSON). // -// See also UnmarshalJSON. +// See also [Version.UnmarshalJSON]. func (v Version) MarshalJSON() ([]byte, error) { var m refs.Version v.WriteToV2(&m) - return m.MarshalJSON() + return protojson.Marshal(&m) } // UnmarshalJSON decodes NeoFS API protocol JSON format into the Version // (Protocol Buffers JSON). Returns an error describing a format violation. // -// See also MarshalJSON. +// See also [Version.MarshalJSON]. func (v *Version) UnmarshalJSON(data []byte) error { var m refs.Version - err := m.UnmarshalJSON(data) + err := protojson.Unmarshal(data, &m) if err != nil { return err } - return v.ReadFromV2(m) + return v.ReadFromV2(&m) } diff --git a/version/version_test.go b/version/version_test.go index 7dda8ce4..e44b5f5f 100644 --- a/version/version_test.go +++ b/version/version_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - "github.com/nspcc-dev/neofs-api-go/v2/refs" + "github.com/nspcc-dev/neofs-sdk-go/api/refs" "github.com/stretchr/testify/require" )