From 6227d673f6b505dc8f095328a602a3ea2ce1ff80 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 05:23:25 +0800 Subject: [PATCH 01/10] Update acp_core submodule to latest commit --- submodules/acp_core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/acp_core b/submodules/acp_core index 036a98e..749982a 160000 --- a/submodules/acp_core +++ b/submodules/acp_core @@ -1 +1 @@ -Subproject commit 036a98e9e20da1d5bc878807b62a6c4e599741b9 +Subproject commit 749982a4b35d0a45871ecb77b4b45ff93c885204 From ffc124336ddd1e118057f621d1cc15ea8d40d6f4 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:09:27 +0800 Subject: [PATCH 02/10] Run go mod tidy --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 78d058a..91b4cc1 100644 --- a/go.mod +++ b/go.mod @@ -255,7 +255,7 @@ require ( github.com/segmentio/asm v1.2.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect - github.com/sourcenetwork/zanzi v0.3.1-0.20240722161512-1aa0a9977af7 // indirect + github.com/sourcenetwork/zanzi v0.3.1-0.20250117191617-40400ffac5e3 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect diff --git a/go.sum b/go.sum index 9e001cd..43bfe98 100644 --- a/go.sum +++ b/go.sum @@ -294,7 +294,7 @@ github.com/bits-and-blooms/bitset v1.11.0 h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFS github.com/bits-and-blooms/bitset v1.11.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY= +github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= @@ -1106,8 +1106,8 @@ github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9yS github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcenetwork/raccoondb v0.2.1-0.20240722161350-d4a78b691ec8 h1:d0jNogSYqMt+dC05tnd+x7lmzEcBHpKoIU5woZSSHFM= github.com/sourcenetwork/raccoondb v0.2.1-0.20240722161350-d4a78b691ec8/go.mod h1:/WJdZWouiY199DypsN0xaP5PF0zy3rka3FxH5Y8o9Bc= -github.com/sourcenetwork/zanzi v0.3.1-0.20240722161512-1aa0a9977af7 h1:k/ChZJf2rn5uKtFVzzqs/SCT83Y7901JoYU25kHBcRA= -github.com/sourcenetwork/zanzi v0.3.1-0.20240722161512-1aa0a9977af7/go.mod h1:c4C+Vd6knqAHX6fl57gb3BROUNC1g3WGGlWROREpC8U= +github.com/sourcenetwork/zanzi v0.3.1-0.20250117191617-40400ffac5e3 h1:ZiNRmk7Kfylv6Hm/KgM1qMl517BRiNbUNjn+kZDeBIQ= +github.com/sourcenetwork/zanzi v0.3.1-0.20250117191617-40400ffac5e3/go.mod h1:c4C+Vd6knqAHX6fl57gb3BROUNC1g3WGGlWROREpC8U= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= From 6cb2980a19ba7a04c12543fcf0545aa9309d0d44 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:12:59 +0800 Subject: [PATCH 03/10] Fix policy_cmd proto, run make proto, revert invalid acp_core imports in pulsar files --- api/sourcehub/acp/policy_cmd.pulsar.go | 186 +++++---------- proto/sourcehub/acp/policy_cmd.proto | 12 +- x/acp/types/policy_cmd.pb.go | 305 +++++++++++-------------- x/acp/types/query.pb.go | 1 + x/acp/types/tx.pb.go | 1 + x/bulletin/types/query.pb.go | 1 + x/bulletin/types/tx.pb.go | 1 + x/epochs/types/query.pb.go | 1 + x/tier/types/query.pb.go | 1 + x/tier/types/tx.pb.go | 1 + 10 files changed, 210 insertions(+), 300 deletions(-) diff --git a/api/sourcehub/acp/policy_cmd.pulsar.go b/api/sourcehub/acp/policy_cmd.pulsar.go index eb774b4..29e6ba8 100644 --- a/api/sourcehub/acp/policy_cmd.pulsar.go +++ b/api/sourcehub/acp/policy_cmd.pulsar.go @@ -4680,14 +4680,12 @@ func (x *fastReflection_DeleteRelationshipCmdResult) ProtoMethods() *protoiface. var ( md_RegisterObjectCmdResult protoreflect.MessageDescriptor - fd_RegisterObjectCmdResult_result protoreflect.FieldDescriptor fd_RegisterObjectCmdResult_record protoreflect.FieldDescriptor ) func init() { file_sourcehub_acp_policy_cmd_proto_init() md_RegisterObjectCmdResult = File_sourcehub_acp_policy_cmd_proto.Messages().ByName("RegisterObjectCmdResult") - fd_RegisterObjectCmdResult_result = md_RegisterObjectCmdResult.Fields().ByName("result") fd_RegisterObjectCmdResult_record = md_RegisterObjectCmdResult.Fields().ByName("record") } @@ -4756,12 +4754,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Interface() protoreflect.ProtoM // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_RegisterObjectCmdResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Result != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Result)) - if !f(fd_RegisterObjectCmdResult_result, value) { - return - } - } if x.Record != nil { value := protoreflect.ValueOfMessage(x.Record.ProtoReflect()) if !f(fd_RegisterObjectCmdResult_record, value) { @@ -4783,8 +4775,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Range(f func(protoreflect.Field // a repeated field is populated if it is non-empty. func (x *fastReflection_RegisterObjectCmdResult) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "sourcehub.acp.RegisterObjectCmdResult.result": - return x.Result != 0 case "sourcehub.acp.RegisterObjectCmdResult.record": return x.Record != nil default: @@ -4803,8 +4793,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Has(fd protoreflect.FieldDescri // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_RegisterObjectCmdResult) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "sourcehub.acp.RegisterObjectCmdResult.result": - x.Result = 0 case "sourcehub.acp.RegisterObjectCmdResult.record": x.Record = nil default: @@ -4823,9 +4811,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Clear(fd protoreflect.FieldDesc // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_RegisterObjectCmdResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "sourcehub.acp.RegisterObjectCmdResult.result": - value := x.Result - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) case "sourcehub.acp.RegisterObjectCmdResult.record": value := x.Record return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -4849,8 +4834,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Get(descriptor protoreflect.Fie // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_RegisterObjectCmdResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "sourcehub.acp.RegisterObjectCmdResult.result": - x.Result = (acp_core.RegistrationResult)(value.Enum()) case "sourcehub.acp.RegisterObjectCmdResult.record": x.Record = value.Message().Interface().(*acp_core.RelationshipRecord) default: @@ -4878,8 +4861,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Mutable(fd protoreflect.FieldDe x.Record = new(acp_core.RelationshipRecord) } return protoreflect.ValueOfMessage(x.Record.ProtoReflect()) - case "sourcehub.acp.RegisterObjectCmdResult.result": - panic(fmt.Errorf("field result of message sourcehub.acp.RegisterObjectCmdResult is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.RegisterObjectCmdResult")) @@ -4893,8 +4874,6 @@ func (x *fastReflection_RegisterObjectCmdResult) Mutable(fd protoreflect.FieldDe // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_RegisterObjectCmdResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "sourcehub.acp.RegisterObjectCmdResult.result": - return protoreflect.ValueOfEnum(0) case "sourcehub.acp.RegisterObjectCmdResult.record": m := new(acp_core.RelationshipRecord) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -4967,9 +4946,6 @@ func (x *fastReflection_RegisterObjectCmdResult) ProtoMethods() *protoiface.Meth var n int var l int _ = l - if x.Result != 0 { - n += 1 + runtime.Sov(uint64(x.Result)) - } if x.Record != nil { l = options.Size(x.Record) n += 1 + l + runtime.Sov(uint64(l)) @@ -5015,12 +4991,7 @@ func (x *fastReflection_RegisterObjectCmdResult) ProtoMethods() *protoiface.Meth copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 - } - if x.Result != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Result)) - i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -5072,25 +5043,6 @@ func (x *fastReflection_RegisterObjectCmdResult) ProtoMethods() *protoiface.Meth } switch fieldNum { case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - x.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Result |= acp_core.RegistrationResult(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) } @@ -6900,8 +6852,7 @@ type RegisterObjectCmdResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Result acp_core.RegistrationResult `protobuf:"varint,1,opt,name=result,proto3,enum=sourcenetwork.acp_core.RegistrationResult" json:"result,omitempty"` - Record *acp_core.RelationshipRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` + Record *acp_core.RelationshipRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` } func (x *RegisterObjectCmdResult) Reset() { @@ -6924,13 +6875,6 @@ func (*RegisterObjectCmdResult) Descriptor() ([]byte, []int) { return file_sourcehub_acp_policy_cmd_proto_rawDescGZIP(), []int{9} } -func (x *RegisterObjectCmdResult) GetResult() acp_core.RegistrationResult { - if x != nil { - return x.Result - } - return acp_core.RegistrationResult(0) -} - func (x *RegisterObjectCmdResult) GetRecord() *acp_core.RelationshipRecord { if x != nil { return x.Record @@ -7171,61 +7115,57 @@ var file_sourcehub_acp_policy_cmd_proto_rawDesc = []byte{ 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0xa1, 0x01, 0x0a, 0x17, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, - 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x72, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, - 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, - 0x66, 0x0a, 0x19, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x75, - 0x6e, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x14, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0xb0, 0x03, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x61, 0x0a, 0x17, 0x73, - 0x65, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x5f, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x53, 0x65, 0x74, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x15, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x6a, - 0x0a, 0x1a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, - 0x63, 0x70, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, - 0x52, 0x18, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x5e, 0x0a, 0x16, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x64, 0x0a, 0x18, 0x75, 0x6e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x55, 0x6e, 0x72, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x5d, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, - 0x42, 0x0e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6d, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x61, - 0x63, 0x70, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x68, 0x75, 0x62, 0x2e, 0x41, 0x63, 0x70, 0xca, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x68, 0x75, 0x62, 0x5c, 0x41, 0x63, 0x70, 0xe2, 0x02, 0x19, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x68, 0x75, 0x62, 0x5c, 0x41, 0x63, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, - 0x3a, 0x3a, 0x41, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x66, 0x0a, 0x19, 0x55, 0x6e, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, + 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, 0x0a, + 0x15, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x5f, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x64, 0x22, 0xb0, 0x03, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6d, 0x64, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x61, 0x0a, 0x17, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x48, 0x00, 0x52, 0x15, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x6a, 0x0a, 0x1a, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x18, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x5e, 0x0a, 0x16, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, + 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x64, 0x0a, 0x18, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x42, 0x0e, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x43, 0x6d, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x61, 0x63, 0x70, 0xa2, 0x02, 0x03, + 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, + 0x41, 0x63, 0x70, 0xca, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, + 0x41, 0x63, 0x70, 0xe2, 0x02, 0x19, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, + 0x41, 0x63, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x41, 0x63, 0x70, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7258,7 +7198,6 @@ var file_sourcehub_acp_policy_cmd_proto_goTypes = []interface{}{ (*acp_core.Relationship)(nil), // 13: sourcenetwork.acp_core.Relationship (*acp_core.Object)(nil), // 14: sourcenetwork.acp_core.Object (*acp_core.RelationshipRecord)(nil), // 15: sourcenetwork.acp_core.RelationshipRecord - (acp_core.RegistrationResult)(0), // 16: sourcenetwork.acp_core.RegistrationResult } var file_sourcehub_acp_policy_cmd_proto_depIdxs = []int32{ 1, // 0: sourcehub.acp.SignedPolicyCmd.payload:type_name -> sourcehub.acp.SignedPolicyCmdPayload @@ -7273,17 +7212,16 @@ var file_sourcehub_acp_policy_cmd_proto_depIdxs = []int32{ 14, // 9: sourcehub.acp.RegisterObjectCmd.object:type_name -> sourcenetwork.acp_core.Object 14, // 10: sourcehub.acp.UnregisterObjectCmd.object:type_name -> sourcenetwork.acp_core.Object 15, // 11: sourcehub.acp.SetRelationshipCmdResult.record:type_name -> sourcenetwork.acp_core.RelationshipRecord - 16, // 12: sourcehub.acp.RegisterObjectCmdResult.result:type_name -> sourcenetwork.acp_core.RegistrationResult - 15, // 13: sourcehub.acp.RegisterObjectCmdResult.record:type_name -> sourcenetwork.acp_core.RelationshipRecord - 7, // 14: sourcehub.acp.PolicyCmdResult.set_relationship_result:type_name -> sourcehub.acp.SetRelationshipCmdResult - 8, // 15: sourcehub.acp.PolicyCmdResult.delete_relationship_result:type_name -> sourcehub.acp.DeleteRelationshipCmdResult - 9, // 16: sourcehub.acp.PolicyCmdResult.register_object_result:type_name -> sourcehub.acp.RegisterObjectCmdResult - 10, // 17: sourcehub.acp.PolicyCmdResult.unregister_object_result:type_name -> sourcehub.acp.UnregisterObjectCmdResult - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 15, // 12: sourcehub.acp.RegisterObjectCmdResult.record:type_name -> sourcenetwork.acp_core.RelationshipRecord + 7, // 13: sourcehub.acp.PolicyCmdResult.set_relationship_result:type_name -> sourcehub.acp.SetRelationshipCmdResult + 8, // 14: sourcehub.acp.PolicyCmdResult.delete_relationship_result:type_name -> sourcehub.acp.DeleteRelationshipCmdResult + 9, // 15: sourcehub.acp.PolicyCmdResult.register_object_result:type_name -> sourcehub.acp.RegisterObjectCmdResult + 10, // 16: sourcehub.acp.PolicyCmdResult.unregister_object_result:type_name -> sourcehub.acp.UnregisterObjectCmdResult + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_sourcehub_acp_policy_cmd_proto_init() } diff --git a/proto/sourcehub/acp/policy_cmd.proto b/proto/sourcehub/acp/policy_cmd.proto index c23d42c..28556dc 100644 --- a/proto/sourcehub/acp/policy_cmd.proto +++ b/proto/sourcehub/acp/policy_cmd.proto @@ -47,7 +47,7 @@ message PolicyCmd { SetRelationshipCmd set_relationship_cmd = 1; DeleteRelationshipCmd delete_relationship_cmd = 2; RegisterObjectCmd register_object_cmd = 3; - UnregisterObjectCmd unregister_object_cmd = 4; + ArchiveObjectCmd archive_object_cmd = 4; } } @@ -89,7 +89,7 @@ message RegisterObjectCmd { // If Charlie has a copy of the object, Eve could convince Charlie to share his copy, granting Eve access to Foo. // The previous scenario where an unauthorized user is able to claim ownership to data previously unaccessible to them // is an "ownership hijack". -message UnregisterObjectCmd { +message ArchiveObjectCmd { sourcenetwork.acp_core.Object object = 1; } @@ -107,12 +107,12 @@ message DeleteRelationshipCmdResult { // RegisterObjectCmdResult registers an Object in a Policy message RegisterObjectCmdResult { - sourcenetwork.acp_core.RegistrationResult result = 1; + // sourcenetwork.acp_core.RegistrationResult result = 1 [deprecated = true]; sourcenetwork.acp_core.RelationshipRecord record = 2; } -// UnregisterObjectCmdResult unregisters an Object in a Policy -message UnregisterObjectCmdResult { +// ArchiveObjectCmdResult unregisters an Object in a Policy +message ArchiveObjectCmdResult { bool found = 1; uint64 relationships_removed = 2; } @@ -122,6 +122,6 @@ message PolicyCmdResult { SetRelationshipCmdResult set_relationship_result = 1; DeleteRelationshipCmdResult delete_relationship_result = 2; RegisterObjectCmdResult register_object_result = 3; - UnregisterObjectCmdResult unregister_object_result = 4; + ArchiveObjectCmdResult archive_object_cmd_result = 4; } } diff --git a/x/acp/types/policy_cmd.pb.go b/x/acp/types/policy_cmd.pb.go index 9e1e6b4..eafbc4f 100644 --- a/x/acp/types/policy_cmd.pb.go +++ b/x/acp/types/policy_cmd.pb.go @@ -180,7 +180,7 @@ type PolicyCmd struct { // *PolicyCmd_SetRelationshipCmd // *PolicyCmd_DeleteRelationshipCmd // *PolicyCmd_RegisterObjectCmd - // *PolicyCmd_UnregisterObjectCmd + // *PolicyCmd_ArchiveObjectCmd Cmd isPolicyCmd_Cmd `protobuf_oneof:"cmd"` } @@ -232,14 +232,14 @@ type PolicyCmd_DeleteRelationshipCmd struct { type PolicyCmd_RegisterObjectCmd struct { RegisterObjectCmd *RegisterObjectCmd `protobuf:"bytes,3,opt,name=register_object_cmd,json=registerObjectCmd,proto3,oneof" json:"register_object_cmd,omitempty"` } -type PolicyCmd_UnregisterObjectCmd struct { - UnregisterObjectCmd *UnregisterObjectCmd `protobuf:"bytes,4,opt,name=unregister_object_cmd,json=unregisterObjectCmd,proto3,oneof" json:"unregister_object_cmd,omitempty"` +type PolicyCmd_ArchiveObjectCmd struct { + ArchiveObjectCmd *ArchiveObjectCmd `protobuf:"bytes,4,opt,name=archive_object_cmd,json=archiveObjectCmd,proto3,oneof" json:"archive_object_cmd,omitempty"` } func (*PolicyCmd_SetRelationshipCmd) isPolicyCmd_Cmd() {} func (*PolicyCmd_DeleteRelationshipCmd) isPolicyCmd_Cmd() {} func (*PolicyCmd_RegisterObjectCmd) isPolicyCmd_Cmd() {} -func (*PolicyCmd_UnregisterObjectCmd) isPolicyCmd_Cmd() {} +func (*PolicyCmd_ArchiveObjectCmd) isPolicyCmd_Cmd() {} func (m *PolicyCmd) GetCmd() isPolicyCmd_Cmd { if m != nil { @@ -269,9 +269,9 @@ func (m *PolicyCmd) GetRegisterObjectCmd() *RegisterObjectCmd { return nil } -func (m *PolicyCmd) GetUnregisterObjectCmd() *UnregisterObjectCmd { - if x, ok := m.GetCmd().(*PolicyCmd_UnregisterObjectCmd); ok { - return x.UnregisterObjectCmd +func (m *PolicyCmd) GetArchiveObjectCmd() *ArchiveObjectCmd { + if x, ok := m.GetCmd().(*PolicyCmd_ArchiveObjectCmd); ok { + return x.ArchiveObjectCmd } return nil } @@ -282,7 +282,7 @@ func (*PolicyCmd) XXX_OneofWrappers() []interface{} { (*PolicyCmd_SetRelationshipCmd)(nil), (*PolicyCmd_DeleteRelationshipCmd)(nil), (*PolicyCmd_RegisterObjectCmd)(nil), - (*PolicyCmd_UnregisterObjectCmd)(nil), + (*PolicyCmd_ArchiveObjectCmd)(nil), } } @@ -443,22 +443,22 @@ func (m *RegisterObjectCmd) GetObject() *types1.Object { // If Charlie has a copy of the object, Eve could convince Charlie to share his copy, granting Eve access to Foo. // The previous scenario where an unauthorized user is able to claim ownership to data previously unaccessible to them // is an "ownership hijack". -type UnregisterObjectCmd struct { +type ArchiveObjectCmd struct { Object *types1.Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` } -func (m *UnregisterObjectCmd) Reset() { *m = UnregisterObjectCmd{} } -func (m *UnregisterObjectCmd) String() string { return proto.CompactTextString(m) } -func (*UnregisterObjectCmd) ProtoMessage() {} -func (*UnregisterObjectCmd) Descriptor() ([]byte, []int) { +func (m *ArchiveObjectCmd) Reset() { *m = ArchiveObjectCmd{} } +func (m *ArchiveObjectCmd) String() string { return proto.CompactTextString(m) } +func (*ArchiveObjectCmd) ProtoMessage() {} +func (*ArchiveObjectCmd) Descriptor() ([]byte, []int) { return fileDescriptor_1de5e9736122d1ff, []int{6} } -func (m *UnregisterObjectCmd) XXX_Unmarshal(b []byte) error { +func (m *ArchiveObjectCmd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UnregisterObjectCmd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ArchiveObjectCmd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UnregisterObjectCmd.Marshal(b, m, deterministic) + return xxx_messageInfo_ArchiveObjectCmd.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -468,19 +468,19 @@ func (m *UnregisterObjectCmd) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *UnregisterObjectCmd) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnregisterObjectCmd.Merge(m, src) +func (m *ArchiveObjectCmd) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArchiveObjectCmd.Merge(m, src) } -func (m *UnregisterObjectCmd) XXX_Size() int { +func (m *ArchiveObjectCmd) XXX_Size() int { return m.Size() } -func (m *UnregisterObjectCmd) XXX_DiscardUnknown() { - xxx_messageInfo_UnregisterObjectCmd.DiscardUnknown(m) +func (m *ArchiveObjectCmd) XXX_DiscardUnknown() { + xxx_messageInfo_ArchiveObjectCmd.DiscardUnknown(m) } -var xxx_messageInfo_UnregisterObjectCmd proto.InternalMessageInfo +var xxx_messageInfo_ArchiveObjectCmd proto.InternalMessageInfo -func (m *UnregisterObjectCmd) GetObject() *types1.Object { +func (m *ArchiveObjectCmd) GetObject() *types1.Object { if m != nil { return m.Object } @@ -588,7 +588,7 @@ func (m *DeleteRelationshipCmdResult) GetRecordFound() bool { // RegisterObjectCmdResult registers an Object in a Policy type RegisterObjectCmdResult struct { - Result types1.RegistrationResult `protobuf:"varint,1,opt,name=result,proto3,enum=sourcenetwork.acp_core.RegistrationResult" json:"result,omitempty"` + // sourcenetwork.acp_core.RegistrationResult result = 1 [deprecated = true]; Record *types1.RelationshipRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` } @@ -625,13 +625,6 @@ func (m *RegisterObjectCmdResult) XXX_DiscardUnknown() { var xxx_messageInfo_RegisterObjectCmdResult proto.InternalMessageInfo -func (m *RegisterObjectCmdResult) GetResult() types1.RegistrationResult { - if m != nil { - return m.Result - } - return types1.RegistrationResult_NoOp -} - func (m *RegisterObjectCmdResult) GetRecord() *types1.RelationshipRecord { if m != nil { return m.Record @@ -639,24 +632,24 @@ func (m *RegisterObjectCmdResult) GetRecord() *types1.RelationshipRecord { return nil } -// UnregisterObjectCmdResult unregisters an Object in a Policy -type UnregisterObjectCmdResult struct { +// ArchiveObjectCmdResult unregisters an Object in a Policy +type ArchiveObjectCmdResult struct { Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"` RelationshipsRemoved uint64 `protobuf:"varint,2,opt,name=relationships_removed,json=relationshipsRemoved,proto3" json:"relationships_removed,omitempty"` } -func (m *UnregisterObjectCmdResult) Reset() { *m = UnregisterObjectCmdResult{} } -func (m *UnregisterObjectCmdResult) String() string { return proto.CompactTextString(m) } -func (*UnregisterObjectCmdResult) ProtoMessage() {} -func (*UnregisterObjectCmdResult) Descriptor() ([]byte, []int) { +func (m *ArchiveObjectCmdResult) Reset() { *m = ArchiveObjectCmdResult{} } +func (m *ArchiveObjectCmdResult) String() string { return proto.CompactTextString(m) } +func (*ArchiveObjectCmdResult) ProtoMessage() {} +func (*ArchiveObjectCmdResult) Descriptor() ([]byte, []int) { return fileDescriptor_1de5e9736122d1ff, []int{10} } -func (m *UnregisterObjectCmdResult) XXX_Unmarshal(b []byte) error { +func (m *ArchiveObjectCmdResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UnregisterObjectCmdResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ArchiveObjectCmdResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UnregisterObjectCmdResult.Marshal(b, m, deterministic) + return xxx_messageInfo_ArchiveObjectCmdResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -666,26 +659,26 @@ func (m *UnregisterObjectCmdResult) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *UnregisterObjectCmdResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnregisterObjectCmdResult.Merge(m, src) +func (m *ArchiveObjectCmdResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArchiveObjectCmdResult.Merge(m, src) } -func (m *UnregisterObjectCmdResult) XXX_Size() int { +func (m *ArchiveObjectCmdResult) XXX_Size() int { return m.Size() } -func (m *UnregisterObjectCmdResult) XXX_DiscardUnknown() { - xxx_messageInfo_UnregisterObjectCmdResult.DiscardUnknown(m) +func (m *ArchiveObjectCmdResult) XXX_DiscardUnknown() { + xxx_messageInfo_ArchiveObjectCmdResult.DiscardUnknown(m) } -var xxx_messageInfo_UnregisterObjectCmdResult proto.InternalMessageInfo +var xxx_messageInfo_ArchiveObjectCmdResult proto.InternalMessageInfo -func (m *UnregisterObjectCmdResult) GetFound() bool { +func (m *ArchiveObjectCmdResult) GetFound() bool { if m != nil { return m.Found } return false } -func (m *UnregisterObjectCmdResult) GetRelationshipsRemoved() uint64 { +func (m *ArchiveObjectCmdResult) GetRelationshipsRemoved() uint64 { if m != nil { return m.RelationshipsRemoved } @@ -698,7 +691,7 @@ type PolicyCmdResult struct { // *PolicyCmdResult_SetRelationshipResult // *PolicyCmdResult_DeleteRelationshipResult // *PolicyCmdResult_RegisterObjectResult - // *PolicyCmdResult_UnregisterObjectResult + // *PolicyCmdResult_ArchiveObjectCmdResult Result isPolicyCmdResult_Result `protobuf_oneof:"result"` } @@ -750,14 +743,14 @@ type PolicyCmdResult_DeleteRelationshipResult struct { type PolicyCmdResult_RegisterObjectResult struct { RegisterObjectResult *RegisterObjectCmdResult `protobuf:"bytes,3,opt,name=register_object_result,json=registerObjectResult,proto3,oneof" json:"register_object_result,omitempty"` } -type PolicyCmdResult_UnregisterObjectResult struct { - UnregisterObjectResult *UnregisterObjectCmdResult `protobuf:"bytes,4,opt,name=unregister_object_result,json=unregisterObjectResult,proto3,oneof" json:"unregister_object_result,omitempty"` +type PolicyCmdResult_ArchiveObjectCmdResult struct { + ArchiveObjectCmdResult *ArchiveObjectCmdResult `protobuf:"bytes,4,opt,name=archive_object_cmd_result,json=archiveObjectCmdResult,proto3,oneof" json:"archive_object_cmd_result,omitempty"` } func (*PolicyCmdResult_SetRelationshipResult) isPolicyCmdResult_Result() {} func (*PolicyCmdResult_DeleteRelationshipResult) isPolicyCmdResult_Result() {} func (*PolicyCmdResult_RegisterObjectResult) isPolicyCmdResult_Result() {} -func (*PolicyCmdResult_UnregisterObjectResult) isPolicyCmdResult_Result() {} +func (*PolicyCmdResult_ArchiveObjectCmdResult) isPolicyCmdResult_Result() {} func (m *PolicyCmdResult) GetResult() isPolicyCmdResult_Result { if m != nil { @@ -787,9 +780,9 @@ func (m *PolicyCmdResult) GetRegisterObjectResult() *RegisterObjectCmdResult { return nil } -func (m *PolicyCmdResult) GetUnregisterObjectResult() *UnregisterObjectCmdResult { - if x, ok := m.GetResult().(*PolicyCmdResult_UnregisterObjectResult); ok { - return x.UnregisterObjectResult +func (m *PolicyCmdResult) GetArchiveObjectCmdResult() *ArchiveObjectCmdResult { + if x, ok := m.GetResult().(*PolicyCmdResult_ArchiveObjectCmdResult); ok { + return x.ArchiveObjectCmdResult } return nil } @@ -800,7 +793,7 @@ func (*PolicyCmdResult) XXX_OneofWrappers() []interface{} { (*PolicyCmdResult_SetRelationshipResult)(nil), (*PolicyCmdResult_DeleteRelationshipResult)(nil), (*PolicyCmdResult_RegisterObjectResult)(nil), - (*PolicyCmdResult_UnregisterObjectResult)(nil), + (*PolicyCmdResult_ArchiveObjectCmdResult)(nil), } } @@ -811,68 +804,67 @@ func init() { proto.RegisterType((*SetRelationshipCmd)(nil), "sourcehub.acp.SetRelationshipCmd") proto.RegisterType((*DeleteRelationshipCmd)(nil), "sourcehub.acp.DeleteRelationshipCmd") proto.RegisterType((*RegisterObjectCmd)(nil), "sourcehub.acp.RegisterObjectCmd") - proto.RegisterType((*UnregisterObjectCmd)(nil), "sourcehub.acp.UnregisterObjectCmd") + proto.RegisterType((*ArchiveObjectCmd)(nil), "sourcehub.acp.ArchiveObjectCmd") proto.RegisterType((*SetRelationshipCmdResult)(nil), "sourcehub.acp.SetRelationshipCmdResult") proto.RegisterType((*DeleteRelationshipCmdResult)(nil), "sourcehub.acp.DeleteRelationshipCmdResult") proto.RegisterType((*RegisterObjectCmdResult)(nil), "sourcehub.acp.RegisterObjectCmdResult") - proto.RegisterType((*UnregisterObjectCmdResult)(nil), "sourcehub.acp.UnregisterObjectCmdResult") + proto.RegisterType((*ArchiveObjectCmdResult)(nil), "sourcehub.acp.ArchiveObjectCmdResult") proto.RegisterType((*PolicyCmdResult)(nil), "sourcehub.acp.PolicyCmdResult") } func init() { proto.RegisterFile("sourcehub/acp/policy_cmd.proto", fileDescriptor_1de5e9736122d1ff) } var fileDescriptor_1de5e9736122d1ff = []byte{ - // 798 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x4e, 0xe3, 0x46, - 0x18, 0x8d, 0x13, 0x92, 0x92, 0x8f, 0x04, 0xca, 0x90, 0x80, 0x1b, 0x2a, 0x17, 0xdc, 0xd2, 0x02, - 0x17, 0x8e, 0x04, 0x52, 0x6f, 0xa9, 0x02, 0xad, 0x52, 0x55, 0x55, 0xd1, 0xb4, 0x48, 0x55, 0x2f, - 0xb0, 0x1c, 0x7b, 0x48, 0x4c, 0xe3, 0x8c, 0x35, 0x1e, 0xb7, 0xf0, 0x00, 0x95, 0x7a, 0xb9, 0xaf, - 0xb0, 0x6f, 0xb0, 0x8f, 0xb1, 0x97, 0x5c, 0xee, 0xe5, 0x0a, 0x1e, 0x62, 0x6f, 0x57, 0x9e, 0x19, - 0xe7, 0xc7, 0xf6, 0xc2, 0x6a, 0xc5, 0x5d, 0x7c, 0xe6, 0xfb, 0xce, 0x99, 0x39, 0xdf, 0xf8, 0xc4, - 0x60, 0x44, 0x34, 0x66, 0x2e, 0x19, 0xc5, 0x83, 0xae, 0xe3, 0x86, 0xdd, 0x90, 0x8e, 0x7d, 0xf7, - 0xd6, 0x76, 0x03, 0xcf, 0x0a, 0x19, 0xe5, 0x14, 0x35, 0xa7, 0xeb, 0x96, 0xe3, 0x86, 0x9d, 0xaf, - 0x86, 0x94, 0x0e, 0xc7, 0xa4, 0x2b, 0x16, 0x07, 0xf1, 0x55, 0x97, 0xfb, 0x01, 0x89, 0xb8, 0x13, - 0x84, 0xb2, 0xbe, 0x73, 0x20, 0xeb, 0x27, 0x84, 0xff, 0x4b, 0xd9, 0xdf, 0x09, 0xa7, 0xed, 0x52, - 0x46, 0xba, 0x8c, 0x8c, 0x1d, 0xee, 0xd3, 0x49, 0x34, 0xf2, 0x55, 0xa9, 0x19, 0xc2, 0xda, 0xef, - 0xfe, 0x70, 0x42, 0xbc, 0x73, 0x21, 0x7a, 0x1a, 0x78, 0xe8, 0x04, 0x3e, 0x0b, 0x9d, 0xdb, 0x31, - 0x75, 0x3c, 0x5d, 0xdb, 0xd1, 0xf6, 0x57, 0x8e, 0xf6, 0xac, 0x05, 0x7d, 0x2b, 0xd3, 0x70, 0x2e, - 0x8b, 0x71, 0xda, 0x85, 0xbe, 0x84, 0x7a, 0xe4, 0x0f, 0x27, 0x0e, 0x8f, 0x19, 0xd1, 0xcb, 0x3b, - 0xda, 0x7e, 0x03, 0xcf, 0x00, 0xf3, 0xff, 0x32, 0x6c, 0x16, 0x33, 0xa0, 0x16, 0x54, 0x1d, 0x97, - 0x53, 0x26, 0x74, 0xeb, 0x58, 0x3e, 0xa0, 0xaf, 0xa1, 0xe9, 0x47, 0x51, 0x4c, 0x3c, 0x7b, 0x44, - 0xfc, 0xe1, 0x88, 0x0b, 0xca, 0x25, 0xdc, 0x90, 0x60, 0x5f, 0x60, 0xe8, 0x00, 0x3e, 0x27, 0x37, - 0xa1, 0xcf, 0xc4, 0xf9, 0x6c, 0x8f, 0x8c, 0xb9, 0xa3, 0x57, 0x44, 0xdd, 0xda, 0x0c, 0x3f, 0x4b, - 0x60, 0x74, 0x02, 0x4d, 0x97, 0x11, 0x59, 0x98, 0x38, 0xa7, 0x2f, 0x89, 0x53, 0x76, 0x2c, 0x69, - 0xab, 0x95, 0xda, 0x6a, 0xfd, 0x91, 0xda, 0x8a, 0x1b, 0x69, 0x43, 0x02, 0xa1, 0x6d, 0xa8, 0xab, - 0x11, 0xf9, 0x9e, 0x5e, 0x15, 0x5b, 0x5d, 0x96, 0xc0, 0xcf, 0x1e, 0x3a, 0x84, 0x8a, 0x1b, 0x78, - 0x7a, 0x4d, 0x70, 0xea, 0x19, 0xe7, 0xa6, 0x27, 0xc6, 0x49, 0x91, 0xf9, 0xae, 0x0c, 0xf5, 0x99, - 0xef, 0x17, 0xd0, 0x8a, 0x08, 0xb7, 0xe7, 0x87, 0x94, 0xdc, 0x01, 0x35, 0x84, 0xdd, 0xec, 0x10, - 0x08, 0xc7, 0x73, 0x95, 0xa7, 0x81, 0xd7, 0x2f, 0x61, 0x14, 0xe5, 0x50, 0x74, 0x09, 0x5b, 0x1e, - 0x19, 0x13, 0x4e, 0xf2, 0xcc, 0x65, 0xc1, 0xfc, 0x4d, 0x86, 0xf9, 0x4c, 0x54, 0xe7, 0xc9, 0xdb, - 0x5e, 0xd1, 0x02, 0xc2, 0xb0, 0xc1, 0xc8, 0xd0, 0x8f, 0x38, 0x61, 0x36, 0x1d, 0x5c, 0x13, 0x97, - 0x0b, 0xee, 0x8a, 0xe0, 0xde, 0xc9, 0x70, 0x63, 0x55, 0xf9, 0x9b, 0x28, 0x94, 0xbc, 0xeb, 0x2c, - 0x0b, 0xa2, 0x3f, 0xa1, 0x1d, 0x4f, 0x8a, 0x58, 0xe5, 0xa8, 0xcc, 0x0c, 0xeb, 0xc5, 0x84, 0x15, - 0xf0, 0x6e, 0xc4, 0x79, 0xb8, 0x57, 0x15, 0xe3, 0x31, 0x2f, 0x01, 0xe5, 0x0d, 0x44, 0x7d, 0x68, - 0xcc, 0x7b, 0xa4, 0x9c, 0x4f, 0xfd, 0x51, 0xaf, 0x93, 0x95, 0xbe, 0x4e, 0xd6, 0x7c, 0x3b, 0x5e, - 0xe8, 0x34, 0x1d, 0x68, 0x17, 0xda, 0xf8, 0x8c, 0x12, 0xbf, 0xc0, 0x7a, 0xce, 0x4d, 0xf4, 0x3d, - 0xd4, 0xa4, 0x5b, 0x8a, 0xd8, 0xf8, 0x10, 0xb1, 0x6c, 0xc1, 0xaa, 0xda, 0xfc, 0x15, 0x36, 0x0a, - 0x4c, 0xfc, 0x64, 0xba, 0xff, 0x34, 0xd0, 0xf3, 0xfe, 0x62, 0x12, 0xc5, 0x63, 0x8e, 0xf6, 0x60, - 0x95, 0x11, 0x97, 0x32, 0xcf, 0x26, 0x37, 0x89, 0x9e, 0xbc, 0xe1, 0xcb, 0xb8, 0x29, 0xd1, 0x1f, - 0x25, 0x88, 0x7a, 0x50, 0x93, 0x80, 0xba, 0xa6, 0x87, 0x1f, 0xe5, 0x91, 0xe8, 0xc0, 0xaa, 0xd3, - 0xfc, 0x01, 0xb6, 0x0b, 0xc7, 0xa0, 0x76, 0xb2, 0x9b, 0x0c, 0x43, 0xec, 0xe4, 0x8a, 0xc6, 0x93, - 0x74, 0x1f, 0x2b, 0x12, 0xfb, 0x29, 0x81, 0xcc, 0x97, 0x1a, 0x6c, 0xe5, 0x6c, 0x56, 0xed, 0x62, - 0x87, 0xc9, 0x2f, 0xd1, 0xb8, 0xfa, 0xd8, 0x0e, 0x13, 0x02, 0x99, 0x41, 0xb2, 0x17, 0xab, 0xce, - 0x67, 0x39, 0xe5, 0x15, 0x7c, 0x51, 0x30, 0x3c, 0xb5, 0xc9, 0x16, 0x54, 0xe7, 0x0f, 0x27, 0x1f, - 0xd0, 0x31, 0xb4, 0xe7, 0x2f, 0x53, 0x64, 0x33, 0x12, 0xd0, 0x7f, 0x88, 0xa7, 0xb2, 0xb5, 0xb5, - 0xb0, 0x88, 0xe5, 0x9a, 0xf9, 0xaa, 0x02, 0x6b, 0xb3, 0x04, 0x93, 0xf4, 0x0e, 0x6c, 0xe5, 0x42, - 0x6b, 0xce, 0x94, 0x95, 0xa3, 0xef, 0x9e, 0xcc, 0x2d, 0xc9, 0x94, 0x04, 0x4c, 0x26, 0xbd, 0x94, - 0xc4, 0x35, 0x74, 0x8a, 0x02, 0x4c, 0xa9, 0x2c, 0xda, 0xf6, 0x68, 0x86, 0x4d, 0x85, 0xf4, 0x7c, - 0x92, 0x29, 0xad, 0x4b, 0xd8, 0xcc, 0xc6, 0x8e, 0xd2, 0x91, 0x79, 0xf6, 0xed, 0x53, 0x79, 0x36, - 0xd5, 0x68, 0x2d, 0x0e, 0x44, 0xf1, 0x7b, 0xa0, 0xe7, 0x83, 0x4d, 0x29, 0xc8, 0x6c, 0xdb, 0x7f, - 0x3a, 0xdb, 0xa6, 0x1a, 0x9b, 0xd9, 0x84, 0x93, 0x2b, 0xbd, 0xe5, 0xf4, 0x62, 0xf6, 0xfa, 0xaf, - 0xef, 0x0d, 0xed, 0xee, 0xde, 0xd0, 0xde, 0xde, 0x1b, 0xda, 0x8b, 0x07, 0xa3, 0x74, 0xf7, 0x60, - 0x94, 0xde, 0x3c, 0x18, 0xa5, 0xbf, 0xac, 0xa1, 0xcf, 0x13, 0x0d, 0x97, 0x06, 0xdd, 0xc5, 0xcf, - 0x85, 0xd9, 0xc7, 0xc8, 0x8d, 0xf8, 0x1c, 0xe1, 0xb7, 0x21, 0x89, 0x06, 0x35, 0xf1, 0xb7, 0x78, - 0xfc, 0x3e, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xae, 0xdc, 0x53, 0xac, 0x08, 0x00, 0x00, + // 782 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x4f, 0xdb, 0x48, + 0x14, 0xcf, 0x1f, 0x92, 0x25, 0x8f, 0x64, 0x81, 0xd9, 0x10, 0xbc, 0x61, 0x65, 0xc0, 0xbb, 0xec, + 0x02, 0x07, 0x47, 0x5a, 0xa4, 0xbd, 0xb2, 0x05, 0x5a, 0xa5, 0xed, 0x01, 0x34, 0x6d, 0x2f, 0x95, + 0x8a, 0xe5, 0xd8, 0x43, 0x62, 0x1a, 0x67, 0xac, 0xf1, 0x84, 0xc2, 0x07, 0xa8, 0xd4, 0x63, 0x3f, + 0x49, 0x3f, 0x47, 0x8f, 0x1c, 0x7b, 0xac, 0xe0, 0xde, 0xcf, 0x50, 0x79, 0x66, 0x9c, 0x38, 0xb6, + 0x5b, 0xaa, 0x8a, 0x5b, 0xf2, 0x7b, 0xef, 0xfd, 0xde, 0xf3, 0xef, 0x8d, 0x7f, 0x63, 0xd0, 0x43, + 0x3a, 0x66, 0x0e, 0x19, 0x8c, 0x7b, 0x1d, 0xdb, 0x09, 0x3a, 0x01, 0x1d, 0x7a, 0xce, 0x95, 0xe5, + 0xf8, 0xae, 0x19, 0x30, 0xca, 0x29, 0x6a, 0x4c, 0xe2, 0xa6, 0xed, 0x04, 0xed, 0xf5, 0x3e, 0xa5, + 0xfd, 0x21, 0xe9, 0x88, 0x60, 0x6f, 0x7c, 0xd6, 0xe1, 0x9e, 0x4f, 0x42, 0x6e, 0xfb, 0x81, 0xcc, + 0x6f, 0xef, 0xc8, 0xfc, 0x11, 0xe1, 0x6f, 0x28, 0x7b, 0x1d, 0x71, 0x5a, 0x0e, 0x65, 0xa4, 0xc3, + 0xc8, 0xd0, 0xe6, 0x1e, 0x1d, 0x85, 0x03, 0x4f, 0xa5, 0x1a, 0x01, 0x2c, 0x3e, 0xf3, 0xfa, 0x23, + 0xe2, 0x9e, 0x88, 0xa6, 0x87, 0xbe, 0x8b, 0xf6, 0xe1, 0x97, 0xc0, 0xbe, 0x1a, 0x52, 0xdb, 0xd5, + 0x8a, 0x1b, 0xc5, 0xed, 0x85, 0x7f, 0xb7, 0xcc, 0x99, 0xfe, 0x66, 0xaa, 0xe0, 0x44, 0x26, 0xe3, + 0xb8, 0x0a, 0xfd, 0x01, 0xb5, 0xd0, 0xeb, 0x8f, 0x6c, 0x3e, 0x66, 0x44, 0x2b, 0x6d, 0x14, 0xb7, + 0xeb, 0x78, 0x0a, 0x18, 0xef, 0x4a, 0xd0, 0xca, 0x67, 0x40, 0x4d, 0xa8, 0xd8, 0x0e, 0xa7, 0x4c, + 0xf4, 0xad, 0x61, 0xf9, 0x07, 0xfd, 0x09, 0x0d, 0x2f, 0x0c, 0xc7, 0xc4, 0xb5, 0x06, 0xc4, 0xeb, + 0x0f, 0xb8, 0xa0, 0x9c, 0xc3, 0x75, 0x09, 0x76, 0x05, 0x86, 0x76, 0x60, 0x89, 0x5c, 0x06, 0x1e, + 0x13, 0xcf, 0x67, 0xb9, 0x64, 0xc8, 0x6d, 0xad, 0x2c, 0xf2, 0x16, 0xa7, 0xf8, 0x51, 0x04, 0xa3, + 0x7d, 0x68, 0x38, 0x8c, 0xc8, 0xc4, 0x48, 0x39, 0x6d, 0x4e, 0x3c, 0x65, 0xdb, 0x94, 0xb2, 0x9a, + 0xb1, 0xac, 0xe6, 0xf3, 0x58, 0x56, 0x5c, 0x8f, 0x0b, 0x22, 0x08, 0xad, 0x41, 0x4d, 0xad, 0xc8, + 0x73, 0xb5, 0x8a, 0x18, 0x75, 0x5e, 0x02, 0x8f, 0x5d, 0xb4, 0x0b, 0x65, 0xc7, 0x77, 0xb5, 0xaa, + 0xe0, 0xd4, 0x52, 0xca, 0x4d, 0x9e, 0x18, 0x47, 0x49, 0xc6, 0x97, 0x12, 0xd4, 0xa6, 0xba, 0xbf, + 0x80, 0x66, 0x48, 0xb8, 0x95, 0x5c, 0x52, 0x74, 0x06, 0xd4, 0x12, 0x36, 0xd3, 0x4b, 0x20, 0x1c, + 0x27, 0x32, 0x0f, 0x7d, 0xb7, 0x5b, 0xc0, 0x28, 0xcc, 0xa0, 0xe8, 0x14, 0x56, 0x5d, 0x32, 0x24, + 0x9c, 0x64, 0x99, 0x4b, 0x82, 0xf9, 0xaf, 0x14, 0xf3, 0x91, 0xc8, 0xce, 0x92, 0xaf, 0xb8, 0x79, + 0x01, 0x84, 0xe1, 0x37, 0x46, 0xfa, 0x5e, 0xc8, 0x09, 0xb3, 0x68, 0xef, 0x9c, 0x38, 0x5c, 0x70, + 0x97, 0x05, 0xf7, 0x46, 0x8a, 0x1b, 0xab, 0xcc, 0x63, 0x91, 0x28, 0x79, 0x97, 0x59, 0x1a, 0x44, + 0xc7, 0x80, 0x6c, 0xe6, 0x0c, 0xbc, 0x0b, 0x92, 0xa4, 0x94, 0x7b, 0x5a, 0x4f, 0x51, 0x3e, 0x90, + 0x89, 0x49, 0xc6, 0x25, 0x3b, 0x85, 0x1d, 0x54, 0xc4, 0x56, 0x8c, 0x53, 0x40, 0x59, 0xdd, 0x50, + 0x17, 0xea, 0x49, 0x69, 0x94, 0xe0, 0xb1, 0x2c, 0xea, 0x2d, 0x32, 0xe3, 0xb7, 0xc8, 0x4c, 0x96, + 0xe3, 0x99, 0x4a, 0xc3, 0x86, 0x95, 0x5c, 0xf5, 0xee, 0xb1, 0xc5, 0x53, 0x58, 0xce, 0x88, 0x88, + 0xfe, 0x83, 0xaa, 0xd4, 0x49, 0x11, 0xeb, 0xdf, 0x22, 0x96, 0x25, 0x58, 0x65, 0x1b, 0x4f, 0x60, + 0x29, 0x2d, 0xdf, 0x4f, 0x73, 0xbd, 0x2d, 0x82, 0x96, 0x15, 0x17, 0x93, 0x70, 0x3c, 0xe4, 0x68, + 0x0b, 0x7e, 0x65, 0xc4, 0xa1, 0xcc, 0xb5, 0xc8, 0x65, 0x34, 0xbb, 0x3c, 0xd5, 0xf3, 0xb8, 0x21, + 0xd1, 0x87, 0x12, 0x44, 0x07, 0x50, 0x95, 0x80, 0x3a, 0x9a, 0xbb, 0x3f, 0x24, 0x90, 0xa8, 0xc0, + 0xaa, 0xd2, 0xf8, 0x1f, 0xd6, 0x72, 0x77, 0xa0, 0x26, 0xd9, 0x8c, 0x36, 0x21, 0x26, 0x39, 0xa3, + 0xe3, 0x51, 0x3c, 0xc7, 0x82, 0xc4, 0x1e, 0x45, 0x90, 0xf1, 0x0a, 0x56, 0x33, 0x12, 0xab, 0xea, + 0xfb, 0x18, 0xd0, 0x81, 0x56, 0x5a, 0x74, 0xc5, 0xde, 0x84, 0x4a, 0x72, 0x28, 0xf9, 0x07, 0xed, + 0xc1, 0x4a, 0xf2, 0x04, 0x84, 0x16, 0x23, 0x3e, 0xbd, 0x20, 0xae, 0xf2, 0xc1, 0xe6, 0x4c, 0x10, + 0xcb, 0x98, 0xf1, 0xa1, 0x0c, 0x8b, 0x53, 0xb7, 0x91, 0xf4, 0x36, 0xac, 0x66, 0x0c, 0x86, 0x89, + 0x90, 0x5a, 0xf5, 0x3f, 0x77, 0x7a, 0x8c, 0x64, 0x8a, 0xcc, 0x20, 0xe5, 0x34, 0xaa, 0xc5, 0x39, + 0xb4, 0xf3, 0xcc, 0x46, 0x75, 0x99, 0xd5, 0xec, 0xbb, 0x7e, 0x33, 0x69, 0xa4, 0x65, 0x5d, 0x47, + 0xf5, 0x3a, 0x85, 0x56, 0xda, 0x78, 0x54, 0x1f, 0xe9, 0x3d, 0x7f, 0xdf, 0xe5, 0x3d, 0x93, 0x1e, + 0xcd, 0x59, 0x07, 0x52, 0xfc, 0x3d, 0xf8, 0x3d, 0x6b, 0x42, 0x71, 0x8b, 0xb9, 0xdc, 0x9b, 0x31, + 0x7f, 0xaf, 0xdd, 0x02, 0x6e, 0xd9, 0xb9, 0x91, 0x83, 0xf9, 0xe8, 0x3c, 0x89, 0x5f, 0xdd, 0x8f, + 0x37, 0x7a, 0xf1, 0xfa, 0x46, 0x2f, 0x7e, 0xbe, 0xd1, 0x8b, 0xef, 0x6f, 0xf5, 0xc2, 0xf5, 0xad, + 0x5e, 0xf8, 0x74, 0xab, 0x17, 0x5e, 0x9a, 0x7d, 0x8f, 0x47, 0x0d, 0x1c, 0xea, 0x77, 0x66, 0x2f, + 0xf6, 0xe9, 0x67, 0xc3, 0xa5, 0xf8, 0x70, 0xe0, 0x57, 0x01, 0x09, 0x7b, 0x55, 0x71, 0x81, 0xed, + 0x7d, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xeb, 0xac, 0xbc, 0x56, 0x08, 0x00, 0x00, } func (m *SignedPolicyCmd) Marshal() (dAtA []byte, err error) { @@ -1083,16 +1075,16 @@ func (m *PolicyCmd_RegisterObjectCmd) MarshalToSizedBuffer(dAtA []byte) (int, er } return len(dAtA) - i, nil } -func (m *PolicyCmd_UnregisterObjectCmd) MarshalTo(dAtA []byte) (int, error) { +func (m *PolicyCmd_ArchiveObjectCmd) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PolicyCmd_UnregisterObjectCmd) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PolicyCmd_ArchiveObjectCmd) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.UnregisterObjectCmd != nil { + if m.ArchiveObjectCmd != nil { { - size, err := m.UnregisterObjectCmd.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ArchiveObjectCmd.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1209,7 +1201,7 @@ func (m *RegisterObjectCmd) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *UnregisterObjectCmd) Marshal() (dAtA []byte, err error) { +func (m *ArchiveObjectCmd) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1219,12 +1211,12 @@ func (m *UnregisterObjectCmd) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UnregisterObjectCmd) MarshalTo(dAtA []byte) (int, error) { +func (m *ArchiveObjectCmd) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnregisterObjectCmd) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ArchiveObjectCmd) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1354,15 +1346,10 @@ func (m *RegisterObjectCmdResult) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x12 } - if m.Result != 0 { - i = encodeVarintPolicyCmd(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } -func (m *UnregisterObjectCmdResult) Marshal() (dAtA []byte, err error) { +func (m *ArchiveObjectCmdResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1372,12 +1359,12 @@ func (m *UnregisterObjectCmdResult) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UnregisterObjectCmdResult) MarshalTo(dAtA []byte) (int, error) { +func (m *ArchiveObjectCmdResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnregisterObjectCmdResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ArchiveObjectCmdResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1495,16 +1482,16 @@ func (m *PolicyCmdResult_RegisterObjectResult) MarshalToSizedBuffer(dAtA []byte) } return len(dAtA) - i, nil } -func (m *PolicyCmdResult_UnregisterObjectResult) MarshalTo(dAtA []byte) (int, error) { +func (m *PolicyCmdResult_ArchiveObjectCmdResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PolicyCmdResult_UnregisterObjectResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PolicyCmdResult_ArchiveObjectCmdResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.UnregisterObjectResult != nil { + if m.ArchiveObjectCmdResult != nil { { - size, err := m.UnregisterObjectResult.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ArchiveObjectCmdResult.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1623,14 +1610,14 @@ func (m *PolicyCmd_RegisterObjectCmd) Size() (n int) { } return n } -func (m *PolicyCmd_UnregisterObjectCmd) Size() (n int) { +func (m *PolicyCmd_ArchiveObjectCmd) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.UnregisterObjectCmd != nil { - l = m.UnregisterObjectCmd.Size() + if m.ArchiveObjectCmd != nil { + l = m.ArchiveObjectCmd.Size() n += 1 + l + sovPolicyCmd(uint64(l)) } return n @@ -1674,7 +1661,7 @@ func (m *RegisterObjectCmd) Size() (n int) { return n } -func (m *UnregisterObjectCmd) Size() (n int) { +func (m *ArchiveObjectCmd) Size() (n int) { if m == nil { return 0 } @@ -1721,9 +1708,6 @@ func (m *RegisterObjectCmdResult) Size() (n int) { } var l int _ = l - if m.Result != 0 { - n += 1 + sovPolicyCmd(uint64(m.Result)) - } if m.Record != nil { l = m.Record.Size() n += 1 + l + sovPolicyCmd(uint64(l)) @@ -1731,7 +1715,7 @@ func (m *RegisterObjectCmdResult) Size() (n int) { return n } -func (m *UnregisterObjectCmdResult) Size() (n int) { +func (m *ArchiveObjectCmdResult) Size() (n int) { if m == nil { return 0 } @@ -1794,14 +1778,14 @@ func (m *PolicyCmdResult_RegisterObjectResult) Size() (n int) { } return n } -func (m *PolicyCmdResult_UnregisterObjectResult) Size() (n int) { +func (m *PolicyCmdResult_ArchiveObjectCmdResult) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.UnregisterObjectResult != nil { - l = m.UnregisterObjectResult.Size() + if m.ArchiveObjectCmdResult != nil { + l = m.ArchiveObjectCmdResult.Size() n += 1 + l + sovPolicyCmd(uint64(l)) } return n @@ -2293,7 +2277,7 @@ func (m *PolicyCmd) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnregisterObjectCmd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ArchiveObjectCmd", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2320,11 +2304,11 @@ func (m *PolicyCmd) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &UnregisterObjectCmd{} + v := &ArchiveObjectCmd{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Cmd = &PolicyCmd_UnregisterObjectCmd{v} + m.Cmd = &PolicyCmd_ArchiveObjectCmd{v} iNdEx = postIndex default: iNdEx = preIndex @@ -2605,7 +2589,7 @@ func (m *RegisterObjectCmd) Unmarshal(dAtA []byte) error { } return nil } -func (m *UnregisterObjectCmd) Unmarshal(dAtA []byte) error { +func (m *ArchiveObjectCmd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2628,10 +2612,10 @@ func (m *UnregisterObjectCmd) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UnregisterObjectCmd: wiretype end group for non-group") + return fmt.Errorf("proto: ArchiveObjectCmd: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UnregisterObjectCmd: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ArchiveObjectCmd: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2896,25 +2880,6 @@ func (m *RegisterObjectCmdResult) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: RegisterObjectCmdResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicyCmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= types1.RegistrationResult(b&0x7F) << shift - if b < 0x80 { - break - } - } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) @@ -2972,7 +2937,7 @@ func (m *RegisterObjectCmdResult) Unmarshal(dAtA []byte) error { } return nil } -func (m *UnregisterObjectCmdResult) Unmarshal(dAtA []byte) error { +func (m *ArchiveObjectCmdResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2995,10 +2960,10 @@ func (m *UnregisterObjectCmdResult) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UnregisterObjectCmdResult: wiretype end group for non-group") + return fmt.Errorf("proto: ArchiveObjectCmdResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UnregisterObjectCmdResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ArchiveObjectCmdResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3197,7 +3162,7 @@ func (m *PolicyCmdResult) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnregisterObjectResult", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ArchiveObjectCmdResult", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3224,11 +3189,11 @@ func (m *PolicyCmdResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &UnregisterObjectCmdResult{} + v := &ArchiveObjectCmdResult{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Result = &PolicyCmdResult_UnregisterObjectResult{v} + m.Result = &PolicyCmdResult_ArchiveObjectCmdResult{v} iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/acp/types/query.pb.go b/x/acp/types/query.pb.go index d074401..8b82c5f 100644 --- a/x/acp/types/query.pb.go +++ b/x/acp/types/query.pb.go @@ -1169,6 +1169,7 @@ func _Query_ObjectOwner_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "sourcehub.acp.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/acp/types/tx.pb.go b/x/acp/types/tx.pb.go index 79927ea..9b74284 100644 --- a/x/acp/types/tx.pb.go +++ b/x/acp/types/tx.pb.go @@ -1043,6 +1043,7 @@ func _Msg_DirectPolicyCmd_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "sourcehub.acp.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/bulletin/types/query.pb.go b/x/bulletin/types/query.pb.go index b712eba..d7cc070 100644 --- a/x/bulletin/types/query.pb.go +++ b/x/bulletin/types/query.pb.go @@ -345,6 +345,7 @@ func _Query_ReadPost_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "sourcehub.bulletin.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/bulletin/types/tx.pb.go b/x/bulletin/types/tx.pb.go index f280016..748db69 100644 --- a/x/bulletin/types/tx.pb.go +++ b/x/bulletin/types/tx.pb.go @@ -373,6 +373,7 @@ func _Msg_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "sourcehub.bulletin.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go index 12b102d..244a0c6 100644 --- a/x/epochs/types/query.pb.go +++ b/x/epochs/types/query.pb.go @@ -340,6 +340,7 @@ func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.epochs.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/tier/types/query.pb.go b/x/tier/types/query.pb.go index b4ec935..ee3ec5d 100644 --- a/x/tier/types/query.pb.go +++ b/x/tier/types/query.pb.go @@ -798,6 +798,7 @@ func _Query_UnlockingLockups_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "sourcehub.tier.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/tier/types/tx.pb.go b/x/tier/types/tx.pb.go index 301c0e1..895aa7c 100644 --- a/x/tier/types/tx.pb.go +++ b/x/tier/types/tx.pb.go @@ -828,6 +828,7 @@ func _Msg_CancelUnlocking_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "sourcehub.tier.v1beta1.Msg", HandlerType: (*MsgServer)(nil), From f9e539073540fe507433934ad1f6d8754d2c1406 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:17:33 +0800 Subject: [PATCH 04/10] Fix policy commands --- x/acp/keeper/policy_cmd.go | 19 ++++++++----------- x/acp/signed_policy_cmd/builder.go | 6 +++--- x/acp/types/policy_cmd.go | 6 +++--- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/x/acp/keeper/policy_cmd.go b/x/acp/keeper/policy_cmd.go index f60398a..de0fc9a 100644 --- a/x/acp/keeper/policy_cmd.go +++ b/x/acp/keeper/policy_cmd.go @@ -24,7 +24,6 @@ func dispatchPolicyCmd(ctx sdk.Context, engine coretypes.ACPEngineServer, policy case *types.PolicyCmd_SetRelationshipCmd: resp, respErr := engine.SetRelationship(goCtx, &coretypes.SetRelationshipRequest{ PolicyId: policyId, - CreationTime: ts, Relationship: c.SetRelationshipCmd.Relationship, }) if respErr != nil { @@ -55,9 +54,8 @@ func dispatchPolicyCmd(ctx sdk.Context, engine coretypes.ACPEngineServer, policy } case *types.PolicyCmd_RegisterObjectCmd: resp, respErr := engine.RegisterObject(goCtx, &coretypes.RegisterObjectRequest{ - PolicyId: policyId, - CreationTime: ts, - Object: c.RegisterObjectCmd.Object, + PolicyId: policyId, + Object: c.RegisterObjectCmd.Object, }) if respErr != nil { err = respErr @@ -65,22 +63,21 @@ func dispatchPolicyCmd(ctx sdk.Context, engine coretypes.ACPEngineServer, policy } result.Result = &types.PolicyCmdResult_RegisterObjectResult{ RegisterObjectResult: &types.RegisterObjectCmdResult{ - Result: resp.Result, Record: resp.Record, }, } - case *types.PolicyCmd_UnregisterObjectCmd: - resp, respErr := engine.UnregisterObject(goCtx, &coretypes.UnregisterObjectRequest{ + case *types.PolicyCmd_ArchiveObjectCmd: + resp, respErr := engine.ArchiveObject(goCtx, &coretypes.ArchiveObjectRequest{ PolicyId: policyId, - Object: c.UnregisterObjectCmd.Object, + Object: c.ArchiveObjectCmd.Object, }) if respErr != nil { err = respErr break } - result.Result = &types.PolicyCmdResult_UnregisterObjectResult{ - UnregisterObjectResult: &types.UnregisterObjectCmdResult{ - Found: resp.Found, + result.Result = &types.PolicyCmdResult_ArchiveObjectCmdResult{ + ArchiveObjectCmdResult: &types.ArchiveObjectCmdResult{ + Found: resp.RecordModified, RelationshipsRemoved: resp.RelationshipsRemoved, }, } diff --git a/x/acp/signed_policy_cmd/builder.go b/x/acp/signed_policy_cmd/builder.go index 8fd616e..6c802d2 100644 --- a/x/acp/signed_policy_cmd/builder.go +++ b/x/acp/signed_policy_cmd/builder.go @@ -131,9 +131,9 @@ func (b *CmdBuilder) RegisterObject(obj *coretypes.Object) { b.cmd.Cmd = types.NewRegisterObjectCmd(obj) } -// UnregisterObject builds a Payload for a UnregisterObject command -func (b *CmdBuilder) UnregisterObject(obj *coretypes.Object) { - b.cmd.Cmd = types.NewUnregisterObjectCmd(obj) +// UnregisterObject builds a Payload for a ArchiveObject command +func (b *CmdBuilder) ArchiveObject(obj *coretypes.Object) { + b.cmd.Cmd = types.NewArchiveObjectCmd(obj) } // SignPayload produces a JWS serialized version of a Payload from a signing key diff --git a/x/acp/types/policy_cmd.go b/x/acp/types/policy_cmd.go index 1b0d19e..29feed0 100644 --- a/x/acp/types/policy_cmd.go +++ b/x/acp/types/policy_cmd.go @@ -32,10 +32,10 @@ func NewRegisterObjectCmd(obj *acptypes.Object) *PolicyCmd { } } -func NewUnregisterObjectCmd(obj *acptypes.Object) *PolicyCmd { +func NewArchiveObjectCmd(obj *acptypes.Object) *PolicyCmd { return &PolicyCmd{ - Cmd: &PolicyCmd_UnregisterObjectCmd{ - UnregisterObjectCmd: &UnregisterObjectCmd{ + Cmd: &PolicyCmd_ArchiveObjectCmd{ + ArchiveObjectCmd: &ArchiveObjectCmd{ Object: obj, }, }, From 7a269f8103a80e19b8f2cebdf59a0ee2a7745bcf Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:18:48 +0800 Subject: [PATCH 05/10] Update engine imports and CreatePolicyRequest --- x/acp/keeper/keeper.go | 4 ++-- x/acp/keeper/msg_server_create_policy.go | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/x/acp/keeper/keeper.go b/x/acp/keeper/keeper.go index 232429f..e2a6bb7 100644 --- a/x/acp/keeper/keeper.go +++ b/x/acp/keeper/keeper.go @@ -10,8 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sourcenetwork/acp_core/pkg/engine" acpruntime "github.com/sourcenetwork/acp_core/pkg/runtime" + services "github.com/sourcenetwork/acp_core/pkg/services" coretypes "github.com/sourcenetwork/acp_core/pkg/types" "github.com/sourcenetwork/sourcehub/x/acp/access_decision" @@ -83,5 +83,5 @@ func (k *Keeper) GetACPEngine(ctx sdk.Context) (coretypes.ACPEngineServer, error return nil, err } - return engine.NewACPEngine(runtime), nil + return services.NewACPEngine(runtime), nil } diff --git a/x/acp/keeper/msg_server_create_policy.go b/x/acp/keeper/msg_server_create_policy.go index 3a906cb..6d62c60 100644 --- a/x/acp/keeper/msg_server_create_policy.go +++ b/x/acp/keeper/msg_server_create_policy.go @@ -33,10 +33,9 @@ func (k msgServer) CreatePolicy(goCtx context.Context, msg *types.MsgCreatePolic txHash := hex.EncodeToString(tx.Hash()) coreResult, err := engine.CreatePolicy(goCtx, &coretypes.CreatePolicyRequest{ - Policy: msg.Policy, - MarshalType: msg.MarshalType, - CreationTime: msg.CreationTime, - Metadata: map[string]string{ + Policy: msg.Policy, + MarshalType: msg.MarshalType, + Attributes: map[string]string{ txHashMapKey: txHash, creatorMapKey: msg.Creator, }, From cd377021a32a93bff9de348383201ccc94637950 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:21:53 +0800 Subject: [PATCH 06/10] Add normalizeTimestamps util --- tests/integration/acp/utils.go | 40 +++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/integration/acp/utils.go b/tests/integration/acp/utils.go index d339340..d3a3113 100644 --- a/tests/integration/acp/utils.go +++ b/tests/integration/acp/utils.go @@ -51,11 +51,49 @@ func AssertResults(ctx *TestCtx, got, want any, gotErr, wantErr error) { assert.NoError(ctx.T, gotErr) } if !isNil(want) { + normalizeTimestamps(got) + normalizeTimestamps(want) assert.Equal(ctx.T, want, got) } } -func isNil(object interface{}) bool { +// Helper function to normalize timestamps by setting Nanos to 0 in any struct containing proto timestamps. +func normalizeTimestamps(obj any) { + if obj == nil { + return + } + + // Check if obj is a pointer and dereference it for reflection. + val := reflect.ValueOf(obj) + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + + // Only handle structs, slices, or maps for recursive normalization. + switch val.Kind() { + case reflect.Struct: + for i := 0; i < val.NumField(); i++ { + field := val.Field(i) + if field.Kind() == reflect.Ptr && field.Type().String() == "*types.Timestamp" { + if ts, ok := field.Interface().(*gogotypes.Timestamp); ok && ts != nil { + ts.Nanos = 0 + } + } else { + normalizeTimestamps(field.Interface()) + } + } + case reflect.Slice: + for i := 0; i < val.Len(); i++ { + normalizeTimestamps(val.Index(i).Interface()) + } + case reflect.Map: + for _, key := range val.MapKeys() { + normalizeTimestamps(val.MapIndex(key).Interface()) + } + } +} + +func isNil(object any) bool { if object == nil { return true } From 8c807fedf39d419f47a3078731e55d0de65860ae Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:22:31 +0800 Subject: [PATCH 07/10] Update test actions and dispatchers --- tests/integration/acp/actions.go | 8 ++++---- tests/integration/acp/dispatchers.go | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/integration/acp/actions.go b/tests/integration/acp/actions.go index 24a223f..84d9b25 100644 --- a/tests/integration/acp/actions.go +++ b/tests/integration/acp/actions.go @@ -136,16 +136,16 @@ func (a *DeleteRelationshipAction) Run(ctx *TestCtx) *types.DeleteRelationshipCm return result } -type UnregisterObjectAction struct { +type ArchiveObjectAction struct { PolicyId string Object *coretypes.Object Actor *TestActor - Expected *types.UnregisterObjectCmdResult + Expected *types.ArchiveObjectCmdResult ExpectedErr error } -func (a *UnregisterObjectAction) Run(ctx *TestCtx) *types.UnregisterObjectCmdResult { - result, err := unregisterObjectDispatcher(ctx, a) +func (a *ArchiveObjectAction) Run(ctx *TestCtx) *types.ArchiveObjectCmdResult { + result, err := archiveObjectDispatcher(ctx, a) AssertResults(ctx, result, a.Expected, err, a.ExpectedErr) return result } diff --git a/tests/integration/acp/dispatchers.go b/tests/integration/acp/dispatchers.go index e5b444e..0a5a7f7 100644 --- a/tests/integration/acp/dispatchers.go +++ b/tests/integration/acp/dispatchers.go @@ -174,7 +174,7 @@ func registerObjectDispatcher(ctx *TestCtx, action *RegisterObjectAction) (resul return result, err } -func unregisterObjectDispatcher(ctx *TestCtx, action *UnregisterObjectAction) (result *types.UnregisterObjectCmdResult, err error) { +func archiveObjectDispatcher(ctx *TestCtx, action *ArchiveObjectAction) (result *types.ArchiveObjectCmdResult, err error) { switch ctx.Strategy { case BearerToken: jws := genToken(ctx, action.Actor) @@ -182,18 +182,18 @@ func unregisterObjectDispatcher(ctx *TestCtx, action *UnregisterObjectAction) (r Creator: ctx.TxSigner.SourceHubAddr, BearerToken: jws, PolicyId: action.PolicyId, - Cmd: types.NewUnregisterObjectCmd(action.Object), + Cmd: types.NewArchiveObjectCmd(action.Object), CreationTime: TimeToProto(ctx.Timestamp), } resp, respErr := ctx.Executor.BearerPolicyCmd(ctx, msg) if resp != nil { - result = resp.Result.GetUnregisterObjectResult() + result = resp.Result.GetArchiveObjectCmdResult() } err = respErr case SignedPayload: var jws string builder := signed_policy_cmd.NewCmdBuilder(ctx.LogicalClock, ctx.GetParams()) - builder.UnregisterObject(action.Object) + builder.ArchiveObject(action.Object) builder.Actor(action.Actor.DID) builder.CreationTimestamp(TimeToProto(ctx.Timestamp)) builder.PolicyID(action.PolicyId) @@ -208,7 +208,7 @@ func unregisterObjectDispatcher(ctx *TestCtx, action *UnregisterObjectAction) (r } resp, respErr := ctx.Executor.SignedPolicyCmd(ctx, msg) if resp != nil { - result = resp.Result.GetUnregisterObjectResult() + result = resp.Result.GetArchiveObjectCmdResult() } err = respErr case Direct: @@ -217,12 +217,12 @@ func unregisterObjectDispatcher(ctx *TestCtx, action *UnregisterObjectAction) (r msg := &types.MsgDirectPolicyCmd{ Creator: action.Actor.SourceHubAddr, PolicyId: action.PolicyId, - Cmd: types.NewUnregisterObjectCmd(action.Object), + Cmd: types.NewArchiveObjectCmd(action.Object), CreationTime: TimeToProto(ctx.Timestamp), } resp, respErr := ctx.Executor.DirectPolicyCmd(ctx, msg) if resp != nil { - result = resp.Result.GetUnregisterObjectResult() + result = resp.Result.GetArchiveObjectCmdResult() } err = respErr } From 400c50c5d6f3cb6434623abcbf07eca07129de66 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:23:57 +0800 Subject: [PATCH 08/10] Fix tests, add unauthorized test for ArchiveObject action --- .../acp/suite/object/register_test.go | 55 +++++---------- .../acp/suite/object/unregister_test.go | 70 +++++++++++-------- .../acp/suite/policy/create_test.go | 20 +++--- 3 files changed, 70 insertions(+), 75 deletions(-) diff --git a/tests/integration/acp/suite/object/register_test.go b/tests/integration/acp/suite/object/register_test.go index c248b0d..a49e1b6 100644 --- a/tests/integration/acp/suite/object/register_test.go +++ b/tests/integration/acp/suite/object/register_test.go @@ -37,7 +37,6 @@ func TestRegisterObject_RegisteringNewObjectIsSucessful(t *testing.T) { Actor: ctx.GetActor("bob"), Object: coretypes.NewObject("resource", "foo"), Expected: &types.RegisterObjectCmdResult{ - Result: coretypes.RegistrationResult_Registered, Record: &coretypes.RelationshipRecord{ PolicyId: ctx.State.PolicyId, OwnerDid: bob.DID, @@ -84,12 +83,13 @@ func TestRegisterObject_RegisteringObjectRegisteredToAnotherUserErrors(t *testin PolicyId: pol.Id, Actor: ctx.GetActor("alice"), Object: coretypes.NewObject("resource", "foo"), - ExpectedErr: errors.ErrorType_UNAUTHORIZED, + Expected: nil, + ExpectedErr: errors.ErrorType_OPERATION_FORBIDDEN, } a2.Run(ctx) } -func TestRegisterObject_ReregisteringObjectOwnedByUserIsNoop(t *testing.T) { +func TestRegisterObject_ReregisteringObjectOwnedByUser_ReturnsOperationForbidden(t *testing.T) { ctx := test.NewTestCtx(t) defer ctx.Cleanup() @@ -108,27 +108,17 @@ func TestRegisterObject_ReregisteringObjectOwnedByUserIsNoop(t *testing.T) { a2.Run(ctx) // when Bob tries to reregister foo - // then the result is a noop - bob := ctx.GetActor("bob") a2 = test.RegisterObjectAction{ - PolicyId: pol.Id, - Actor: ctx.GetActor("bob"), - Object: coretypes.NewObject("resource", "foo"), - Expected: &types.RegisterObjectCmdResult{ - Result: coretypes.RegistrationResult_NoOp, - Record: &coretypes.RelationshipRecord{ - PolicyId: ctx.State.PolicyId, - OwnerDid: bob.DID, - Relationship: coretypes.NewActorRelationship("resource", "foo", "owner", bob.DID), - Archived: false, - CreationTime: test.TimeToProto(ctx.Timestamp), - }, - }, + PolicyId: pol.Id, + Actor: ctx.GetActor("bob"), + Object: coretypes.NewObject("resource", "foo"), + Expected: nil, + ExpectedErr: errors.ErrorType_OPERATION_FORBIDDEN, } a2.Run(ctx) } -func TestRegisterObject_RegisteringAnotherUsersArchivedObjectErrors(t *testing.T) { +func TestRegisterObject_RegisteringAnotherUsersArchivedObject_ReturnsOperationForbidden(t *testing.T) { ctx := test.NewTestCtx(t) defer ctx.Cleanup() @@ -146,7 +136,7 @@ func TestRegisterObject_RegisteringAnotherUsersArchivedObjectErrors(t *testing.T } a2.Run(ctx) - a3 := test.UnregisterObjectAction{ + a3 := test.ArchiveObjectAction{ PolicyId: pol.Id, Actor: ctx.GetActor("bob"), Object: coretypes.NewObject("resource", "foo"), @@ -159,12 +149,13 @@ func TestRegisterObject_RegisteringAnotherUsersArchivedObjectErrors(t *testing.T PolicyId: pol.Id, Actor: ctx.GetActor("alice"), Object: coretypes.NewObject("resource", "foo"), - ExpectedErr: errors.ErrorType_UNAUTHORIZED, + Expected: nil, + ExpectedErr: errors.ErrorType_OPERATION_FORBIDDEN, } action.Run(ctx) } -func TestRegisterObject_RegisteringArchivedUserObjectUnarchivesObject(t *testing.T) { +func TestRegisterObject_RegisteringArchivedUserObject_ReturnsOperationForbidden(t *testing.T) { ctx := test.NewTestCtx(t) defer ctx.Cleanup() @@ -180,7 +171,7 @@ func TestRegisterObject_RegisteringArchivedUserObjectUnarchivesObject(t *testing Object: coretypes.NewObject("resource", "foo"), } a2.Run(ctx) - a3 := test.UnregisterObjectAction{ + a3 := test.ArchiveObjectAction{ PolicyId: pol.Id, Actor: ctx.GetActor("bob"), Object: coretypes.NewObject("resource", "foo"), @@ -190,19 +181,11 @@ func TestRegisterObject_RegisteringArchivedUserObjectUnarchivesObject(t *testing // when Bob tries to register foo, it is unarchived bob := ctx.GetActor("bob") action := test.RegisterObjectAction{ - PolicyId: pol.Id, - Actor: bob, - Object: coretypes.NewObject("resource", "foo"), - Expected: &types.RegisterObjectCmdResult{ - Result: coretypes.RegistrationResult_Unarchived, - Record: &coretypes.RelationshipRecord{ - PolicyId: ctx.State.PolicyId, - OwnerDid: bob.DID, - Relationship: coretypes.NewActorRelationship("resource", "foo", "owner", bob.DID), - Archived: false, - CreationTime: test.TimeToProto(ctx.Timestamp), - }, - }, + PolicyId: pol.Id, + Actor: bob, + Object: coretypes.NewObject("resource", "foo"), + Expected: nil, + ExpectedErr: errors.ErrorType_OPERATION_FORBIDDEN, } action.Run(ctx) diff --git a/tests/integration/acp/suite/object/unregister_test.go b/tests/integration/acp/suite/object/unregister_test.go index 3339540..435d029 100644 --- a/tests/integration/acp/suite/object/unregister_test.go +++ b/tests/integration/acp/suite/object/unregister_test.go @@ -10,7 +10,7 @@ import ( "github.com/sourcenetwork/sourcehub/x/acp/types" ) -var unregisterTestPol = ` +var archiveTestPol = ` name: policy resources: file: @@ -23,11 +23,11 @@ resources: - actor ` -func setupUnregister(t *testing.T) *test.TestCtx { +func setupArchive(t *testing.T) *test.TestCtx { ctx := test.NewTestCtx(t) a1 := test.CreatePolicyAction{ Creator: ctx.TxSigner, - Policy: unregisterTestPol, + Policy: archiveTestPol, } a1.Run(ctx) a2 := test.RegisterObjectAction{ @@ -45,15 +45,15 @@ func setupUnregister(t *testing.T) *test.TestCtx { return ctx } -func TestUnregisterObject_RegisteredObjectCanBeUnregisteredByAuthor(t *testing.T) { - ctx := setupUnregister(t) +func TestArchiveObject_RegisteredObjectCanBeUnregisteredByAuthor(t *testing.T) { + ctx := setupArchive(t) defer ctx.Cleanup() - action := test.UnregisterObjectAction{ + action := test.ArchiveObjectAction{ PolicyId: ctx.State.PolicyId, Object: coretypes.NewObject("file", "foo"), Actor: ctx.GetActor("alice"), - Expected: &types.UnregisterObjectCmdResult{ + Expected: &types.ArchiveObjectCmdResult{ Found: true, RelationshipsRemoved: 2, }, @@ -61,11 +61,11 @@ func TestUnregisterObject_RegisteredObjectCanBeUnregisteredByAuthor(t *testing.T action.Run(ctx) } -func TestUnregisterObject_ActorCannotUnregisterObjectTheyDoNotOwn(t *testing.T) { - ctx := setupUnregister(t) +func TestArchiveObject_ActorCannotUnregisterObjectTheyDoNotOwn(t *testing.T) { + ctx := setupArchive(t) defer ctx.Cleanup() - action := test.UnregisterObjectAction{ + action := test.ArchiveObjectAction{ PolicyId: ctx.State.PolicyId, Object: coretypes.NewObject("file", "foo"), Actor: ctx.GetActor("bob"), @@ -74,49 +74,61 @@ func TestUnregisterObject_ActorCannotUnregisterObjectTheyDoNotOwn(t *testing.T) action.Run(ctx) } -func TestUnregisterObject_UnregisteringAnObjectThatDoesNotExistReturnsFoundFalse(t *testing.T) { - ctx := setupUnregister(t) +func TestArchiveObject_UnregisteringAnObjectThatDoesNotExist_ReturnsBadInput(t *testing.T) { + ctx := setupArchive(t) defer ctx.Cleanup() - action := test.UnregisterObjectAction{ - PolicyId: ctx.State.PolicyId, - Object: coretypes.NewObject("file", "file-isnt-registerd"), - Actor: ctx.GetActor("bob"), - Expected: &types.UnregisterObjectCmdResult{ - Found: false, - RelationshipsRemoved: 0, - }, + action := test.ArchiveObjectAction{ + PolicyId: ctx.State.PolicyId, + Object: coretypes.NewObject("file", "file-isnt-registerd"), + Actor: ctx.GetActor("bob"), + Expected: nil, + ExpectedErr: errors.ErrorType_BAD_INPUT, + } + action.Run(ctx) +} + +func TestArchiveObject_UnregisteringAnObjectWithoutManagePermission_ReturnsUnauthorized(t *testing.T) { + ctx := setupArchive(t) + defer ctx.Cleanup() + + action := test.ArchiveObjectAction{ + PolicyId: ctx.State.PolicyId, + Object: coretypes.NewObject("file", "foo"), + Actor: ctx.GetActor("bob"), + Expected: nil, + ExpectedErr: errors.ErrorType_UNAUTHORIZED, } action.Run(ctx) } -func TestUnregisterObject_UnregisteringAnAlreadyArchivedObjectIsANoop(t *testing.T) { - ctx := setupUnregister(t) +func TestArchiveObject_UnregisteringAnAlreadyArchivedObjectIsANoop(t *testing.T) { + ctx := setupArchive(t) defer ctx.Cleanup() - action := test.UnregisterObjectAction{ + action := test.ArchiveObjectAction{ PolicyId: ctx.State.PolicyId, Object: coretypes.NewObject("file", "foo"), Actor: ctx.GetActor("alice"), } action.Run(ctx) - action = test.UnregisterObjectAction{ + action = test.ArchiveObjectAction{ PolicyId: ctx.State.PolicyId, Object: coretypes.NewObject("file", "foo"), Actor: ctx.GetActor("alice"), - Expected: &types.UnregisterObjectCmdResult{ - Found: true, + Expected: &types.ArchiveObjectCmdResult{ + Found: false, }, } action.Run(ctx) } -func TestUnregisterObject_SendingInvalidPolicyIdErrors(t *testing.T) { - ctx := setupUnregister(t) +func TestArchiveObject_SendingInvalidPolicyIdErrors(t *testing.T) { + ctx := setupArchive(t) defer ctx.Cleanup() - action := test.UnregisterObjectAction{ + action := test.ArchiveObjectAction{ PolicyId: "abc1234", Object: coretypes.NewObject("file", "foo"), Actor: ctx.GetActor("alice"), diff --git a/tests/integration/acp/suite/policy/create_test.go b/tests/integration/acp/suite/policy/create_test.go index 30299b3..d9703c9 100644 --- a/tests/integration/acp/suite/policy/create_test.go +++ b/tests/integration/acp/suite/policy/create_test.go @@ -38,22 +38,22 @@ actor: doc: my actor ` want := &coretypes.Policy{ - Id: "d12fa4d041911f2c77f6f49dd73942fb03389ab983714315af67b0f8e7cbcfef", + Id: "d011372c7e2cd34fd63777c513bb5eb16713834b855f424158474b77c1800410", Name: "policy", Description: "ok", CreationTime: test.TimeToProto(ctx.Timestamp), Resources: []*coretypes.Resource{ - &coretypes.Resource{ + { Name: "file", Relations: []*coretypes.Relation{ - &coretypes.Relation{ + { Name: "admin", Manages: []string{ "reader", }, VrTypes: []*coretypes.Restriction{}, }, - &coretypes.Relation{ + { Name: "owner", Doc: "owner owns", VrTypes: []*coretypes.Restriction{ @@ -63,31 +63,31 @@ actor: }, }, }, - &coretypes.Relation{ + { Name: "reader", }, }, Permissions: []*coretypes.Permission{ - &coretypes.Permission{ + { Name: "own", Expression: "owner", Doc: "own doc", }, - &coretypes.Permission{ + { Name: "read", Expression: "owner + reader", }, - &coretypes.Permission{ + { Name: "_can_manage_admin", Expression: "owner", Doc: "permission controls actors which are allowed to create relationships for the admin relation (permission was auto-generated by SourceHub).", }, - &coretypes.Permission{ + { Name: "_can_manage_owner", Expression: "owner", Doc: "permission controls actors which are allowed to create relationships for the owner relation (permission was auto-generated by SourceHub).", }, - &coretypes.Permission{ + { Name: "_can_manage_reader", Expression: "(admin + owner)", Doc: "permission controls actors which are allowed to create relationships for the reader relation (permission was auto-generated by SourceHub).", From e297fec01a40010dd5a627b547790dba456e4519 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:25:05 +0800 Subject: [PATCH 09/10] Update CmdArchiveObject cli command to archive-object policy-id resource objectId --- x/acp/client/cli/policy_cmd.go | 14 +++++++------- x/acp/client/cli/tx_bearer_policy_cmd.go | 2 +- x/acp/client/cli/tx_direct_policy_cmd.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x/acp/client/cli/policy_cmd.go b/x/acp/client/cli/policy_cmd.go index b55128e..7b62fd8 100644 --- a/x/acp/client/cli/policy_cmd.go +++ b/x/acp/client/cli/policy_cmd.go @@ -80,14 +80,14 @@ func CmdRegisterObject(dispatcher dispatcher) *cobra.Command { return cmd } -func CmdUnregisterObject(dispatcher dispatcher) *cobra.Command { +func CmdArchiveObject(dispatcher dispatcher) *cobra.Command { cmd := &cobra.Command{ - Use: "unregister-object policy-id resource objectId", - Short: "Issue UnregisterObject PolicyCmd", + Use: "archive-object policy-id resource objectId", + Short: "Issue ArchiveObject PolicyCmd", Long: ``, Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) (err error) { - polId, polCmd, err := parseUnregisterObjectArgs(args) + polId, polCmd, err := parseArchiveObjectArgs(args) if err != nil { return err } @@ -168,12 +168,12 @@ func parseRegisterObjectArgs(args []string) (string, *types.PolicyCmd, error) { return polId, types.NewRegisterObjectCmd(coretypes.NewObject(resource, objId)), nil } -func parseUnregisterObjectArgs(args []string) (string, *types.PolicyCmd, error) { +func parseArchiveObjectArgs(args []string) (string, *types.PolicyCmd, error) { if len(args) != 3 { - return "", nil, fmt.Errorf("UnregisterObject: invalid number of arguments: policy-id resource objectId") + return "", nil, fmt.Errorf("ArchiveObject: invalid number of arguments: policy-id resource objectId") } polId := args[0] resource := args[1] objId := args[2] - return polId, types.NewUnregisterObjectCmd(coretypes.NewObject(resource, objId)), nil + return polId, types.NewArchiveObjectCmd(coretypes.NewObject(resource, objId)), nil } diff --git a/x/acp/client/cli/tx_bearer_policy_cmd.go b/x/acp/client/cli/tx_bearer_policy_cmd.go index a6519f0..37ac2b7 100644 --- a/x/acp/client/cli/tx_bearer_policy_cmd.go +++ b/x/acp/client/cli/tx_bearer_policy_cmd.go @@ -38,7 +38,7 @@ func CmdBearerPolicyCmd() *cobra.Command { flags.String(BearerFlag, "", "specifies the bearer token to be broadcast with the command") cmd.AddCommand(CmdRegisterObject(bearerDispatcher)) - cmd.AddCommand(CmdUnregisterObject(bearerDispatcher)) + cmd.AddCommand(CmdArchiveObject(bearerDispatcher)) cmd.AddCommand(CmdSetRelationship(bearerDispatcher)) cmd.AddCommand(CmdDeleteRelationship(bearerDispatcher)) return cmd diff --git a/x/acp/client/cli/tx_direct_policy_cmd.go b/x/acp/client/cli/tx_direct_policy_cmd.go index ac5700f..9e46a0a 100644 --- a/x/acp/client/cli/tx_direct_policy_cmd.go +++ b/x/acp/client/cli/tx_direct_policy_cmd.go @@ -30,7 +30,7 @@ func CmdDirectPolicyCmd() *cobra.Command { } cmd.AddCommand(CmdRegisterObject(directDispatcher)) - cmd.AddCommand(CmdUnregisterObject(directDispatcher)) + cmd.AddCommand(CmdArchiveObject(directDispatcher)) cmd.AddCommand(CmdSetRelationship(directDispatcher)) cmd.AddCommand(CmdDeleteRelationship(directDispatcher)) return cmd From b189b0772e73eb9b2402f44616c87de9683b2cca Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 21 Jan 2025 09:59:19 +0800 Subject: [PATCH 10/10] Update comments and rerun proto gen --- api/sourcehub/acp/policy_cmd.pulsar.go | 678 ++++++++++++------------- proto/sourcehub/acp/policy_cmd.proto | 2 +- x/acp/signed_policy_cmd/builder.go | 2 +- x/acp/types/policy_cmd.pb.go | 2 +- 4 files changed, 342 insertions(+), 342 deletions(-) diff --git a/api/sourcehub/acp/policy_cmd.pulsar.go b/api/sourcehub/acp/policy_cmd.pulsar.go index 29e6ba8..0b25ab9 100644 --- a/api/sourcehub/acp/policy_cmd.pulsar.go +++ b/api/sourcehub/acp/policy_cmd.pulsar.go @@ -1258,7 +1258,7 @@ var ( fd_PolicyCmd_set_relationship_cmd protoreflect.FieldDescriptor fd_PolicyCmd_delete_relationship_cmd protoreflect.FieldDescriptor fd_PolicyCmd_register_object_cmd protoreflect.FieldDescriptor - fd_PolicyCmd_unregister_object_cmd protoreflect.FieldDescriptor + fd_PolicyCmd_archive_object_cmd protoreflect.FieldDescriptor ) func init() { @@ -1267,7 +1267,7 @@ func init() { fd_PolicyCmd_set_relationship_cmd = md_PolicyCmd.Fields().ByName("set_relationship_cmd") fd_PolicyCmd_delete_relationship_cmd = md_PolicyCmd.Fields().ByName("delete_relationship_cmd") fd_PolicyCmd_register_object_cmd = md_PolicyCmd.Fields().ByName("register_object_cmd") - fd_PolicyCmd_unregister_object_cmd = md_PolicyCmd.Fields().ByName("unregister_object_cmd") + fd_PolicyCmd_archive_object_cmd = md_PolicyCmd.Fields().ByName("archive_object_cmd") } var _ protoreflect.Message = (*fastReflection_PolicyCmd)(nil) @@ -1355,10 +1355,10 @@ func (x *fastReflection_PolicyCmd) Range(f func(protoreflect.FieldDescriptor, pr if !f(fd_PolicyCmd_register_object_cmd, value) { return } - case *PolicyCmd_UnregisterObjectCmd: - v := o.UnregisterObjectCmd + case *PolicyCmd_ArchiveObjectCmd: + v := o.ArchiveObjectCmd value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_PolicyCmd_unregister_object_cmd, value) { + if !f(fd_PolicyCmd_archive_object_cmd, value) { return } } @@ -1402,10 +1402,10 @@ func (x *fastReflection_PolicyCmd) Has(fd protoreflect.FieldDescriptor) bool { } else { return false } - case "sourcehub.acp.PolicyCmd.unregister_object_cmd": + case "sourcehub.acp.PolicyCmd.archive_object_cmd": if x.Cmd == nil { return false - } else if _, ok := x.Cmd.(*PolicyCmd_UnregisterObjectCmd); ok { + } else if _, ok := x.Cmd.(*PolicyCmd_ArchiveObjectCmd); ok { return true } else { return false @@ -1432,7 +1432,7 @@ func (x *fastReflection_PolicyCmd) Clear(fd protoreflect.FieldDescriptor) { x.Cmd = nil case "sourcehub.acp.PolicyCmd.register_object_cmd": x.Cmd = nil - case "sourcehub.acp.PolicyCmd.unregister_object_cmd": + case "sourcehub.acp.PolicyCmd.archive_object_cmd": x.Cmd = nil default: if fd.IsExtension() { @@ -1474,13 +1474,13 @@ func (x *fastReflection_PolicyCmd) Get(descriptor protoreflect.FieldDescriptor) } else { return protoreflect.ValueOfMessage((*RegisterObjectCmd)(nil).ProtoReflect()) } - case "sourcehub.acp.PolicyCmd.unregister_object_cmd": + case "sourcehub.acp.PolicyCmd.archive_object_cmd": if x.Cmd == nil { - return protoreflect.ValueOfMessage((*UnregisterObjectCmd)(nil).ProtoReflect()) - } else if v, ok := x.Cmd.(*PolicyCmd_UnregisterObjectCmd); ok { - return protoreflect.ValueOfMessage(v.UnregisterObjectCmd.ProtoReflect()) + return protoreflect.ValueOfMessage((*ArchiveObjectCmd)(nil).ProtoReflect()) + } else if v, ok := x.Cmd.(*PolicyCmd_ArchiveObjectCmd); ok { + return protoreflect.ValueOfMessage(v.ArchiveObjectCmd.ProtoReflect()) } else { - return protoreflect.ValueOfMessage((*UnregisterObjectCmd)(nil).ProtoReflect()) + return protoreflect.ValueOfMessage((*ArchiveObjectCmd)(nil).ProtoReflect()) } default: if descriptor.IsExtension() { @@ -1511,9 +1511,9 @@ func (x *fastReflection_PolicyCmd) Set(fd protoreflect.FieldDescriptor, value pr case "sourcehub.acp.PolicyCmd.register_object_cmd": cv := value.Message().Interface().(*RegisterObjectCmd) x.Cmd = &PolicyCmd_RegisterObjectCmd{RegisterObjectCmd: cv} - case "sourcehub.acp.PolicyCmd.unregister_object_cmd": - cv := value.Message().Interface().(*UnregisterObjectCmd) - x.Cmd = &PolicyCmd_UnregisterObjectCmd{UnregisterObjectCmd: cv} + case "sourcehub.acp.PolicyCmd.archive_object_cmd": + cv := value.Message().Interface().(*ArchiveObjectCmd) + x.Cmd = &PolicyCmd_ArchiveObjectCmd{ArchiveObjectCmd: cv} default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.PolicyCmd")) @@ -1582,19 +1582,19 @@ func (x *fastReflection_PolicyCmd) Mutable(fd protoreflect.FieldDescriptor) prot x.Cmd = oneofValue return protoreflect.ValueOfMessage(value.ProtoReflect()) } - case "sourcehub.acp.PolicyCmd.unregister_object_cmd": + case "sourcehub.acp.PolicyCmd.archive_object_cmd": if x.Cmd == nil { - value := &UnregisterObjectCmd{} - oneofValue := &PolicyCmd_UnregisterObjectCmd{UnregisterObjectCmd: value} + value := &ArchiveObjectCmd{} + oneofValue := &PolicyCmd_ArchiveObjectCmd{ArchiveObjectCmd: value} x.Cmd = oneofValue return protoreflect.ValueOfMessage(value.ProtoReflect()) } switch m := x.Cmd.(type) { - case *PolicyCmd_UnregisterObjectCmd: - return protoreflect.ValueOfMessage(m.UnregisterObjectCmd.ProtoReflect()) + case *PolicyCmd_ArchiveObjectCmd: + return protoreflect.ValueOfMessage(m.ArchiveObjectCmd.ProtoReflect()) default: - value := &UnregisterObjectCmd{} - oneofValue := &PolicyCmd_UnregisterObjectCmd{UnregisterObjectCmd: value} + value := &ArchiveObjectCmd{} + oneofValue := &PolicyCmd_ArchiveObjectCmd{ArchiveObjectCmd: value} x.Cmd = oneofValue return protoreflect.ValueOfMessage(value.ProtoReflect()) } @@ -1620,8 +1620,8 @@ func (x *fastReflection_PolicyCmd) NewField(fd protoreflect.FieldDescriptor) pro case "sourcehub.acp.PolicyCmd.register_object_cmd": value := &RegisterObjectCmd{} return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "sourcehub.acp.PolicyCmd.unregister_object_cmd": - value := &UnregisterObjectCmd{} + case "sourcehub.acp.PolicyCmd.archive_object_cmd": + value := &ArchiveObjectCmd{} return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if fd.IsExtension() { @@ -1647,8 +1647,8 @@ func (x *fastReflection_PolicyCmd) WhichOneof(d protoreflect.OneofDescriptor) pr return x.Descriptor().Fields().ByName("delete_relationship_cmd") case *PolicyCmd_RegisterObjectCmd: return x.Descriptor().Fields().ByName("register_object_cmd") - case *PolicyCmd_UnregisterObjectCmd: - return x.Descriptor().Fields().ByName("unregister_object_cmd") + case *PolicyCmd_ArchiveObjectCmd: + return x.Descriptor().Fields().ByName("archive_object_cmd") } default: panic(fmt.Errorf("%s is not a oneof field in sourcehub.acp.PolicyCmd", d.FullName())) @@ -1725,11 +1725,11 @@ func (x *fastReflection_PolicyCmd) ProtoMethods() *protoiface.Methods { } l = options.Size(x.RegisterObjectCmd) n += 1 + l + runtime.Sov(uint64(l)) - case *PolicyCmd_UnregisterObjectCmd: + case *PolicyCmd_ArchiveObjectCmd: if x == nil { break } - l = options.Size(x.UnregisterObjectCmd) + l = options.Size(x.ArchiveObjectCmd) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1801,8 +1801,8 @@ func (x *fastReflection_PolicyCmd) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x1a - case *PolicyCmd_UnregisterObjectCmd: - encoded, err := options.Marshal(x.UnregisterObjectCmd) + case *PolicyCmd_ArchiveObjectCmd: + encoded, err := options.Marshal(x.ArchiveObjectCmd) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1971,7 +1971,7 @@ func (x *fastReflection_PolicyCmd) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnregisterObjectCmd", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ArchiveObjectCmd", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1998,11 +1998,11 @@ func (x *fastReflection_PolicyCmd) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - v := &UnregisterObjectCmd{} + v := &ArchiveObjectCmd{} if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Cmd = &PolicyCmd_UnregisterObjectCmd{v} + x.Cmd = &PolicyCmd_ArchiveObjectCmd{v} iNdEx = postIndex default: iNdEx = preIndex @@ -3345,25 +3345,25 @@ func (x *fastReflection_RegisterObjectCmd) ProtoMethods() *protoiface.Methods { } var ( - md_UnregisterObjectCmd protoreflect.MessageDescriptor - fd_UnregisterObjectCmd_object protoreflect.FieldDescriptor + md_ArchiveObjectCmd protoreflect.MessageDescriptor + fd_ArchiveObjectCmd_object protoreflect.FieldDescriptor ) func init() { file_sourcehub_acp_policy_cmd_proto_init() - md_UnregisterObjectCmd = File_sourcehub_acp_policy_cmd_proto.Messages().ByName("UnregisterObjectCmd") - fd_UnregisterObjectCmd_object = md_UnregisterObjectCmd.Fields().ByName("object") + md_ArchiveObjectCmd = File_sourcehub_acp_policy_cmd_proto.Messages().ByName("ArchiveObjectCmd") + fd_ArchiveObjectCmd_object = md_ArchiveObjectCmd.Fields().ByName("object") } -var _ protoreflect.Message = (*fastReflection_UnregisterObjectCmd)(nil) +var _ protoreflect.Message = (*fastReflection_ArchiveObjectCmd)(nil) -type fastReflection_UnregisterObjectCmd UnregisterObjectCmd +type fastReflection_ArchiveObjectCmd ArchiveObjectCmd -func (x *UnregisterObjectCmd) ProtoReflect() protoreflect.Message { - return (*fastReflection_UnregisterObjectCmd)(x) +func (x *ArchiveObjectCmd) ProtoReflect() protoreflect.Message { + return (*fastReflection_ArchiveObjectCmd)(x) } -func (x *UnregisterObjectCmd) slowProtoReflect() protoreflect.Message { +func (x *ArchiveObjectCmd) slowProtoReflect() protoreflect.Message { mi := &file_sourcehub_acp_policy_cmd_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3375,43 +3375,43 @@ func (x *UnregisterObjectCmd) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_UnregisterObjectCmd_messageType fastReflection_UnregisterObjectCmd_messageType -var _ protoreflect.MessageType = fastReflection_UnregisterObjectCmd_messageType{} +var _fastReflection_ArchiveObjectCmd_messageType fastReflection_ArchiveObjectCmd_messageType +var _ protoreflect.MessageType = fastReflection_ArchiveObjectCmd_messageType{} -type fastReflection_UnregisterObjectCmd_messageType struct{} +type fastReflection_ArchiveObjectCmd_messageType struct{} -func (x fastReflection_UnregisterObjectCmd_messageType) Zero() protoreflect.Message { - return (*fastReflection_UnregisterObjectCmd)(nil) +func (x fastReflection_ArchiveObjectCmd_messageType) Zero() protoreflect.Message { + return (*fastReflection_ArchiveObjectCmd)(nil) } -func (x fastReflection_UnregisterObjectCmd_messageType) New() protoreflect.Message { - return new(fastReflection_UnregisterObjectCmd) +func (x fastReflection_ArchiveObjectCmd_messageType) New() protoreflect.Message { + return new(fastReflection_ArchiveObjectCmd) } -func (x fastReflection_UnregisterObjectCmd_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_UnregisterObjectCmd +func (x fastReflection_ArchiveObjectCmd_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ArchiveObjectCmd } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_UnregisterObjectCmd) Descriptor() protoreflect.MessageDescriptor { - return md_UnregisterObjectCmd +func (x *fastReflection_ArchiveObjectCmd) Descriptor() protoreflect.MessageDescriptor { + return md_ArchiveObjectCmd } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_UnregisterObjectCmd) Type() protoreflect.MessageType { - return _fastReflection_UnregisterObjectCmd_messageType +func (x *fastReflection_ArchiveObjectCmd) Type() protoreflect.MessageType { + return _fastReflection_ArchiveObjectCmd_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_UnregisterObjectCmd) New() protoreflect.Message { - return new(fastReflection_UnregisterObjectCmd) +func (x *fastReflection_ArchiveObjectCmd) New() protoreflect.Message { + return new(fastReflection_ArchiveObjectCmd) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_UnregisterObjectCmd) Interface() protoreflect.ProtoMessage { - return (*UnregisterObjectCmd)(x) +func (x *fastReflection_ArchiveObjectCmd) Interface() protoreflect.ProtoMessage { + return (*ArchiveObjectCmd)(x) } // Range iterates over every populated field in an undefined order, @@ -3419,10 +3419,10 @@ func (x *fastReflection_UnregisterObjectCmd) Interface() protoreflect.ProtoMessa // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_UnregisterObjectCmd) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_ArchiveObjectCmd) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Object != nil { value := protoreflect.ValueOfMessage(x.Object.ProtoReflect()) - if !f(fd_UnregisterObjectCmd_object, value) { + if !f(fd_ArchiveObjectCmd_object, value) { return } } @@ -3439,15 +3439,15 @@ func (x *fastReflection_UnregisterObjectCmd) Range(f func(protoreflect.FieldDesc // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_UnregisterObjectCmd) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ArchiveObjectCmd) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmd.object": + case "sourcehub.acp.ArchiveObjectCmd.object": return x.Object != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmd")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmd")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmd does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmd does not contain field %s", fd.FullName())) } } @@ -3457,15 +3457,15 @@ func (x *fastReflection_UnregisterObjectCmd) Has(fd protoreflect.FieldDescriptor // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmd) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ArchiveObjectCmd) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmd.object": + case "sourcehub.acp.ArchiveObjectCmd.object": x.Object = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmd")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmd")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmd does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmd does not contain field %s", fd.FullName())) } } @@ -3475,16 +3475,16 @@ func (x *fastReflection_UnregisterObjectCmd) Clear(fd protoreflect.FieldDescript // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_UnregisterObjectCmd) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ArchiveObjectCmd) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "sourcehub.acp.UnregisterObjectCmd.object": + case "sourcehub.acp.ArchiveObjectCmd.object": value := x.Object return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmd")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmd")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmd does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmd does not contain field %s", descriptor.FullName())) } } @@ -3498,15 +3498,15 @@ func (x *fastReflection_UnregisterObjectCmd) Get(descriptor protoreflect.FieldDe // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmd) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ArchiveObjectCmd) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmd.object": + case "sourcehub.acp.ArchiveObjectCmd.object": x.Object = value.Message().Interface().(*acp_core.Object) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmd")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmd")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmd does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmd does not contain field %s", fd.FullName())) } } @@ -3520,44 +3520,44 @@ func (x *fastReflection_UnregisterObjectCmd) Set(fd protoreflect.FieldDescriptor // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmd) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ArchiveObjectCmd) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmd.object": + case "sourcehub.acp.ArchiveObjectCmd.object": if x.Object == nil { x.Object = new(acp_core.Object) } return protoreflect.ValueOfMessage(x.Object.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmd")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmd")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmd does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmd does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_UnregisterObjectCmd) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ArchiveObjectCmd) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmd.object": + case "sourcehub.acp.ArchiveObjectCmd.object": m := new(acp_core.Object) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmd")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmd")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmd does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmd does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_UnregisterObjectCmd) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ArchiveObjectCmd) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.acp.UnregisterObjectCmd", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in sourcehub.acp.ArchiveObjectCmd", d.FullName())) } panic("unreachable") } @@ -3565,7 +3565,7 @@ func (x *fastReflection_UnregisterObjectCmd) WhichOneof(d protoreflect.OneofDesc // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_UnregisterObjectCmd) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ArchiveObjectCmd) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3576,7 +3576,7 @@ func (x *fastReflection_UnregisterObjectCmd) GetUnknown() protoreflect.RawFields // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmd) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ArchiveObjectCmd) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3588,7 +3588,7 @@ func (x *fastReflection_UnregisterObjectCmd) SetUnknown(fields protoreflect.RawF // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_UnregisterObjectCmd) IsValid() bool { +func (x *fastReflection_ArchiveObjectCmd) IsValid() bool { return x != nil } @@ -3598,9 +3598,9 @@ func (x *fastReflection_UnregisterObjectCmd) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_UnregisterObjectCmd) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ArchiveObjectCmd) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*UnregisterObjectCmd) + x := input.Message.Interface().(*ArchiveObjectCmd) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3626,7 +3626,7 @@ func (x *fastReflection_UnregisterObjectCmd) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*UnregisterObjectCmd) + x := input.Message.Interface().(*ArchiveObjectCmd) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3670,7 +3670,7 @@ func (x *fastReflection_UnregisterObjectCmd) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*UnregisterObjectCmd) + x := input.Message.Interface().(*ArchiveObjectCmd) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3702,10 +3702,10 @@ func (x *fastReflection_UnregisterObjectCmd) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnregisterObjectCmd: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ArchiveObjectCmd: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnregisterObjectCmd: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ArchiveObjectCmd: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4991,7 +4991,7 @@ func (x *fastReflection_RegisterObjectCmdResult) ProtoMethods() *protoiface.Meth copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -5042,7 +5042,7 @@ func (x *fastReflection_RegisterObjectCmdResult) ProtoMethods() *protoiface.Meth return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RegisterObjectCmdResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) } @@ -5114,27 +5114,27 @@ func (x *fastReflection_RegisterObjectCmdResult) ProtoMethods() *protoiface.Meth } var ( - md_UnregisterObjectCmdResult protoreflect.MessageDescriptor - fd_UnregisterObjectCmdResult_found protoreflect.FieldDescriptor - fd_UnregisterObjectCmdResult_relationships_removed protoreflect.FieldDescriptor + md_ArchiveObjectCmdResult protoreflect.MessageDescriptor + fd_ArchiveObjectCmdResult_found protoreflect.FieldDescriptor + fd_ArchiveObjectCmdResult_relationships_removed protoreflect.FieldDescriptor ) func init() { file_sourcehub_acp_policy_cmd_proto_init() - md_UnregisterObjectCmdResult = File_sourcehub_acp_policy_cmd_proto.Messages().ByName("UnregisterObjectCmdResult") - fd_UnregisterObjectCmdResult_found = md_UnregisterObjectCmdResult.Fields().ByName("found") - fd_UnregisterObjectCmdResult_relationships_removed = md_UnregisterObjectCmdResult.Fields().ByName("relationships_removed") + md_ArchiveObjectCmdResult = File_sourcehub_acp_policy_cmd_proto.Messages().ByName("ArchiveObjectCmdResult") + fd_ArchiveObjectCmdResult_found = md_ArchiveObjectCmdResult.Fields().ByName("found") + fd_ArchiveObjectCmdResult_relationships_removed = md_ArchiveObjectCmdResult.Fields().ByName("relationships_removed") } -var _ protoreflect.Message = (*fastReflection_UnregisterObjectCmdResult)(nil) +var _ protoreflect.Message = (*fastReflection_ArchiveObjectCmdResult)(nil) -type fastReflection_UnregisterObjectCmdResult UnregisterObjectCmdResult +type fastReflection_ArchiveObjectCmdResult ArchiveObjectCmdResult -func (x *UnregisterObjectCmdResult) ProtoReflect() protoreflect.Message { - return (*fastReflection_UnregisterObjectCmdResult)(x) +func (x *ArchiveObjectCmdResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_ArchiveObjectCmdResult)(x) } -func (x *UnregisterObjectCmdResult) slowProtoReflect() protoreflect.Message { +func (x *ArchiveObjectCmdResult) slowProtoReflect() protoreflect.Message { mi := &file_sourcehub_acp_policy_cmd_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5146,43 +5146,43 @@ func (x *UnregisterObjectCmdResult) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_UnregisterObjectCmdResult_messageType fastReflection_UnregisterObjectCmdResult_messageType -var _ protoreflect.MessageType = fastReflection_UnregisterObjectCmdResult_messageType{} +var _fastReflection_ArchiveObjectCmdResult_messageType fastReflection_ArchiveObjectCmdResult_messageType +var _ protoreflect.MessageType = fastReflection_ArchiveObjectCmdResult_messageType{} -type fastReflection_UnregisterObjectCmdResult_messageType struct{} +type fastReflection_ArchiveObjectCmdResult_messageType struct{} -func (x fastReflection_UnregisterObjectCmdResult_messageType) Zero() protoreflect.Message { - return (*fastReflection_UnregisterObjectCmdResult)(nil) +func (x fastReflection_ArchiveObjectCmdResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_ArchiveObjectCmdResult)(nil) } -func (x fastReflection_UnregisterObjectCmdResult_messageType) New() protoreflect.Message { - return new(fastReflection_UnregisterObjectCmdResult) +func (x fastReflection_ArchiveObjectCmdResult_messageType) New() protoreflect.Message { + return new(fastReflection_ArchiveObjectCmdResult) } -func (x fastReflection_UnregisterObjectCmdResult_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_UnregisterObjectCmdResult +func (x fastReflection_ArchiveObjectCmdResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ArchiveObjectCmdResult } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_UnregisterObjectCmdResult) Descriptor() protoreflect.MessageDescriptor { - return md_UnregisterObjectCmdResult +func (x *fastReflection_ArchiveObjectCmdResult) Descriptor() protoreflect.MessageDescriptor { + return md_ArchiveObjectCmdResult } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_UnregisterObjectCmdResult) Type() protoreflect.MessageType { - return _fastReflection_UnregisterObjectCmdResult_messageType +func (x *fastReflection_ArchiveObjectCmdResult) Type() protoreflect.MessageType { + return _fastReflection_ArchiveObjectCmdResult_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_UnregisterObjectCmdResult) New() protoreflect.Message { - return new(fastReflection_UnregisterObjectCmdResult) +func (x *fastReflection_ArchiveObjectCmdResult) New() protoreflect.Message { + return new(fastReflection_ArchiveObjectCmdResult) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_UnregisterObjectCmdResult) Interface() protoreflect.ProtoMessage { - return (*UnregisterObjectCmdResult)(x) +func (x *fastReflection_ArchiveObjectCmdResult) Interface() protoreflect.ProtoMessage { + return (*ArchiveObjectCmdResult)(x) } // Range iterates over every populated field in an undefined order, @@ -5190,16 +5190,16 @@ func (x *fastReflection_UnregisterObjectCmdResult) Interface() protoreflect.Prot // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_UnregisterObjectCmdResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_ArchiveObjectCmdResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Found != false { value := protoreflect.ValueOfBool(x.Found) - if !f(fd_UnregisterObjectCmdResult_found, value) { + if !f(fd_ArchiveObjectCmdResult_found, value) { return } } if x.RelationshipsRemoved != uint64(0) { value := protoreflect.ValueOfUint64(x.RelationshipsRemoved) - if !f(fd_UnregisterObjectCmdResult_relationships_removed, value) { + if !f(fd_ArchiveObjectCmdResult_relationships_removed, value) { return } } @@ -5216,17 +5216,17 @@ func (x *fastReflection_UnregisterObjectCmdResult) Range(f func(protoreflect.Fie // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_UnregisterObjectCmdResult) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ArchiveObjectCmdResult) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmdResult.found": + case "sourcehub.acp.ArchiveObjectCmdResult.found": return x.Found != false - case "sourcehub.acp.UnregisterObjectCmdResult.relationships_removed": + case "sourcehub.acp.ArchiveObjectCmdResult.relationships_removed": return x.RelationshipsRemoved != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmdResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmdResult")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmdResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmdResult does not contain field %s", fd.FullName())) } } @@ -5236,17 +5236,17 @@ func (x *fastReflection_UnregisterObjectCmdResult) Has(fd protoreflect.FieldDesc // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmdResult) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ArchiveObjectCmdResult) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmdResult.found": + case "sourcehub.acp.ArchiveObjectCmdResult.found": x.Found = false - case "sourcehub.acp.UnregisterObjectCmdResult.relationships_removed": + case "sourcehub.acp.ArchiveObjectCmdResult.relationships_removed": x.RelationshipsRemoved = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmdResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmdResult")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmdResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmdResult does not contain field %s", fd.FullName())) } } @@ -5256,19 +5256,19 @@ func (x *fastReflection_UnregisterObjectCmdResult) Clear(fd protoreflect.FieldDe // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_UnregisterObjectCmdResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ArchiveObjectCmdResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "sourcehub.acp.UnregisterObjectCmdResult.found": + case "sourcehub.acp.ArchiveObjectCmdResult.found": value := x.Found return protoreflect.ValueOfBool(value) - case "sourcehub.acp.UnregisterObjectCmdResult.relationships_removed": + case "sourcehub.acp.ArchiveObjectCmdResult.relationships_removed": value := x.RelationshipsRemoved return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmdResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmdResult")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmdResult does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmdResult does not contain field %s", descriptor.FullName())) } } @@ -5282,17 +5282,17 @@ func (x *fastReflection_UnregisterObjectCmdResult) Get(descriptor protoreflect.F // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmdResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ArchiveObjectCmdResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmdResult.found": + case "sourcehub.acp.ArchiveObjectCmdResult.found": x.Found = value.Bool() - case "sourcehub.acp.UnregisterObjectCmdResult.relationships_removed": + case "sourcehub.acp.ArchiveObjectCmdResult.relationships_removed": x.RelationshipsRemoved = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmdResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmdResult")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmdResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmdResult does not contain field %s", fd.FullName())) } } @@ -5306,44 +5306,44 @@ func (x *fastReflection_UnregisterObjectCmdResult) Set(fd protoreflect.FieldDesc // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmdResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ArchiveObjectCmdResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmdResult.found": - panic(fmt.Errorf("field found of message sourcehub.acp.UnregisterObjectCmdResult is not mutable")) - case "sourcehub.acp.UnregisterObjectCmdResult.relationships_removed": - panic(fmt.Errorf("field relationships_removed of message sourcehub.acp.UnregisterObjectCmdResult is not mutable")) + case "sourcehub.acp.ArchiveObjectCmdResult.found": + panic(fmt.Errorf("field found of message sourcehub.acp.ArchiveObjectCmdResult is not mutable")) + case "sourcehub.acp.ArchiveObjectCmdResult.relationships_removed": + panic(fmt.Errorf("field relationships_removed of message sourcehub.acp.ArchiveObjectCmdResult is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmdResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmdResult")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmdResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmdResult does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_UnregisterObjectCmdResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ArchiveObjectCmdResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "sourcehub.acp.UnregisterObjectCmdResult.found": + case "sourcehub.acp.ArchiveObjectCmdResult.found": return protoreflect.ValueOfBool(false) - case "sourcehub.acp.UnregisterObjectCmdResult.relationships_removed": + case "sourcehub.acp.ArchiveObjectCmdResult.relationships_removed": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.UnregisterObjectCmdResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.ArchiveObjectCmdResult")) } - panic(fmt.Errorf("message sourcehub.acp.UnregisterObjectCmdResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message sourcehub.acp.ArchiveObjectCmdResult does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_UnregisterObjectCmdResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ArchiveObjectCmdResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.acp.UnregisterObjectCmdResult", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in sourcehub.acp.ArchiveObjectCmdResult", d.FullName())) } panic("unreachable") } @@ -5351,7 +5351,7 @@ func (x *fastReflection_UnregisterObjectCmdResult) WhichOneof(d protoreflect.One // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_UnregisterObjectCmdResult) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ArchiveObjectCmdResult) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5362,7 +5362,7 @@ func (x *fastReflection_UnregisterObjectCmdResult) GetUnknown() protoreflect.Raw // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_UnregisterObjectCmdResult) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ArchiveObjectCmdResult) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5374,7 +5374,7 @@ func (x *fastReflection_UnregisterObjectCmdResult) SetUnknown(fields protoreflec // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_UnregisterObjectCmdResult) IsValid() bool { +func (x *fastReflection_ArchiveObjectCmdResult) IsValid() bool { return x != nil } @@ -5384,9 +5384,9 @@ func (x *fastReflection_UnregisterObjectCmdResult) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_UnregisterObjectCmdResult) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ArchiveObjectCmdResult) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*UnregisterObjectCmdResult) + x := input.Message.Interface().(*ArchiveObjectCmdResult) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5414,7 +5414,7 @@ func (x *fastReflection_UnregisterObjectCmdResult) ProtoMethods() *protoiface.Me } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*UnregisterObjectCmdResult) + x := input.Message.Interface().(*ArchiveObjectCmdResult) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5459,7 +5459,7 @@ func (x *fastReflection_UnregisterObjectCmdResult) ProtoMethods() *protoiface.Me }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*UnregisterObjectCmdResult) + x := input.Message.Interface().(*ArchiveObjectCmdResult) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5491,10 +5491,10 @@ func (x *fastReflection_UnregisterObjectCmdResult) ProtoMethods() *protoiface.Me fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnregisterObjectCmdResult: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ArchiveObjectCmdResult: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnregisterObjectCmdResult: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ArchiveObjectCmdResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5576,7 +5576,7 @@ var ( fd_PolicyCmdResult_set_relationship_result protoreflect.FieldDescriptor fd_PolicyCmdResult_delete_relationship_result protoreflect.FieldDescriptor fd_PolicyCmdResult_register_object_result protoreflect.FieldDescriptor - fd_PolicyCmdResult_unregister_object_result protoreflect.FieldDescriptor + fd_PolicyCmdResult_archive_object_cmd_result protoreflect.FieldDescriptor ) func init() { @@ -5585,7 +5585,7 @@ func init() { fd_PolicyCmdResult_set_relationship_result = md_PolicyCmdResult.Fields().ByName("set_relationship_result") fd_PolicyCmdResult_delete_relationship_result = md_PolicyCmdResult.Fields().ByName("delete_relationship_result") fd_PolicyCmdResult_register_object_result = md_PolicyCmdResult.Fields().ByName("register_object_result") - fd_PolicyCmdResult_unregister_object_result = md_PolicyCmdResult.Fields().ByName("unregister_object_result") + fd_PolicyCmdResult_archive_object_cmd_result = md_PolicyCmdResult.Fields().ByName("archive_object_cmd_result") } var _ protoreflect.Message = (*fastReflection_PolicyCmdResult)(nil) @@ -5673,10 +5673,10 @@ func (x *fastReflection_PolicyCmdResult) Range(f func(protoreflect.FieldDescript if !f(fd_PolicyCmdResult_register_object_result, value) { return } - case *PolicyCmdResult_UnregisterObjectResult: - v := o.UnregisterObjectResult + case *PolicyCmdResult_ArchiveObjectCmdResult: + v := o.ArchiveObjectCmdResult value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_PolicyCmdResult_unregister_object_result, value) { + if !f(fd_PolicyCmdResult_archive_object_cmd_result, value) { return } } @@ -5720,10 +5720,10 @@ func (x *fastReflection_PolicyCmdResult) Has(fd protoreflect.FieldDescriptor) bo } else { return false } - case "sourcehub.acp.PolicyCmdResult.unregister_object_result": + case "sourcehub.acp.PolicyCmdResult.archive_object_cmd_result": if x.Result == nil { return false - } else if _, ok := x.Result.(*PolicyCmdResult_UnregisterObjectResult); ok { + } else if _, ok := x.Result.(*PolicyCmdResult_ArchiveObjectCmdResult); ok { return true } else { return false @@ -5750,7 +5750,7 @@ func (x *fastReflection_PolicyCmdResult) Clear(fd protoreflect.FieldDescriptor) x.Result = nil case "sourcehub.acp.PolicyCmdResult.register_object_result": x.Result = nil - case "sourcehub.acp.PolicyCmdResult.unregister_object_result": + case "sourcehub.acp.PolicyCmdResult.archive_object_cmd_result": x.Result = nil default: if fd.IsExtension() { @@ -5792,13 +5792,13 @@ func (x *fastReflection_PolicyCmdResult) Get(descriptor protoreflect.FieldDescri } else { return protoreflect.ValueOfMessage((*RegisterObjectCmdResult)(nil).ProtoReflect()) } - case "sourcehub.acp.PolicyCmdResult.unregister_object_result": + case "sourcehub.acp.PolicyCmdResult.archive_object_cmd_result": if x.Result == nil { - return protoreflect.ValueOfMessage((*UnregisterObjectCmdResult)(nil).ProtoReflect()) - } else if v, ok := x.Result.(*PolicyCmdResult_UnregisterObjectResult); ok { - return protoreflect.ValueOfMessage(v.UnregisterObjectResult.ProtoReflect()) + return protoreflect.ValueOfMessage((*ArchiveObjectCmdResult)(nil).ProtoReflect()) + } else if v, ok := x.Result.(*PolicyCmdResult_ArchiveObjectCmdResult); ok { + return protoreflect.ValueOfMessage(v.ArchiveObjectCmdResult.ProtoReflect()) } else { - return protoreflect.ValueOfMessage((*UnregisterObjectCmdResult)(nil).ProtoReflect()) + return protoreflect.ValueOfMessage((*ArchiveObjectCmdResult)(nil).ProtoReflect()) } default: if descriptor.IsExtension() { @@ -5829,9 +5829,9 @@ func (x *fastReflection_PolicyCmdResult) Set(fd protoreflect.FieldDescriptor, va case "sourcehub.acp.PolicyCmdResult.register_object_result": cv := value.Message().Interface().(*RegisterObjectCmdResult) x.Result = &PolicyCmdResult_RegisterObjectResult{RegisterObjectResult: cv} - case "sourcehub.acp.PolicyCmdResult.unregister_object_result": - cv := value.Message().Interface().(*UnregisterObjectCmdResult) - x.Result = &PolicyCmdResult_UnregisterObjectResult{UnregisterObjectResult: cv} + case "sourcehub.acp.PolicyCmdResult.archive_object_cmd_result": + cv := value.Message().Interface().(*ArchiveObjectCmdResult) + x.Result = &PolicyCmdResult_ArchiveObjectCmdResult{ArchiveObjectCmdResult: cv} default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.acp.PolicyCmdResult")) @@ -5900,19 +5900,19 @@ func (x *fastReflection_PolicyCmdResult) Mutable(fd protoreflect.FieldDescriptor x.Result = oneofValue return protoreflect.ValueOfMessage(value.ProtoReflect()) } - case "sourcehub.acp.PolicyCmdResult.unregister_object_result": + case "sourcehub.acp.PolicyCmdResult.archive_object_cmd_result": if x.Result == nil { - value := &UnregisterObjectCmdResult{} - oneofValue := &PolicyCmdResult_UnregisterObjectResult{UnregisterObjectResult: value} + value := &ArchiveObjectCmdResult{} + oneofValue := &PolicyCmdResult_ArchiveObjectCmdResult{ArchiveObjectCmdResult: value} x.Result = oneofValue return protoreflect.ValueOfMessage(value.ProtoReflect()) } switch m := x.Result.(type) { - case *PolicyCmdResult_UnregisterObjectResult: - return protoreflect.ValueOfMessage(m.UnregisterObjectResult.ProtoReflect()) + case *PolicyCmdResult_ArchiveObjectCmdResult: + return protoreflect.ValueOfMessage(m.ArchiveObjectCmdResult.ProtoReflect()) default: - value := &UnregisterObjectCmdResult{} - oneofValue := &PolicyCmdResult_UnregisterObjectResult{UnregisterObjectResult: value} + value := &ArchiveObjectCmdResult{} + oneofValue := &PolicyCmdResult_ArchiveObjectCmdResult{ArchiveObjectCmdResult: value} x.Result = oneofValue return protoreflect.ValueOfMessage(value.ProtoReflect()) } @@ -5938,8 +5938,8 @@ func (x *fastReflection_PolicyCmdResult) NewField(fd protoreflect.FieldDescripto case "sourcehub.acp.PolicyCmdResult.register_object_result": value := &RegisterObjectCmdResult{} return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "sourcehub.acp.PolicyCmdResult.unregister_object_result": - value := &UnregisterObjectCmdResult{} + case "sourcehub.acp.PolicyCmdResult.archive_object_cmd_result": + value := &ArchiveObjectCmdResult{} return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if fd.IsExtension() { @@ -5965,8 +5965,8 @@ func (x *fastReflection_PolicyCmdResult) WhichOneof(d protoreflect.OneofDescript return x.Descriptor().Fields().ByName("delete_relationship_result") case *PolicyCmdResult_RegisterObjectResult: return x.Descriptor().Fields().ByName("register_object_result") - case *PolicyCmdResult_UnregisterObjectResult: - return x.Descriptor().Fields().ByName("unregister_object_result") + case *PolicyCmdResult_ArchiveObjectCmdResult: + return x.Descriptor().Fields().ByName("archive_object_cmd_result") } default: panic(fmt.Errorf("%s is not a oneof field in sourcehub.acp.PolicyCmdResult", d.FullName())) @@ -6043,11 +6043,11 @@ func (x *fastReflection_PolicyCmdResult) ProtoMethods() *protoiface.Methods { } l = options.Size(x.RegisterObjectResult) n += 1 + l + runtime.Sov(uint64(l)) - case *PolicyCmdResult_UnregisterObjectResult: + case *PolicyCmdResult_ArchiveObjectCmdResult: if x == nil { break } - l = options.Size(x.UnregisterObjectResult) + l = options.Size(x.ArchiveObjectCmdResult) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -6119,8 +6119,8 @@ func (x *fastReflection_PolicyCmdResult) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x1a - case *PolicyCmdResult_UnregisterObjectResult: - encoded, err := options.Marshal(x.UnregisterObjectResult) + case *PolicyCmdResult_ArchiveObjectCmdResult: + encoded, err := options.Marshal(x.ArchiveObjectCmdResult) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6289,7 +6289,7 @@ func (x *fastReflection_PolicyCmdResult) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnregisterObjectResult", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ArchiveObjectCmdResult", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6316,11 +6316,11 @@ func (x *fastReflection_PolicyCmdResult) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - v := &UnregisterObjectCmdResult{} + v := &ArchiveObjectCmdResult{} if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Result = &PolicyCmdResult_UnregisterObjectResult{v} + x.Result = &PolicyCmdResult_ArchiveObjectCmdResult{v} iNdEx = postIndex default: iNdEx = preIndex @@ -6513,7 +6513,7 @@ type PolicyCmd struct { // *PolicyCmd_SetRelationshipCmd // *PolicyCmd_DeleteRelationshipCmd // *PolicyCmd_RegisterObjectCmd - // *PolicyCmd_UnregisterObjectCmd + // *PolicyCmd_ArchiveObjectCmd Cmd isPolicyCmd_Cmd `protobuf_oneof:"cmd"` } @@ -6565,9 +6565,9 @@ func (x *PolicyCmd) GetRegisterObjectCmd() *RegisterObjectCmd { return nil } -func (x *PolicyCmd) GetUnregisterObjectCmd() *UnregisterObjectCmd { - if x, ok := x.GetCmd().(*PolicyCmd_UnregisterObjectCmd); ok { - return x.UnregisterObjectCmd +func (x *PolicyCmd) GetArchiveObjectCmd() *ArchiveObjectCmd { + if x, ok := x.GetCmd().(*PolicyCmd_ArchiveObjectCmd); ok { + return x.ArchiveObjectCmd } return nil } @@ -6588,8 +6588,8 @@ type PolicyCmd_RegisterObjectCmd struct { RegisterObjectCmd *RegisterObjectCmd `protobuf:"bytes,3,opt,name=register_object_cmd,json=registerObjectCmd,proto3,oneof"` } -type PolicyCmd_UnregisterObjectCmd struct { - UnregisterObjectCmd *UnregisterObjectCmd `protobuf:"bytes,4,opt,name=unregister_object_cmd,json=unregisterObjectCmd,proto3,oneof"` +type PolicyCmd_ArchiveObjectCmd struct { + ArchiveObjectCmd *ArchiveObjectCmd `protobuf:"bytes,4,opt,name=archive_object_cmd,json=archiveObjectCmd,proto3,oneof"` } func (*PolicyCmd_SetRelationshipCmd) isPolicyCmd_Cmd() {} @@ -6598,7 +6598,7 @@ func (*PolicyCmd_DeleteRelationshipCmd) isPolicyCmd_Cmd() {} func (*PolicyCmd_RegisterObjectCmd) isPolicyCmd_Cmd() {} -func (*PolicyCmd_UnregisterObjectCmd) isPolicyCmd_Cmd() {} +func (*PolicyCmd_ArchiveObjectCmd) isPolicyCmd_Cmd() {} // SetRelationship creates or updates a Relationship within a Policy // A Relationship is a statement which ties together an object and a subjecto with a "relation", @@ -6718,7 +6718,7 @@ func (x *RegisterObjectCmd) GetObject() *acp_core.Object { return nil } -// UnregisterObject let's an Object's Owner effectively "unshare" their Object. +// ArchiveObject let's an Object's Owner effectively "unshare" their Object. // This method wipes all Relationships referencing the given Object. // // A caveat is that after removing the Relationships, a record of the original Object owner @@ -6730,7 +6730,7 @@ func (x *RegisterObjectCmd) GetObject() *acp_core.Object { // If Charlie has a copy of the object, Eve could convince Charlie to share his copy, granting Eve access to Foo. // The previous scenario where an unauthorized user is able to claim ownership to data previously unaccessible to them // is an "ownership hijack". -type UnregisterObjectCmd struct { +type ArchiveObjectCmd struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -6738,8 +6738,8 @@ type UnregisterObjectCmd struct { Object *acp_core.Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` } -func (x *UnregisterObjectCmd) Reset() { - *x = UnregisterObjectCmd{} +func (x *ArchiveObjectCmd) Reset() { + *x = ArchiveObjectCmd{} if protoimpl.UnsafeEnabled { mi := &file_sourcehub_acp_policy_cmd_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6747,18 +6747,18 @@ func (x *UnregisterObjectCmd) Reset() { } } -func (x *UnregisterObjectCmd) String() string { +func (x *ArchiveObjectCmd) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UnregisterObjectCmd) ProtoMessage() {} +func (*ArchiveObjectCmd) ProtoMessage() {} -// Deprecated: Use UnregisterObjectCmd.ProtoReflect.Descriptor instead. -func (*UnregisterObjectCmd) Descriptor() ([]byte, []int) { +// Deprecated: Use ArchiveObjectCmd.ProtoReflect.Descriptor instead. +func (*ArchiveObjectCmd) Descriptor() ([]byte, []int) { return file_sourcehub_acp_policy_cmd_proto_rawDescGZIP(), []int{6} } -func (x *UnregisterObjectCmd) GetObject() *acp_core.Object { +func (x *ArchiveObjectCmd) GetObject() *acp_core.Object { if x != nil { return x.Object } @@ -6852,7 +6852,8 @@ type RegisterObjectCmdResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Record *acp_core.RelationshipRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + // sourcenetwork.acp_core.RegistrationResult result = 1 [deprecated = true]; + Record *acp_core.RelationshipRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` } func (x *RegisterObjectCmdResult) Reset() { @@ -6882,8 +6883,8 @@ func (x *RegisterObjectCmdResult) GetRecord() *acp_core.RelationshipRecord { return nil } -// UnregisterObjectCmdResult unregisters an Object in a Policy -type UnregisterObjectCmdResult struct { +// ArchiveObjectCmdResult unregisters an Object in a Policy +type ArchiveObjectCmdResult struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -6892,8 +6893,8 @@ type UnregisterObjectCmdResult struct { RelationshipsRemoved uint64 `protobuf:"varint,2,opt,name=relationships_removed,json=relationshipsRemoved,proto3" json:"relationships_removed,omitempty"` } -func (x *UnregisterObjectCmdResult) Reset() { - *x = UnregisterObjectCmdResult{} +func (x *ArchiveObjectCmdResult) Reset() { + *x = ArchiveObjectCmdResult{} if protoimpl.UnsafeEnabled { mi := &file_sourcehub_acp_policy_cmd_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6901,25 +6902,25 @@ func (x *UnregisterObjectCmdResult) Reset() { } } -func (x *UnregisterObjectCmdResult) String() string { +func (x *ArchiveObjectCmdResult) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UnregisterObjectCmdResult) ProtoMessage() {} +func (*ArchiveObjectCmdResult) ProtoMessage() {} -// Deprecated: Use UnregisterObjectCmdResult.ProtoReflect.Descriptor instead. -func (*UnregisterObjectCmdResult) Descriptor() ([]byte, []int) { +// Deprecated: Use ArchiveObjectCmdResult.ProtoReflect.Descriptor instead. +func (*ArchiveObjectCmdResult) Descriptor() ([]byte, []int) { return file_sourcehub_acp_policy_cmd_proto_rawDescGZIP(), []int{10} } -func (x *UnregisterObjectCmdResult) GetFound() bool { +func (x *ArchiveObjectCmdResult) GetFound() bool { if x != nil { return x.Found } return false } -func (x *UnregisterObjectCmdResult) GetRelationshipsRemoved() uint64 { +func (x *ArchiveObjectCmdResult) GetRelationshipsRemoved() uint64 { if x != nil { return x.RelationshipsRemoved } @@ -6936,7 +6937,7 @@ type PolicyCmdResult struct { // *PolicyCmdResult_SetRelationshipResult // *PolicyCmdResult_DeleteRelationshipResult // *PolicyCmdResult_RegisterObjectResult - // *PolicyCmdResult_UnregisterObjectResult + // *PolicyCmdResult_ArchiveObjectCmdResult Result isPolicyCmdResult_Result `protobuf_oneof:"result"` } @@ -6988,9 +6989,9 @@ func (x *PolicyCmdResult) GetRegisterObjectResult() *RegisterObjectCmdResult { return nil } -func (x *PolicyCmdResult) GetUnregisterObjectResult() *UnregisterObjectCmdResult { - if x, ok := x.GetResult().(*PolicyCmdResult_UnregisterObjectResult); ok { - return x.UnregisterObjectResult +func (x *PolicyCmdResult) GetArchiveObjectCmdResult() *ArchiveObjectCmdResult { + if x, ok := x.GetResult().(*PolicyCmdResult_ArchiveObjectCmdResult); ok { + return x.ArchiveObjectCmdResult } return nil } @@ -7011,8 +7012,8 @@ type PolicyCmdResult_RegisterObjectResult struct { RegisterObjectResult *RegisterObjectCmdResult `protobuf:"bytes,3,opt,name=register_object_result,json=registerObjectResult,proto3,oneof"` } -type PolicyCmdResult_UnregisterObjectResult struct { - UnregisterObjectResult *UnregisterObjectCmdResult `protobuf:"bytes,4,opt,name=unregister_object_result,json=unregisterObjectResult,proto3,oneof"` +type PolicyCmdResult_ArchiveObjectCmdResult struct { + ArchiveObjectCmdResult *ArchiveObjectCmdResult `protobuf:"bytes,4,opt,name=archive_object_cmd_result,json=archiveObjectCmdResult,proto3,oneof"` } func (*PolicyCmdResult_SetRelationshipResult) isPolicyCmdResult_Result() {} @@ -7021,7 +7022,7 @@ func (*PolicyCmdResult_DeleteRelationshipResult) isPolicyCmdResult_Result() {} func (*PolicyCmdResult_RegisterObjectResult) isPolicyCmdResult_Result() {} -func (*PolicyCmdResult_UnregisterObjectResult) isPolicyCmdResult_Result() {} +func (*PolicyCmdResult_ArchiveObjectCmdResult) isPolicyCmdResult_Result() {} var File_sourcehub_acp_policy_cmd_proto protoreflect.FileDescriptor @@ -7057,7 +7058,7 @@ var file_sourcehub_acp_policy_cmd_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0xf7, 0x02, 0x0a, 0x09, 0x50, 0x6f, 0x6c, + 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0xee, 0x02, 0x0a, 0x09, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6d, 0x64, 0x12, 0x55, 0x0a, 0x14, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, @@ -7075,97 +7076,96 @@ var file_sourcehub_acp_policy_cmd_proto_rawDesc = []byte{ 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, - 0x64, 0x12, 0x58, 0x0a, 0x15, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, - 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x43, 0x6d, 0x64, 0x48, 0x00, 0x52, 0x13, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x63, - 0x6d, 0x64, 0x22, 0x5e, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x12, 0x48, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, - 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x68, 0x69, 0x70, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, - 0x69, 0x70, 0x22, 0x61, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x12, 0x48, 0x0a, 0x0c, 0x72, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x68, 0x69, 0x70, 0x22, 0x4b, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x22, 0x4d, 0x0a, 0x13, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x22, 0x85, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, - 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, - 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, + 0x64, 0x12, 0x4f, 0x0a, 0x12, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x41, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x48, 0x00, + 0x52, 0x10, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, + 0x6d, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x5e, 0x0a, 0x12, 0x53, 0x65, 0x74, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x12, + 0x48, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x40, 0x0a, 0x1b, 0x44, 0x65, 0x6c, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0c, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x22, 0x61, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, - 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x5d, 0x0a, 0x17, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x66, 0x0a, 0x19, 0x55, 0x6e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, - 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, 0x0a, - 0x15, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x5f, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x72, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x64, 0x22, 0xb0, 0x03, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6d, 0x64, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x61, 0x0a, 0x17, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x48, 0x00, 0x52, 0x15, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x6a, 0x0a, 0x1a, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, - 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x44, 0x65, + 0x6d, 0x64, 0x12, 0x48, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, + 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0c, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x22, 0x4b, 0x0a, 0x11, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, + 0x64, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x4a, 0x0a, 0x10, 0x41, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x12, 0x36, 0x0a, + 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, + 0x70, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x40, 0x0a, + 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x22, + 0x5d, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x61, 0x63, 0x70, 0x5f, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x63, + 0x0a, 0x16, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, + 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, + 0x0a, 0x15, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x5f, + 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x64, 0x22, 0xae, 0x03, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6d, + 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x61, 0x0a, 0x17, 0x73, 0x65, 0x74, 0x5f, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x48, 0x00, 0x52, 0x15, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x6a, 0x0a, 0x1a, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, + 0x70, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, + 0x70, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x18, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, - 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x18, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x5e, 0x0a, 0x16, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, - 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, - 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x64, 0x0a, 0x18, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x42, 0x0e, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x43, 0x6d, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x61, 0x63, 0x70, 0xa2, 0x02, 0x03, - 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, - 0x41, 0x63, 0x70, 0xca, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, - 0x41, 0x63, 0x70, 0xe2, 0x02, 0x19, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, - 0x41, 0x63, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x41, 0x63, 0x70, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x5e, 0x0a, 0x16, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, + 0x52, 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x62, 0x0a, 0x19, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6d, 0x64, 0x5f, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x48, 0x00, 0x52, 0x16, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x61, 0x63, 0x70, 0x42, 0x0e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x43, 0x6d, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x61, 0x63, 0x70, 0xa2, 0x02, 0x03, 0x53, + 0x41, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x41, + 0x63, 0x70, 0xca, 0x02, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x41, + 0x63, 0x70, 0xe2, 0x02, 0x19, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x41, + 0x63, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x41, 0x63, 0x70, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7188,11 +7188,11 @@ var file_sourcehub_acp_policy_cmd_proto_goTypes = []interface{}{ (*SetRelationshipCmd)(nil), // 3: sourcehub.acp.SetRelationshipCmd (*DeleteRelationshipCmd)(nil), // 4: sourcehub.acp.DeleteRelationshipCmd (*RegisterObjectCmd)(nil), // 5: sourcehub.acp.RegisterObjectCmd - (*UnregisterObjectCmd)(nil), // 6: sourcehub.acp.UnregisterObjectCmd + (*ArchiveObjectCmd)(nil), // 6: sourcehub.acp.ArchiveObjectCmd (*SetRelationshipCmdResult)(nil), // 7: sourcehub.acp.SetRelationshipCmdResult (*DeleteRelationshipCmdResult)(nil), // 8: sourcehub.acp.DeleteRelationshipCmdResult (*RegisterObjectCmdResult)(nil), // 9: sourcehub.acp.RegisterObjectCmdResult - (*UnregisterObjectCmdResult)(nil), // 10: sourcehub.acp.UnregisterObjectCmdResult + (*ArchiveObjectCmdResult)(nil), // 10: sourcehub.acp.ArchiveObjectCmdResult (*PolicyCmdResult)(nil), // 11: sourcehub.acp.PolicyCmdResult (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp (*acp_core.Relationship)(nil), // 13: sourcenetwork.acp_core.Relationship @@ -7206,17 +7206,17 @@ var file_sourcehub_acp_policy_cmd_proto_depIdxs = []int32{ 3, // 3: sourcehub.acp.PolicyCmd.set_relationship_cmd:type_name -> sourcehub.acp.SetRelationshipCmd 4, // 4: sourcehub.acp.PolicyCmd.delete_relationship_cmd:type_name -> sourcehub.acp.DeleteRelationshipCmd 5, // 5: sourcehub.acp.PolicyCmd.register_object_cmd:type_name -> sourcehub.acp.RegisterObjectCmd - 6, // 6: sourcehub.acp.PolicyCmd.unregister_object_cmd:type_name -> sourcehub.acp.UnregisterObjectCmd + 6, // 6: sourcehub.acp.PolicyCmd.archive_object_cmd:type_name -> sourcehub.acp.ArchiveObjectCmd 13, // 7: sourcehub.acp.SetRelationshipCmd.relationship:type_name -> sourcenetwork.acp_core.Relationship 13, // 8: sourcehub.acp.DeleteRelationshipCmd.relationship:type_name -> sourcenetwork.acp_core.Relationship 14, // 9: sourcehub.acp.RegisterObjectCmd.object:type_name -> sourcenetwork.acp_core.Object - 14, // 10: sourcehub.acp.UnregisterObjectCmd.object:type_name -> sourcenetwork.acp_core.Object + 14, // 10: sourcehub.acp.ArchiveObjectCmd.object:type_name -> sourcenetwork.acp_core.Object 15, // 11: sourcehub.acp.SetRelationshipCmdResult.record:type_name -> sourcenetwork.acp_core.RelationshipRecord 15, // 12: sourcehub.acp.RegisterObjectCmdResult.record:type_name -> sourcenetwork.acp_core.RelationshipRecord 7, // 13: sourcehub.acp.PolicyCmdResult.set_relationship_result:type_name -> sourcehub.acp.SetRelationshipCmdResult 8, // 14: sourcehub.acp.PolicyCmdResult.delete_relationship_result:type_name -> sourcehub.acp.DeleteRelationshipCmdResult 9, // 15: sourcehub.acp.PolicyCmdResult.register_object_result:type_name -> sourcehub.acp.RegisterObjectCmdResult - 10, // 16: sourcehub.acp.PolicyCmdResult.unregister_object_result:type_name -> sourcehub.acp.UnregisterObjectCmdResult + 10, // 16: sourcehub.acp.PolicyCmdResult.archive_object_cmd_result:type_name -> sourcehub.acp.ArchiveObjectCmdResult 17, // [17:17] is the sub-list for method output_type 17, // [17:17] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name @@ -7303,7 +7303,7 @@ func file_sourcehub_acp_policy_cmd_proto_init() { } } file_sourcehub_acp_policy_cmd_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnregisterObjectCmd); i { + switch v := v.(*ArchiveObjectCmd); i { case 0: return &v.state case 1: @@ -7351,7 +7351,7 @@ func file_sourcehub_acp_policy_cmd_proto_init() { } } file_sourcehub_acp_policy_cmd_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnregisterObjectCmdResult); i { + switch v := v.(*ArchiveObjectCmdResult); i { case 0: return &v.state case 1: @@ -7379,13 +7379,13 @@ func file_sourcehub_acp_policy_cmd_proto_init() { (*PolicyCmd_SetRelationshipCmd)(nil), (*PolicyCmd_DeleteRelationshipCmd)(nil), (*PolicyCmd_RegisterObjectCmd)(nil), - (*PolicyCmd_UnregisterObjectCmd)(nil), + (*PolicyCmd_ArchiveObjectCmd)(nil), } file_sourcehub_acp_policy_cmd_proto_msgTypes[11].OneofWrappers = []interface{}{ (*PolicyCmdResult_SetRelationshipResult)(nil), (*PolicyCmdResult_DeleteRelationshipResult)(nil), (*PolicyCmdResult_RegisterObjectResult)(nil), - (*PolicyCmdResult_UnregisterObjectResult)(nil), + (*PolicyCmdResult_ArchiveObjectCmdResult)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/proto/sourcehub/acp/policy_cmd.proto b/proto/sourcehub/acp/policy_cmd.proto index 28556dc..0842da9 100644 --- a/proto/sourcehub/acp/policy_cmd.proto +++ b/proto/sourcehub/acp/policy_cmd.proto @@ -77,7 +77,7 @@ message RegisterObjectCmd { } -// UnregisterObject let's an Object's Owner effectively "unshare" their Object. +// ArchiveObject let's an Object's Owner effectively "unshare" their Object. // This method wipes all Relationships referencing the given Object. // // A caveat is that after removing the Relationships, a record of the original Object owner diff --git a/x/acp/signed_policy_cmd/builder.go b/x/acp/signed_policy_cmd/builder.go index 6c802d2..a3c4450 100644 --- a/x/acp/signed_policy_cmd/builder.go +++ b/x/acp/signed_policy_cmd/builder.go @@ -131,7 +131,7 @@ func (b *CmdBuilder) RegisterObject(obj *coretypes.Object) { b.cmd.Cmd = types.NewRegisterObjectCmd(obj) } -// UnregisterObject builds a Payload for a ArchiveObject command +// ArchiveObject builds a Payload for a ArchiveObject command func (b *CmdBuilder) ArchiveObject(obj *coretypes.Object) { b.cmd.Cmd = types.NewArchiveObjectCmd(obj) } diff --git a/x/acp/types/policy_cmd.pb.go b/x/acp/types/policy_cmd.pb.go index eafbc4f..b344833 100644 --- a/x/acp/types/policy_cmd.pb.go +++ b/x/acp/types/policy_cmd.pb.go @@ -431,7 +431,7 @@ func (m *RegisterObjectCmd) GetObject() *types1.Object { return nil } -// UnregisterObject let's an Object's Owner effectively "unshare" their Object. +// ArchiveObject let's an Object's Owner effectively "unshare" their Object. // This method wipes all Relationships referencing the given Object. // // A caveat is that after removing the Relationships, a record of the original Object owner