diff --git a/apemanager/convert.go b/apemanager/convert.go new file mode 100644 index 00000000..12b087c3 --- /dev/null +++ b/apemanager/convert.go @@ -0,0 +1,481 @@ +package apemanager + +import ( + "fmt" + + apemanager "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" +) + +func TargetTypeToGRPCField(typ TargetType) apemanager.TargetType { + switch typ { + case TargetTypeNamespace: + return apemanager.TargetType_NAMESPACE + case TargetTypeContainer: + return apemanager.TargetType_CONTAINER + case TargetTypeUser: + return apemanager.TargetType_USER + case TargetTypeGroup: + return apemanager.TargetType_GROUP + default: + return apemanager.TargetType_UNDEFINED + } +} + +func TargetTypeFromGRPCField(typ apemanager.TargetType) TargetType { + switch typ { + case apemanager.TargetType_NAMESPACE: + return TargetTypeNamespace + case apemanager.TargetType_CONTAINER: + return TargetTypeContainer + case apemanager.TargetType_USER: + return TargetTypeUser + case apemanager.TargetType_GROUP: + return TargetTypeGroup + default: + return TargetTypeUndefined + } +} + +func TargetTypeToGRPC(typ TargetType) apemanager.TargetType { + return apemanager.TargetType(typ) +} + +func TargetTypeFromGRPC(typ apemanager.TargetType) TargetType { + return TargetType(typ) +} + +func (v2 *ChainTarget) ToGRPCMessage() grpc.Message { + var mgrpc *apemanager.ChainTarget + + if v2 != nil { + mgrpc = new(apemanager.ChainTarget) + + mgrpc.SetType(TargetTypeToGRPC(v2.GetTargetType())) + mgrpc.SetName(v2.GetName()) + } + + return mgrpc +} + +func (v2 *ChainTarget) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*apemanager.ChainTarget) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + v2.SetTargetType(TargetTypeFromGRPC(mgrpc.GetType())) + v2.SetName(mgrpc.GetName()) + + return nil +} + +func (v2 *ChainRaw) ToGRPCMessage() grpc.Message { + var mgrpc *apemanager.Chain_Raw + + if v2 != nil { + mgrpc = new(apemanager.Chain_Raw) + + mgrpc.SetRaw(v2.GetRaw()) + } + + return mgrpc +} + +func (v2 *ChainRaw) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*apemanager.Chain_Raw) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + v2.SetRaw(mgrpc.GetRaw()) + + return nil +} + +func (v2 *Chain) ToGRPCMessage() grpc.Message { + var mgrpc *apemanager.Chain + + if v2 != nil { + mgrpc = new(apemanager.Chain) + + switch chainKind := v2.GetKind().(type) { + default: + panic(fmt.Sprintf("unsupported chain kind: %T", chainKind)) + case *ChainRaw: + mgrpc.SetKind(chainKind.ToGRPCMessage().(*apemanager.Chain_Raw)) + } + } + + return mgrpc +} + +func (v2 *Chain) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*apemanager.Chain) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + switch chainKind := mgrpc.GetKind().(type) { + default: + return fmt.Errorf("unsupported chain kind: %T", chainKind) + case *apemanager.Chain_Raw: + chainRaw := new(ChainRaw) + if err := chainRaw.FromGRPCMessage(chainKind); err != nil { + return err + } + v2.SetKind(chainRaw) + } + + return nil +} + +func (reqBody *AddChainRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.AddChainRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.AddChainRequest_Body) + + reqBodygrpc.SetTarget(reqBody.GetTarget().ToGRPCMessage().(*apemanager.ChainTarget)) + reqBodygrpc.SetChain(reqBody.GetChain().ToGRPCMessage().(*apemanager.Chain)) + } + + return reqBodygrpc +} + +func (reqBody *AddChainRequestBody) FromGRPCMessage(m grpc.Message) error { + reqBodygrpc, ok := m.(*apemanager.AddChainRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, reqBodygrpc) + } + + if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { + reqBody.target = new(ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + if chaingrpc := reqBodygrpc.GetChain(); chaingrpc != nil { + reqBody.chain = new(Chain) + if err := reqBody.GetChain().FromGRPCMessage(chaingrpc); err != nil { + return err + } + } + + return nil +} + +func (req *AddChainRequest) ToGRPCMessage() grpc.Message { + var reqgrpc *apemanager.AddChainRequest + + if req != nil { + reqgrpc = new(apemanager.AddChainRequest) + + reqgrpc.SetBody(req.GetBody().ToGRPCMessage().(*apemanager.AddChainRequest_Body)) + req.RequestHeaders.ToMessage(reqgrpc) + } + + return reqgrpc +} + +func (req *AddChainRequest) FromGRPCMessage(m grpc.Message) error { + reqgrpc, ok := m.(*apemanager.AddChainRequest) + if !ok { + return message.NewUnexpectedMessageType(m, reqgrpc) + } + + if reqBodygrpc := reqgrpc.GetBody(); reqBodygrpc != nil { + req.body = new(AddChainRequestBody) + if err := req.body.FromGRPCMessage(reqBodygrpc); err != nil { + return err + } + } + + return req.RequestHeaders.FromMessage(reqgrpc) +} + +func (respBody *AddChainResponseBody) ToGRPCMessage() grpc.Message { + var respBodygrpc *apemanager.AddChainResponse_Body + + if respBody != nil { + respBodygrpc = new(apemanager.AddChainResponse_Body) + + respBodygrpc.SetChainID(respBody.GetChainID()) + } + + return respBodygrpc +} + +func (respBody *AddChainResponseBody) FromGRPCMessage(m grpc.Message) error { + respBodygrpc, ok := m.(*apemanager.AddChainResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, respBodygrpc) + } + + respBody.SetChainID(respBodygrpc.GetChainId()) + + return nil +} + +func (resp *AddChainResponse) ToGRPCMessage() grpc.Message { + var respgrpc *apemanager.AddChainResponse + + if resp != nil { + respgrpc = new(apemanager.AddChainResponse) + + respgrpc.SetBody(resp.body.ToGRPCMessage().(*apemanager.AddChainResponse_Body)) + resp.ResponseHeaders.ToMessage(respgrpc) + } + + return respgrpc +} + +func (resp *AddChainResponse) FromGRPCMessage(m grpc.Message) error { + respgrpc, ok := m.(*apemanager.AddChainResponse) + if !ok { + return message.NewUnexpectedMessageType(m, respgrpc) + } + + if respBodygrpc := respgrpc.GetBody(); respBodygrpc != nil { + resp.body = new(AddChainResponseBody) + if err := resp.body.FromGRPCMessage(respBodygrpc); err != nil { + return err + } + } + + return resp.ResponseHeaders.FromMessage(respgrpc) +} + +func (reqBody *RemoveChainRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.RemoveChainRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.RemoveChainRequest_Body) + + reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) + reqBodygrpc.SetChainID(reqBody.GetChainID()) + } + + return reqBodygrpc +} + +func (reqBody *RemoveChainRequestBody) FromGRPCMessage(m grpc.Message) error { + reqBodygrpc, ok := m.(*apemanager.RemoveChainRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, reqBodygrpc) + } + + if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { + reqBody.target = new(ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + reqBody.SetChainID(reqBodygrpc.GetChainId()) + + return nil +} + +func (req *RemoveChainRequest) ToGRPCMessage() grpc.Message { + var reqgrpc *apemanager.RemoveChainRequest + + if req != nil { + reqgrpc = new(apemanager.RemoveChainRequest) + + reqgrpc.SetBody(req.body.ToGRPCMessage().(*apemanager.RemoveChainRequest_Body)) + req.RequestHeaders.ToMessage(reqgrpc) + } + + return reqgrpc +} + +func (req *RemoveChainRequest) FromGRPCMessage(m grpc.Message) error { + reqgrpc, ok := m.(*apemanager.RemoveChainRequest) + if !ok { + return message.NewUnexpectedMessageType(m, reqgrpc) + } + + if reqBodygrpc := reqgrpc.GetBody(); reqBodygrpc != nil { + req.body = new(RemoveChainRequestBody) + if err := req.body.FromGRPCMessage(reqBodygrpc); err != nil { + return err + } + } + + return req.RequestHeaders.FromMessage(reqgrpc) +} + +func (respBody *RemoveChainResponseBody) ToGRPCMessage() grpc.Message { + var respBodygrpc *apemanager.RemoveChainResponse_Body + + if respBody != nil { + respBodygrpc = new(apemanager.RemoveChainResponse_Body) + } + + return respBodygrpc +} + +func (respBody *RemoveChainResponseBody) FromGRPCMessage(m grpc.Message) error { + respBodygrpc, ok := m.(*apemanager.RemoveChainResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, respBodygrpc) + } + + return nil +} + +func (resp *RemoveChainResponse) ToGRPCMessage() grpc.Message { + var respgrpc *apemanager.RemoveChainResponse + + if resp != nil { + respgrpc = new(apemanager.RemoveChainResponse) + + respgrpc.SetBody(resp.body.ToGRPCMessage().(*apemanager.RemoveChainResponse_Body)) + resp.ResponseHeaders.ToMessage(respgrpc) + } + + return respgrpc +} + +func (resp *RemoveChainResponse) FromGRPCMessage(m grpc.Message) error { + respgrpc, ok := m.(*apemanager.RemoveChainResponse) + if !ok { + return message.NewUnexpectedMessageType(m, respgrpc) + } + + if respBodygrpc := respgrpc.GetBody(); respBodygrpc != nil { + resp.body = new(RemoveChainResponseBody) + if err := resp.body.FromGRPCMessage(respBodygrpc); err != nil { + return err + } + } + + return resp.ResponseHeaders.FromMessage(respgrpc) +} + +func (reqBody *ListChainsRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.ListChainsRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.ListChainsRequest_Body) + + reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) + } + + return reqBodygrpc +} + +func (reqBody *ListChainsRequestBody) FromGRPCMessage(m grpc.Message) error { + reqBodygrpc, ok := m.(*apemanager.ListChainsRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, reqBodygrpc) + } + + if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { + reqBody.target = new(ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + return nil +} + +func (req *ListChainsRequest) ToGRPCMessage() grpc.Message { + var reqgrpc *apemanager.ListChainsRequest + + if req != nil { + reqgrpc = new(apemanager.ListChainsRequest) + + reqgrpc.SetBody(req.body.ToGRPCMessage().(*apemanager.ListChainsRequest_Body)) + req.RequestHeaders.ToMessage(reqgrpc) + } + + return reqgrpc +} + +func (req *ListChainsRequest) FromGRPCMessage(m grpc.Message) error { + reqgrpc, ok := m.(*apemanager.ListChainsRequest) + if !ok { + return message.NewUnexpectedMessageType(m, reqgrpc) + } + + if reqBodygrpc := reqgrpc.GetBody(); reqBodygrpc != nil { + req.body = new(ListChainsRequestBody) + if err := req.body.FromGRPCMessage(reqBodygrpc); err != nil { + return err + } + } + + return req.RequestHeaders.FromMessage(reqgrpc) +} + +func (respBody *ListChainsResponseBody) ToGRPCMessage() grpc.Message { + var respBodygrpc *apemanager.ListChainsResponse_Body + + if respBody != nil { + respBodygrpc = new(apemanager.ListChainsResponse_Body) + + chainsgrpc := make([]*apemanager.Chain, 0, len(respBody.GetChains())) + for _, chain := range respBody.GetChains() { + chainsgrpc = append(chainsgrpc, chain.ToGRPCMessage().(*apemanager.Chain)) + } + + respBodygrpc.SetChains(chainsgrpc) + } + + return respBodygrpc +} + +func (respBody *ListChainsResponseBody) FromGRPCMessage(m grpc.Message) error { + respBodygrpc, ok := m.(*apemanager.ListChainsResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, respBodygrpc) + } + + chains := make([]*Chain, 0, len(respBodygrpc.GetChains())) + + for _, chaingrpc := range respBodygrpc.GetChains() { + chain := new(Chain) + if err := chain.FromGRPCMessage(chaingrpc); err != nil { + return err + } + chains = append(chains, chain) + } + + respBody.SetChains(chains) + + return nil +} + +func (resp *ListChainsResponse) ToGRPCMessage() grpc.Message { + var respgrpc *apemanager.ListChainsResponse + + if resp != nil { + respgrpc = new(apemanager.ListChainsResponse) + + respgrpc.SetBody(resp.body.ToGRPCMessage().(*apemanager.ListChainsResponse_Body)) + resp.ResponseHeaders.ToMessage(respgrpc) + } + + return respgrpc +} + +func (resp *ListChainsResponse) FromGRPCMessage(m grpc.Message) error { + respgrpc, ok := m.(*apemanager.ListChainsResponse) + if !ok { + return message.NewUnexpectedMessageType(m, respgrpc) + } + + if respBodygrpc := respgrpc.GetBody(); respBodygrpc != nil { + resp.body = new(ListChainsResponseBody) + if err := resp.body.FromGRPCMessage(respBodygrpc); err != nil { + return err + } + } + + return resp.ResponseHeaders.FromMessage(respgrpc) +} diff --git a/apemanager/grpc/service.go b/apemanager/grpc/service.go new file mode 100644 index 00000000..89ffa716 --- /dev/null +++ b/apemanager/grpc/service.go @@ -0,0 +1,105 @@ +package apemanager + +import ( + session_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" +) + +func (rb *AddChainRequest_Body) SetTarget(t *ChainTarget) { + rb.Target = t +} + +func (rb *AddChainRequest_Body) SetChain(chain *Chain) { + rb.Chain = chain +} + +func (r *AddChainRequest) SetBody(rb *AddChainRequest_Body) { + r.Body = rb +} + +func (r *AddChainRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { + r.MetaHeader = mh +} + +func (r *AddChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { + r.VerifyHeader = vh +} + +func (rb *AddChainResponse_Body) SetChainID(chainID []byte) { + rb.ChainId = chainID +} + +func (r *AddChainResponse) SetBody(rb *AddChainResponse_Body) { + r.Body = rb +} + +func (r *AddChainResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { + r.MetaHeader = mh +} + +func (r *AddChainResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { + r.VerifyHeader = vh +} + +func (rb *RemoveChainRequest_Body) SetTarget(t *ChainTarget) { + rb.Target = t +} + +func (rb *RemoveChainRequest_Body) SetChainID(chainID []byte) { + rb.ChainId = chainID +} + +func (r *RemoveChainRequest) SetBody(rb *RemoveChainRequest_Body) { + r.Body = rb +} + +func (r *RemoveChainRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { + r.MetaHeader = mh +} + +func (r *RemoveChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { + r.VerifyHeader = vh +} + +func (r *RemoveChainResponse) SetBody(rb *RemoveChainResponse_Body) { + r.Body = rb +} + +func (r *RemoveChainResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { + r.MetaHeader = mh +} + +func (r *RemoveChainResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { + r.VerifyHeader = vh +} + +func (r *ListChainsRequest_Body) SetTarget(t *ChainTarget) { + r.Target = t +} + +func (r *ListChainsRequest) SetBody(rb *ListChainsRequest_Body) { + r.Body = rb +} + +func (r *ListChainsRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { + r.MetaHeader = mh +} + +func (r *ListChainsRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { + r.VerifyHeader = vh +} + +func (rb *ListChainsResponse_Body) SetChains(chains []*Chain) { + rb.Chains = chains +} + +func (r *ListChainsResponse) SetBody(rb *ListChainsResponse_Body) { + r.Body = rb +} + +func (r *ListChainsResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { + r.MetaHeader = mh +} + +func (r *ListChainsResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { + r.VerifyHeader = vh +} diff --git a/apemanager/grpc/service.pb.go b/apemanager/grpc/service.pb.go new file mode 100644 index 00000000..157da44a --- /dev/null +++ b/apemanager/grpc/service.pb.go @@ -0,0 +1,1131 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: apemanager/grpc/service.proto + +package apemanager + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/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) +) + +type AddChainRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The request's body. + Body *AddChainRequest_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 *grpc.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 *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AddChainRequest) Reset() { + *x = AddChainRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainRequest) ProtoMessage() {} + +func (x *AddChainRequest) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 AddChainRequest.ProtoReflect.Descriptor instead. +func (*AddChainRequest) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *AddChainRequest) GetBody() *AddChainRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AddChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AddChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type AddChainResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response's body. + Body *AddChainResponse_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 *grpc.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 *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AddChainResponse) Reset() { + *x = AddChainResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainResponse) ProtoMessage() {} + +func (x *AddChainResponse) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 AddChainResponse.ProtoReflect.Descriptor instead. +func (*AddChainResponse) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *AddChainResponse) GetBody() *AddChainResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AddChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AddChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type RemoveChainRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The request's body. + Body *RemoveChainRequest_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 *grpc.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 *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *RemoveChainRequest) Reset() { + *x = RemoveChainRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainRequest) ProtoMessage() {} + +func (x *RemoveChainRequest) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 RemoveChainRequest.ProtoReflect.Descriptor instead. +func (*RemoveChainRequest) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2} +} + +func (x *RemoveChainRequest) GetBody() *RemoveChainRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *RemoveChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *RemoveChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type RemoveChainResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response's body. + Body *RemoveChainResponse_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 *grpc.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 *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *RemoveChainResponse) Reset() { + *x = RemoveChainResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainResponse) ProtoMessage() {} + +func (x *RemoveChainResponse) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 RemoveChainResponse.ProtoReflect.Descriptor instead. +func (*RemoveChainResponse) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{3} +} + +func (x *RemoveChainResponse) GetBody() *RemoveChainResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *RemoveChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *RemoveChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type ListChainsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The request's body. + Body *ListChainsRequest_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 *grpc.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 *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *ListChainsRequest) Reset() { + *x = ListChainsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsRequest) ProtoMessage() {} + +func (x *ListChainsRequest) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 ListChainsRequest.ProtoReflect.Descriptor instead. +func (*ListChainsRequest) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4} +} + +func (x *ListChainsRequest) GetBody() *ListChainsRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListChainsRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListChainsRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type ListChainsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response's body. + Body *ListChainsResponse_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 *grpc.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 *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *ListChainsResponse) Reset() { + *x = ListChainsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsResponse) ProtoMessage() {} + +func (x *ListChainsResponse) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 ListChainsResponse.ProtoReflect.Descriptor instead. +func (*ListChainsResponse) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5} +} + +func (x *ListChainsResponse) GetBody() *ListChainsResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListChainsResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListChainsResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type AddChainRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A target for which a rule chain is added. + Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // The chain to set for the target. + Chain *Chain `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` +} + +func (x *AddChainRequest_Body) Reset() { + *x = AddChainRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainRequest_Body) ProtoMessage() {} + +func (x *AddChainRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 AddChainRequest_Body.ProtoReflect.Descriptor instead. +func (*AddChainRequest_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *AddChainRequest_Body) GetTarget() *ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +func (x *AddChainRequest_Body) GetChain() *Chain { + if x != nil { + return x.Chain + } + return nil +} + +type AddChainResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Chain ID assigned for the added rule chain. + // If chain ID is left empty in the request, then + // it will be generated. + ChainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (x *AddChainResponse_Body) Reset() { + *x = AddChainResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainResponse_Body) ProtoMessage() {} + +func (x *AddChainResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 AddChainResponse_Body.ProtoReflect.Descriptor instead. +func (*AddChainResponse_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *AddChainResponse_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} + +type RemoveChainRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Target for which a rule chain is removed. + Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // Chain ID assigned for the rule chain. + ChainId []byte `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (x *RemoveChainRequest_Body) Reset() { + *x = RemoveChainRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainRequest_Body) ProtoMessage() {} + +func (x *RemoveChainRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 RemoveChainRequest_Body.ProtoReflect.Descriptor instead. +func (*RemoveChainRequest_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *RemoveChainRequest_Body) GetTarget() *ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +func (x *RemoveChainRequest_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} + +// Since RemoveChain is an idempotent operation, then the only indicator that +// operation could not be performed is an error returning to a client. +type RemoveChainResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveChainResponse_Body) Reset() { + *x = RemoveChainResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainResponse_Body) ProtoMessage() {} + +func (x *RemoveChainResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 RemoveChainResponse_Body.ProtoReflect.Descriptor instead. +func (*RemoveChainResponse_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{3, 0} +} + +type ListChainsRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Target for which rule chains are listed. + Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *ListChainsRequest_Body) Reset() { + *x = ListChainsRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsRequest_Body) ProtoMessage() {} + +func (x *ListChainsRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 ListChainsRequest_Body.ProtoReflect.Descriptor instead. +func (*ListChainsRequest_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *ListChainsRequest_Body) GetTarget() *ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +type ListChainsResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of chains defined for the reqeusted target. + Chains []*Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` +} + +func (x *ListChainsResponse_Body) Reset() { + *x = ListChainsResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsResponse_Body) ProtoMessage() {} + +func (x *ListChainsResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 ListChainsResponse_Body.ProtoReflect.Descriptor instead. +func (*ListChainsResponse_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ListChainsResponse_Body) GetChains() []*Chain { + if x != nil { + return x.Chains + } + return nil +} + +var File_apemanager_grpc_service_proto protoreflect.FileDescriptor + +var file_apemanager_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x15, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x1a, 0x1b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 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, 0xe4, 0x02, + 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, + 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, 0x76, 0x0a, 0x04, + 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x32, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x22, 0x93, 0x02, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 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, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x21, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x12, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x42, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, + 0x61, 0x69, 0x6e, 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, + 0x5d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xfe, + 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, + 0xb4, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x42, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xb2, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x3c, 0x0a, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x32, 0xb9, 0x02, 0x0a, 0x11, + 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x5b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, + 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, + 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x29, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_apemanager_grpc_service_proto_rawDescOnce sync.Once + file_apemanager_grpc_service_proto_rawDescData = file_apemanager_grpc_service_proto_rawDesc +) + +func file_apemanager_grpc_service_proto_rawDescGZIP() []byte { + file_apemanager_grpc_service_proto_rawDescOnce.Do(func() { + file_apemanager_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_apemanager_grpc_service_proto_rawDescData) + }) + return file_apemanager_grpc_service_proto_rawDescData +} + +var file_apemanager_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_apemanager_grpc_service_proto_goTypes = []interface{}{ + (*AddChainRequest)(nil), // 0: frostfs.v2.apemanager.AddChainRequest + (*AddChainResponse)(nil), // 1: frostfs.v2.apemanager.AddChainResponse + (*RemoveChainRequest)(nil), // 2: frostfs.v2.apemanager.RemoveChainRequest + (*RemoveChainResponse)(nil), // 3: frostfs.v2.apemanager.RemoveChainResponse + (*ListChainsRequest)(nil), // 4: frostfs.v2.apemanager.ListChainsRequest + (*ListChainsResponse)(nil), // 5: frostfs.v2.apemanager.ListChainsResponse + (*AddChainRequest_Body)(nil), // 6: frostfs.v2.apemanager.AddChainRequest.Body + (*AddChainResponse_Body)(nil), // 7: frostfs.v2.apemanager.AddChainResponse.Body + (*RemoveChainRequest_Body)(nil), // 8: frostfs.v2.apemanager.RemoveChainRequest.Body + (*RemoveChainResponse_Body)(nil), // 9: frostfs.v2.apemanager.RemoveChainResponse.Body + (*ListChainsRequest_Body)(nil), // 10: frostfs.v2.apemanager.ListChainsRequest.Body + (*ListChainsResponse_Body)(nil), // 11: frostfs.v2.apemanager.ListChainsResponse.Body + (*grpc.RequestMetaHeader)(nil), // 12: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 13: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 14: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 15: neo.fs.v2.session.ResponseVerificationHeader + (*ChainTarget)(nil), // 16: frostfs.v2.apemanager.ChainTarget + (*Chain)(nil), // 17: frostfs.v2.apemanager.Chain +} +var file_apemanager_grpc_service_proto_depIdxs = []int32{ + 6, // 0: frostfs.v2.apemanager.AddChainRequest.body:type_name -> frostfs.v2.apemanager.AddChainRequest.Body + 12, // 1: frostfs.v2.apemanager.AddChainRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 2: frostfs.v2.apemanager.AddChainRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 7, // 3: frostfs.v2.apemanager.AddChainResponse.body:type_name -> frostfs.v2.apemanager.AddChainResponse.Body + 14, // 4: frostfs.v2.apemanager.AddChainResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 5: frostfs.v2.apemanager.AddChainResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: frostfs.v2.apemanager.RemoveChainRequest.body:type_name -> frostfs.v2.apemanager.RemoveChainRequest.Body + 12, // 7: frostfs.v2.apemanager.RemoveChainRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 8: frostfs.v2.apemanager.RemoveChainRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 9, // 9: frostfs.v2.apemanager.RemoveChainResponse.body:type_name -> frostfs.v2.apemanager.RemoveChainResponse.Body + 14, // 10: frostfs.v2.apemanager.RemoveChainResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 11: frostfs.v2.apemanager.RemoveChainResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 10, // 12: frostfs.v2.apemanager.ListChainsRequest.body:type_name -> frostfs.v2.apemanager.ListChainsRequest.Body + 12, // 13: frostfs.v2.apemanager.ListChainsRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 14: frostfs.v2.apemanager.ListChainsRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 11, // 15: frostfs.v2.apemanager.ListChainsResponse.body:type_name -> frostfs.v2.apemanager.ListChainsResponse.Body + 14, // 16: frostfs.v2.apemanager.ListChainsResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 17: frostfs.v2.apemanager.ListChainsResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 16, // 18: frostfs.v2.apemanager.AddChainRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget + 17, // 19: frostfs.v2.apemanager.AddChainRequest.Body.chain:type_name -> frostfs.v2.apemanager.Chain + 16, // 20: frostfs.v2.apemanager.RemoveChainRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget + 16, // 21: frostfs.v2.apemanager.ListChainsRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget + 17, // 22: frostfs.v2.apemanager.ListChainsResponse.Body.chains:type_name -> frostfs.v2.apemanager.Chain + 0, // 23: frostfs.v2.apemanager.APEManagerService.AddChain:input_type -> frostfs.v2.apemanager.AddChainRequest + 2, // 24: frostfs.v2.apemanager.APEManagerService.RemoveChain:input_type -> frostfs.v2.apemanager.RemoveChainRequest + 4, // 25: frostfs.v2.apemanager.APEManagerService.ListChains:input_type -> frostfs.v2.apemanager.ListChainsRequest + 1, // 26: frostfs.v2.apemanager.APEManagerService.AddChain:output_type -> frostfs.v2.apemanager.AddChainResponse + 3, // 27: frostfs.v2.apemanager.APEManagerService.RemoveChain:output_type -> frostfs.v2.apemanager.RemoveChainResponse + 5, // 28: frostfs.v2.apemanager.APEManagerService.ListChains:output_type -> frostfs.v2.apemanager.ListChainsResponse + 26, // [26:29] is the sub-list for method output_type + 23, // [23:26] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name +} + +func init() { file_apemanager_grpc_service_proto_init() } +func file_apemanager_grpc_service_proto_init() { + if File_apemanager_grpc_service_proto != nil { + return + } + file_apemanager_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_apemanager_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsResponse_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_apemanager_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_apemanager_grpc_service_proto_goTypes, + DependencyIndexes: file_apemanager_grpc_service_proto_depIdxs, + MessageInfos: file_apemanager_grpc_service_proto_msgTypes, + }.Build() + File_apemanager_grpc_service_proto = out.File + file_apemanager_grpc_service_proto_rawDesc = nil + file_apemanager_grpc_service_proto_goTypes = nil + file_apemanager_grpc_service_proto_depIdxs = nil +} diff --git a/apemanager/grpc/service_grpc.pb.go b/apemanager/grpc/service_grpc.pb.go new file mode 100644 index 00000000..484fec5b --- /dev/null +++ b/apemanager/grpc/service_grpc.pb.go @@ -0,0 +1,245 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: apemanager/grpc/service.proto + +package apemanager + +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 ( + APEManagerService_AddChain_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/AddChain" + APEManagerService_RemoveChain_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/RemoveChain" + APEManagerService_ListChains_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/ListChains" +) + +// APEManagerServiceClient is the client API for APEManagerService 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 APEManagerServiceClient interface { + // Add a rule chain for a specific target to `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully added; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + AddChain(ctx context.Context, in *AddChainRequest, opts ...grpc.CallOption) (*AddChainResponse, error) + // Remove a rule chain for a specific target from `Policy` smart contract. + // RemoveChain is an idempotent operation: removal of non-existing rule chain + // also means success. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully removed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + RemoveChain(ctx context.Context, in *RemoveChainRequest, opts ...grpc.CallOption) (*RemoveChainResponse, error) + // List chains defined for a specific target from `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // chains have been successfully listed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + ListChains(ctx context.Context, in *ListChainsRequest, opts ...grpc.CallOption) (*ListChainsResponse, error) +} + +type aPEManagerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAPEManagerServiceClient(cc grpc.ClientConnInterface) APEManagerServiceClient { + return &aPEManagerServiceClient{cc} +} + +func (c *aPEManagerServiceClient) AddChain(ctx context.Context, in *AddChainRequest, opts ...grpc.CallOption) (*AddChainResponse, error) { + out := new(AddChainResponse) + err := c.cc.Invoke(ctx, APEManagerService_AddChain_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPEManagerServiceClient) RemoveChain(ctx context.Context, in *RemoveChainRequest, opts ...grpc.CallOption) (*RemoveChainResponse, error) { + out := new(RemoveChainResponse) + err := c.cc.Invoke(ctx, APEManagerService_RemoveChain_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPEManagerServiceClient) ListChains(ctx context.Context, in *ListChainsRequest, opts ...grpc.CallOption) (*ListChainsResponse, error) { + out := new(ListChainsResponse) + err := c.cc.Invoke(ctx, APEManagerService_ListChains_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// APEManagerServiceServer is the server API for APEManagerService service. +// All implementations should embed UnimplementedAPEManagerServiceServer +// for forward compatibility +type APEManagerServiceServer interface { + // Add a rule chain for a specific target to `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully added; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + AddChain(context.Context, *AddChainRequest) (*AddChainResponse, error) + // Remove a rule chain for a specific target from `Policy` smart contract. + // RemoveChain is an idempotent operation: removal of non-existing rule chain + // also means success. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully removed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + RemoveChain(context.Context, *RemoveChainRequest) (*RemoveChainResponse, error) + // List chains defined for a specific target from `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // chains have been successfully listed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) +} + +// UnimplementedAPEManagerServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAPEManagerServiceServer struct { +} + +func (UnimplementedAPEManagerServiceServer) AddChain(context.Context, *AddChainRequest) (*AddChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddChain not implemented") +} +func (UnimplementedAPEManagerServiceServer) RemoveChain(context.Context, *RemoveChainRequest) (*RemoveChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveChain not implemented") +} +func (UnimplementedAPEManagerServiceServer) ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListChains not implemented") +} + +// UnsafeAPEManagerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to APEManagerServiceServer will +// result in compilation errors. +type UnsafeAPEManagerServiceServer interface { + mustEmbedUnimplementedAPEManagerServiceServer() +} + +func RegisterAPEManagerServiceServer(s grpc.ServiceRegistrar, srv APEManagerServiceServer) { + s.RegisterService(&APEManagerService_ServiceDesc, srv) +} + +func _APEManagerService_AddChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddChainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APEManagerServiceServer).AddChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: APEManagerService_AddChain_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APEManagerServiceServer).AddChain(ctx, req.(*AddChainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APEManagerService_RemoveChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveChainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APEManagerServiceServer).RemoveChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: APEManagerService_RemoveChain_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APEManagerServiceServer).RemoveChain(ctx, req.(*RemoveChainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APEManagerService_ListChains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListChainsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APEManagerServiceServer).ListChains(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: APEManagerService_ListChains_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APEManagerServiceServer).ListChains(ctx, req.(*ListChainsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// APEManagerService_ServiceDesc is the grpc.ServiceDesc for APEManagerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var APEManagerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "frostfs.v2.apemanager.APEManagerService", + HandlerType: (*APEManagerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddChain", + Handler: _APEManagerService_AddChain_Handler, + }, + { + MethodName: "RemoveChain", + Handler: _APEManagerService_RemoveChain_Handler, + }, + { + MethodName: "ListChains", + Handler: _APEManagerService_ListChains_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "apemanager/grpc/service.proto", +} diff --git a/apemanager/grpc/types.go b/apemanager/grpc/types.go new file mode 100644 index 00000000..0f2ebb26 --- /dev/null +++ b/apemanager/grpc/types.go @@ -0,0 +1,21 @@ +package apemanager + +func (t *ChainTarget) SetType(typ TargetType) { + t.Type = typ +} + +func (t *ChainTarget) SetName(name string) { + t.Name = name +} + +func (c *Chain) SetKind(kind isChain_Kind) { + c.Kind = kind +} + +func (cr *Chain_Raw) SetRaw(raw []byte) { + cr.Raw = raw +} + +func (cr *Chain_Raw) GetRaw() []byte { + return cr.Raw +} diff --git a/apemanager/grpc/types.pb.go b/apemanager/grpc/types.pb.go new file mode 100644 index 00000000..395857ae --- /dev/null +++ b/apemanager/grpc/types.pb.go @@ -0,0 +1,312 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: apemanager/grpc/types.proto + +package apemanager + +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) +) + +// TargetType is a type target to which a rule chain is defined. +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +// Enum value maps for TargetType. +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) Enum() *TargetType { + p := new(TargetType) + *p = x + return p +} + +func (x TargetType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetType) Descriptor() protoreflect.EnumDescriptor { + return file_apemanager_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (TargetType) Type() protoreflect.EnumType { + return &file_apemanager_grpc_types_proto_enumTypes[0] +} + +func (x TargetType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TargetType.Descriptor instead. +func (TargetType) EnumDescriptor() ([]byte, []int) { + return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// ChainTarget is an object to which a rule chain is defined. +type ChainTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.apemanager.TargetType" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ChainTarget) Reset() { + *x = ChainTarget{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChainTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainTarget) ProtoMessage() {} + +func (x *ChainTarget) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 ChainTarget.ProtoReflect.Descriptor instead. +func (*ChainTarget) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *ChainTarget) GetType() TargetType { + if x != nil { + return x.Type + } + return TargetType_UNDEFINED +} + +func (x *ChainTarget) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Chain is a chain of rules defined for a specific target. +type Chain struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *Chain_Raw + Kind isChain_Kind `protobuf_oneof:"kind"` +} + +func (x *Chain) Reset() { + *x = Chain{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Chain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chain) ProtoMessage() {} + +func (x *Chain) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_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 Chain.ProtoReflect.Descriptor instead. +func (*Chain) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (m *Chain) GetKind() isChain_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *Chain) GetRaw() []byte { + if x, ok := x.GetKind().(*Chain_Raw); ok { + return x.Raw + } + return nil +} + +type isChain_Kind interface { + isChain_Kind() +} + +type Chain_Raw struct { + // Raw representation of a serizalized rule chain. + Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"` +} + +func (*Chain_Raw) isChain_Kind() {} + +var File_apemanager_grpc_types_proto protoreflect.FileDescriptor + +var file_apemanager_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x21, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, + 0x0a, 0x05, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, + 0x69, 0x6e, 0x64, 0x2a, 0x4e, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, + 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, + 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, + 0x50, 0x10, 0x04, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, + 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_apemanager_grpc_types_proto_rawDescOnce sync.Once + file_apemanager_grpc_types_proto_rawDescData = file_apemanager_grpc_types_proto_rawDesc +) + +func file_apemanager_grpc_types_proto_rawDescGZIP() []byte { + file_apemanager_grpc_types_proto_rawDescOnce.Do(func() { + file_apemanager_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_apemanager_grpc_types_proto_rawDescData) + }) + return file_apemanager_grpc_types_proto_rawDescData +} + +var file_apemanager_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_apemanager_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_apemanager_grpc_types_proto_goTypes = []interface{}{ + (TargetType)(0), // 0: frostfs.v2.apemanager.TargetType + (*ChainTarget)(nil), // 1: frostfs.v2.apemanager.ChainTarget + (*Chain)(nil), // 2: frostfs.v2.apemanager.Chain +} +var file_apemanager_grpc_types_proto_depIdxs = []int32{ + 0, // 0: frostfs.v2.apemanager.ChainTarget.type:type_name -> frostfs.v2.apemanager.TargetType + 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_apemanager_grpc_types_proto_init() } +func file_apemanager_grpc_types_proto_init() { + if File_apemanager_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_apemanager_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainTarget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chain); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_apemanager_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Chain_Raw)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_apemanager_grpc_types_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_apemanager_grpc_types_proto_goTypes, + DependencyIndexes: file_apemanager_grpc_types_proto_depIdxs, + EnumInfos: file_apemanager_grpc_types_proto_enumTypes, + MessageInfos: file_apemanager_grpc_types_proto_msgTypes, + }.Build() + File_apemanager_grpc_types_proto = out.File + file_apemanager_grpc_types_proto_rawDesc = nil + file_apemanager_grpc_types_proto_goTypes = nil + file_apemanager_grpc_types_proto_depIdxs = nil +} diff --git a/apemanager/json.go b/apemanager/json.go new file mode 100644 index 00000000..4f44d5ed --- /dev/null +++ b/apemanager/json.go @@ -0,0 +1,14 @@ +package apemanager + +import ( + apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" +) + +func (t *ChainTarget) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(t) +} + +func (t *ChainTarget) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(t, data, new(apemanager_grpc.ChainTarget)) +} diff --git a/apemanager/marshal.go b/apemanager/marshal.go new file mode 100644 index 00000000..22e092e2 --- /dev/null +++ b/apemanager/marshal.go @@ -0,0 +1,288 @@ +package apemanager + +import ( + "fmt" + + apemanager "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" +) + +const ( + chainTargetTargetTypeField = 1 + chainTargetNameField = 2 + + chainRawField = 1 + + addChainReqBodyTargetField = 1 + addChainReqBodyChainField = 2 + + addChainRespBodyChainIDField = 1 + + removeChainReqBodyTargetField = 1 + removeChainReqBodyChainField = 2 + + /* + Fields for RemoveResponseBody are missed since RemoveResponseBody is empty. + */ + + listChainsReqBodyTargetField = 1 + + listChainsRespBodyChainsField = 1 +) + +func (t *ChainTarget) StableSize() (size int) { + if t == nil { + return 0 + } + + size += proto.EnumSize(chainTargetTargetTypeField, int32(t.targeType)) + size += proto.StringSize(chainTargetNameField, t.name) + + return size +} + +func (t *ChainTarget) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(chainTargetTargetTypeField, buf[offset:], int32(t.targeType)) + proto.StringMarshal(chainTargetNameField, buf[offset:], t.name) + + return buf +} + +func (t *ChainTarget) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(apemanager.ChainTarget)) +} + +func (c *Chain) StableSize() (size int) { + if c == nil { + return 0 + } + + switch v := c.GetKind().(type) { + case *ChainRaw: + if v != nil { + size += proto.BytesSize(chainRawField, v.GetRaw()) + } + default: + panic(fmt.Sprintf("unsupported chain kind: %T", v)) + } + + return size +} + +func (c *Chain) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + switch v := c.GetKind().(type) { + case *ChainRaw: + if v != nil { + proto.BytesMarshal(chainRawField, buf[offset:], v.GetRaw()) + } + default: + panic(fmt.Sprintf("unsupported chain kind: %T", v)) + } + + return buf +} + +func (c *Chain) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(apemanager.Chain)) +} + +func (rb *AddChainRequestBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.NestedStructureSize(addChainReqBodyTargetField, rb.target) + size += proto.NestedStructureSize(addChainReqBodyChainField, rb.chain) + + return size +} + +func (rb *AddChainRequestBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(addChainReqBodyTargetField, buf[offset:], rb.target) + proto.NestedStructureMarshal(addChainReqBodyChainField, buf[offset:], rb.chain) + + return buf +} + +func (rb *AddChainRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.AddChainRequest_Body)) +} + +func (rb *AddChainResponseBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.BytesSize(addChainRespBodyChainIDField, rb.chainID) + + return size +} + +func (rb *AddChainResponseBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + + proto.BytesMarshal(addChainRespBodyChainIDField, buf[offset:], rb.chainID) + + return buf +} + +func (rb *AddChainResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.AddChainResponse_Body)) +} + +func (rb *RemoveChainRequestBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.NestedStructureSize(addChainReqBodyTargetField, rb.target) + size += proto.BytesSize(addChainReqBodyChainField, rb.chainID) + + return size +} + +func (rb *RemoveChainRequestBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(removeChainReqBodyTargetField, buf[offset:], rb.target) + proto.BytesMarshal(removeChainReqBodyChainField, buf[offset:], rb.chainID) + + return buf +} + +func (rb *RemoveChainRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.RemoveChainRequest_Body)) +} + +func (rb *RemoveChainResponseBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + return size +} + +func (rb *RemoveChainResponseBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + return buf +} + +func (rb *RemoveChainResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.RemoveChainResponse_Body)) +} + +func (rb *ListChainsRequestBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.NestedStructureSize(listChainsReqBodyTargetField, rb.target) + + return size +} + +func (rb *ListChainsRequestBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + proto.NestedStructureMarshal(addChainReqBodyTargetField, buf[offset:], rb.target) + + return buf +} + +func (rb *ListChainsRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.ListChainsRequest_Body)) +} + +func (rb *ListChainsResponseBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + for _, chain := range rb.GetChains() { + size += proto.NestedStructureSize(listChainsRespBodyChainsField, chain) + } + + return size +} + +func (rb *ListChainsResponseBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + for _, chain := range rb.GetChains() { + offset += proto.NestedStructureMarshal(listChainsRespBodyChainsField, buf[offset:], chain) + } + + return buf +} + +func (rb *ListChainsResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.ListChainsResponse_Body)) +} diff --git a/apemanager/message_test.go b/apemanager/message_test.go new file mode 100644 index 00000000..2d623d53 --- /dev/null +++ b/apemanager/message_test.go @@ -0,0 +1,27 @@ +package apemanager_test + +import ( + "testing" + + apemanagertest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return apemanagertest.GenerateChainTarget(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainRequestBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainRequest(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainResponseBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainResponse(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainRequestBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainRequest(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainResponseBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainResponse(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsRequestBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsRequest(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsResponseBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsResponse(empty) }, + ) +} diff --git a/apemanager/status.go b/apemanager/status.go new file mode 100644 index 00000000..932fa6b5 --- /dev/null +++ b/apemanager/status.go @@ -0,0 +1,76 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" +) + +// LocalizeFailStatus checks if passed global status.Code is related to ape manager failure and: +// +// then localizes the code and returns true, +// else leaves the code unchanged and returns false. +// +// Arg must be non-nil. +func LocalizeFailStatus(c *status.Code) bool { + return status.LocalizeIfInSection(c, uint32(statusgrpc.Section_SECTION_APE_MANAGER)) +} + +// GlobalizeFail globalizes local code of ape manager failure. +// +// Arg must be non-nil. +func GlobalizeFail(c *status.Code) { + c.GlobalizeSection(uint32(statusgrpc.Section_SECTION_APE_MANAGER)) +} + +const ( + // StatusAPEManagerAccessDenied is a local status.Code value for + // ACCESS_DENIED ape manager failure. + StatusAPEManagerAccessDenied status.Code = iota +) + +const ( + // detailAccessDeniedDesc is a StatusAccessDenied detail ID for + // human-readable description. + detailAccessDeniedDesc = iota +) + +// WriteAccessDeniedDesc writes human-readable description of StatusAccessDenied +// into status.Status as a detail. The status must not be nil. +// +// Existing details are expected to be ID-unique, otherwise undefined behavior. +func WriteAccessDeniedDesc(st *status.Status, desc string) { + var found bool + + st.IterateDetails(func(d *status.Detail) bool { + if d.ID() == detailAccessDeniedDesc { + found = true + d.SetValue([]byte(desc)) + } + + return found + }) + + if !found { + var d status.Detail + + d.SetID(detailAccessDeniedDesc) + d.SetValue([]byte(desc)) + + st.AppendDetails(d) + } +} + +// ReadAccessDeniedDesc looks up for status detail with human-readable description +// of StatusAccessDenied. Returns empty string if detail is missing. +func ReadAccessDeniedDesc(st status.Status) (desc string) { + st.IterateDetails(func(d *status.Detail) bool { + if d.ID() == detailAccessDeniedDesc { + desc = string(d.Value()) + return true + } + + return false + }) + + return +} diff --git a/apemanager/status_test.go b/apemanager/status_test.go new file mode 100644 index 00000000..c150ac70 --- /dev/null +++ b/apemanager/status_test.go @@ -0,0 +1,30 @@ +package apemanager_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" + "github.com/stretchr/testify/require" +) + +func TestStatusCodes(t *testing.T) { + statustest.TestCodes(t, apemanager.LocalizeFailStatus, apemanager.GlobalizeFail, + apemanager.StatusAPEManagerAccessDenied, 5120, + ) +} + +func TestAccessDeniedDesc(t *testing.T) { + var st status.Status + + require.Empty(t, apemanager.ReadAccessDeniedDesc(st)) + + const desc = "some description" + + apemanager.WriteAccessDeniedDesc(&st, desc) + require.Equal(t, desc, apemanager.ReadAccessDeniedDesc(st)) + + apemanager.WriteAccessDeniedDesc(&st, desc+"1") + require.Equal(t, desc+"1", apemanager.ReadAccessDeniedDesc(st)) +} diff --git a/apemanager/string.go b/apemanager/string.go new file mode 100644 index 00000000..dddeedeb --- /dev/null +++ b/apemanager/string.go @@ -0,0 +1,18 @@ +package apemanager + +import ( + apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" +) + +func (tt TargetType) String() string { + return TargetTypeToGRPCField(tt).String() +} + +func (tt *TargetType) FromString(s string) bool { + i, ok := apemanager_grpc.TargetType_value[s] + if ok { + *tt = TargetType(i) + } + + return ok +} diff --git a/apemanager/test/generate.go b/apemanager/test/generate.go new file mode 100644 index 00000000..00dd2365 --- /dev/null +++ b/apemanager/test/generate.go @@ -0,0 +1,208 @@ +package apemanagertest + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" +) + +func generateChainID(empty bool) []byte { + if empty { + return []byte{} + } + + return []byte("616c6c6f774f626a476574436e72") +} + +func generateRawChains(empty bool, n int) []*apemanager.Chain { + if empty { + return []*apemanager.Chain{} + } + + res := make([]*apemanager.Chain, n) + for i := range res { + res[i] = generateRawChain(empty) + } + return res +} + +func generateRawChain(empty bool) *apemanager.Chain { + chRaw := new(apemanager.ChainRaw) + + if empty { + chRaw.SetRaw([]byte("{}")) + } else { + chRaw.SetRaw([]byte(`{ + "ID": "", + "Rules": [ + { + "Status": "Allow", + "Actions": { + "Inverted": false, + "Names": [ + "GetObject" + ] + }, + "Resources": { + "Inverted": false, + "Names": [ + "native:object/*" + ] + }, + "Any": false, + "Condition": [ + { + "Op": "StringEquals", + "Object": "Resource", + "Key": "Department", + "Value": "HR" + } + ] + } + ], + "MatchType": "DenyPriority" + }`)) + } + + ch := new(apemanager.Chain) + ch.SetKind(chRaw) + return ch +} + +func GenerateChainTarget(empty bool) *apemanager.ChainTarget { + m := new(apemanager.ChainTarget) + + if !empty { + m.SetTargetType(apemanager.TargetTypeContainer) + m.SetName("BzQw5HH3feoxFDD5tCT87Y1726qzgLfxEE7wgtoRzB3R") + } + + return m +} + +func GenerateAddChainRequestBody(empty bool) *apemanager.AddChainRequestBody { + m := new(apemanager.AddChainRequestBody) + + if !empty { + m.SetTarget(GenerateChainTarget(empty)) + m.SetChain(generateRawChain(empty)) + } + + return m +} + +func GenerateAddChainRequest(empty bool) *apemanager.AddChainRequest { + m := new(apemanager.AddChainRequest) + + if !empty { + m.SetBody(GenerateAddChainRequestBody(empty)) + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + } + + return m +} + +func GenerateAddChainResponseBody(empty bool) *apemanager.AddChainResponseBody { + m := new(apemanager.AddChainResponseBody) + + if !empty { + m.SetChainID(generateChainID(empty)) + } + + return m +} + +func GenerateAddChainResponse(empty bool) *apemanager.AddChainResponse { + m := new(apemanager.AddChainResponse) + + if !empty { + m.SetBody(GenerateAddChainResponseBody(empty)) + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + } + + return m +} + +func GenerateRemoveChainRequestBody(empty bool) *apemanager.RemoveChainRequestBody { + m := new(apemanager.RemoveChainRequestBody) + + if !empty { + m.SetChainID(generateChainID(empty)) + m.SetTarget(GenerateChainTarget(empty)) + } + + return m +} + +func GenerateRemoveChainRequest(empty bool) *apemanager.RemoveChainRequest { + m := new(apemanager.RemoveChainRequest) + + if !empty { + m.SetBody(GenerateRemoveChainRequestBody(empty)) + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + } + + return m +} + +func GenerateRemoveChainResponseBody(_ bool) *apemanager.RemoveChainResponseBody { + return new(apemanager.RemoveChainResponseBody) +} + +func GenerateRemoveChainResponse(empty bool) *apemanager.RemoveChainResponse { + m := new(apemanager.RemoveChainResponse) + + if !empty { + m.SetBody(GenerateRemoveChainResponseBody(empty)) + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + } + + return m +} + +func GenerateListChainsRequestBody(empty bool) *apemanager.ListChainsRequestBody { + m := new(apemanager.ListChainsRequestBody) + + if !empty { + m.SetTarget(GenerateChainTarget(empty)) + } + + return m +} + +func GenerateListChainsRequest(empty bool) *apemanager.ListChainsRequest { + m := new(apemanager.ListChainsRequest) + + if !empty { + m.SetBody(GenerateListChainsRequestBody(empty)) + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + } + + return m +} + +func GenerateListChainsResponseBody(empty bool) *apemanager.ListChainsResponseBody { + m := new(apemanager.ListChainsResponseBody) + + if !empty { + m.SetChains(generateRawChains(empty, 10)) + } + + return m +} + +func GenerateListChainsResponse(empty bool) *apemanager.ListChainsResponse { + m := new(apemanager.ListChainsResponse) + + if !empty { + m.SetBody(GenerateListChainsResponseBody(empty)) + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + } + + return m +} diff --git a/apemanager/types.go b/apemanager/types.go new file mode 100644 index 00000000..1fcca294 --- /dev/null +++ b/apemanager/types.go @@ -0,0 +1,244 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" +) + +type TargetType uint32 + +const ( + TargetTypeUndefined TargetType = iota + TargetTypeNamespace + TargetTypeContainer + TargetTypeUser + TargetTypeGroup +) + +type ChainTarget struct { + targeType TargetType + + name string +} + +func (ct *ChainTarget) SetTargetType(targeType TargetType) { + ct.targeType = targeType +} + +func (ct *ChainTarget) SetName(name string) { + ct.name = name +} + +func (ct *ChainTarget) GetTargetType() TargetType { + if ct != nil { + return ct.targeType + } + + return 0 +} + +func (ct *ChainTarget) GetName() string { + if ct != nil { + return ct.name + } + + return "" +} + +type AddChainRequest struct { + body *AddChainRequestBody + + session.RequestHeaders +} + +func (r *AddChainRequest) SetBody(body *AddChainRequestBody) { + r.body = body +} + +func (r *AddChainRequest) GetBody() *AddChainRequestBody { + return r.body +} + +type chainKind interface { + isChainKind() +} + +type Chain struct { + kind chainKind +} + +func (c *Chain) SetKind(kind chainKind) { + c.kind = kind +} + +func (c *Chain) GetKind() chainKind { + return c.kind +} + +type ChainRaw struct { + Raw []byte +} + +func (*ChainRaw) isChainKind() {} + +func (c *ChainRaw) SetRaw(raw []byte) { + c.Raw = raw +} + +func (c *ChainRaw) GetRaw() []byte { + return c.Raw +} + +type AddChainRequestBody struct { + target *ChainTarget + + chain *Chain +} + +func (rb *AddChainRequestBody) SetTarget(target *ChainTarget) { + rb.target = target +} + +func (rb *AddChainRequestBody) GetTarget() *ChainTarget { + return rb.target +} + +func (rb *AddChainRequestBody) SetChain(chain *Chain) { + rb.chain = chain +} + +func (rb *AddChainRequestBody) GetChain() *Chain { + return rb.chain +} + +type AddChainResponse struct { + body *AddChainResponseBody + + session.ResponseHeaders +} + +func (r *AddChainResponse) SetBody(body *AddChainResponseBody) { + r.body = body +} + +func (r *AddChainResponse) GetBody() *AddChainResponseBody { + return r.body +} + +type AddChainResponseBody struct { + chainID []byte +} + +func (rb *AddChainResponseBody) SetChainID(chainID []byte) { + rb.chainID = chainID +} + +func (rb *AddChainResponseBody) GetChainID() []byte { + return rb.chainID +} + +type RemoveChainRequest struct { + body *RemoveChainRequestBody + + session.RequestHeaders +} + +func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) { + r.body = body +} + +func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody { + return r.body +} + +type RemoveChainRequestBody struct { + target *ChainTarget + + chainID []byte +} + +func (rb *RemoveChainRequestBody) SetTarget(target *ChainTarget) { + rb.target = target +} + +func (rb *RemoveChainRequestBody) GetTarget() *ChainTarget { + return rb.target +} + +func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) { + rb.chainID = chainID +} + +func (rb *RemoveChainRequestBody) GetChainID() []byte { + return rb.chainID +} + +type RemoveChainResponse struct { + body *RemoveChainResponseBody + + session.ResponseHeaders +} + +type RemoveChainResponseBody struct { +} + +func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) { + r.body = body +} + +func (r *RemoveChainResponse) GetBody() *RemoveChainResponseBody { + return r.body +} + +type ListChainsRequest struct { + body *ListChainsRequestBody + + session.RequestHeaders +} + +func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) { + r.body = body +} + +func (r *ListChainsRequest) GetBody() *ListChainsRequestBody { + return r.body +} + +type ListChainsRequestBody struct { + target *ChainTarget +} + +func (rb *ListChainsRequestBody) SetTarget(target *ChainTarget) { + rb.target = target +} + +func (rb *ListChainsRequestBody) GetTarget() *ChainTarget { + return rb.target +} + +type ListChainsResponse struct { + body *ListChainsResponseBody + + session.ResponseHeaders +} + +func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) { + r.body = body +} + +func (r *ListChainsResponse) GetBody() *ListChainsResponseBody { + return r.body +} + +type ListChainsResponseBody struct { + chains []*Chain + + session.RequestHeaders +} + +func (r *ListChainsResponseBody) SetChains(chains []*Chain) { + r.chains = chains +} + +func (r *ListChainsResponseBody) GetChains() []*Chain { + return r.chains +} diff --git a/rpc/apemanager.go b/rpc/apemanager.go new file mode 100644 index 00000000..3f3d6cdc --- /dev/null +++ b/rpc/apemanager.go @@ -0,0 +1,60 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" +) + +const serviceAPEManager = serviceNamePrefix + "apemanager.APEManagerService" + +const ( + rpcAPEManagerAddChain = "AddChain" + rpcAPEManagerRemoveChain = "RemoveChain" + rpcAPEManagerListChains = "ListChains" +) + +func AddChain( + cli *client.Client, + req *apemanager.AddChainRequest, + opts ...client.CallOption, +) (*apemanager.AddChainResponse, error) { + resp := new(apemanager.AddChainResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerAddChain), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func RemoveChain( + cli *client.Client, + req *apemanager.RemoveChainRequest, + opts ...client.CallOption, +) (*apemanager.RemoveChainResponse, error) { + resp := new(apemanager.RemoveChainResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerRemoveChain), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func ListChains( + cli *client.Client, + req *apemanager.ListChainsRequest, + opts ...client.CallOption, +) (*apemanager.ListChainsResponse, error) { + resp := new(apemanager.ListChainsResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerListChains), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/signature/body.go b/signature/body.go index b7bb6b43..3362e958 100644 --- a/signature/body.go +++ b/signature/body.go @@ -4,6 +4,7 @@ import ( "fmt" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" @@ -105,5 +106,19 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *netmap.SnapshotResponse: return v.GetBody() + + /* APEManager */ + case *apemanager.AddChainRequest: + return v.GetBody() + case *apemanager.AddChainResponse: + return v.GetBody() + case *apemanager.RemoveChainRequest: + return v.GetBody() + case *apemanager.RemoveChainResponse: + return v.GetBody() + case *apemanager.ListChainsRequest: + return v.GetBody() + case *apemanager.ListChainsResponse: + return v.GetBody() } } diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index 96372943..64a08353 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -34,6 +34,8 @@ const ( Section_SECTION_CONTAINER Section = 3 // Session service-specific errors. Section_SECTION_SESSION Section = 4 + // Session service-specific errors. + Section_SECTION_APE_MANAGER Section = 5 ) // Enum value maps for Section. @@ -44,6 +46,7 @@ var ( 2: "SECTION_OBJECT", 3: "SECTION_CONTAINER", 4: "SECTION_SESSION", + 5: "SECTION_APE_MANAGER", } Section_value = map[string]int32{ "SECTION_SUCCESS": 0, @@ -51,6 +54,7 @@ var ( "SECTION_OBJECT": 2, "SECTION_CONTAINER": 3, "SECTION_SESSION": 4, + "SECTION_APE_MANAGER": 5, } ) @@ -359,6 +363,51 @@ func (Session) EnumDescriptor() ([]byte, []int) { return file_status_grpc_types_proto_rawDescGZIP(), []int{5} } +// Section of status for APE manager related operations. +type APEManager int32 + +const ( + // [**5120**] The operation is denied by APE manager. + APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0 +) + +// Enum value maps for APEManager. +var ( + APEManager_name = map[int32]string{ + 0: "APE_MANAGER_ACCESS_DENIED", + } + APEManager_value = map[string]int32{ + "APE_MANAGER_ACCESS_DENIED": 0, + } +) + +func (x APEManager) Enum() *APEManager { + p := new(APEManager) + *p = x + return p +} + +func (x APEManager) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (APEManager) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[6].Descriptor() +} + +func (APEManager) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[6] +} + +func (x APEManager) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use APEManager.Descriptor instead. +func (APEManager) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{6} +} + // 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. @@ -531,46 +580,51 @@ var file_status_grpc_types_proto_rawDesc = []byte{ 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, 0x55, 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, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, - 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, - 0x02, 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, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, - 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 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, + 0x93, 0x01, 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, 0x12, 0x17, 0x0a, 0x13, + 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, + 0x47, 0x45, 0x52, 0x10, 0x05, 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, 0x55, 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, 0x12, 0x1b, + 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 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, 0x2a, 0x2b, + 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, + 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x61, 0x5a, 0x42, 0x67, + 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, + 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, + 0x73, 0x74, 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 ( @@ -585,7 +639,7 @@ func file_status_grpc_types_proto_rawDescGZIP() []byte { return file_status_grpc_types_proto_rawDescData } -var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) 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 @@ -594,11 +648,12 @@ var file_status_grpc_types_proto_goTypes = []interface{}{ (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 + (APEManager)(0), // 6: neo.fs.v2.status.APEManager + (*Status)(nil), // 7: neo.fs.v2.status.Status + (*Status_Detail)(nil), // 8: 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 + 8, // 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 @@ -642,7 +697,7 @@ func file_status_grpc_types_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_status_grpc_types_proto_rawDesc, - NumEnums: 6, + NumEnums: 7, NumMessages: 2, NumExtensions: 0, NumServices: 0,