diff --git a/api/did/v1/accounts.pulsar.go b/api/did/v1/accounts.pulsar.go new file mode 100644 index 000000000..b808919bb --- /dev/null +++ b/api/did/v1/accounts.pulsar.go @@ -0,0 +1,70 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: did/v1/accounts.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_did_v1_accounts_proto protoreflect.FileDescriptor + +var file_did_v1_accounts_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, + 0x7d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, + 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, + 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_did_v1_accounts_proto_goTypes = []interface{}{} +var file_did_v1_accounts_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_did_v1_accounts_proto_init() } +func file_did_v1_accounts_proto_init() { + if File_did_v1_accounts_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_did_v1_accounts_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_did_v1_accounts_proto_goTypes, + DependencyIndexes: file_did_v1_accounts_proto_depIdxs, + }.Build() + File_did_v1_accounts_proto = out.File + file_did_v1_accounts_proto_rawDesc = nil + file_did_v1_accounts_proto_goTypes = nil + file_did_v1_accounts_proto_depIdxs = nil +} diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index badb81c64..39deb96a2 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -10,6 +10,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" + sort "sort" sync "sync" ) @@ -805,27 +806,25 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryExistsRequest protoreflect.MessageDescriptor - fd_QueryExistsRequest_kind protoreflect.FieldDescriptor - fd_QueryExistsRequest_value protoreflect.FieldDescriptor + md_QueryAccountsRequest protoreflect.MessageDescriptor + fd_QueryAccountsRequest_did protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryExistsRequest = File_did_v1_query_proto.Messages().ByName("QueryExistsRequest") - fd_QueryExistsRequest_kind = md_QueryExistsRequest.Fields().ByName("kind") - fd_QueryExistsRequest_value = md_QueryExistsRequest.Fields().ByName("value") + md_QueryAccountsRequest = File_did_v1_query_proto.Messages().ByName("QueryAccountsRequest") + fd_QueryAccountsRequest_did = md_QueryAccountsRequest.Fields().ByName("did") } -var _ protoreflect.Message = (*fastReflection_QueryExistsRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAccountsRequest)(nil) -type fastReflection_QueryExistsRequest QueryExistsRequest +type fastReflection_QueryAccountsRequest QueryAccountsRequest -func (x *QueryExistsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryExistsRequest)(x) +func (x *QueryAccountsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountsRequest)(x) } -func (x *QueryExistsRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryAccountsRequest) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -837,43 +836,43 @@ func (x *QueryExistsRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryExistsRequest_messageType fastReflection_QueryExistsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryExistsRequest_messageType{} +var _fastReflection_QueryAccountsRequest_messageType fastReflection_QueryAccountsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountsRequest_messageType{} -type fastReflection_QueryExistsRequest_messageType struct{} +type fastReflection_QueryAccountsRequest_messageType struct{} -func (x fastReflection_QueryExistsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryExistsRequest)(nil) +func (x fastReflection_QueryAccountsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountsRequest)(nil) } -func (x fastReflection_QueryExistsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryExistsRequest) +func (x fastReflection_QueryAccountsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountsRequest) } -func (x fastReflection_QueryExistsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryExistsRequest +func (x fastReflection_QueryAccountsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountsRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryExistsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryExistsRequest +func (x *fastReflection_QueryAccountsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountsRequest } // 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_QueryExistsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryExistsRequest_messageType +func (x *fastReflection_QueryAccountsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountsRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryExistsRequest) New() protoreflect.Message { - return new(fastReflection_QueryExistsRequest) +func (x *fastReflection_QueryAccountsRequest) New() protoreflect.Message { + return new(fastReflection_QueryAccountsRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryExistsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryExistsRequest)(x) +func (x *fastReflection_QueryAccountsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAccountsRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -881,16 +880,10 @@ func (x *fastReflection_QueryExistsRequest) Interface() protoreflect.ProtoMessag // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryExistsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Kind != "" { - value := protoreflect.ValueOfString(x.Kind) - if !f(fd_QueryExistsRequest_kind, value) { - return - } - } - if x.Value != "" { - value := protoreflect.ValueOfString(x.Value) - if !f(fd_QueryExistsRequest_value, value) { +func (x *fastReflection_QueryAccountsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QueryAccountsRequest_did, value) { return } } @@ -907,17 +900,15 @@ func (x *fastReflection_QueryExistsRequest) Range(f func(protoreflect.FieldDescr // 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_QueryExistsRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAccountsRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryExistsRequest.kind": - return x.Kind != "" - case "did.v1.QueryExistsRequest.value": - return x.Value != "" + case "did.v1.QueryAccountsRequest.did": + return x.Did != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) } - panic(fmt.Errorf("message did.v1.QueryExistsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsRequest does not contain field %s", fd.FullName())) } } @@ -927,17 +918,15 @@ func (x *fastReflection_QueryExistsRequest) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryExistsRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAccountsRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryExistsRequest.kind": - x.Kind = "" - case "did.v1.QueryExistsRequest.value": - x.Value = "" + case "did.v1.QueryAccountsRequest.did": + x.Did = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) } - panic(fmt.Errorf("message did.v1.QueryExistsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsRequest does not contain field %s", fd.FullName())) } } @@ -947,19 +936,16 @@ func (x *fastReflection_QueryExistsRequest) Clear(fd protoreflect.FieldDescripto // 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_QueryExistsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryExistsRequest.kind": - value := x.Kind - return protoreflect.ValueOfString(value) - case "did.v1.QueryExistsRequest.value": - value := x.Value + case "did.v1.QueryAccountsRequest.did": + value := x.Did return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) } - panic(fmt.Errorf("message did.v1.QueryExistsRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsRequest does not contain field %s", descriptor.FullName())) } } @@ -973,17 +959,15 @@ func (x *fastReflection_QueryExistsRequest) Get(descriptor protoreflect.FieldDes // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryExistsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAccountsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryExistsRequest.kind": - x.Kind = value.Interface().(string) - case "did.v1.QueryExistsRequest.value": - x.Value = value.Interface().(string) + case "did.v1.QueryAccountsRequest.did": + x.Did = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) } - panic(fmt.Errorf("message did.v1.QueryExistsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsRequest does not contain field %s", fd.FullName())) } } @@ -997,44 +981,40 @@ func (x *fastReflection_QueryExistsRequest) 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_QueryExistsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryExistsRequest.kind": - panic(fmt.Errorf("field kind of message did.v1.QueryExistsRequest is not mutable")) - case "did.v1.QueryExistsRequest.value": - panic(fmt.Errorf("field value of message did.v1.QueryExistsRequest is not mutable")) + case "did.v1.QueryAccountsRequest.did": + panic(fmt.Errorf("field did of message did.v1.QueryAccountsRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) } - panic(fmt.Errorf("message did.v1.QueryExistsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryExistsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryExistsRequest.kind": - return protoreflect.ValueOfString("") - case "did.v1.QueryExistsRequest.value": + case "did.v1.QueryAccountsRequest.did": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) } - panic(fmt.Errorf("message did.v1.QueryExistsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryExistsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAccountsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryExistsRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryAccountsRequest", d.FullName())) } panic("unreachable") } @@ -1042,7 +1022,7 @@ func (x *fastReflection_QueryExistsRequest) WhichOneof(d protoreflect.OneofDescr // 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_QueryExistsRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAccountsRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1053,7 +1033,7 @@ func (x *fastReflection_QueryExistsRequest) 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_QueryExistsRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAccountsRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1065,7 +1045,7 @@ func (x *fastReflection_QueryExistsRequest) SetUnknown(fields protoreflect.RawFi // 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_QueryExistsRequest) IsValid() bool { +func (x *fastReflection_QueryAccountsRequest) IsValid() bool { return x != nil } @@ -1075,9 +1055,9 @@ func (x *fastReflection_QueryExistsRequest) 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_QueryExistsRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAccountsRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryExistsRequest) + x := input.Message.Interface().(*QueryAccountsRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1089,11 +1069,7 @@ func (x *fastReflection_QueryExistsRequest) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Kind) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Value) + l = len(x.Did) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1107,7 +1083,7 @@ func (x *fastReflection_QueryExistsRequest) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryExistsRequest) + x := input.Message.Interface().(*QueryAccountsRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1126,17 +1102,10 @@ func (x *fastReflection_QueryExistsRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Value) > 0 { - i -= len(x.Value) - copy(dAtA[i:], x.Value) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) - i-- - dAtA[i] = 0x12 - } - if len(x.Kind) > 0 { - i -= len(x.Kind) - copy(dAtA[i:], x.Kind) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) i-- dAtA[i] = 0xa } @@ -1151,7 +1120,7 @@ func (x *fastReflection_QueryExistsRequest) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryExistsRequest) + x := input.Message.Interface().(*QueryAccountsRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1183,15 +1152,15 @@ func (x *fastReflection_QueryExistsRequest) 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: QueryExistsRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryExistsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1219,39 +1188,7 @@ func (x *fastReflection_QueryExistsRequest) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - 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++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Value = string(dAtA[iNdEx:postIndex]) + x.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1289,25 +1226,25 @@ func (x *fastReflection_QueryExistsRequest) ProtoMethods() *protoiface.Methods { } var ( - md_QueryExistsResponse protoreflect.MessageDescriptor - fd_QueryExistsResponse_exists protoreflect.FieldDescriptor + md_QueryAccountsResponse protoreflect.MessageDescriptor + fd_QueryAccountsResponse_exists protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryExistsResponse = File_did_v1_query_proto.Messages().ByName("QueryExistsResponse") - fd_QueryExistsResponse_exists = md_QueryExistsResponse.Fields().ByName("exists") + md_QueryAccountsResponse = File_did_v1_query_proto.Messages().ByName("QueryAccountsResponse") + fd_QueryAccountsResponse_exists = md_QueryAccountsResponse.Fields().ByName("exists") } -var _ protoreflect.Message = (*fastReflection_QueryExistsResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAccountsResponse)(nil) -type fastReflection_QueryExistsResponse QueryExistsResponse +type fastReflection_QueryAccountsResponse QueryAccountsResponse -func (x *QueryExistsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryExistsResponse)(x) +func (x *QueryAccountsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountsResponse)(x) } -func (x *QueryExistsResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryAccountsResponse) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1319,43 +1256,43 @@ func (x *QueryExistsResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryExistsResponse_messageType fastReflection_QueryExistsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryExistsResponse_messageType{} +var _fastReflection_QueryAccountsResponse_messageType fastReflection_QueryAccountsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountsResponse_messageType{} -type fastReflection_QueryExistsResponse_messageType struct{} +type fastReflection_QueryAccountsResponse_messageType struct{} -func (x fastReflection_QueryExistsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryExistsResponse)(nil) +func (x fastReflection_QueryAccountsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountsResponse)(nil) } -func (x fastReflection_QueryExistsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryExistsResponse) +func (x fastReflection_QueryAccountsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountsResponse) } -func (x fastReflection_QueryExistsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryExistsResponse +func (x fastReflection_QueryAccountsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryExistsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryExistsResponse +func (x *fastReflection_QueryAccountsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountsResponse } // 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_QueryExistsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryExistsResponse_messageType +func (x *fastReflection_QueryAccountsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryExistsResponse) New() protoreflect.Message { - return new(fastReflection_QueryExistsResponse) +func (x *fastReflection_QueryAccountsResponse) New() protoreflect.Message { + return new(fastReflection_QueryAccountsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryExistsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryExistsResponse)(x) +func (x *fastReflection_QueryAccountsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAccountsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1363,10 +1300,10 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryAccountsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Exists != false { value := protoreflect.ValueOfBool(x.Exists) - if !f(fd_QueryExistsResponse_exists, value) { + if !f(fd_QueryAccountsResponse_exists, value) { return } } @@ -1383,15 +1320,15 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAccountsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryExistsResponse.exists": + case "did.v1.QueryAccountsResponse.exists": return x.Exists != false default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) } - panic(fmt.Errorf("message did.v1.QueryExistsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) } } @@ -1401,15 +1338,15 @@ func (x *fastReflection_QueryExistsResponse) Has(fd protoreflect.FieldDescriptor // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryExistsResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAccountsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryExistsResponse.exists": + case "did.v1.QueryAccountsResponse.exists": x.Exists = false default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) } - panic(fmt.Errorf("message did.v1.QueryExistsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) } } @@ -1419,16 +1356,16 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryExistsResponse.exists": + case "did.v1.QueryAccountsResponse.exists": value := x.Exists return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) } - panic(fmt.Errorf("message did.v1.QueryExistsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", descriptor.FullName())) } } @@ -1442,15 +1379,15 @@ func (x *fastReflection_QueryExistsResponse) Get(descriptor protoreflect.FieldDe // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryExistsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAccountsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryExistsResponse.exists": + case "did.v1.QueryAccountsResponse.exists": x.Exists = value.Bool() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) } - panic(fmt.Errorf("message did.v1.QueryExistsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) } } @@ -1464,40 +1401,40 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryExistsResponse.exists": - panic(fmt.Errorf("field exists of message did.v1.QueryExistsResponse is not mutable")) + case "did.v1.QueryAccountsResponse.exists": + panic(fmt.Errorf("field exists of message did.v1.QueryAccountsResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) } - panic(fmt.Errorf("message did.v1.QueryExistsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryExistsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryExistsResponse.exists": + case "did.v1.QueryAccountsResponse.exists": return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryExistsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) } - panic(fmt.Errorf("message did.v1.QueryExistsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryExistsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAccountsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryExistsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryAccountsResponse", d.FullName())) } panic("unreachable") } @@ -1505,7 +1442,7 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAccountsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1516,7 +1453,7 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAccountsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1528,7 +1465,7 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) IsValid() bool { +func (x *fastReflection_QueryAccountsResponse) IsValid() bool { return x != nil } @@ -1538,9 +1475,9 @@ func (x *fastReflection_QueryExistsResponse) 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_QueryExistsResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAccountsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryExistsResponse) + x := input.Message.Interface().(*QueryAccountsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1565,7 +1502,7 @@ func (x *fastReflection_QueryExistsResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryExistsResponse) + x := input.Message.Interface().(*QueryAccountsResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1605,7 +1542,7 @@ func (x *fastReflection_QueryExistsResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryExistsResponse) + x := input.Message.Interface().(*QueryAccountsResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1637,10 +1574,10 @@ func (x *fastReflection_QueryExistsResponse) 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: QueryExistsResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryExistsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1699,14 +1636,2128 @@ func (x *fastReflection_QueryExistsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryResolveRequest protoreflect.MessageDescriptor - fd_QueryResolveRequest_id protoreflect.FieldDescriptor + md_QueryCredentialsRequest protoreflect.MessageDescriptor + fd_QueryCredentialsRequest_did protoreflect.FieldDescriptor + fd_QueryCredentialsRequest_origin protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryCredentialsRequest = File_did_v1_query_proto.Messages().ByName("QueryCredentialsRequest") + fd_QueryCredentialsRequest_did = md_QueryCredentialsRequest.Fields().ByName("did") + fd_QueryCredentialsRequest_origin = md_QueryCredentialsRequest.Fields().ByName("origin") +} + +var _ protoreflect.Message = (*fastReflection_QueryCredentialsRequest)(nil) + +type fastReflection_QueryCredentialsRequest QueryCredentialsRequest + +func (x *QueryCredentialsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCredentialsRequest)(x) +} + +func (x *QueryCredentialsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCredentialsRequest_messageType fastReflection_QueryCredentialsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCredentialsRequest_messageType{} + +type fastReflection_QueryCredentialsRequest_messageType struct{} + +func (x fastReflection_QueryCredentialsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCredentialsRequest)(nil) +} +func (x fastReflection_QueryCredentialsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCredentialsRequest) +} +func (x fastReflection_QueryCredentialsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCredentialsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCredentialsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCredentialsRequest +} + +// 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_QueryCredentialsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCredentialsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCredentialsRequest) New() protoreflect.Message { + return new(fastReflection_QueryCredentialsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCredentialsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCredentialsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCredentialsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QueryCredentialsRequest_did, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QueryCredentialsRequest_origin, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_QueryCredentialsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryCredentialsRequest.did": + return x.Did != "" + case "did.v1.QueryCredentialsRequest.origin": + return x.Origin != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryCredentialsRequest.did": + x.Did = "" + case "did.v1.QueryCredentialsRequest.origin": + x.Origin = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_QueryCredentialsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryCredentialsRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + case "did.v1.QueryCredentialsRequest.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryCredentialsRequest.did": + x.Did = value.Interface().(string) + case "did.v1.QueryCredentialsRequest.origin": + x.Origin = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryCredentialsRequest.did": + panic(fmt.Errorf("field did of message did.v1.QueryCredentialsRequest is not mutable")) + case "did.v1.QueryCredentialsRequest.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryCredentialsRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryCredentialsRequest.did": + return protoreflect.ValueOfString("") + case "did.v1.QueryCredentialsRequest.origin": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryCredentialsRequest", d.FullName())) + } + panic("unreachable") +} + +// 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_QueryCredentialsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_QueryCredentialsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCredentialsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCredentialsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCredentialsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCredentialsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.Map = (*_QueryCredentialsResponse_1_map)(nil) + +type _QueryCredentialsResponse_1_map struct { + m *map[string][]byte +} + +func (x *_QueryCredentialsResponse_1_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_QueryCredentialsResponse_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfBytes(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_QueryCredentialsResponse_1_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_QueryCredentialsResponse_1_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_QueryCredentialsResponse_1_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfBytes(v) +} + +func (x *_QueryCredentialsResponse_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_QueryCredentialsResponse_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_QueryCredentialsResponse_1_map) NewValue() protoreflect.Value { + var v []byte + return protoreflect.ValueOfBytes(v) +} + +func (x *_QueryCredentialsResponse_1_map) IsValid() bool { + return x.m != nil +} + +var ( + md_QueryCredentialsResponse protoreflect.MessageDescriptor + fd_QueryCredentialsResponse_credentials protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryCredentialsResponse = File_did_v1_query_proto.Messages().ByName("QueryCredentialsResponse") + fd_QueryCredentialsResponse_credentials = md_QueryCredentialsResponse.Fields().ByName("credentials") +} + +var _ protoreflect.Message = (*fastReflection_QueryCredentialsResponse)(nil) + +type fastReflection_QueryCredentialsResponse QueryCredentialsResponse + +func (x *QueryCredentialsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCredentialsResponse)(x) +} + +func (x *QueryCredentialsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCredentialsResponse_messageType fastReflection_QueryCredentialsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCredentialsResponse_messageType{} + +type fastReflection_QueryCredentialsResponse_messageType struct{} + +func (x fastReflection_QueryCredentialsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCredentialsResponse)(nil) +} +func (x fastReflection_QueryCredentialsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCredentialsResponse) +} +func (x fastReflection_QueryCredentialsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCredentialsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCredentialsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCredentialsResponse +} + +// 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_QueryCredentialsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCredentialsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCredentialsResponse) New() protoreflect.Message { + return new(fastReflection_QueryCredentialsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCredentialsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCredentialsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCredentialsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Credentials) != 0 { + value := protoreflect.ValueOfMap(&_QueryCredentialsResponse_1_map{m: &x.Credentials}) + if !f(fd_QueryCredentialsResponse_credentials, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_QueryCredentialsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryCredentialsResponse.credentials": + return len(x.Credentials) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryCredentialsResponse.credentials": + x.Credentials = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_QueryCredentialsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryCredentialsResponse.credentials": + if len(x.Credentials) == 0 { + return protoreflect.ValueOfMap(&_QueryCredentialsResponse_1_map{}) + } + mapValue := &_QueryCredentialsResponse_1_map{m: &x.Credentials} + return protoreflect.ValueOfMap(mapValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryCredentialsResponse.credentials": + mv := value.Map() + cmv := mv.(*_QueryCredentialsResponse_1_map) + x.Credentials = *cmv.m + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryCredentialsResponse.credentials": + if x.Credentials == nil { + x.Credentials = make(map[string][]byte) + } + value := &_QueryCredentialsResponse_1_map{m: &x.Credentials} + return protoreflect.ValueOfMap(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryCredentialsResponse.credentials": + m := make(map[string][]byte) + return protoreflect.ValueOfMap(&_QueryCredentialsResponse_1_map{m: &m}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryCredentialsResponse", d.FullName())) + } + panic("unreachable") +} + +// 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_QueryCredentialsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCredentialsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_QueryCredentialsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCredentialsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Credentials) > 0 { + SiZeMaP := func(k string, v []byte) { + l = 1 + len(v) + runtime.Sov(uint64(len(v))) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Credentials)) + for k := range x.Credentials { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Credentials[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Credentials { + SiZeMaP(k, v) + } + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCredentialsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Credentials) > 0 { + MaRsHaLmAp := func(k string, v []byte) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForCredentials := make([]string, 0, len(x.Credentials)) + for k := range x.Credentials { + keysForCredentials = append(keysForCredentials, string(k)) + } + sort.Slice(keysForCredentials, func(i, j int) bool { + return keysForCredentials[i] < keysForCredentials[j] + }) + for iNdEx := len(keysForCredentials) - 1; iNdEx >= 0; iNdEx-- { + v := x.Credentials[string(keysForCredentials[iNdEx])] + out, err := MaRsHaLmAp(keysForCredentials[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Credentials { + v := x.Credentials[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCredentialsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Credentials == nil { + x.Credentials = make(map[string][]byte) + } + var mapkey string + var mapvalue []byte + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + 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++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapbyteLen uint64 + 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++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postbytesIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } else { + iNdEx = entryPreIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.Credentials[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryIdentitiesRequest protoreflect.MessageDescriptor + fd_QueryIdentitiesRequest_did protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryIdentitiesRequest = File_did_v1_query_proto.Messages().ByName("QueryIdentitiesRequest") + fd_QueryIdentitiesRequest_did = md_QueryIdentitiesRequest.Fields().ByName("did") +} + +var _ protoreflect.Message = (*fastReflection_QueryIdentitiesRequest)(nil) + +type fastReflection_QueryIdentitiesRequest QueryIdentitiesRequest + +func (x *QueryIdentitiesRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryIdentitiesRequest)(x) +} + +func (x *QueryIdentitiesRequest) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryIdentitiesRequest_messageType fastReflection_QueryIdentitiesRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryIdentitiesRequest_messageType{} + +type fastReflection_QueryIdentitiesRequest_messageType struct{} + +func (x fastReflection_QueryIdentitiesRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryIdentitiesRequest)(nil) +} +func (x fastReflection_QueryIdentitiesRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryIdentitiesRequest) +} +func (x fastReflection_QueryIdentitiesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIdentitiesRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryIdentitiesRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIdentitiesRequest +} + +// 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_QueryIdentitiesRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryIdentitiesRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryIdentitiesRequest) New() protoreflect.Message { + return new(fastReflection_QueryIdentitiesRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryIdentitiesRequest) Interface() protoreflect.ProtoMessage { + return (*QueryIdentitiesRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryIdentitiesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QueryIdentitiesRequest_did, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_QueryIdentitiesRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryIdentitiesRequest.did": + return x.Did != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryIdentitiesRequest.did": + x.Did = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_QueryIdentitiesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryIdentitiesRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryIdentitiesRequest.did": + x.Did = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryIdentitiesRequest.did": + panic(fmt.Errorf("field did of message did.v1.QueryIdentitiesRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest 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_QueryIdentitiesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryIdentitiesRequest.did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest 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_QueryIdentitiesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryIdentitiesRequest", d.FullName())) + } + panic("unreachable") +} + +// 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_QueryIdentitiesRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_QueryIdentitiesRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryIdentitiesRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryIdentitiesRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryIdentitiesRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryIdentitiesRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIdentitiesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIdentitiesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryIdentitiesResponse_2_list)(nil) + +type _QueryIdentitiesResponse_2_list struct { + list *[]*VerificationMethod +} + +func (x *_QueryIdentitiesResponse_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryIdentitiesResponse_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryIdentitiesResponse_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + (*x.list)[i] = concreteValue +} + +func (x *_QueryIdentitiesResponse_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryIdentitiesResponse_2_list) AppendMutable() protoreflect.Value { + v := new(VerificationMethod) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryIdentitiesResponse_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryIdentitiesResponse_2_list) NewElement() protoreflect.Value { + v := new(VerificationMethod) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryIdentitiesResponse_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryIdentitiesResponse protoreflect.MessageDescriptor + fd_QueryIdentitiesResponse_exists protoreflect.FieldDescriptor + fd_QueryIdentitiesResponse_verificationMethod protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryIdentitiesResponse = File_did_v1_query_proto.Messages().ByName("QueryIdentitiesResponse") + fd_QueryIdentitiesResponse_exists = md_QueryIdentitiesResponse.Fields().ByName("exists") + fd_QueryIdentitiesResponse_verificationMethod = md_QueryIdentitiesResponse.Fields().ByName("verificationMethod") +} + +var _ protoreflect.Message = (*fastReflection_QueryIdentitiesResponse)(nil) + +type fastReflection_QueryIdentitiesResponse QueryIdentitiesResponse + +func (x *QueryIdentitiesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryIdentitiesResponse)(x) +} + +func (x *QueryIdentitiesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryIdentitiesResponse_messageType fastReflection_QueryIdentitiesResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryIdentitiesResponse_messageType{} + +type fastReflection_QueryIdentitiesResponse_messageType struct{} + +func (x fastReflection_QueryIdentitiesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryIdentitiesResponse)(nil) +} +func (x fastReflection_QueryIdentitiesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryIdentitiesResponse) +} +func (x fastReflection_QueryIdentitiesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIdentitiesResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryIdentitiesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIdentitiesResponse +} + +// 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_QueryIdentitiesResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryIdentitiesResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryIdentitiesResponse) New() protoreflect.Message { + return new(fastReflection_QueryIdentitiesResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryIdentitiesResponse) Interface() protoreflect.ProtoMessage { + return (*QueryIdentitiesResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryIdentitiesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Exists != false { + value := protoreflect.ValueOfBool(x.Exists) + if !f(fd_QueryIdentitiesResponse_exists, value) { + return + } + } + if len(x.VerificationMethod) != 0 { + value := protoreflect.ValueOfList(&_QueryIdentitiesResponse_2_list{list: &x.VerificationMethod}) + if !f(fd_QueryIdentitiesResponse_verificationMethod, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_QueryIdentitiesResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryIdentitiesResponse.exists": + return x.Exists != false + case "did.v1.QueryIdentitiesResponse.verificationMethod": + return len(x.VerificationMethod) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryIdentitiesResponse.exists": + x.Exists = false + case "did.v1.QueryIdentitiesResponse.verificationMethod": + x.VerificationMethod = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_QueryIdentitiesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryIdentitiesResponse.exists": + value := x.Exists + return protoreflect.ValueOfBool(value) + case "did.v1.QueryIdentitiesResponse.verificationMethod": + if len(x.VerificationMethod) == 0 { + return protoreflect.ValueOfList(&_QueryIdentitiesResponse_2_list{}) + } + listValue := &_QueryIdentitiesResponse_2_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryIdentitiesResponse.exists": + x.Exists = value.Bool() + case "did.v1.QueryIdentitiesResponse.verificationMethod": + lv := value.List() + clv := lv.(*_QueryIdentitiesResponse_2_list) + x.VerificationMethod = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryIdentitiesResponse.verificationMethod": + if x.VerificationMethod == nil { + x.VerificationMethod = []*VerificationMethod{} + } + value := &_QueryIdentitiesResponse_2_list{list: &x.VerificationMethod} + return protoreflect.ValueOfList(value) + case "did.v1.QueryIdentitiesResponse.exists": + panic(fmt.Errorf("field exists of message did.v1.QueryIdentitiesResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryIdentitiesResponse.exists": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryIdentitiesResponse.verificationMethod": + list := []*VerificationMethod{} + return protoreflect.ValueOfList(&_QueryIdentitiesResponse_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) + } + panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryIdentitiesResponse", d.FullName())) + } + panic("unreachable") +} + +// 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_QueryIdentitiesResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryIdentitiesResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_QueryIdentitiesResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryIdentitiesResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryIdentitiesResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Exists { + n += 2 + } + if len(x.VerificationMethod) > 0 { + for _, e := range x.VerificationMethod { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryIdentitiesResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.VerificationMethod) > 0 { + for iNdEx := len(x.VerificationMethod) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VerificationMethod[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.Exists { + i-- + if x.Exists { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryIdentitiesResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIdentitiesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIdentitiesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var v int + 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Exists = bool(v != 0) + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VerificationMethod", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.VerificationMethod = append(x.VerificationMethod, &VerificationMethod{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VerificationMethod[len(x.VerificationMethod)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryResolveRequest protoreflect.MessageDescriptor + fd_QueryResolveRequest_did protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() md_QueryResolveRequest = File_did_v1_query_proto.Messages().ByName("QueryResolveRequest") - fd_QueryResolveRequest_id = md_QueryResolveRequest.Fields().ByName("id") + fd_QueryResolveRequest_did = md_QueryResolveRequest.Fields().ByName("did") } var _ protoreflect.Message = (*fastReflection_QueryResolveRequest)(nil) @@ -1718,7 +3769,7 @@ func (x *QueryResolveRequest) ProtoReflect() protoreflect.Message { } func (x *QueryResolveRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[4] + mi := &file_did_v1_query_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1774,9 +3825,9 @@ func (x *fastReflection_QueryResolveRequest) Interface() protoreflect.ProtoMessa // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryResolveRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_QueryResolveRequest_id, value) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QueryResolveRequest_did, value) { return } } @@ -1795,8 +3846,8 @@ func (x *fastReflection_QueryResolveRequest) Range(f func(protoreflect.FieldDesc // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryResolveRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryResolveRequest.id": - return x.Id != "" + case "did.v1.QueryResolveRequest.did": + return x.Did != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) @@ -1813,8 +3864,8 @@ func (x *fastReflection_QueryResolveRequest) Has(fd protoreflect.FieldDescriptor // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryResolveRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryResolveRequest.id": - x.Id = "" + case "did.v1.QueryResolveRequest.did": + x.Did = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) @@ -1831,8 +3882,8 @@ func (x *fastReflection_QueryResolveRequest) Clear(fd protoreflect.FieldDescript // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryResolveRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryResolveRequest.id": - value := x.Id + case "did.v1.QueryResolveRequest.did": + value := x.Did return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -1854,8 +3905,8 @@ func (x *fastReflection_QueryResolveRequest) Get(descriptor protoreflect.FieldDe // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryResolveRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryResolveRequest.id": - x.Id = value.Interface().(string) + case "did.v1.QueryResolveRequest.did": + x.Did = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) @@ -1876,8 +3927,8 @@ func (x *fastReflection_QueryResolveRequest) Set(fd protoreflect.FieldDescriptor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryResolveRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryResolveRequest.id": - panic(fmt.Errorf("field id of message did.v1.QueryResolveRequest is not mutable")) + case "did.v1.QueryResolveRequest.did": + panic(fmt.Errorf("field did of message did.v1.QueryResolveRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) @@ -1891,7 +3942,7 @@ func (x *fastReflection_QueryResolveRequest) Mutable(fd protoreflect.FieldDescri // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryResolveRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryResolveRequest.id": + case "did.v1.QueryResolveRequest.did": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -1962,7 +4013,7 @@ func (x *fastReflection_QueryResolveRequest) ProtoMethods() *protoiface.Methods var n int var l int _ = l - l = len(x.Id) + l = len(x.Did) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1995,10 +4046,10 @@ func (x *fastReflection_QueryResolveRequest) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) i-- dAtA[i] = 0xa } @@ -2053,7 +4104,7 @@ func (x *fastReflection_QueryResolveRequest) ProtoMethods() *protoiface.Methods switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2081,7 +4132,7 @@ func (x *fastReflection_QueryResolveRequest) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Id = string(dAtA[iNdEx:postIndex]) + x.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2138,7 +4189,7 @@ func (x *QueryResolveResponse) ProtoReflect() protoreflect.Message { } func (x *QueryResolveResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[5] + mi := &file_did_v1_query_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2194,8 +4245,8 @@ func (x *fastReflection_QueryResolveResponse) Interface() protoreflect.ProtoMess // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryResolveResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Document != "" { - value := protoreflect.ValueOfString(x.Document) + if x.Document != nil { + value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) if !f(fd_QueryResolveResponse_document, value) { return } @@ -2216,7 +4267,7 @@ func (x *fastReflection_QueryResolveResponse) Range(f func(protoreflect.FieldDes func (x *fastReflection_QueryResolveResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.QueryResolveResponse.document": - return x.Document != "" + return x.Document != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2234,7 +4285,7 @@ func (x *fastReflection_QueryResolveResponse) Has(fd protoreflect.FieldDescripto func (x *fastReflection_QueryResolveResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.QueryResolveResponse.document": - x.Document = "" + x.Document = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2253,7 +4304,7 @@ func (x *fastReflection_QueryResolveResponse) Get(descriptor protoreflect.FieldD switch descriptor.FullName() { case "did.v1.QueryResolveResponse.document": value := x.Document - return protoreflect.ValueOfString(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2275,7 +4326,7 @@ func (x *fastReflection_QueryResolveResponse) Get(descriptor protoreflect.FieldD func (x *fastReflection_QueryResolveResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "did.v1.QueryResolveResponse.document": - x.Document = value.Interface().(string) + x.Document = value.Message().Interface().(*Document) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2297,7 +4348,10 @@ func (x *fastReflection_QueryResolveResponse) Set(fd protoreflect.FieldDescripto func (x *fastReflection_QueryResolveResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.QueryResolveResponse.document": - panic(fmt.Errorf("field document of message did.v1.QueryResolveResponse is not mutable")) + if x.Document == nil { + x.Document = new(Document) + } + return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2312,7 +4366,8 @@ func (x *fastReflection_QueryResolveResponse) Mutable(fd protoreflect.FieldDescr func (x *fastReflection_QueryResolveResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.QueryResolveResponse.document": - return protoreflect.ValueOfString("") + m := new(Document) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2382,8 +4437,8 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l - l = len(x.Document) - if l > 0 { + if x.Document != nil { + l = options.Size(x.Document) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -2415,10 +4470,17 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Document) > 0 { - i -= len(x.Document) - copy(dAtA[i:], x.Document) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Document))) + if x.Document != nil { + encoded, err := options.Marshal(x.Document) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -2475,7 +4537,7 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2485,23 +4547,27 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Document = string(dAtA[iNdEx:postIndex]) + if x.Document == nil { + x.Document = &Document{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Document); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2539,26 +4605,26 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryWitnessCredentialRequest protoreflect.MessageDescriptor - fd_QueryWitnessCredentialRequest_id protoreflect.FieldDescriptor + md_QueryServiceRequest protoreflect.MessageDescriptor + fd_QueryServiceRequest_origin protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryWitnessCredentialRequest = File_did_v1_query_proto.Messages().ByName("QueryWitnessCredentialRequest") - fd_QueryWitnessCredentialRequest_id = md_QueryWitnessCredentialRequest.Fields().ByName("id") + md_QueryServiceRequest = File_did_v1_query_proto.Messages().ByName("QueryServiceRequest") + fd_QueryServiceRequest_origin = md_QueryServiceRequest.Fields().ByName("origin") } -var _ protoreflect.Message = (*fastReflection_QueryWitnessCredentialRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryServiceRequest)(nil) -type fastReflection_QueryWitnessCredentialRequest QueryWitnessCredentialRequest +type fastReflection_QueryServiceRequest QueryServiceRequest -func (x *QueryWitnessCredentialRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryWitnessCredentialRequest)(x) +func (x *QueryServiceRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryServiceRequest)(x) } -func (x *QueryWitnessCredentialRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[6] +func (x *QueryServiceRequest) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2569,43 +4635,43 @@ func (x *QueryWitnessCredentialRequest) slowProtoReflect() protoreflect.Message return mi.MessageOf(x) } -var _fastReflection_QueryWitnessCredentialRequest_messageType fastReflection_QueryWitnessCredentialRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryWitnessCredentialRequest_messageType{} +var _fastReflection_QueryServiceRequest_messageType fastReflection_QueryServiceRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryServiceRequest_messageType{} -type fastReflection_QueryWitnessCredentialRequest_messageType struct{} +type fastReflection_QueryServiceRequest_messageType struct{} -func (x fastReflection_QueryWitnessCredentialRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryWitnessCredentialRequest)(nil) +func (x fastReflection_QueryServiceRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryServiceRequest)(nil) } -func (x fastReflection_QueryWitnessCredentialRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryWitnessCredentialRequest) +func (x fastReflection_QueryServiceRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryServiceRequest) } -func (x fastReflection_QueryWitnessCredentialRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryWitnessCredentialRequest +func (x fastReflection_QueryServiceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryServiceRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryWitnessCredentialRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryWitnessCredentialRequest +func (x *fastReflection_QueryServiceRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryServiceRequest } // 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_QueryWitnessCredentialRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryWitnessCredentialRequest_messageType +func (x *fastReflection_QueryServiceRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryServiceRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryWitnessCredentialRequest) New() protoreflect.Message { - return new(fastReflection_QueryWitnessCredentialRequest) +func (x *fastReflection_QueryServiceRequest) New() protoreflect.Message { + return new(fastReflection_QueryServiceRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryWitnessCredentialRequest) Interface() protoreflect.ProtoMessage { - return (*QueryWitnessCredentialRequest)(x) +func (x *fastReflection_QueryServiceRequest) Interface() protoreflect.ProtoMessage { + return (*QueryServiceRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -2613,10 +4679,10 @@ func (x *fastReflection_QueryWitnessCredentialRequest) Interface() protoreflect. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryWitnessCredentialRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_QueryWitnessCredentialRequest_id, value) { +func (x *fastReflection_QueryServiceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QueryServiceRequest_origin, value) { return } } @@ -2633,15 +4699,15 @@ func (x *fastReflection_QueryWitnessCredentialRequest) Range(f func(protoreflect // 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_QueryWitnessCredentialRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryServiceRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialRequest.id": - return x.Id != "" + case "did.v1.QueryServiceRequest.origin": + return x.Origin != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceRequest")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceRequest does not contain field %s", fd.FullName())) } } @@ -2651,15 +4717,15 @@ func (x *fastReflection_QueryWitnessCredentialRequest) Has(fd protoreflect.Field // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryServiceRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialRequest.id": - x.Id = "" + case "did.v1.QueryServiceRequest.origin": + x.Origin = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceRequest")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceRequest does not contain field %s", fd.FullName())) } } @@ -2669,16 +4735,16 @@ func (x *fastReflection_QueryWitnessCredentialRequest) Clear(fd protoreflect.Fie // 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_QueryWitnessCredentialRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryServiceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryWitnessCredentialRequest.id": - value := x.Id + case "did.v1.QueryServiceRequest.origin": + value := x.Origin return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceRequest")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceRequest does not contain field %s", descriptor.FullName())) } } @@ -2692,15 +4758,15 @@ func (x *fastReflection_QueryWitnessCredentialRequest) Get(descriptor protorefle // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryServiceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialRequest.id": - x.Id = value.Interface().(string) + case "did.v1.QueryServiceRequest.origin": + x.Origin = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceRequest")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceRequest does not contain field %s", fd.FullName())) } } @@ -2714,40 +4780,40 @@ func (x *fastReflection_QueryWitnessCredentialRequest) Set(fd protoreflect.Field // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryServiceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialRequest.id": - panic(fmt.Errorf("field id of message did.v1.QueryWitnessCredentialRequest is not mutable")) + case "did.v1.QueryServiceRequest.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryServiceRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceRequest")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceRequest 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_QueryWitnessCredentialRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryServiceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialRequest.id": + case "did.v1.QueryServiceRequest.origin": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceRequest")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceRequest 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_QueryWitnessCredentialRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryServiceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryWitnessCredentialRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryServiceRequest", d.FullName())) } panic("unreachable") } @@ -2755,7 +4821,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) WhichOneof(d protoreflect // 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_QueryWitnessCredentialRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryServiceRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2766,7 +4832,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) GetUnknown() protoreflect // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryServiceRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2778,7 +4844,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) SetUnknown(fields protore // 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_QueryWitnessCredentialRequest) IsValid() bool { +func (x *fastReflection_QueryServiceRequest) IsValid() bool { return x != nil } @@ -2788,9 +4854,9 @@ func (x *fastReflection_QueryWitnessCredentialRequest) 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_QueryWitnessCredentialRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryWitnessCredentialRequest) + x := input.Message.Interface().(*QueryServiceRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2802,7 +4868,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac var n int var l int _ = l - l = len(x.Id) + l = len(x.Origin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2816,7 +4882,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryWitnessCredentialRequest) + x := input.Message.Interface().(*QueryServiceRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2835,10 +4901,10 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) i-- dAtA[i] = 0xa } @@ -2853,7 +4919,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryWitnessCredentialRequest) + x := input.Message.Interface().(*QueryServiceRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2885,15 +4951,15 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryWitnessCredentialRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryWitnessCredentialRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2921,7 +4987,7 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Id = string(dAtA[iNdEx:postIndex]) + x.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2959,26 +5025,26 @@ func (x *fastReflection_QueryWitnessCredentialRequest) ProtoMethods() *protoifac } var ( - md_QueryWitnessCredentialResponse protoreflect.MessageDescriptor - fd_QueryWitnessCredentialResponse_options protoreflect.FieldDescriptor + md_QueryServiceResponse protoreflect.MessageDescriptor + fd_QueryServiceResponse_options protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryWitnessCredentialResponse = File_did_v1_query_proto.Messages().ByName("QueryWitnessCredentialResponse") - fd_QueryWitnessCredentialResponse_options = md_QueryWitnessCredentialResponse.Fields().ByName("options") + md_QueryServiceResponse = File_did_v1_query_proto.Messages().ByName("QueryServiceResponse") + fd_QueryServiceResponse_options = md_QueryServiceResponse.Fields().ByName("options") } -var _ protoreflect.Message = (*fastReflection_QueryWitnessCredentialResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryServiceResponse)(nil) -type fastReflection_QueryWitnessCredentialResponse QueryWitnessCredentialResponse +type fastReflection_QueryServiceResponse QueryServiceResponse -func (x *QueryWitnessCredentialResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryWitnessCredentialResponse)(x) +func (x *QueryServiceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryServiceResponse)(x) } -func (x *QueryWitnessCredentialResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[7] +func (x *QueryServiceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2989,43 +5055,43 @@ func (x *QueryWitnessCredentialResponse) slowProtoReflect() protoreflect.Message return mi.MessageOf(x) } -var _fastReflection_QueryWitnessCredentialResponse_messageType fastReflection_QueryWitnessCredentialResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryWitnessCredentialResponse_messageType{} +var _fastReflection_QueryServiceResponse_messageType fastReflection_QueryServiceResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryServiceResponse_messageType{} -type fastReflection_QueryWitnessCredentialResponse_messageType struct{} +type fastReflection_QueryServiceResponse_messageType struct{} -func (x fastReflection_QueryWitnessCredentialResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryWitnessCredentialResponse)(nil) +func (x fastReflection_QueryServiceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryServiceResponse)(nil) } -func (x fastReflection_QueryWitnessCredentialResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryWitnessCredentialResponse) +func (x fastReflection_QueryServiceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryServiceResponse) } -func (x fastReflection_QueryWitnessCredentialResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryWitnessCredentialResponse +func (x fastReflection_QueryServiceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryServiceResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryWitnessCredentialResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryWitnessCredentialResponse +func (x *fastReflection_QueryServiceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryServiceResponse } // 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_QueryWitnessCredentialResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryWitnessCredentialResponse_messageType +func (x *fastReflection_QueryServiceResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryServiceResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryWitnessCredentialResponse) New() protoreflect.Message { - return new(fastReflection_QueryWitnessCredentialResponse) +func (x *fastReflection_QueryServiceResponse) New() protoreflect.Message { + return new(fastReflection_QueryServiceResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryWitnessCredentialResponse) Interface() protoreflect.ProtoMessage { - return (*QueryWitnessCredentialResponse)(x) +func (x *fastReflection_QueryServiceResponse) Interface() protoreflect.ProtoMessage { + return (*QueryServiceResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -3033,10 +5099,10 @@ func (x *fastReflection_QueryWitnessCredentialResponse) Interface() protoreflect // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryWitnessCredentialResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryServiceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Options != "" { value := protoreflect.ValueOfString(x.Options) - if !f(fd_QueryWitnessCredentialResponse_options, value) { + if !f(fd_QueryServiceResponse_options, value) { return } } @@ -3053,15 +5119,15 @@ func (x *fastReflection_QueryWitnessCredentialResponse) Range(f func(protoreflec // 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_QueryWitnessCredentialResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryServiceResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialResponse.options": + case "did.v1.QueryServiceResponse.options": return x.Options != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceResponse does not contain field %s", fd.FullName())) } } @@ -3071,15 +5137,15 @@ func (x *fastReflection_QueryWitnessCredentialResponse) Has(fd protoreflect.Fiel // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryServiceResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialResponse.options": + case "did.v1.QueryServiceResponse.options": x.Options = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceResponse does not contain field %s", fd.FullName())) } } @@ -3089,16 +5155,16 @@ func (x *fastReflection_QueryWitnessCredentialResponse) Clear(fd protoreflect.Fi // 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_QueryWitnessCredentialResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryServiceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryWitnessCredentialResponse.options": + case "did.v1.QueryServiceResponse.options": value := x.Options return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceResponse does not contain field %s", descriptor.FullName())) } } @@ -3112,15 +5178,15 @@ func (x *fastReflection_QueryWitnessCredentialResponse) Get(descriptor protorefl // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryServiceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialResponse.options": + case "did.v1.QueryServiceResponse.options": x.Options = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceResponse does not contain field %s", fd.FullName())) } } @@ -3134,40 +5200,40 @@ func (x *fastReflection_QueryWitnessCredentialResponse) Set(fd protoreflect.Fiel // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialResponse.options": - panic(fmt.Errorf("field options of message did.v1.QueryWitnessCredentialResponse is not mutable")) + case "did.v1.QueryServiceResponse.options": + panic(fmt.Errorf("field options of message did.v1.QueryServiceResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceResponse 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_QueryWitnessCredentialResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryServiceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryWitnessCredentialResponse.options": + case "did.v1.QueryServiceResponse.options": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryWitnessCredentialResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) } - panic(fmt.Errorf("message did.v1.QueryWitnessCredentialResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryServiceResponse 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_QueryWitnessCredentialResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryServiceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryWitnessCredentialResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryServiceResponse", d.FullName())) } panic("unreachable") } @@ -3175,7 +5241,7 @@ func (x *fastReflection_QueryWitnessCredentialResponse) WhichOneof(d protoreflec // 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_QueryWitnessCredentialResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryServiceResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3186,7 +5252,7 @@ func (x *fastReflection_QueryWitnessCredentialResponse) GetUnknown() protoreflec // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryWitnessCredentialResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryServiceResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3198,7 +5264,7 @@ func (x *fastReflection_QueryWitnessCredentialResponse) SetUnknown(fields protor // 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_QueryWitnessCredentialResponse) IsValid() bool { +func (x *fastReflection_QueryServiceResponse) IsValid() bool { return x != nil } @@ -3208,9 +5274,9 @@ func (x *fastReflection_QueryWitnessCredentialResponse) 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_QueryWitnessCredentialResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryWitnessCredentialResponse) + x := input.Message.Interface().(*QueryServiceResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3236,7 +5302,7 @@ func (x *fastReflection_QueryWitnessCredentialResponse) ProtoMethods() *protoifa } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryWitnessCredentialResponse) + x := input.Message.Interface().(*QueryServiceResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3273,7 +5339,7 @@ func (x *fastReflection_QueryWitnessCredentialResponse) ProtoMethods() *protoifa }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryWitnessCredentialResponse) + x := input.Message.Interface().(*QueryServiceResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3305,10 +5371,10 @@ func (x *fastReflection_QueryWitnessCredentialResponse) ProtoMethods() *protoifa fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryWitnessCredentialResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryWitnessCredentialResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3455,18 +5521,17 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -// QueryExistsRequest is the request type for the Query/Exists RPC method. -type QueryExistsRequest struct { +// QueryAccountsRequest is the request type for the Query/Exists RPC method. +type QueryAccountsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` } -func (x *QueryExistsRequest) Reset() { - *x = QueryExistsRequest{} +func (x *QueryAccountsRequest) Reset() { + *x = QueryAccountsRequest{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3474,33 +5539,26 @@ func (x *QueryExistsRequest) Reset() { } } -func (x *QueryExistsRequest) String() string { +func (x *QueryAccountsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryExistsRequest) ProtoMessage() {} +func (*QueryAccountsRequest) ProtoMessage() {} -// Deprecated: Use QueryExistsRequest.ProtoReflect.Descriptor instead. -func (*QueryExistsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAccountsRequest.ProtoReflect.Descriptor instead. +func (*QueryAccountsRequest) Descriptor() ([]byte, []int) { return file_did_v1_query_proto_rawDescGZIP(), []int{2} } -func (x *QueryExistsRequest) GetKind() string { +func (x *QueryAccountsRequest) GetDid() string { if x != nil { - return x.Kind + return x.Did } return "" } -func (x *QueryExistsRequest) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// QueryExistsResponse is the response type for the Query/Exists RPC method. -type QueryExistsResponse struct { +// QueryAccountsResponse is the response type for the Query/Exists RPC method. +type QueryAccountsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -3508,8 +5566,8 @@ type QueryExistsResponse struct { Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` } -func (x *QueryExistsResponse) Reset() { - *x = QueryExistsResponse{} +func (x *QueryAccountsResponse) Reset() { + *x = QueryAccountsResponse{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_query_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3517,37 +5575,197 @@ func (x *QueryExistsResponse) Reset() { } } -func (x *QueryExistsResponse) String() string { +func (x *QueryAccountsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryExistsResponse) ProtoMessage() {} +func (*QueryAccountsResponse) ProtoMessage() {} -// Deprecated: Use QueryExistsResponse.ProtoReflect.Descriptor instead. -func (*QueryExistsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAccountsResponse.ProtoReflect.Descriptor instead. +func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { return file_did_v1_query_proto_rawDescGZIP(), []int{3} } -func (x *QueryExistsResponse) GetExists() bool { +func (x *QueryAccountsResponse) GetExists() bool { if x != nil { return x.Exists } return false } +// QueryCredentialsRequest is the request type for the Query/Exists RPC method. +type QueryCredentialsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` +} + +func (x *QueryCredentialsRequest) Reset() { + *x = QueryCredentialsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCredentialsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCredentialsRequest) ProtoMessage() {} + +// Deprecated: Use QueryCredentialsRequest.ProtoReflect.Descriptor instead. +func (*QueryCredentialsRequest) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryCredentialsRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +func (x *QueryCredentialsRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +// QueryCredentialsResponse is the response type for the Query/Exists RPC method. +type QueryCredentialsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Credentials map[string][]byte `protobuf:"bytes,1,rep,name=credentials,proto3" json:"credentials,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *QueryCredentialsResponse) Reset() { + *x = QueryCredentialsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCredentialsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCredentialsResponse) ProtoMessage() {} + +// Deprecated: Use QueryCredentialsResponse.ProtoReflect.Descriptor instead. +func (*QueryCredentialsResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryCredentialsResponse) GetCredentials() map[string][]byte { + if x != nil { + return x.Credentials + } + return nil +} + +// QueryIdentitiesRequest is the request type for the Query/Exists RPC method. +type QueryIdentitiesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` +} + +func (x *QueryIdentitiesRequest) Reset() { + *x = QueryIdentitiesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryIdentitiesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryIdentitiesRequest) ProtoMessage() {} + +// Deprecated: Use QueryIdentitiesRequest.ProtoReflect.Descriptor instead. +func (*QueryIdentitiesRequest) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryIdentitiesRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +// QueryIdentitiesResponse is the response type for the Query/Exists RPC method. +type QueryIdentitiesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + VerificationMethod []*VerificationMethod `protobuf:"bytes,2,rep,name=verificationMethod,proto3" json:"verificationMethod,omitempty"` +} + +func (x *QueryIdentitiesResponse) Reset() { + *x = QueryIdentitiesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryIdentitiesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryIdentitiesResponse) ProtoMessage() {} + +// Deprecated: Use QueryIdentitiesResponse.ProtoReflect.Descriptor instead. +func (*QueryIdentitiesResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryIdentitiesResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +func (x *QueryIdentitiesResponse) GetVerificationMethod() []*VerificationMethod { + if x != nil { + return x.VerificationMethod + } + return nil +} + // QueryResolveRequest is the request type for the Query/Resolve RPC method. type QueryResolveRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` } func (x *QueryResolveRequest) Reset() { *x = QueryResolveRequest{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[4] + mi := &file_did_v1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3561,12 +5779,12 @@ func (*QueryResolveRequest) ProtoMessage() {} // Deprecated: Use QueryResolveRequest.ProtoReflect.Descriptor instead. func (*QueryResolveRequest) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{4} + return file_did_v1_query_proto_rawDescGZIP(), []int{8} } -func (x *QueryResolveRequest) GetId() string { +func (x *QueryResolveRequest) GetDid() string { if x != nil { - return x.Id + return x.Did } return "" } @@ -3578,13 +5796,13 @@ type QueryResolveResponse struct { unknownFields protoimpl.UnknownFields // document is the DID document - Document string `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` + Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` } func (x *QueryResolveResponse) Reset() { *x = QueryResolveResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[5] + mi := &file_did_v1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3598,54 +5816,54 @@ func (*QueryResolveResponse) ProtoMessage() {} // Deprecated: Use QueryResolveResponse.ProtoReflect.Descriptor instead. func (*QueryResolveResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{5} + return file_did_v1_query_proto_rawDescGZIP(), []int{9} } -func (x *QueryResolveResponse) GetDocument() string { +func (x *QueryResolveResponse) GetDocument() *Document { if x != nil { return x.Document } - return "" + return nil } -// QueryLoginOptionsRequest is the request type for the Query/LoginOptions RPC method. -type QueryWitnessCredentialRequest struct { +// QueryServiceRequest is the request type for the Query/LoginOptions RPC method. +type QueryServiceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"` } -func (x *QueryWitnessCredentialRequest) Reset() { - *x = QueryWitnessCredentialRequest{} +func (x *QueryServiceRequest) Reset() { + *x = QueryServiceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[6] + mi := &file_did_v1_query_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryWitnessCredentialRequest) String() string { +func (x *QueryServiceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryWitnessCredentialRequest) ProtoMessage() {} +func (*QueryServiceRequest) ProtoMessage() {} -// Deprecated: Use QueryWitnessCredentialRequest.ProtoReflect.Descriptor instead. -func (*QueryWitnessCredentialRequest) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{6} +// Deprecated: Use QueryServiceRequest.ProtoReflect.Descriptor instead. +func (*QueryServiceRequest) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{10} } -func (x *QueryWitnessCredentialRequest) GetId() string { +func (x *QueryServiceRequest) GetOrigin() string { if x != nil { - return x.Id + return x.Origin } return "" } // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. -type QueryWitnessCredentialResponse struct { +type QueryServiceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -3654,27 +5872,27 @@ type QueryWitnessCredentialResponse struct { Options string `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (x *QueryWitnessCredentialResponse) Reset() { - *x = QueryWitnessCredentialResponse{} +func (x *QueryServiceResponse) Reset() { + *x = QueryServiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[7] + mi := &file_did_v1_query_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryWitnessCredentialResponse) String() string { +func (x *QueryServiceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryWitnessCredentialResponse) ProtoMessage() {} +func (*QueryServiceResponse) ProtoMessage() {} -// Deprecated: Use QueryWitnessCredentialResponse.ProtoReflect.Descriptor instead. -func (*QueryWitnessCredentialResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{7} +// Deprecated: Use QueryServiceResponse.ProtoReflect.Descriptor instead. +func (*QueryServiceResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{11} } -func (x *QueryWitnessCredentialResponse) GetOptions() string { +func (x *QueryServiceResponse) GetOptions() string { if x != nil { return x.Options } @@ -3689,61 +5907,106 @@ var file_did_v1_query_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3e, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x1a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x28, 0x0a, 0x14, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x64, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x22, 0x25, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x32, 0x0a, 0x14, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, - 0x2f, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x3a, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xd4, 0x02, 0x0a, - 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x56, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0d, 0x12, 0x0b, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x69, - 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x72, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x11, 0x57, 0x69, - 0x74, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, - 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x69, - 0x74, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x61, 0x73, 0x73, - 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x77, 0x69, 0x74, 0x6e, - 0x65, 0x73, 0x73, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, - 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, - 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, - 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x73, 0x74, 0x73, 0x22, 0x43, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xaf, 0x01, 0x0a, 0x18, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, + 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2a, 0x0a, 0x16, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x7d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x4a, 0x0a, 0x12, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x27, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, + 0x44, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x22, 0x30, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xf5, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x56, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x64, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x64, 0x69, 0x64, 0x2f, + 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x79, + 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x1f, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, + 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x7d, 0x2f, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x6c, 0x0a, 0x0a, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, + 0x12, 0x15, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x60, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x12, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x63, 0x0a, 0x07, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x7d, 0x42, 0x7a, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, + 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, + 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, + 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -3758,31 +6021,47 @@ func file_did_v1_query_proto_rawDescGZIP() []byte { return file_did_v1_query_proto_rawDescData } -var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_did_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: did.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse - (*QueryExistsRequest)(nil), // 2: did.v1.QueryExistsRequest - (*QueryExistsResponse)(nil), // 3: did.v1.QueryExistsResponse - (*QueryResolveRequest)(nil), // 4: did.v1.QueryResolveRequest - (*QueryResolveResponse)(nil), // 5: did.v1.QueryResolveResponse - (*QueryWitnessCredentialRequest)(nil), // 6: did.v1.QueryWitnessCredentialRequest - (*QueryWitnessCredentialResponse)(nil), // 7: did.v1.QueryWitnessCredentialResponse - (*Params)(nil), // 8: did.v1.Params + (*QueryParamsRequest)(nil), // 0: did.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse + (*QueryAccountsRequest)(nil), // 2: did.v1.QueryAccountsRequest + (*QueryAccountsResponse)(nil), // 3: did.v1.QueryAccountsResponse + (*QueryCredentialsRequest)(nil), // 4: did.v1.QueryCredentialsRequest + (*QueryCredentialsResponse)(nil), // 5: did.v1.QueryCredentialsResponse + (*QueryIdentitiesRequest)(nil), // 6: did.v1.QueryIdentitiesRequest + (*QueryIdentitiesResponse)(nil), // 7: did.v1.QueryIdentitiesResponse + (*QueryResolveRequest)(nil), // 8: did.v1.QueryResolveRequest + (*QueryResolveResponse)(nil), // 9: did.v1.QueryResolveResponse + (*QueryServiceRequest)(nil), // 10: did.v1.QueryServiceRequest + (*QueryServiceResponse)(nil), // 11: did.v1.QueryServiceResponse + nil, // 12: did.v1.QueryCredentialsResponse.CredentialsEntry + (*Params)(nil), // 13: did.v1.Params + (*VerificationMethod)(nil), // 14: did.v1.VerificationMethod + (*Document)(nil), // 15: did.v1.Document } var file_did_v1_query_proto_depIdxs = []int32{ - 8, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params - 0, // 1: did.v1.Query.Params:input_type -> did.v1.QueryParamsRequest - 4, // 2: did.v1.Query.ResolveIdentifier:input_type -> did.v1.QueryResolveRequest - 6, // 3: did.v1.Query.WitnessCredential:input_type -> did.v1.QueryWitnessCredentialRequest - 1, // 4: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse - 5, // 5: did.v1.Query.ResolveIdentifier:output_type -> did.v1.QueryResolveResponse - 7, // 6: did.v1.Query.WitnessCredential:output_type -> did.v1.QueryWitnessCredentialResponse - 4, // [4:7] is the sub-list for method output_type - 1, // [1:4] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 13, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 12, // 1: did.v1.QueryCredentialsResponse.credentials:type_name -> did.v1.QueryCredentialsResponse.CredentialsEntry + 14, // 2: did.v1.QueryIdentitiesResponse.verificationMethod:type_name -> did.v1.VerificationMethod + 15, // 3: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document + 0, // 4: did.v1.Query.Params:input_type -> did.v1.QueryParamsRequest + 2, // 5: did.v1.Query.Accounts:input_type -> did.v1.QueryAccountsRequest + 4, // 6: did.v1.Query.Credentials:input_type -> did.v1.QueryCredentialsRequest + 6, // 7: did.v1.Query.Identities:input_type -> did.v1.QueryIdentitiesRequest + 8, // 8: did.v1.Query.Resolve:input_type -> did.v1.QueryResolveRequest + 10, // 9: did.v1.Query.Service:input_type -> did.v1.QueryServiceRequest + 1, // 10: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 3, // 11: did.v1.Query.Accounts:output_type -> did.v1.QueryAccountsResponse + 5, // 12: did.v1.Query.Credentials:output_type -> did.v1.QueryCredentialsResponse + 7, // 13: did.v1.Query.Identities:output_type -> did.v1.QueryIdentitiesResponse + 9, // 14: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse + 11, // 15: did.v1.Query.Service:output_type -> did.v1.QueryServiceResponse + 10, // [10:16] is the sub-list for method output_type + 4, // [4:10] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_did_v1_query_proto_init() } @@ -3791,6 +6070,7 @@ func file_did_v1_query_proto_init() { return } file_did_v1_genesis_proto_init() + file_did_v1_types_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { @@ -3817,7 +6097,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryExistsRequest); i { + switch v := v.(*QueryAccountsRequest); i { case 0: return &v.state case 1: @@ -3829,7 +6109,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryExistsResponse); i { + switch v := v.(*QueryAccountsResponse); i { case 0: return &v.state case 1: @@ -3841,7 +6121,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryResolveRequest); i { + switch v := v.(*QueryCredentialsRequest); i { case 0: return &v.state case 1: @@ -3853,7 +6133,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryResolveResponse); i { + switch v := v.(*QueryCredentialsResponse); i { case 0: return &v.state case 1: @@ -3865,7 +6145,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryWitnessCredentialRequest); i { + switch v := v.(*QueryIdentitiesRequest); i { case 0: return &v.state case 1: @@ -3877,7 +6157,55 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryWitnessCredentialResponse); i { + switch v := v.(*QueryIdentitiesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResolveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResolveResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryServiceResponse); i { case 0: return &v.state case 1: @@ -3895,7 +6223,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 0428e9076..d51ed3c02 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -19,9 +19,12 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/did.v1.Query/Params" - Query_ResolveIdentifier_FullMethodName = "/did.v1.Query/ResolveIdentifier" - Query_WitnessCredential_FullMethodName = "/did.v1.Query/WitnessCredential" + Query_Params_FullMethodName = "/did.v1.Query/Params" + Query_Accounts_FullMethodName = "/did.v1.Query/Accounts" + Query_Credentials_FullMethodName = "/did.v1.Query/Credentials" + Query_Identities_FullMethodName = "/did.v1.Query/Identities" + Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" + Query_Service_FullMethodName = "/did.v1.Query/Service" ) // QueryClient is the client API for Query service. @@ -30,10 +33,16 @@ const ( type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Accounts returns associated wallet accounts with the DID. + Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) + // Credentials returns associated credentials with the DID and Service Origin. + Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) + // Identities returns associated identity with the DID. + Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) // Resolve queries the DID document by its id. - ResolveIdentifier(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. - WitnessCredential(ctx context.Context, in *QueryWitnessCredentialRequest, opts ...grpc.CallOption) (*QueryWitnessCredentialResponse, error) + Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) + // Service returns associated ServiceInfo for a given Origin + Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) } type queryClient struct { @@ -53,18 +62,45 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) ResolveIdentifier(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { - out := new(QueryResolveResponse) - err := c.cc.Invoke(ctx, Query_ResolveIdentifier_FullMethodName, in, out, opts...) +func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { + out := new(QueryAccountsResponse) + err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) WitnessCredential(ctx context.Context, in *QueryWitnessCredentialRequest, opts ...grpc.CallOption) (*QueryWitnessCredentialResponse, error) { - out := new(QueryWitnessCredentialResponse) - err := c.cc.Invoke(ctx, Query_WitnessCredential_FullMethodName, in, out, opts...) +func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { + out := new(QueryCredentialsResponse) + err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) { + out := new(QueryIdentitiesResponse) + err := c.cc.Invoke(ctx, Query_Identities_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { + out := new(QueryResolveResponse) + err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { + out := new(QueryServiceResponse) + err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -77,10 +113,16 @@ func (c *queryClient) WitnessCredential(ctx context.Context, in *QueryWitnessCre type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Accounts returns associated wallet accounts with the DID. + Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) + // Credentials returns associated credentials with the DID and Service Origin. + Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) + // Identities returns associated identity with the DID. + Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) // Resolve queries the DID document by its id. - ResolveIdentifier(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) - // LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. - WitnessCredential(context.Context, *QueryWitnessCredentialRequest) (*QueryWitnessCredentialResponse, error) + Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) + // Service returns associated ServiceInfo for a given Origin + Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) mustEmbedUnimplementedQueryServer() } @@ -91,11 +133,20 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) ResolveIdentifier(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResolveIdentifier not implemented") +func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") } -func (UnimplementedQueryServer) WitnessCredential(context.Context, *QueryWitnessCredentialRequest) (*QueryWitnessCredentialResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WitnessCredential not implemented") +func (UnimplementedQueryServer) Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") +} +func (UnimplementedQueryServer) Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Identities not implemented") +} +func (UnimplementedQueryServer) Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") +} +func (UnimplementedQueryServer) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} @@ -128,38 +179,92 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_ResolveIdentifier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Accounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Accounts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCredentialsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Credentials(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Credentials_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Credentials(ctx, req.(*QueryCredentialsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Identities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIdentitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Identities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Identities_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Identities(ctx, req.(*QueryIdentitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryResolveRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ResolveIdentifier(ctx, in) + return srv.(QueryServer).Resolve(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_ResolveIdentifier_FullMethodName, + FullMethod: Query_Resolve_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ResolveIdentifier(ctx, req.(*QueryResolveRequest)) + return srv.(QueryServer).Resolve(ctx, req.(*QueryResolveRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_WitnessCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryWitnessCredentialRequest) +func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryServiceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).WitnessCredential(ctx, in) + return srv.(QueryServer).Service(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_WitnessCredential_FullMethodName, + FullMethod: Query_Service_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).WitnessCredential(ctx, req.(*QueryWitnessCredentialRequest)) + return srv.(QueryServer).Service(ctx, req.(*QueryServiceRequest)) } return interceptor(ctx, in, info, handler) } @@ -176,12 +281,24 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "ResolveIdentifier", - Handler: _Query_ResolveIdentifier_Handler, + MethodName: "Accounts", + Handler: _Query_Accounts_Handler, }, { - MethodName: "WitnessCredential", - Handler: _Query_WitnessCredential_Handler, + MethodName: "Credentials", + Handler: _Query_Credentials_Handler, + }, + { + MethodName: "Identities", + Handler: _Query_Identities_Handler, + }, + { + MethodName: "Resolve", + Handler: _Query_Resolve_Handler, + }, + { + MethodName: "Service", + Handler: _Query_Service_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index a8d8a1386..5a7d36468 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -17,9 +17,9 @@ type AliasesTable interface { Has(ctx context.Context, id string) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. Get(ctx context.Context, id string) (*Aliases, error) - HasByHandle(ctx context.Context, handle string) (found bool, err error) - // GetByHandle returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByHandle(ctx context.Context, handle string) (*Aliases, error) + HasBySubject(ctx context.Context, subject string) (found bool, err error) + // GetBySubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetBySubject(ctx context.Context, subject string) (*Aliases, error) List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error @@ -60,16 +60,16 @@ func (this AliasesIdIndexKey) WithId(id string) AliasesIdIndexKey { return this } -type AliasesHandleIndexKey struct { +type AliasesSubjectIndexKey struct { vs []interface{} } -func (x AliasesHandleIndexKey) id() uint32 { return 1 } -func (x AliasesHandleIndexKey) values() []interface{} { return x.vs } -func (x AliasesHandleIndexKey) aliasesIndexKey() {} +func (x AliasesSubjectIndexKey) id() uint32 { return 1 } +func (x AliasesSubjectIndexKey) values() []interface{} { return x.vs } +func (x AliasesSubjectIndexKey) aliasesIndexKey() {} -func (this AliasesHandleIndexKey) WithHandle(handle string) AliasesHandleIndexKey { - this.vs = []interface{}{handle} +func (this AliasesSubjectIndexKey) WithSubject(subject string) AliasesSubjectIndexKey { + this.vs = []interface{}{subject} return this } @@ -109,16 +109,16 @@ func (this aliasesTable) Get(ctx context.Context, id string) (*Aliases, error) { return &aliases, nil } -func (this aliasesTable) HasByHandle(ctx context.Context, handle string) (found bool, err error) { +func (this aliasesTable) HasBySubject(ctx context.Context, subject string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - handle, + subject, ) } -func (this aliasesTable) GetByHandle(ctx context.Context, handle string) (*Aliases, error) { +func (this aliasesTable) GetBySubject(ctx context.Context, subject string) (*Aliases, error) { var aliases Aliases found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &aliases, - handle, + subject, ) if err != nil { return nil, err diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index f24ba4f8c..1029d7a66 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -18,7 +18,7 @@ var ( md_Aliases protoreflect.MessageDescriptor fd_Aliases_id protoreflect.FieldDescriptor fd_Aliases_origin protoreflect.FieldDescriptor - fd_Aliases_handle protoreflect.FieldDescriptor + fd_Aliases_subject protoreflect.FieldDescriptor fd_Aliases_controller protoreflect.FieldDescriptor fd_Aliases_expiration protoreflect.FieldDescriptor ) @@ -28,7 +28,7 @@ func init() { md_Aliases = File_did_v1_state_proto.Messages().ByName("Aliases") fd_Aliases_id = md_Aliases.Fields().ByName("id") fd_Aliases_origin = md_Aliases.Fields().ByName("origin") - fd_Aliases_handle = md_Aliases.Fields().ByName("handle") + fd_Aliases_subject = md_Aliases.Fields().ByName("subject") fd_Aliases_controller = md_Aliases.Fields().ByName("controller") fd_Aliases_expiration = md_Aliases.Fields().ByName("expiration") } @@ -110,9 +110,9 @@ func (x *fastReflection_Aliases) Range(f func(protoreflect.FieldDescriptor, prot return } } - if x.Handle != "" { - value := protoreflect.ValueOfString(x.Handle) - if !f(fd_Aliases_handle, value) { + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Aliases_subject, value) { return } } @@ -147,8 +147,8 @@ func (x *fastReflection_Aliases) Has(fd protoreflect.FieldDescriptor) bool { return x.Id != "" case "did.v1.Aliases.origin": return x.Origin != "" - case "did.v1.Aliases.handle": - return x.Handle != "" + case "did.v1.Aliases.subject": + return x.Subject != "" case "did.v1.Aliases.controller": return x.Controller != "" case "did.v1.Aliases.expiration": @@ -173,8 +173,8 @@ func (x *fastReflection_Aliases) Clear(fd protoreflect.FieldDescriptor) { x.Id = "" case "did.v1.Aliases.origin": x.Origin = "" - case "did.v1.Aliases.handle": - x.Handle = "" + case "did.v1.Aliases.subject": + x.Subject = "" case "did.v1.Aliases.controller": x.Controller = "" case "did.v1.Aliases.expiration": @@ -201,8 +201,8 @@ func (x *fastReflection_Aliases) Get(descriptor protoreflect.FieldDescriptor) pr case "did.v1.Aliases.origin": value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.Aliases.handle": - value := x.Handle + case "did.v1.Aliases.subject": + value := x.Subject return protoreflect.ValueOfString(value) case "did.v1.Aliases.controller": value := x.Controller @@ -234,8 +234,8 @@ func (x *fastReflection_Aliases) Set(fd protoreflect.FieldDescriptor, value prot x.Id = value.Interface().(string) case "did.v1.Aliases.origin": x.Origin = value.Interface().(string) - case "did.v1.Aliases.handle": - x.Handle = value.Interface().(string) + case "did.v1.Aliases.subject": + x.Subject = value.Interface().(string) case "did.v1.Aliases.controller": x.Controller = value.Interface().(string) case "did.v1.Aliases.expiration": @@ -264,8 +264,8 @@ func (x *fastReflection_Aliases) Mutable(fd protoreflect.FieldDescriptor) protor panic(fmt.Errorf("field id of message did.v1.Aliases is not mutable")) case "did.v1.Aliases.origin": panic(fmt.Errorf("field origin of message did.v1.Aliases is not mutable")) - case "did.v1.Aliases.handle": - panic(fmt.Errorf("field handle of message did.v1.Aliases is not mutable")) + case "did.v1.Aliases.subject": + panic(fmt.Errorf("field subject of message did.v1.Aliases is not mutable")) case "did.v1.Aliases.controller": panic(fmt.Errorf("field controller of message did.v1.Aliases is not mutable")) case "did.v1.Aliases.expiration": @@ -287,7 +287,7 @@ func (x *fastReflection_Aliases) NewField(fd protoreflect.FieldDescriptor) proto return protoreflect.ValueOfString("") case "did.v1.Aliases.origin": return protoreflect.ValueOfString("") - case "did.v1.Aliases.handle": + case "did.v1.Aliases.subject": return protoreflect.ValueOfString("") case "did.v1.Aliases.controller": return protoreflect.ValueOfString("") @@ -370,7 +370,7 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Handle) + l = len(x.Subject) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -422,10 +422,10 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x22 } - if len(x.Handle) > 0 { - i -= len(x.Handle) - copy(dAtA[i:], x.Handle) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Handle))) + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) i-- dAtA[i] = 0x1a } @@ -558,7 +558,7 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Handle", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -586,7 +586,7 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Handle = string(dAtA[iNdEx:postIndex]) + x.Subject = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -5151,8 +5151,8 @@ type Aliases struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Origin is the Alias provider Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - // Handle is the user defined alias - Handle string `protobuf:"bytes,3,opt,name=handle,proto3" json:"handle,omitempty"` + // Subject is the user defined alias + Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` // Controller of the alias Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` // Expiration of the alias @@ -5193,9 +5193,9 @@ func (x *Aliases) GetOrigin() string { return "" } -func (x *Aliases) GetHandle() string { +func (x *Aliases) GetSubject() string { if x != nil { - return x.Handle + return x.Subject } return "" } @@ -5624,109 +5624,109 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xa7, 0x01, 0x0a, 0x07, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0xaa, 0x01, 0x0a, 0x07, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x1c, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x16, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x06, 0x68, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x80, 0x02, 0x0a, 0x09, 0x41, 0x73, - 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, - 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, - 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, - 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x22, 0x94, 0x01, 0x0a, - 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, - 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x03, 0x22, 0xaf, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x64, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4d, 0x75, 0x6c, - 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x63, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, - 0x43, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, - 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, - 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x04, 0x22, 0x8b, 0x03, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x44, 0x69, - 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, - 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, - 0x61, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, - 0x6b, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, - 0x64, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, - 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x05, 0x22, 0xdc, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1e, 0x0a, + 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x1d, 0xf2, + 0x9e, 0xd3, 0x8e, 0x03, 0x17, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x80, 0x02, 0x0a, + 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, + 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, + 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, + 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x22, + 0x94, 0x01, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x5f, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x44, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x1a, 0x43, 0x0a, - 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x06, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, - 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, - 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, - 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x22, 0xaf, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, + 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x22, 0x8b, 0x03, 0x0a, 0x0a, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, + 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x44, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4d, 0x75, 0x6c, + 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x64, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x22, 0xdc, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x44, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x52, 0x0a, 0x11, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, + 0x2f, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x06, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/did/v1/types.pulsar.go b/api/did/v1/types.pulsar.go index 475fe7f8b..2577ba552 100644 --- a/api/did/v1/types.pulsar.go +++ b/api/did/v1/types.pulsar.go @@ -16,271 +16,84 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_BaseDocument_2_list)(nil) +var _ protoreflect.List = (*_Credential_4_list)(nil) -type _BaseDocument_2_list struct { - list *[]*VerificationMethod -} - -func (x *_BaseDocument_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_BaseDocument_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_BaseDocument_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*VerificationMethod) - (*x.list)[i] = concreteValue -} - -func (x *_BaseDocument_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*VerificationMethod) - *x.list = append(*x.list, concreteValue) -} - -func (x *_BaseDocument_2_list) AppendMutable() protoreflect.Value { - v := new(VerificationMethod) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_BaseDocument_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_BaseDocument_2_list) NewElement() protoreflect.Value { - v := new(VerificationMethod) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_BaseDocument_2_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_BaseDocument_4_list)(nil) - -type _BaseDocument_4_list struct { +type _Credential_4_list struct { list *[]string } -func (x *_BaseDocument_4_list) Len() int { +func (x *_Credential_4_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_BaseDocument_4_list) Get(i int) protoreflect.Value { +func (x *_Credential_4_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_BaseDocument_4_list) Set(i int, value protoreflect.Value) { +func (x *_Credential_4_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_BaseDocument_4_list) Append(value protoreflect.Value) { +func (x *_Credential_4_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_BaseDocument_4_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message BaseDocument at list field Authentication as it is not of Message kind")) +func (x *_Credential_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Credential at list field Transport as it is not of Message kind")) } -func (x *_BaseDocument_4_list) Truncate(n int) { +func (x *_Credential_4_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_BaseDocument_4_list) NewElement() protoreflect.Value { +func (x *_Credential_4_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_BaseDocument_4_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_BaseDocument_5_list)(nil) - -type _BaseDocument_5_list struct { - list *[]string -} - -func (x *_BaseDocument_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_BaseDocument_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_BaseDocument_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_BaseDocument_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_BaseDocument_5_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message BaseDocument at list field AssertionMethod as it is not of Message kind")) -} - -func (x *_BaseDocument_5_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_BaseDocument_5_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_BaseDocument_5_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_BaseDocument_7_list)(nil) - -type _BaseDocument_7_list struct { - list *[]string -} - -func (x *_BaseDocument_7_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_BaseDocument_7_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_BaseDocument_7_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_BaseDocument_7_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_BaseDocument_7_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message BaseDocument at list field CapabilityDelegation as it is not of Message kind")) -} - -func (x *_BaseDocument_7_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_BaseDocument_7_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_BaseDocument_7_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_BaseDocument_8_list)(nil) - -type _BaseDocument_8_list struct { - list *[]string -} - -func (x *_BaseDocument_8_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_BaseDocument_8_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_BaseDocument_8_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_BaseDocument_8_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_BaseDocument_8_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message BaseDocument at list field CapabilityInvocation as it is not of Message kind")) -} - -func (x *_BaseDocument_8_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_BaseDocument_8_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_BaseDocument_8_list) IsValid() bool { +func (x *_Credential_4_list) IsValid() bool { return x.list != nil } var ( - md_BaseDocument protoreflect.MessageDescriptor - fd_BaseDocument_id protoreflect.FieldDescriptor - fd_BaseDocument_verification_methods protoreflect.FieldDescriptor - fd_BaseDocument_authentication protoreflect.FieldDescriptor - fd_BaseDocument_assertion_method protoreflect.FieldDescriptor - fd_BaseDocument_capability_delegation protoreflect.FieldDescriptor - fd_BaseDocument_capability_invocation protoreflect.FieldDescriptor + md_Credential protoreflect.MessageDescriptor + fd_Credential_id protoreflect.FieldDescriptor + fd_Credential_credential_type protoreflect.FieldDescriptor + fd_Credential_credential_id protoreflect.FieldDescriptor + fd_Credential_transport protoreflect.FieldDescriptor + fd_Credential_attestation_type protoreflect.FieldDescriptor + fd_Credential_display_name protoreflect.FieldDescriptor + fd_Credential_controller protoreflect.FieldDescriptor ) func init() { file_did_v1_types_proto_init() - md_BaseDocument = File_did_v1_types_proto.Messages().ByName("BaseDocument") - fd_BaseDocument_id = md_BaseDocument.Fields().ByName("id") - fd_BaseDocument_verification_methods = md_BaseDocument.Fields().ByName("verification_methods") - fd_BaseDocument_authentication = md_BaseDocument.Fields().ByName("authentication") - fd_BaseDocument_assertion_method = md_BaseDocument.Fields().ByName("assertion_method") - fd_BaseDocument_capability_delegation = md_BaseDocument.Fields().ByName("capability_delegation") - fd_BaseDocument_capability_invocation = md_BaseDocument.Fields().ByName("capability_invocation") + md_Credential = File_did_v1_types_proto.Messages().ByName("Credential") + fd_Credential_id = md_Credential.Fields().ByName("id") + fd_Credential_credential_type = md_Credential.Fields().ByName("credential_type") + fd_Credential_credential_id = md_Credential.Fields().ByName("credential_id") + fd_Credential_transport = md_Credential.Fields().ByName("transport") + fd_Credential_attestation_type = md_Credential.Fields().ByName("attestation_type") + fd_Credential_display_name = md_Credential.Fields().ByName("display_name") + fd_Credential_controller = md_Credential.Fields().ByName("controller") } -var _ protoreflect.Message = (*fastReflection_BaseDocument)(nil) +var _ protoreflect.Message = (*fastReflection_Credential)(nil) -type fastReflection_BaseDocument BaseDocument +type fastReflection_Credential Credential -func (x *BaseDocument) ProtoReflect() protoreflect.Message { - return (*fastReflection_BaseDocument)(x) +func (x *Credential) ProtoReflect() protoreflect.Message { + return (*fastReflection_Credential)(x) } -func (x *BaseDocument) slowProtoReflect() protoreflect.Message { +func (x *Credential) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_types_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -292,43 +105,43 @@ func (x *BaseDocument) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_BaseDocument_messageType fastReflection_BaseDocument_messageType -var _ protoreflect.MessageType = fastReflection_BaseDocument_messageType{} +var _fastReflection_Credential_messageType fastReflection_Credential_messageType +var _ protoreflect.MessageType = fastReflection_Credential_messageType{} -type fastReflection_BaseDocument_messageType struct{} +type fastReflection_Credential_messageType struct{} -func (x fastReflection_BaseDocument_messageType) Zero() protoreflect.Message { - return (*fastReflection_BaseDocument)(nil) +func (x fastReflection_Credential_messageType) Zero() protoreflect.Message { + return (*fastReflection_Credential)(nil) } -func (x fastReflection_BaseDocument_messageType) New() protoreflect.Message { - return new(fastReflection_BaseDocument) +func (x fastReflection_Credential_messageType) New() protoreflect.Message { + return new(fastReflection_Credential) } -func (x fastReflection_BaseDocument_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BaseDocument +func (x fastReflection_Credential_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Credential } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_BaseDocument) Descriptor() protoreflect.MessageDescriptor { - return md_BaseDocument +func (x *fastReflection_Credential) Descriptor() protoreflect.MessageDescriptor { + return md_Credential } // 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_BaseDocument) Type() protoreflect.MessageType { - return _fastReflection_BaseDocument_messageType +func (x *fastReflection_Credential) Type() protoreflect.MessageType { + return _fastReflection_Credential_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_BaseDocument) New() protoreflect.Message { - return new(fastReflection_BaseDocument) +func (x *fastReflection_Credential) New() protoreflect.Message { + return new(fastReflection_Credential) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_BaseDocument) Interface() protoreflect.ProtoMessage { - return (*BaseDocument)(x) +func (x *fastReflection_Credential) Interface() protoreflect.ProtoMessage { + return (*Credential)(x) } // Range iterates over every populated field in an undefined order, @@ -336,40 +149,46 @@ func (x *fastReflection_BaseDocument) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_BaseDocument) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Credential) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_BaseDocument_id, value) { + if !f(fd_Credential_id, value) { return } } - if len(x.VerificationMethods) != 0 { - value := protoreflect.ValueOfList(&_BaseDocument_2_list{list: &x.VerificationMethods}) - if !f(fd_BaseDocument_verification_methods, value) { + if x.CredentialType != "" { + value := protoreflect.ValueOfString(x.CredentialType) + if !f(fd_Credential_credential_type, value) { return } } - if len(x.Authentication) != 0 { - value := protoreflect.ValueOfList(&_BaseDocument_4_list{list: &x.Authentication}) - if !f(fd_BaseDocument_authentication, value) { + if len(x.CredentialId) != 0 { + value := protoreflect.ValueOfBytes(x.CredentialId) + if !f(fd_Credential_credential_id, value) { return } } - if len(x.AssertionMethod) != 0 { - value := protoreflect.ValueOfList(&_BaseDocument_5_list{list: &x.AssertionMethod}) - if !f(fd_BaseDocument_assertion_method, value) { + if len(x.Transport) != 0 { + value := protoreflect.ValueOfList(&_Credential_4_list{list: &x.Transport}) + if !f(fd_Credential_transport, value) { return } } - if len(x.CapabilityDelegation) != 0 { - value := protoreflect.ValueOfList(&_BaseDocument_7_list{list: &x.CapabilityDelegation}) - if !f(fd_BaseDocument_capability_delegation, value) { + if x.AttestationType != "" { + value := protoreflect.ValueOfString(x.AttestationType) + if !f(fd_Credential_attestation_type, value) { return } } - if len(x.CapabilityInvocation) != 0 { - value := protoreflect.ValueOfList(&_BaseDocument_8_list{list: &x.CapabilityInvocation}) - if !f(fd_BaseDocument_capability_invocation, value) { + if x.DisplayName != "" { + value := protoreflect.ValueOfString(x.DisplayName) + if !f(fd_Credential_display_name, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Credential_controller, value) { return } } @@ -386,25 +205,27 @@ func (x *fastReflection_BaseDocument) Range(f func(protoreflect.FieldDescriptor, // 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_BaseDocument) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Credential) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.BaseDocument.id": + case "did.v1.Credential.id": return x.Id != "" - case "did.v1.BaseDocument.verification_methods": - return len(x.VerificationMethods) != 0 - case "did.v1.BaseDocument.authentication": - return len(x.Authentication) != 0 - case "did.v1.BaseDocument.assertion_method": - return len(x.AssertionMethod) != 0 - case "did.v1.BaseDocument.capability_delegation": - return len(x.CapabilityDelegation) != 0 - case "did.v1.BaseDocument.capability_invocation": - return len(x.CapabilityInvocation) != 0 + case "did.v1.Credential.credential_type": + return x.CredentialType != "" + case "did.v1.Credential.credential_id": + return len(x.CredentialId) != 0 + case "did.v1.Credential.transport": + return len(x.Transport) != 0 + case "did.v1.Credential.attestation_type": + return x.AttestationType != "" + case "did.v1.Credential.display_name": + return x.DisplayName != "" + case "did.v1.Credential.controller": + return x.Controller != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.BaseDocument")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) } - panic(fmt.Errorf("message did.v1.BaseDocument does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Credential does not contain field %s", fd.FullName())) } } @@ -414,25 +235,27 @@ func (x *fastReflection_BaseDocument) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseDocument) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Credential) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.BaseDocument.id": + case "did.v1.Credential.id": x.Id = "" - case "did.v1.BaseDocument.verification_methods": - x.VerificationMethods = nil - case "did.v1.BaseDocument.authentication": - x.Authentication = nil - case "did.v1.BaseDocument.assertion_method": - x.AssertionMethod = nil - case "did.v1.BaseDocument.capability_delegation": - x.CapabilityDelegation = nil - case "did.v1.BaseDocument.capability_invocation": - x.CapabilityInvocation = nil + case "did.v1.Credential.credential_type": + x.CredentialType = "" + case "did.v1.Credential.credential_id": + x.CredentialId = nil + case "did.v1.Credential.transport": + x.Transport = nil + case "did.v1.Credential.attestation_type": + x.AttestationType = "" + case "did.v1.Credential.display_name": + x.DisplayName = "" + case "did.v1.Credential.controller": + x.Controller = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.BaseDocument")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) } - panic(fmt.Errorf("message did.v1.BaseDocument does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Credential does not contain field %s", fd.FullName())) } } @@ -442,46 +265,37 @@ func (x *fastReflection_BaseDocument) Clear(fd protoreflect.FieldDescriptor) { // 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_BaseDocument) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Credential) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.BaseDocument.id": + case "did.v1.Credential.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.BaseDocument.verification_methods": - if len(x.VerificationMethods) == 0 { - return protoreflect.ValueOfList(&_BaseDocument_2_list{}) + case "did.v1.Credential.credential_type": + value := x.CredentialType + return protoreflect.ValueOfString(value) + case "did.v1.Credential.credential_id": + value := x.CredentialId + return protoreflect.ValueOfBytes(value) + case "did.v1.Credential.transport": + if len(x.Transport) == 0 { + return protoreflect.ValueOfList(&_Credential_4_list{}) } - listValue := &_BaseDocument_2_list{list: &x.VerificationMethods} - return protoreflect.ValueOfList(listValue) - case "did.v1.BaseDocument.authentication": - if len(x.Authentication) == 0 { - return protoreflect.ValueOfList(&_BaseDocument_4_list{}) - } - listValue := &_BaseDocument_4_list{list: &x.Authentication} - return protoreflect.ValueOfList(listValue) - case "did.v1.BaseDocument.assertion_method": - if len(x.AssertionMethod) == 0 { - return protoreflect.ValueOfList(&_BaseDocument_5_list{}) - } - listValue := &_BaseDocument_5_list{list: &x.AssertionMethod} - return protoreflect.ValueOfList(listValue) - case "did.v1.BaseDocument.capability_delegation": - if len(x.CapabilityDelegation) == 0 { - return protoreflect.ValueOfList(&_BaseDocument_7_list{}) - } - listValue := &_BaseDocument_7_list{list: &x.CapabilityDelegation} - return protoreflect.ValueOfList(listValue) - case "did.v1.BaseDocument.capability_invocation": - if len(x.CapabilityInvocation) == 0 { - return protoreflect.ValueOfList(&_BaseDocument_8_list{}) - } - listValue := &_BaseDocument_8_list{list: &x.CapabilityInvocation} + listValue := &_Credential_4_list{list: &x.Transport} return protoreflect.ValueOfList(listValue) + case "did.v1.Credential.attestation_type": + value := x.AttestationType + return protoreflect.ValueOfString(value) + case "did.v1.Credential.display_name": + value := x.DisplayName + return protoreflect.ValueOfString(value) + case "did.v1.Credential.controller": + value := x.Controller + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.BaseDocument")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) } - panic(fmt.Errorf("message did.v1.BaseDocument does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Credential does not contain field %s", descriptor.FullName())) } } @@ -495,35 +309,29 @@ func (x *fastReflection_BaseDocument) Get(descriptor protoreflect.FieldDescripto // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseDocument) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Credential) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.BaseDocument.id": + case "did.v1.Credential.id": x.Id = value.Interface().(string) - case "did.v1.BaseDocument.verification_methods": + case "did.v1.Credential.credential_type": + x.CredentialType = value.Interface().(string) + case "did.v1.Credential.credential_id": + x.CredentialId = value.Bytes() + case "did.v1.Credential.transport": lv := value.List() - clv := lv.(*_BaseDocument_2_list) - x.VerificationMethods = *clv.list - case "did.v1.BaseDocument.authentication": - lv := value.List() - clv := lv.(*_BaseDocument_4_list) - x.Authentication = *clv.list - case "did.v1.BaseDocument.assertion_method": - lv := value.List() - clv := lv.(*_BaseDocument_5_list) - x.AssertionMethod = *clv.list - case "did.v1.BaseDocument.capability_delegation": - lv := value.List() - clv := lv.(*_BaseDocument_7_list) - x.CapabilityDelegation = *clv.list - case "did.v1.BaseDocument.capability_invocation": - lv := value.List() - clv := lv.(*_BaseDocument_8_list) - x.CapabilityInvocation = *clv.list + clv := lv.(*_Credential_4_list) + x.Transport = *clv.list + case "did.v1.Credential.attestation_type": + x.AttestationType = value.Interface().(string) + case "did.v1.Credential.display_name": + x.DisplayName = value.Interface().(string) + case "did.v1.Credential.controller": + x.Controller = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.BaseDocument")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) } - panic(fmt.Errorf("message did.v1.BaseDocument does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Credential does not contain field %s", fd.FullName())) } } @@ -537,85 +345,69 @@ func (x *fastReflection_BaseDocument) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseDocument) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Credential) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.BaseDocument.verification_methods": - if x.VerificationMethods == nil { - x.VerificationMethods = []*VerificationMethod{} + case "did.v1.Credential.transport": + if x.Transport == nil { + x.Transport = []string{} } - value := &_BaseDocument_2_list{list: &x.VerificationMethods} + value := &_Credential_4_list{list: &x.Transport} return protoreflect.ValueOfList(value) - case "did.v1.BaseDocument.authentication": - if x.Authentication == nil { - x.Authentication = []string{} - } - value := &_BaseDocument_4_list{list: &x.Authentication} - return protoreflect.ValueOfList(value) - case "did.v1.BaseDocument.assertion_method": - if x.AssertionMethod == nil { - x.AssertionMethod = []string{} - } - value := &_BaseDocument_5_list{list: &x.AssertionMethod} - return protoreflect.ValueOfList(value) - case "did.v1.BaseDocument.capability_delegation": - if x.CapabilityDelegation == nil { - x.CapabilityDelegation = []string{} - } - value := &_BaseDocument_7_list{list: &x.CapabilityDelegation} - return protoreflect.ValueOfList(value) - case "did.v1.BaseDocument.capability_invocation": - if x.CapabilityInvocation == nil { - x.CapabilityInvocation = []string{} - } - value := &_BaseDocument_8_list{list: &x.CapabilityInvocation} - return protoreflect.ValueOfList(value) - case "did.v1.BaseDocument.id": - panic(fmt.Errorf("field id of message did.v1.BaseDocument is not mutable")) + case "did.v1.Credential.id": + panic(fmt.Errorf("field id of message did.v1.Credential is not mutable")) + case "did.v1.Credential.credential_type": + panic(fmt.Errorf("field credential_type of message did.v1.Credential is not mutable")) + case "did.v1.Credential.credential_id": + panic(fmt.Errorf("field credential_id of message did.v1.Credential is not mutable")) + case "did.v1.Credential.attestation_type": + panic(fmt.Errorf("field attestation_type of message did.v1.Credential is not mutable")) + case "did.v1.Credential.display_name": + panic(fmt.Errorf("field display_name of message did.v1.Credential is not mutable")) + case "did.v1.Credential.controller": + panic(fmt.Errorf("field controller of message did.v1.Credential is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.BaseDocument")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) } - panic(fmt.Errorf("message did.v1.BaseDocument does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Credential 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_BaseDocument) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Credential) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.BaseDocument.id": + case "did.v1.Credential.id": return protoreflect.ValueOfString("") - case "did.v1.BaseDocument.verification_methods": - list := []*VerificationMethod{} - return protoreflect.ValueOfList(&_BaseDocument_2_list{list: &list}) - case "did.v1.BaseDocument.authentication": + case "did.v1.Credential.credential_type": + return protoreflect.ValueOfString("") + case "did.v1.Credential.credential_id": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Credential.transport": list := []string{} - return protoreflect.ValueOfList(&_BaseDocument_4_list{list: &list}) - case "did.v1.BaseDocument.assertion_method": - list := []string{} - return protoreflect.ValueOfList(&_BaseDocument_5_list{list: &list}) - case "did.v1.BaseDocument.capability_delegation": - list := []string{} - return protoreflect.ValueOfList(&_BaseDocument_7_list{list: &list}) - case "did.v1.BaseDocument.capability_invocation": - list := []string{} - return protoreflect.ValueOfList(&_BaseDocument_8_list{list: &list}) + return protoreflect.ValueOfList(&_Credential_4_list{list: &list}) + case "did.v1.Credential.attestation_type": + return protoreflect.ValueOfString("") + case "did.v1.Credential.display_name": + return protoreflect.ValueOfString("") + case "did.v1.Credential.controller": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.BaseDocument")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) } - panic(fmt.Errorf("message did.v1.BaseDocument does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Credential 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_BaseDocument) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Credential) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.BaseDocument", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Credential", d.FullName())) } panic("unreachable") } @@ -623,7 +415,7 @@ func (x *fastReflection_BaseDocument) WhichOneof(d protoreflect.OneofDescriptor) // 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_BaseDocument) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Credential) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -634,7 +426,7 @@ func (x *fastReflection_BaseDocument) 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_BaseDocument) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Credential) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -646,7 +438,7 @@ func (x *fastReflection_BaseDocument) SetUnknown(fields protoreflect.RawFields) // 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_BaseDocument) IsValid() bool { +func (x *fastReflection_Credential) IsValid() bool { return x != nil } @@ -656,9 +448,1083 @@ func (x *fastReflection_BaseDocument) 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_BaseDocument) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Credential) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BaseDocument) + x := input.Message.Interface().(*Credential) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CredentialType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CredentialId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Transport) > 0 { + for _, s := range x.Transport { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.AttestationType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DisplayName) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Credential) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0x3a + } + if len(x.DisplayName) > 0 { + i -= len(x.DisplayName) + copy(dAtA[i:], x.DisplayName) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DisplayName))) + i-- + dAtA[i] = 0x32 + } + if len(x.AttestationType) > 0 { + i -= len(x.AttestationType) + copy(dAtA[i:], x.AttestationType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationType))) + i-- + dAtA[i] = 0x2a + } + if len(x.Transport) > 0 { + for iNdEx := len(x.Transport) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Transport[iNdEx]) + copy(dAtA[i:], x.Transport[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Transport[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.CredentialId) > 0 { + i -= len(x.CredentialId) + copy(dAtA[i:], x.CredentialId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialId))) + i-- + dAtA[i] = 0x1a + } + if len(x.CredentialType) > 0 { + i -= len(x.CredentialType) + copy(dAtA[i:], x.CredentialType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialType))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Credential) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Credential: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Credential: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialType", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CredentialType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) + } + var byteLen int + 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CredentialId = append(x.CredentialId[:0], dAtA[iNdEx:postIndex]...) + if x.CredentialId == nil { + x.CredentialId = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Transport", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Transport = append(x.Transport, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationType", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AttestationType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisplayName", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DisplayName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_Document_2_list)(nil) + +type _Document_2_list struct { + list *[]*VerificationMethod +} + +func (x *_Document_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Document_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + (*x.list)[i] = concreteValue +} + +func (x *_Document_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_2_list) AppendMutable() protoreflect.Value { + v := new(VerificationMethod) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Document_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Document_2_list) NewElement() protoreflect.Value { + v := new(VerificationMethod) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Document_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_4_list)(nil) + +type _Document_4_list struct { + list *[]string +} + +func (x *_Document_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Authentication as it is not of Message kind")) +} + +func (x *_Document_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_5_list)(nil) + +type _Document_5_list struct { + list *[]string +} + +func (x *_Document_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_Document_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_7_list)(nil) + +type _Document_7_list struct { + list *[]string +} + +func (x *_Document_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_Document_7_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_7_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_7_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_8_list)(nil) + +type _Document_8_list struct { + list *[]string +} + +func (x *_Document_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityInvocation as it is not of Message kind")) +} + +func (x *_Document_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_8_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Document protoreflect.MessageDescriptor + fd_Document_id protoreflect.FieldDescriptor + fd_Document_verification_methods protoreflect.FieldDescriptor + fd_Document_authentication protoreflect.FieldDescriptor + fd_Document_assertion_method protoreflect.FieldDescriptor + fd_Document_capability_delegation protoreflect.FieldDescriptor + fd_Document_capability_invocation protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_types_proto_init() + md_Document = File_did_v1_types_proto.Messages().ByName("Document") + fd_Document_id = md_Document.Fields().ByName("id") + fd_Document_verification_methods = md_Document.Fields().ByName("verification_methods") + fd_Document_authentication = md_Document.Fields().ByName("authentication") + fd_Document_assertion_method = md_Document.Fields().ByName("assertion_method") + fd_Document_capability_delegation = md_Document.Fields().ByName("capability_delegation") + fd_Document_capability_invocation = md_Document.Fields().ByName("capability_invocation") +} + +var _ protoreflect.Message = (*fastReflection_Document)(nil) + +type fastReflection_Document Document + +func (x *Document) ProtoReflect() protoreflect.Message { + return (*fastReflection_Document)(x) +} + +func (x *Document) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Document_messageType fastReflection_Document_messageType +var _ protoreflect.MessageType = fastReflection_Document_messageType{} + +type fastReflection_Document_messageType struct{} + +func (x fastReflection_Document_messageType) Zero() protoreflect.Message { + return (*fastReflection_Document)(nil) +} +func (x fastReflection_Document_messageType) New() protoreflect.Message { + return new(fastReflection_Document) +} +func (x fastReflection_Document_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Document +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Document) Descriptor() protoreflect.MessageDescriptor { + return md_Document +} + +// 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_Document) Type() protoreflect.MessageType { + return _fastReflection_Document_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Document) New() protoreflect.Message { + return new(fastReflection_Document) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Document) Interface() protoreflect.ProtoMessage { + return (*Document)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Document) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Document_id, value) { + return + } + } + if len(x.VerificationMethods) != 0 { + value := protoreflect.ValueOfList(&_Document_2_list{list: &x.VerificationMethods}) + if !f(fd_Document_verification_methods, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_Document_4_list{list: &x.Authentication}) + if !f(fd_Document_authentication, value) { + return + } + } + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_Document_5_list{list: &x.AssertionMethod}) + if !f(fd_Document_assertion_method, value) { + return + } + } + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_Document_7_list{list: &x.CapabilityDelegation}) + if !f(fd_Document_capability_delegation, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_Document_8_list{list: &x.CapabilityInvocation}) + if !f(fd_Document_capability_invocation, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_Document) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Document.id": + return x.Id != "" + case "did.v1.Document.verification_methods": + return len(x.VerificationMethods) != 0 + case "did.v1.Document.authentication": + return len(x.Authentication) != 0 + case "did.v1.Document.assertion_method": + return len(x.AssertionMethod) != 0 + case "did.v1.Document.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "did.v1.Document.capability_invocation": + return len(x.CapabilityInvocation) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Document.id": + x.Id = "" + case "did.v1.Document.verification_methods": + x.VerificationMethods = nil + case "did.v1.Document.authentication": + x.Authentication = nil + case "did.v1.Document.assertion_method": + x.AssertionMethod = nil + case "did.v1.Document.capability_delegation": + x.CapabilityDelegation = nil + case "did.v1.Document.capability_invocation": + x.CapabilityInvocation = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_Document) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Document.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Document.verification_methods": + if len(x.VerificationMethods) == 0 { + return protoreflect.ValueOfList(&_Document_2_list{}) + } + listValue := &_Document_2_list{list: &x.VerificationMethods} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_Document_4_list{}) + } + listValue := &_Document_4_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_Document_5_list{}) + } + listValue := &_Document_5_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_Document_7_list{}) + } + listValue := &_Document_7_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_Document_8_list{}) + } + listValue := &_Document_8_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Document.id": + x.Id = value.Interface().(string) + case "did.v1.Document.verification_methods": + lv := value.List() + clv := lv.(*_Document_2_list) + x.VerificationMethods = *clv.list + case "did.v1.Document.authentication": + lv := value.List() + clv := lv.(*_Document_4_list) + x.Authentication = *clv.list + case "did.v1.Document.assertion_method": + lv := value.List() + clv := lv.(*_Document_5_list) + x.AssertionMethod = *clv.list + case "did.v1.Document.capability_delegation": + lv := value.List() + clv := lv.(*_Document_7_list) + x.CapabilityDelegation = *clv.list + case "did.v1.Document.capability_invocation": + lv := value.List() + clv := lv.(*_Document_8_list) + x.CapabilityInvocation = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Document.verification_methods": + if x.VerificationMethods == nil { + x.VerificationMethods = []*VerificationMethod{} + } + value := &_Document_2_list{list: &x.VerificationMethods} + return protoreflect.ValueOfList(value) + case "did.v1.Document.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_Document_4_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "did.v1.Document.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_Document_5_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} + } + value := &_Document_7_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_Document_8_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.id": + panic(fmt.Errorf("field id of message did.v1.Document is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document 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_Document) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Document.id": + return protoreflect.ValueOfString("") + case "did.v1.Document.verification_methods": + list := []*VerificationMethod{} + return protoreflect.ValueOfList(&_Document_2_list{list: &list}) + case "did.v1.Document.authentication": + list := []string{} + return protoreflect.ValueOfList(&_Document_4_list{list: &list}) + case "did.v1.Document.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_Document_5_list{list: &list}) + case "did.v1.Document.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_Document_7_list{list: &list}) + case "did.v1.Document.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_Document_8_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document 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_Document) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Document", d.FullName())) + } + panic("unreachable") +} + +// 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_Document) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_Document) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Document) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Document) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -714,7 +1580,7 @@ func (x *fastReflection_BaseDocument) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BaseDocument) + x := input.Message.Interface().(*Document) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -803,7 +1669,7 @@ func (x *fastReflection_BaseDocument) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BaseDocument) + x := input.Message.Interface().(*Document) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -835,10 +1701,10 @@ func (x *fastReflection_BaseDocument) 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: BaseDocument: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BaseDocument: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1070,6 +1936,1444 @@ func (x *fastReflection_BaseDocument) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_Identity_4_list)(nil) + +type _Identity_4_list struct { + list *[]*Credential +} + +func (x *_Identity_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Identity_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Identity_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + (*x.list)[i] = concreteValue +} + +func (x *_Identity_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Identity_4_list) AppendMutable() protoreflect.Value { + v := new(Credential) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Identity_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Identity_4_list) NewElement() protoreflect.Value { + v := new(Credential) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Identity_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Identity_5_list)(nil) + +type _Identity_5_list struct { + list *[]*VerificationMethod +} + +func (x *_Identity_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Identity_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Identity_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + (*x.list)[i] = concreteValue +} + +func (x *_Identity_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VerificationMethod) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Identity_5_list) AppendMutable() protoreflect.Value { + v := new(VerificationMethod) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Identity_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Identity_5_list) NewElement() protoreflect.Value { + v := new(VerificationMethod) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Identity_5_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Identity protoreflect.MessageDescriptor + fd_Identity_id protoreflect.FieldDescriptor + fd_Identity_subject protoreflect.FieldDescriptor + fd_Identity_controller protoreflect.FieldDescriptor + fd_Identity_credentials protoreflect.FieldDescriptor + fd_Identity_verification_methods protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_types_proto_init() + md_Identity = File_did_v1_types_proto.Messages().ByName("Identity") + fd_Identity_id = md_Identity.Fields().ByName("id") + fd_Identity_subject = md_Identity.Fields().ByName("subject") + fd_Identity_controller = md_Identity.Fields().ByName("controller") + fd_Identity_credentials = md_Identity.Fields().ByName("credentials") + fd_Identity_verification_methods = md_Identity.Fields().ByName("verification_methods") +} + +var _ protoreflect.Message = (*fastReflection_Identity)(nil) + +type fastReflection_Identity Identity + +func (x *Identity) ProtoReflect() protoreflect.Message { + return (*fastReflection_Identity)(x) +} + +func (x *Identity) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Identity_messageType fastReflection_Identity_messageType +var _ protoreflect.MessageType = fastReflection_Identity_messageType{} + +type fastReflection_Identity_messageType struct{} + +func (x fastReflection_Identity_messageType) Zero() protoreflect.Message { + return (*fastReflection_Identity)(nil) +} +func (x fastReflection_Identity_messageType) New() protoreflect.Message { + return new(fastReflection_Identity) +} +func (x fastReflection_Identity_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Identity +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Identity) Descriptor() protoreflect.MessageDescriptor { + return md_Identity +} + +// 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_Identity) Type() protoreflect.MessageType { + return _fastReflection_Identity_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Identity) New() protoreflect.Message { + return new(fastReflection_Identity) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Identity) Interface() protoreflect.ProtoMessage { + return (*Identity)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Identity) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Identity_id, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Identity_subject, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Identity_controller, value) { + return + } + } + if len(x.Credentials) != 0 { + value := protoreflect.ValueOfList(&_Identity_4_list{list: &x.Credentials}) + if !f(fd_Identity_credentials, value) { + return + } + } + if len(x.VerificationMethods) != 0 { + value := protoreflect.ValueOfList(&_Identity_5_list{list: &x.VerificationMethods}) + if !f(fd_Identity_verification_methods, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_Identity) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Identity.id": + return x.Id != "" + case "did.v1.Identity.subject": + return x.Subject != "" + case "did.v1.Identity.controller": + return x.Controller != "" + case "did.v1.Identity.credentials": + return len(x.Credentials) != 0 + case "did.v1.Identity.verification_methods": + return len(x.VerificationMethods) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Identity")) + } + panic(fmt.Errorf("message did.v1.Identity does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Identity) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Identity.id": + x.Id = "" + case "did.v1.Identity.subject": + x.Subject = "" + case "did.v1.Identity.controller": + x.Controller = "" + case "did.v1.Identity.credentials": + x.Credentials = nil + case "did.v1.Identity.verification_methods": + x.VerificationMethods = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Identity")) + } + panic(fmt.Errorf("message did.v1.Identity does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_Identity) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Identity.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Identity.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.Identity.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.Identity.credentials": + if len(x.Credentials) == 0 { + return protoreflect.ValueOfList(&_Identity_4_list{}) + } + listValue := &_Identity_4_list{list: &x.Credentials} + return protoreflect.ValueOfList(listValue) + case "did.v1.Identity.verification_methods": + if len(x.VerificationMethods) == 0 { + return protoreflect.ValueOfList(&_Identity_5_list{}) + } + listValue := &_Identity_5_list{list: &x.VerificationMethods} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Identity")) + } + panic(fmt.Errorf("message did.v1.Identity does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Identity) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Identity.id": + x.Id = value.Interface().(string) + case "did.v1.Identity.subject": + x.Subject = value.Interface().(string) + case "did.v1.Identity.controller": + x.Controller = value.Interface().(string) + case "did.v1.Identity.credentials": + lv := value.List() + clv := lv.(*_Identity_4_list) + x.Credentials = *clv.list + case "did.v1.Identity.verification_methods": + lv := value.List() + clv := lv.(*_Identity_5_list) + x.VerificationMethods = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Identity")) + } + panic(fmt.Errorf("message did.v1.Identity does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Identity) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Identity.credentials": + if x.Credentials == nil { + x.Credentials = []*Credential{} + } + value := &_Identity_4_list{list: &x.Credentials} + return protoreflect.ValueOfList(value) + case "did.v1.Identity.verification_methods": + if x.VerificationMethods == nil { + x.VerificationMethods = []*VerificationMethod{} + } + value := &_Identity_5_list{list: &x.VerificationMethods} + return protoreflect.ValueOfList(value) + case "did.v1.Identity.id": + panic(fmt.Errorf("field id of message did.v1.Identity is not mutable")) + case "did.v1.Identity.subject": + panic(fmt.Errorf("field subject of message did.v1.Identity is not mutable")) + case "did.v1.Identity.controller": + panic(fmt.Errorf("field controller of message did.v1.Identity is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Identity")) + } + panic(fmt.Errorf("message did.v1.Identity 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_Identity) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Identity.id": + return protoreflect.ValueOfString("") + case "did.v1.Identity.subject": + return protoreflect.ValueOfString("") + case "did.v1.Identity.controller": + return protoreflect.ValueOfString("") + case "did.v1.Identity.credentials": + list := []*Credential{} + return protoreflect.ValueOfList(&_Identity_4_list{list: &list}) + case "did.v1.Identity.verification_methods": + list := []*VerificationMethod{} + return protoreflect.ValueOfList(&_Identity_5_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Identity")) + } + panic(fmt.Errorf("message did.v1.Identity 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_Identity) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Identity", d.FullName())) + } + panic("unreachable") +} + +// 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_Identity) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Identity) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_Identity) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Identity) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Identity) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Credentials) > 0 { + for _, e := range x.Credentials { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.VerificationMethods) > 0 { + for _, e := range x.VerificationMethods { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Identity) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.VerificationMethods) > 0 { + for iNdEx := len(x.VerificationMethods) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VerificationMethods[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + } + if len(x.Credentials) > 0 { + for iNdEx := len(x.Credentials) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Credentials[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0x1a + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Identity) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Identity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Identity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Credentials = append(x.Credentials, &Credential{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Credentials[len(x.Credentials)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VerificationMethods", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.VerificationMethods = append(x.VerificationMethods, &VerificationMethod{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VerificationMethods[len(x.VerificationMethods)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_PubKey protoreflect.MessageDescriptor + fd_PubKey_id protoreflect.FieldDescriptor + fd_PubKey_key protoreflect.FieldDescriptor + fd_PubKey_key_type protoreflect.FieldDescriptor + fd_PubKey_controller protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_types_proto_init() + md_PubKey = File_did_v1_types_proto.Messages().ByName("PubKey") + fd_PubKey_id = md_PubKey.Fields().ByName("id") + fd_PubKey_key = md_PubKey.Fields().ByName("key") + fd_PubKey_key_type = md_PubKey.Fields().ByName("key_type") + fd_PubKey_controller = md_PubKey.Fields().ByName("controller") +} + +var _ protoreflect.Message = (*fastReflection_PubKey)(nil) + +type fastReflection_PubKey PubKey + +func (x *PubKey) ProtoReflect() protoreflect.Message { + return (*fastReflection_PubKey)(x) +} + +func (x *PubKey) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_PubKey_messageType fastReflection_PubKey_messageType +var _ protoreflect.MessageType = fastReflection_PubKey_messageType{} + +type fastReflection_PubKey_messageType struct{} + +func (x fastReflection_PubKey_messageType) Zero() protoreflect.Message { + return (*fastReflection_PubKey)(nil) +} +func (x fastReflection_PubKey_messageType) New() protoreflect.Message { + return new(fastReflection_PubKey) +} +func (x fastReflection_PubKey_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PubKey) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey +} + +// 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_PubKey) Type() protoreflect.MessageType { + return _fastReflection_PubKey_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PubKey) New() protoreflect.Message { + return new(fastReflection_PubKey) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PubKey) Interface() protoreflect.ProtoMessage { + return (*PubKey)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_PubKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_PubKey_id, value) { + return + } + } + if len(x.Key) != 0 { + value := protoreflect.ValueOfBytes(x.Key) + if !f(fd_PubKey_key, value) { + return + } + } + if x.KeyType != "" { + value := protoreflect.ValueOfString(x.KeyType) + if !f(fd_PubKey_key_type, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_PubKey_controller, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// 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_PubKey) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.PubKey.id": + return x.Id != "" + case "did.v1.PubKey.key": + return len(x.Key) != 0 + case "did.v1.PubKey.key_type": + return x.KeyType != "" + case "did.v1.PubKey.controller": + return x.Controller != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.PubKey.id": + x.Id = "" + case "did.v1.PubKey.key": + x.Key = nil + case "did.v1.PubKey.key_type": + x.KeyType = "" + case "did.v1.PubKey.controller": + x.Controller = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// 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_PubKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.PubKey.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.key": + value := x.Key + return protoreflect.ValueOfBytes(value) + case "did.v1.PubKey.key_type": + value := x.KeyType + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.PubKey.id": + x.Id = value.Interface().(string) + case "did.v1.PubKey.key": + x.Key = value.Bytes() + case "did.v1.PubKey.key_type": + x.KeyType = value.Interface().(string) + case "did.v1.PubKey.controller": + x.Controller = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.id": + panic(fmt.Errorf("field id of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.key": + panic(fmt.Errorf("field key of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.key_type": + panic(fmt.Errorf("field key_type of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.controller": + panic(fmt.Errorf("field controller of message did.v1.PubKey is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.id": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.key": + return protoreflect.ValueOfBytes(nil) + case "did.v1.PubKey.key_type": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.controller": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey", d.FullName())) + } + panic("unreachable") +} + +// 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_PubKey) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// 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_PubKey) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.KeyType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0x22 + } + if len(x.KeyType) > 0 { + i -= len(x.KeyType) + copy(dAtA[i:], x.KeyType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyType))) + i-- + dAtA[i] = 0x1a + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) + if x.Key == nil { + x.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.KeyType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var _ protoreflect.Map = (*_VerificationMethod_4_map)(nil) type _VerificationMethod_4_map struct { @@ -1178,7 +3482,7 @@ func (x *VerificationMethod) ProtoReflect() protoreflect.Message { } func (x *VerificationMethod) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_types_proto_msgTypes[1] + mi := &file_did_v1_types_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1935,8 +4239,92 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// BaseDocument defines a DID document -type BaseDocument struct { +// Credential defines a WebAuthn credential +type Credential struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CredentialType string `protobuf:"bytes,2,opt,name=credential_type,json=credentialType,proto3" json:"credential_type,omitempty"` + CredentialId []byte `protobuf:"bytes,3,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + Transport []string `protobuf:"bytes,4,rep,name=transport,proto3" json:"transport,omitempty"` + AttestationType string `protobuf:"bytes,5,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` + DisplayName string `protobuf:"bytes,6,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Controller string `protobuf:"bytes,7,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (x *Credential) Reset() { + *x = Credential{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Credential) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Credential) ProtoMessage() {} + +// Deprecated: Use Credential.ProtoReflect.Descriptor instead. +func (*Credential) Descriptor() ([]byte, []int) { + return file_did_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Credential) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Credential) GetCredentialType() string { + if x != nil { + return x.CredentialType + } + return "" +} + +func (x *Credential) GetCredentialId() []byte { + if x != nil { + return x.CredentialId + } + return nil +} + +func (x *Credential) GetTransport() []string { + if x != nil { + return x.Transport + } + return nil +} + +func (x *Credential) GetAttestationType() string { + if x != nil { + return x.AttestationType + } + return "" +} + +func (x *Credential) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Credential) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +// Document defines a DID document +type Document struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1949,68 +4337,196 @@ type BaseDocument struct { CapabilityInvocation []string `protobuf:"bytes,8,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` } -func (x *BaseDocument) Reset() { - *x = BaseDocument{} +func (x *Document) Reset() { + *x = Document{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_types_proto_msgTypes[0] + mi := &file_did_v1_types_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *BaseDocument) String() string { +func (x *Document) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BaseDocument) ProtoMessage() {} +func (*Document) ProtoMessage() {} -// Deprecated: Use BaseDocument.ProtoReflect.Descriptor instead. -func (*BaseDocument) Descriptor() ([]byte, []int) { - return file_did_v1_types_proto_rawDescGZIP(), []int{0} +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_did_v1_types_proto_rawDescGZIP(), []int{1} } -func (x *BaseDocument) GetId() string { +func (x *Document) GetId() string { if x != nil { return x.Id } return "" } -func (x *BaseDocument) GetVerificationMethods() []*VerificationMethod { +func (x *Document) GetVerificationMethods() []*VerificationMethod { if x != nil { return x.VerificationMethods } return nil } -func (x *BaseDocument) GetAuthentication() []string { +func (x *Document) GetAuthentication() []string { if x != nil { return x.Authentication } return nil } -func (x *BaseDocument) GetAssertionMethod() []string { +func (x *Document) GetAssertionMethod() []string { if x != nil { return x.AssertionMethod } return nil } -func (x *BaseDocument) GetCapabilityDelegation() []string { +func (x *Document) GetCapabilityDelegation() []string { if x != nil { return x.CapabilityDelegation } return nil } -func (x *BaseDocument) GetCapabilityInvocation() []string { +func (x *Document) GetCapabilityInvocation() []string { if x != nil { return x.CapabilityInvocation } return nil } +// Identity defines an associated profile for a did subject +type Identity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + Credentials []*Credential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` + VerificationMethods []*VerificationMethod `protobuf:"bytes,5,rep,name=verification_methods,json=verificationMethods,proto3" json:"verification_methods,omitempty"` +} + +func (x *Identity) Reset() { + *x = Identity{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Identity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Identity) ProtoMessage() {} + +// Deprecated: Use Identity.ProtoReflect.Descriptor instead. +func (*Identity) Descriptor() ([]byte, []int) { + return file_did_v1_types_proto_rawDescGZIP(), []int{2} +} + +func (x *Identity) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Identity) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *Identity) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *Identity) GetCredentials() []*Credential { + if x != nil { + return x.Credentials + } + return nil +} + +func (x *Identity) GetVerificationMethods() []*VerificationMethod { + if x != nil { + return x.VerificationMethods + } + return nil +} + +// PubKey defines a public key for a did +type PubKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + KeyType string `protobuf:"bytes,3,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (x *PubKey) Reset() { + *x = PubKey{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubKey) ProtoMessage() {} + +// Deprecated: Use PubKey.ProtoReflect.Descriptor instead. +func (*PubKey) Descriptor() ([]byte, []int) { + return file_did_v1_types_proto_rawDescGZIP(), []int{3} +} + +func (x *PubKey) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PubKey) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *PubKey) GetKeyType() string { + if x != nil { + return x.KeyType + } + return "" +} + +func (x *PubKey) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + // VerificationMethod defines a verification method type VerificationMethod struct { state protoimpl.MessageState @@ -2028,7 +4544,7 @@ type VerificationMethod struct { func (x *VerificationMethod) Reset() { *x = VerificationMethod{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_types_proto_msgTypes[1] + mi := &file_did_v1_types_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2042,7 +4558,7 @@ func (*VerificationMethod) ProtoMessage() {} // Deprecated: Use VerificationMethod.ProtoReflect.Descriptor instead. func (*VerificationMethod) Descriptor() ([]byte, []int) { - return file_did_v1_types_proto_rawDescGZIP(), []int{1} + return file_did_v1_types_proto_rawDescGZIP(), []int{4} } func (x *VerificationMethod) GetId() string { @@ -2083,51 +4599,87 @@ var file_did_v1_types_proto_rawDesc = []byte{ 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x02, 0x0a, - 0x0c, 0x42, 0x61, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4d, 0x0a, - 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x0e, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, - 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, - 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, - 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8f, 0x02, 0x0a, 0x12, 0x56, 0x65, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x01, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0xa6, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x4d, 0x0a, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, - 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, - 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x7a, 0x0a, 0x0a, 0x63, - 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, - 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, + 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd9, + 0x01, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x0b, + 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x4d, 0x0a, 0x14, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x65, 0x0a, 0x06, 0x50, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x22, 0x8f, 0x02, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, + 0x73, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, + 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, + 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, + 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, + 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2142,20 +4694,25 @@ func file_did_v1_types_proto_rawDescGZIP() []byte { return file_did_v1_types_proto_rawDescData } -var file_did_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_did_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_did_v1_types_proto_goTypes = []interface{}{ - (*BaseDocument)(nil), // 0: did.v1.BaseDocument - (*VerificationMethod)(nil), // 1: did.v1.VerificationMethod - nil, // 2: did.v1.VerificationMethod.PublicKeyJwksEntry + (*Credential)(nil), // 0: did.v1.Credential + (*Document)(nil), // 1: did.v1.Document + (*Identity)(nil), // 2: did.v1.Identity + (*PubKey)(nil), // 3: did.v1.PubKey + (*VerificationMethod)(nil), // 4: did.v1.VerificationMethod + nil, // 5: did.v1.VerificationMethod.PublicKeyJwksEntry } var file_did_v1_types_proto_depIdxs = []int32{ - 1, // 0: did.v1.BaseDocument.verification_methods:type_name -> did.v1.VerificationMethod - 2, // 1: did.v1.VerificationMethod.public_key_jwks:type_name -> did.v1.VerificationMethod.PublicKeyJwksEntry - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 0: did.v1.Document.verification_methods:type_name -> did.v1.VerificationMethod + 0, // 1: did.v1.Identity.credentials:type_name -> did.v1.Credential + 4, // 2: did.v1.Identity.verification_methods:type_name -> did.v1.VerificationMethod + 5, // 3: did.v1.VerificationMethod.public_key_jwks:type_name -> did.v1.VerificationMethod.PublicKeyJwksEntry + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_did_v1_types_proto_init() } @@ -2166,7 +4723,7 @@ func file_did_v1_types_proto_init() { file_did_v1_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaseDocument); i { + switch v := v.(*Credential); i { case 0: return &v.state case 1: @@ -2178,6 +4735,42 @@ func file_did_v1_types_proto_init() { } } file_did_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Identity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VerificationMethod); i { case 0: return &v.state @@ -2196,7 +4789,7 @@ func file_did_v1_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_types_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/devbox.json b/devbox.json index 2d7543be6..f3fc2b666 100644 --- a/devbox.json +++ b/devbox.json @@ -1,12 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.10.5/.schema/devbox.schema.json", - "packages": [ - "ipfs@latest", - "golangci-lint@latest", - "go@1.21", - "templ@latest", - "air@latest" - ], + "packages": ["golangci-lint@latest", "go@1.21", "templ@latest", "air@latest"], "env": { "GOPATH": "$HOME/go", "PATH": "$HOME/go/bin:$PATH" @@ -14,7 +8,6 @@ "shell": { "scripts": { "proto": ["make proto-gen"], - "templ": ["templ generate"], "ps": ["devbox services ls"] } } diff --git a/process-compose.yml b/process-compose.yml deleted file mode 100644 index b6d152c44..000000000 --- a/process-compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: "0.5" - -processes: - ipfs: - command: ipfs daemon - restart: always - sonrd: - command: task testnet diff --git a/proto/did/v1/accounts.proto b/proto/did/v1/accounts.proto new file mode 100644 index 000000000..f189a6a7b --- /dev/null +++ b/proto/did/v1/accounts.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package did.v1; + +option go_package = "github.com/onsonr/hway/x/did/types"; diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 9ff61ffbc..2bd10adcd 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -3,6 +3,7 @@ package did.v1; import "google/api/annotations.proto"; import "did/v1/genesis.proto"; +import "did/v1/types.proto"; option go_package = "github.com/onsonr/hway/x/did/types"; @@ -13,14 +14,29 @@ service Query { option (google.api.http).get = "/did/params"; } -// Resolve queries the DID document by its id. - rpc ResolveIdentifier(QueryResolveRequest) returns (QueryResolveResponse) { - option (google.api.http).get = "/did/resolve/{id}"; + // Accounts returns associated wallet accounts with the DID. + rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { + option (google.api.http).get = "/did/{did}/accounts"; + } + + // Credentials returns associated credentials with the DID and Service Origin. + rpc Credentials(QueryCredentialsRequest) returns (QueryCredentialsResponse) { + option (google.api.http).get = "/did/{did}/{origin}/credentials"; + } + + // Identities returns associated identity with the DID. + rpc Identities(QueryIdentitiesRequest) returns (QueryIdentitiesResponse) { + option (google.api.http).get = "/did/{did}/identities"; + } + + // Resolve queries the DID document by its id. + rpc Resolve(QueryResolveRequest) returns (QueryResolveResponse) { + option (google.api.http).get = "/did/resolve/{did}"; } - // LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. - rpc WitnessCredential(QueryWitnessCredentialRequest) returns (QueryWitnessCredentialResponse) { - option (google.api.http).get = "/did/assertion/{id}/witness"; + // Service returns associated ServiceInfo for a given Origin + rpc Service(QueryServiceRequest) returns (QueryServiceResponse) { + option (google.api.http).get = "/did/service/{origin}"; } } @@ -33,35 +49,56 @@ message QueryParamsResponse { Params params = 1; } -// QueryExistsRequest is the request type for the Query/Exists RPC method. -message QueryExistsRequest { - string kind = 1; - string value = 2; +// QueryAccountsRequest is the request type for the Query/Exists RPC method. +message QueryAccountsRequest { + string did = 1; } -// QueryExistsResponse is the response type for the Query/Exists RPC method. -message QueryExistsResponse { +// QueryAccountsResponse is the response type for the Query/Exists RPC method. +message QueryAccountsResponse { bool exists = 1; } +// QueryCredentialsRequest is the request type for the Query/Exists RPC method. +message QueryCredentialsRequest { + string did = 1; + string origin = 2; +} + +// QueryCredentialsResponse is the response type for the Query/Exists RPC method. +message QueryCredentialsResponse { + map credentials = 1; +} + +// QueryIdentitiesRequest is the request type for the Query/Exists RPC method. +message QueryIdentitiesRequest { + string did = 1; +} + +// QueryIdentitiesResponse is the response type for the Query/Exists RPC method. +message QueryIdentitiesResponse { + bool exists = 1; + repeated VerificationMethod verificationMethod = 2; +} + // QueryResolveRequest is the request type for the Query/Resolve RPC method. message QueryResolveRequest { - string id = 1; + string did = 1; } // QueryResolveResponse is the response type for the Query/Resolve RPC method. message QueryResolveResponse { // document is the DID document - string document = 1; + Document document = 1; } -// QueryLoginOptionsRequest is the request type for the Query/LoginOptions RPC method. -message QueryWitnessCredentialRequest { - string id = 1; +// QueryServiceRequest is the request type for the Query/LoginOptions RPC method. +message QueryServiceRequest { + string origin = 1; } // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. -message QueryWitnessCredentialResponse { +message QueryServiceResponse { // options is the PublicKeyCredentialAttestationOptions string options = 1; } diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 924fcb99c..9eb487d27 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -12,7 +12,7 @@ message Aliases { option (cosmos.orm.v1.table) = { id: 1 primary_key: {fields: "id"} - index: { id: 1, fields: "handle", unique: true } + index: { id: 1, fields: "subject", unique: true } }; // The unique identifier of the alias @@ -21,8 +21,8 @@ message Aliases { // Origin is the Alias provider string origin = 2; - // Handle is the user defined alias - string handle = 3; + // Subject is the user defined alias + string subject = 3; // Controller of the alias string controller = 4; diff --git a/proto/did/v1/types.proto b/proto/did/v1/types.proto index 32994f964..5f44ce332 100644 --- a/proto/did/v1/types.proto +++ b/proto/did/v1/types.proto @@ -9,9 +9,19 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/onsonr/hway/x/did/types"; +// Credential defines a WebAuthn credential +message Credential { + string id = 1; + string credential_type = 2; + bytes credential_id = 3; + repeated string transport = 4; + string attestation_type = 5; + string display_name = 6; + string controller = 7; +} -// BaseDocument defines a DID document -message BaseDocument { +// Document defines a DID document +message Document { string id = 1; repeated VerificationMethod verification_methods = 2; repeated string authentication = 4; @@ -20,6 +30,23 @@ message BaseDocument { repeated string capability_invocation = 8; } +// Identity defines an associated profile for a did subject +message Identity { + string id = 1; + string subject = 2; + string controller = 3; + repeated Credential credentials = 4; + repeated VerificationMethod verification_methods = 5; +} + +// PubKey defines a public key for a did +message PubKey { + string id = 1; + bytes key = 2; + string key_type = 3; + string controller = 4; +} + // VerificationMethod defines a verification method message VerificationMethod { string id = 1; diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index c2f402fea..9833169ce 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -31,23 +31,32 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type return &types.QueryParamsResponse{Params: &p}, nil } -// PropertyExists implements types.QueryServer. -func (k Querier) PropertyExists(goCtx context.Context, req *types.QueryExistsRequest) (*types.QueryExistsResponse, error) { +// Accounts implements types.QueryServer. +func (k Querier) Accounts(goCtx context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("PropertyExists is unimplemented") - return &types.QueryExistsResponse{}, nil + return &types.QueryAccountsResponse{}, nil } -// ResolveIdentifier implements types.QueryServer. -func (k Querier) ResolveIdentifier(goCtx context.Context, req *types.QueryResolveRequest) (*types.QueryResolveResponse, error) { +// Credentials implements types.QueryServer. +func (k Querier) Credentials(goCtx context.Context, req *types.QueryCredentialsRequest) (*types.QueryCredentialsResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + return &types.QueryCredentialsResponse{}, nil +} + +// Identities implements types.QueryServer. +func (k Querier) Identities(goCtx context.Context, req *types.QueryIdentitiesRequest) (*types.QueryIdentitiesResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + return &types.QueryIdentitiesResponse{}, nil +} + +// Resolve implements types.QueryServer. +func (k Querier) Resolve(goCtx context.Context, req *types.QueryResolveRequest) (*types.QueryResolveResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("ResolveIdentifier is unimplemented") return &types.QueryResolveResponse{}, nil } -// WitnessCredential implements types.QueryServer. -func (k Querier) WitnessCredential(goCtx context.Context, req *types.QueryWitnessCredentialRequest) (*types.QueryWitnessCredentialResponse, error) { +// Service implements types.QueryServer. +func (k Querier) Service(goCtx context.Context, req *types.QueryServiceRequest) (*types.QueryServiceResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("WitnessCredential is unimplemented") - return &types.QueryWitnessCredentialResponse{}, nil + return &types.QueryServiceResponse{}, nil } diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index 5888ae209..956baa4f5 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -3,9 +3,11 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "cosmossdk.io/errors" + didv1 "github.com/onsonr/hway/api/did/v1" "github.com/onsonr/hway/x/did/types" ) @@ -29,23 +31,33 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams return nil, ms.k.Params.Set(ctx, msg.Params) } -// RegisterController implements types.MsgServer. -func (ms msgServer) RegisterController(ctx context.Context, msg *types.MsgRegisterController) (*types.MsgRegisterControllerResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - panic("RegisterController is unimplemented") - return &types.MsgRegisterControllerResponse{}, nil -} - // Authenticate implements types.MsgServer. func (ms msgServer) Authenticate(ctx context.Context, msg *types.MsgAuthenticate) (*types.MsgAuthenticateResponse, error) { + if ms.k.authority != msg.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) + } // ctx := sdk.UnwrapSDKContext(goCtx) - panic("Authenticate is unimplemented") return &types.MsgAuthenticateResponse{}, nil } +// RegisterController implements types.MsgServer. +func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegisterController) (*types.MsgRegisterControllerResponse, error) { + if ms.k.authority != msg.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + svc := didv1.Service{ + ControllerDid: msg.Authority, + } + ms.k.OrmDB.ServiceTable().Insert(ctx, &svc) + return &types.MsgRegisterControllerResponse{}, nil +} + // RegisterService implements types.MsgServer. func (ms msgServer) RegisterService(ctx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) { + if ms.k.authority != msg.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) + } // ctx := sdk.UnwrapSDKContext(goCtx) - panic("RegisterService is unimplemented") return &types.MsgRegisterServiceResponse{}, nil } diff --git a/x/did/keeper/state.go b/x/did/keeper/state.go index b55569d4a..b64f6c9e5 100644 --- a/x/did/keeper/state.go +++ b/x/did/keeper/state.go @@ -1 +1,16 @@ package keeper + +func (k Keeper) insertAliasFromDisplayName() { +} + +func (k Keeper) insertAssertionFromIdentity() { +} + +func (k Keeper) insertAuthenticationFromCredential() { +} + +func (k Keeper) insertControllerFromMotrVault() { +} + +func (k Keeper) insertDelegationFromAccount() { +} diff --git a/x/did/types/accounts.pb.go b/x/did/types/accounts.pb.go new file mode 100644 index 000000000..bdef8a1e6 --- /dev/null +++ b/x/did/types/accounts.pb.go @@ -0,0 +1,35 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: did/v1/accounts.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) } + +var fileDescriptor_2125a09fb14c3bc3 = []byte{ + // 122 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1, + 0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x74, 0xb2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, + 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, + 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, + 0x5c, 0xfd, 0xfc, 0xbc, 0xe2, 0xfc, 0xbc, 0x22, 0xfd, 0x8c, 0xf2, 0xc4, 0x4a, 0xfd, 0x0a, 0x7d, + 0x90, 0x89, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xc3, 0x8c, 0x01, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x28, 0xd1, 0x54, 0x54, 0x65, 0x00, 0x00, 0x00, +} diff --git a/x/did/types/codec.go b/x/did/types/codec.go index 303293b86..4e875afeb 100644 --- a/x/did/types/codec.go +++ b/x/did/types/codec.go @@ -34,7 +34,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, - &MsgInitializeController{}, + &MsgRegisterController{}, + &MsgRegisterService{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/did/types/msgs.go b/x/did/types/msgs.go index 1b827d9e2..e308bb52a 100644 --- a/x/did/types/msgs.go +++ b/x/did/types/msgs.go @@ -7,6 +7,10 @@ import ( var _ sdk.Msg = &MsgUpdateParams{} +// +// [UpdateParams] +// + // NewMsgUpdateParams creates new instance of MsgUpdateParams func NewMsgUpdateParams( sender sdk.Address, @@ -44,33 +48,72 @@ func (msg *MsgUpdateParams) Validate() error { return msg.Params.Validate() } -// NewMsgInitializeController creates a new instance of MsgInitializeController -func NewMsgInitializeController( +// +// [RegisterController] +// + +// NewMsgRegisterController creates a new instance of MsgRegisterController +func NewMsgRegisterController( sender sdk.Address, -) (*MsgInitializeController, error) { - return &MsgInitializeController{ +) (*MsgRegisterController, error) { + return &MsgRegisterController{ Authority: sender.String(), }, nil } // Route returns the name of the module -func (msg MsgInitializeController) Route() string { return ModuleName } +func (msg MsgRegisterController) Route() string { return ModuleName } // Type returns the the action -func (msg MsgInitializeController) Type() string { return "initialize_controller" } +func (msg MsgRegisterController) Type() string { return "initialize_controller" } // GetSignBytes implements the LegacyMsg interface. -func (msg MsgInitializeController) GetSignBytes() []byte { +func (msg MsgRegisterController) GetSignBytes() []byte { return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) } // GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg *MsgInitializeController) GetSigners() []sdk.AccAddress { +func (msg *MsgRegisterController) GetSigners() []sdk.AccAddress { addr, _ := sdk.AccAddressFromBech32(msg.Authority) return []sdk.AccAddress{addr} } // ValidateBasic does a sanity check on the provided data. -func (msg *MsgInitializeController) Validate() error { +func (msg *MsgRegisterController) Validate() error { + return nil +} + +// +// [RegisterService] +// + +// NewMsgRegisterController creates a new instance of MsgRegisterController +func NewMsgRegisterService( + sender sdk.Address, +) (*MsgRegisterService, error) { + return &MsgRegisterService{ + Authority: sender.String(), + }, nil +} + +// Route returns the name of the module +func (msg MsgRegisterService) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgRegisterService) Type() string { return "initialize_controller" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgRegisterService) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgRegisterService) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (msg *MsgRegisterService) Validate() error { return nil } diff --git a/x/did/types/perms.go b/x/did/types/perms.go index 7d3ba6518..a05a1b0d4 100644 --- a/x/did/types/perms.go +++ b/x/did/types/perms.go @@ -3,7 +3,7 @@ package types import "gopkg.in/macaroon-bakery.v2/bakery/checkers" var ( - PermissionScope_PERMISSION_SCOPEStrings = [...]string{ + PermissionScopeStrings = [...]string{ "profile.name", "identifiers.email", "identifiers.phone", @@ -19,7 +19,7 @@ var ( "admin.validator", } - StringToPermissionScope_PERMISSION_SCOPE = map[string]PermissionScope{ + StringToPermissionScope = map[string]PermissionScope{ "PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, "PERMISSION_SCOPE_PROFILE_NAME": PermissionScope_PERMISSION_SCOPE_PROFILE_NAME, "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_EMAIL, @@ -35,6 +35,19 @@ var ( "PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER, "PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, } - - PermissionNamespace *checkers.Namespace ) + +func ResolvePermissionScope(scope string) (PermissionScope, bool) { + uriToPrefix := make(map[string]string) + for _, scope := range PermissionScopeStrings { + uriToPrefix["https://example.com/auth/"+scope] = scope + } + PermissionNamespace := checkers.NewNamespace(uriToPrefix) + + prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope) + if !ok { + return 0, false + } + permScope, ok := StringToPermissionScope[prefix] + return permScope, ok +} diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index dc64b90fd..c820c2b90 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -111,24 +111,23 @@ func (m *QueryParamsResponse) GetParams() *Params { return nil } -// QueryExistsRequest is the request type for the Query/Exists RPC method. -type QueryExistsRequest struct { - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +// QueryAccountsRequest is the request type for the Query/Exists RPC method. +type QueryAccountsRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` } -func (m *QueryExistsRequest) Reset() { *m = QueryExistsRequest{} } -func (m *QueryExistsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryExistsRequest) ProtoMessage() {} -func (*QueryExistsRequest) Descriptor() ([]byte, []int) { +func (m *QueryAccountsRequest) Reset() { *m = QueryAccountsRequest{} } +func (m *QueryAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountsRequest) ProtoMessage() {} +func (*QueryAccountsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ae1fa9bb626e2869, []int{2} } -func (m *QueryExistsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAccountsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryExistsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryExistsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAccountsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -138,49 +137,42 @@ func (m *QueryExistsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryExistsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExistsRequest.Merge(m, src) +func (m *QueryAccountsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountsRequest.Merge(m, src) } -func (m *QueryExistsRequest) XXX_Size() int { +func (m *QueryAccountsRequest) XXX_Size() int { return m.Size() } -func (m *QueryExistsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExistsRequest.DiscardUnknown(m) +func (m *QueryAccountsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryExistsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAccountsRequest proto.InternalMessageInfo -func (m *QueryExistsRequest) GetKind() string { +func (m *QueryAccountsRequest) GetDid() string { if m != nil { - return m.Kind + return m.Did } return "" } -func (m *QueryExistsRequest) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -// QueryExistsResponse is the response type for the Query/Exists RPC method. -type QueryExistsResponse struct { +// QueryAccountsResponse is the response type for the Query/Exists RPC method. +type QueryAccountsResponse struct { Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` } -func (m *QueryExistsResponse) Reset() { *m = QueryExistsResponse{} } -func (m *QueryExistsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryExistsResponse) ProtoMessage() {} -func (*QueryExistsResponse) Descriptor() ([]byte, []int) { +func (m *QueryAccountsResponse) Reset() { *m = QueryAccountsResponse{} } +func (m *QueryAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountsResponse) ProtoMessage() {} +func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ae1fa9bb626e2869, []int{3} } -func (m *QueryExistsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAccountsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryExistsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryExistsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAccountsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -190,35 +182,231 @@ func (m *QueryExistsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryExistsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExistsResponse.Merge(m, src) +func (m *QueryAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountsResponse.Merge(m, src) } -func (m *QueryExistsResponse) XXX_Size() int { +func (m *QueryAccountsResponse) XXX_Size() int { return m.Size() } -func (m *QueryExistsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExistsResponse.DiscardUnknown(m) +func (m *QueryAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryExistsResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo -func (m *QueryExistsResponse) GetExists() bool { +func (m *QueryAccountsResponse) GetExists() bool { if m != nil { return m.Exists } return false } +// QueryCredentialsRequest is the request type for the Query/Exists RPC method. +type QueryCredentialsRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` +} + +func (m *QueryCredentialsRequest) Reset() { *m = QueryCredentialsRequest{} } +func (m *QueryCredentialsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCredentialsRequest) ProtoMessage() {} +func (*QueryCredentialsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{4} +} +func (m *QueryCredentialsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCredentialsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCredentialsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCredentialsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCredentialsRequest.Merge(m, src) +} +func (m *QueryCredentialsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCredentialsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCredentialsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCredentialsRequest proto.InternalMessageInfo + +func (m *QueryCredentialsRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +func (m *QueryCredentialsRequest) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +// QueryCredentialsResponse is the response type for the Query/Exists RPC method. +type QueryCredentialsResponse struct { + Credentials map[string][]byte `protobuf:"bytes,1,rep,name=credentials,proto3" json:"credentials,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryCredentialsResponse) Reset() { *m = QueryCredentialsResponse{} } +func (m *QueryCredentialsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCredentialsResponse) ProtoMessage() {} +func (*QueryCredentialsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{5} +} +func (m *QueryCredentialsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCredentialsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCredentialsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCredentialsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCredentialsResponse.Merge(m, src) +} +func (m *QueryCredentialsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCredentialsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCredentialsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCredentialsResponse proto.InternalMessageInfo + +func (m *QueryCredentialsResponse) GetCredentials() map[string][]byte { + if m != nil { + return m.Credentials + } + return nil +} + +// QueryIdentitiesRequest is the request type for the Query/Exists RPC method. +type QueryIdentitiesRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` +} + +func (m *QueryIdentitiesRequest) Reset() { *m = QueryIdentitiesRequest{} } +func (m *QueryIdentitiesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIdentitiesRequest) ProtoMessage() {} +func (*QueryIdentitiesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{6} +} +func (m *QueryIdentitiesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIdentitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIdentitiesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIdentitiesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIdentitiesRequest.Merge(m, src) +} +func (m *QueryIdentitiesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIdentitiesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIdentitiesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIdentitiesRequest proto.InternalMessageInfo + +func (m *QueryIdentitiesRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +// QueryIdentitiesResponse is the response type for the Query/Exists RPC method. +type QueryIdentitiesResponse struct { + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + VerificationMethod []*VerificationMethod `protobuf:"bytes,2,rep,name=verificationMethod,proto3" json:"verificationMethod,omitempty"` +} + +func (m *QueryIdentitiesResponse) Reset() { *m = QueryIdentitiesResponse{} } +func (m *QueryIdentitiesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIdentitiesResponse) ProtoMessage() {} +func (*QueryIdentitiesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{7} +} +func (m *QueryIdentitiesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIdentitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIdentitiesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIdentitiesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIdentitiesResponse.Merge(m, src) +} +func (m *QueryIdentitiesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIdentitiesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIdentitiesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIdentitiesResponse proto.InternalMessageInfo + +func (m *QueryIdentitiesResponse) GetExists() bool { + if m != nil { + return m.Exists + } + return false +} + +func (m *QueryIdentitiesResponse) GetVerificationMethod() []*VerificationMethod { + if m != nil { + return m.VerificationMethod + } + return nil +} + // QueryResolveRequest is the request type for the Query/Resolve RPC method. type QueryResolveRequest struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` } func (m *QueryResolveRequest) Reset() { *m = QueryResolveRequest{} } func (m *QueryResolveRequest) String() string { return proto.CompactTextString(m) } func (*QueryResolveRequest) ProtoMessage() {} func (*QueryResolveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{4} + return fileDescriptor_ae1fa9bb626e2869, []int{8} } func (m *QueryResolveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -247,9 +435,9 @@ func (m *QueryResolveRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryResolveRequest proto.InternalMessageInfo -func (m *QueryResolveRequest) GetId() string { +func (m *QueryResolveRequest) GetDid() string { if m != nil { - return m.Id + return m.Did } return "" } @@ -257,14 +445,14 @@ func (m *QueryResolveRequest) GetId() string { // QueryResolveResponse is the response type for the Query/Resolve RPC method. type QueryResolveResponse struct { // document is the DID document - Document string `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` + Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` } func (m *QueryResolveResponse) Reset() { *m = QueryResolveResponse{} } func (m *QueryResolveResponse) String() string { return proto.CompactTextString(m) } func (*QueryResolveResponse) ProtoMessage() {} func (*QueryResolveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{5} + return fileDescriptor_ae1fa9bb626e2869, []int{9} } func (m *QueryResolveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -293,30 +481,30 @@ func (m *QueryResolveResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryResolveResponse proto.InternalMessageInfo -func (m *QueryResolveResponse) GetDocument() string { +func (m *QueryResolveResponse) GetDocument() *Document { if m != nil { return m.Document } - return "" + return nil } -// QueryLoginOptionsRequest is the request type for the Query/LoginOptions RPC method. -type QueryWitnessCredentialRequest struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +// QueryServiceRequest is the request type for the Query/LoginOptions RPC method. +type QueryServiceRequest struct { + Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"` } -func (m *QueryWitnessCredentialRequest) Reset() { *m = QueryWitnessCredentialRequest{} } -func (m *QueryWitnessCredentialRequest) String() string { return proto.CompactTextString(m) } -func (*QueryWitnessCredentialRequest) ProtoMessage() {} -func (*QueryWitnessCredentialRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{6} +func (m *QueryServiceRequest) Reset() { *m = QueryServiceRequest{} } +func (m *QueryServiceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryServiceRequest) ProtoMessage() {} +func (*QueryServiceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{10} } -func (m *QueryWitnessCredentialRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryServiceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryWitnessCredentialRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryWitnessCredentialRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -326,43 +514,43 @@ func (m *QueryWitnessCredentialRequest) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryWitnessCredentialRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryWitnessCredentialRequest.Merge(m, src) +func (m *QueryServiceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceRequest.Merge(m, src) } -func (m *QueryWitnessCredentialRequest) XXX_Size() int { +func (m *QueryServiceRequest) XXX_Size() int { return m.Size() } -func (m *QueryWitnessCredentialRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryWitnessCredentialRequest.DiscardUnknown(m) +func (m *QueryServiceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryWitnessCredentialRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryServiceRequest proto.InternalMessageInfo -func (m *QueryWitnessCredentialRequest) GetId() string { +func (m *QueryServiceRequest) GetOrigin() string { if m != nil { - return m.Id + return m.Origin } return "" } // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. -type QueryWitnessCredentialResponse struct { +type QueryServiceResponse struct { // options is the PublicKeyCredentialAttestationOptions Options string `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (m *QueryWitnessCredentialResponse) Reset() { *m = QueryWitnessCredentialResponse{} } -func (m *QueryWitnessCredentialResponse) String() string { return proto.CompactTextString(m) } -func (*QueryWitnessCredentialResponse) ProtoMessage() {} -func (*QueryWitnessCredentialResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{7} +func (m *QueryServiceResponse) Reset() { *m = QueryServiceResponse{} } +func (m *QueryServiceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryServiceResponse) ProtoMessage() {} +func (*QueryServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{11} } -func (m *QueryWitnessCredentialResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryServiceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryWitnessCredentialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryWitnessCredentialResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -372,19 +560,19 @@ func (m *QueryWitnessCredentialResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *QueryWitnessCredentialResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryWitnessCredentialResponse.Merge(m, src) +func (m *QueryServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceResponse.Merge(m, src) } -func (m *QueryWitnessCredentialResponse) XXX_Size() int { +func (m *QueryServiceResponse) XXX_Size() int { return m.Size() } -func (m *QueryWitnessCredentialResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryWitnessCredentialResponse.DiscardUnknown(m) +func (m *QueryServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryWitnessCredentialResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryServiceResponse proto.InternalMessageInfo -func (m *QueryWitnessCredentialResponse) GetOptions() string { +func (m *QueryServiceResponse) GetOptions() string { if m != nil { return m.Options } @@ -394,47 +582,65 @@ func (m *QueryWitnessCredentialResponse) GetOptions() string { func init() { proto.RegisterType((*QueryParamsRequest)(nil), "did.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") - proto.RegisterType((*QueryExistsRequest)(nil), "did.v1.QueryExistsRequest") - proto.RegisterType((*QueryExistsResponse)(nil), "did.v1.QueryExistsResponse") + proto.RegisterType((*QueryAccountsRequest)(nil), "did.v1.QueryAccountsRequest") + proto.RegisterType((*QueryAccountsResponse)(nil), "did.v1.QueryAccountsResponse") + proto.RegisterType((*QueryCredentialsRequest)(nil), "did.v1.QueryCredentialsRequest") + proto.RegisterType((*QueryCredentialsResponse)(nil), "did.v1.QueryCredentialsResponse") + proto.RegisterMapType((map[string][]byte)(nil), "did.v1.QueryCredentialsResponse.CredentialsEntry") + proto.RegisterType((*QueryIdentitiesRequest)(nil), "did.v1.QueryIdentitiesRequest") + proto.RegisterType((*QueryIdentitiesResponse)(nil), "did.v1.QueryIdentitiesResponse") proto.RegisterType((*QueryResolveRequest)(nil), "did.v1.QueryResolveRequest") proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse") - proto.RegisterType((*QueryWitnessCredentialRequest)(nil), "did.v1.QueryWitnessCredentialRequest") - proto.RegisterType((*QueryWitnessCredentialResponse)(nil), "did.v1.QueryWitnessCredentialResponse") + proto.RegisterType((*QueryServiceRequest)(nil), "did.v1.QueryServiceRequest") + proto.RegisterType((*QueryServiceResponse)(nil), "did.v1.QueryServiceResponse") } func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 459 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0xb3, 0x8b, 0x5d, 0xeb, 0x2b, 0x16, 0x32, 0x09, 0x12, 0xb7, 0xed, 0x22, 0x23, 0x2d, - 0x5e, 0xdc, 0xa1, 0xf1, 0x26, 0xea, 0x41, 0xf1, 0xe0, 0x4d, 0x73, 0x50, 0xf0, 0x36, 0xed, 0x3c, - 0xd3, 0xc1, 0x64, 0x66, 0xbb, 0x33, 0x9b, 0x36, 0x88, 0x17, 0x2f, 0x5e, 0x05, 0xff, 0x29, 0x8f, - 0x05, 0x3d, 0x78, 0x94, 0xc4, 0x3f, 0x44, 0xf2, 0x76, 0x56, 0x58, 0xda, 0xd0, 0x5b, 0xde, 0x8f, - 0xef, 0xf7, 0x33, 0xf9, 0x3e, 0x16, 0x98, 0xd2, 0x4a, 0xcc, 0x0e, 0xc5, 0x69, 0x85, 0xe5, 0x3c, - 0x2f, 0x4a, 0xeb, 0x2d, 0x4b, 0x94, 0x56, 0xf9, 0xec, 0x30, 0xdd, 0x1d, 0x5b, 0x3b, 0x9e, 0xa0, - 0x90, 0x85, 0x16, 0xd2, 0x18, 0xeb, 0xa5, 0xd7, 0xd6, 0xb8, 0x7a, 0x2b, 0xed, 0x07, 0xe5, 0x18, - 0x0d, 0x3a, 0x1d, 0xba, 0xbc, 0x0f, 0xec, 0xcd, 0xca, 0xea, 0xb5, 0x2c, 0xe5, 0xd4, 0x8d, 0xf0, - 0xb4, 0x42, 0xe7, 0xf9, 0x53, 0xe8, 0xb5, 0xba, 0xae, 0xb0, 0xc6, 0x21, 0x3b, 0x80, 0xa4, 0xa0, - 0xce, 0x20, 0xba, 0x17, 0x3d, 0xd8, 0x1a, 0x6e, 0xe7, 0x35, 0x39, 0x0f, 0x7b, 0x61, 0xca, 0x9f, - 0x05, 0xd3, 0x97, 0xe7, 0xda, 0xf9, 0xc6, 0x94, 0x31, 0xb8, 0xf1, 0x51, 0x1b, 0x45, 0xda, 0x5b, - 0x23, 0xfa, 0xcd, 0xfa, 0xb0, 0x31, 0x93, 0x93, 0x0a, 0x07, 0x31, 0x35, 0xeb, 0x82, 0x3f, 0x0c, - 0xf8, 0x46, 0x1f, 0xf0, 0x77, 0x20, 0x41, 0xea, 0x90, 0xc5, 0xe6, 0x28, 0x54, 0x7c, 0x3f, 0xac, - 0x8f, 0xd0, 0xd9, 0xc9, 0x0c, 0x1b, 0xde, 0x36, 0xc4, 0xba, 0xa1, 0xc5, 0x5a, 0xf1, 0x21, 0xf4, - 0xdb, 0x6b, 0xc1, 0x36, 0x85, 0x4d, 0x65, 0x8f, 0xab, 0x29, 0x1a, 0x1f, 0xb6, 0xff, 0xd7, 0x5c, - 0xc0, 0x1e, 0x69, 0xde, 0x69, 0x6f, 0xd0, 0xb9, 0x17, 0x25, 0x2a, 0x34, 0x5e, 0xcb, 0xc9, 0x3a, - 0xc8, 0x63, 0xc8, 0xd6, 0x09, 0x02, 0x6e, 0x00, 0x37, 0x6d, 0x41, 0x87, 0x09, 0xb2, 0xa6, 0x1c, - 0xfe, 0x8a, 0x61, 0x83, 0xc4, 0xec, 0x2d, 0x24, 0x75, 0xa4, 0x2c, 0x6d, 0x22, 0xbe, 0x7c, 0xa5, - 0x74, 0xe7, 0xca, 0x59, 0x8d, 0xe1, 0xbd, 0x2f, 0x3f, 0xff, 0x7e, 0x8f, 0x6f, 0xb3, 0x2d, 0xb1, - 0xba, 0x7b, 0x7d, 0x18, 0xa6, 0xa1, 0x1b, 0xfe, 0xfd, 0x2b, 0x7a, 0xd6, 0x07, 0x8d, 0x25, 0x6b, - 0xdb, 0xb4, 0x43, 0x4c, 0x77, 0xaf, 0x1e, 0x06, 0xc8, 0x5d, 0x82, 0xf4, 0x58, 0x97, 0x20, 0x65, - 0x3d, 0x15, 0x9f, 0xb4, 0xfa, 0xcc, 0xbe, 0x46, 0xd0, 0xbd, 0x14, 0x02, 0xdb, 0x6f, 0xd9, 0xad, - 0x4b, 0x35, 0x3d, 0xb8, 0x6e, 0x2d, 0xf0, 0xef, 0x13, 0x7f, 0x8f, 0xed, 0x10, 0x5f, 0x3a, 0x87, - 0xe5, 0x2a, 0x4a, 0x7a, 0x81, 0x38, 0xab, 0x65, 0xcf, 0x9f, 0xfc, 0x58, 0x64, 0xd1, 0xc5, 0x22, - 0x8b, 0xfe, 0x2c, 0xb2, 0xe8, 0xdb, 0x32, 0xeb, 0x5c, 0x2c, 0xb3, 0xce, 0xef, 0x65, 0xd6, 0x79, - 0xcf, 0xc7, 0xda, 0x9f, 0x54, 0x47, 0xf9, 0xb1, 0x9d, 0x0a, 0x6b, 0x9c, 0x35, 0xa5, 0x38, 0x39, - 0x93, 0x73, 0x71, 0x4e, 0x76, 0x7e, 0x5e, 0xa0, 0x3b, 0x4a, 0xe8, 0x3b, 0x79, 0xf4, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0xa6, 0x3a, 0x22, 0xfd, 0x79, 0x03, 0x00, 0x00, + // 665 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x4f, 0x4f, 0xd4, 0x4e, + 0x18, 0xc7, 0xe9, 0xf2, 0x63, 0xe1, 0xf7, 0xac, 0x1a, 0x32, 0x2c, 0xb0, 0x29, 0x50, 0x70, 0x0e, + 0x42, 0x8c, 0x6e, 0x05, 0x2f, 0xc6, 0xa8, 0x89, 0x82, 0x07, 0x4d, 0x4c, 0xb4, 0x24, 0x1c, 0x3c, + 0x59, 0x3a, 0xe3, 0x32, 0x61, 0x99, 0x29, 0xed, 0xb4, 0xd2, 0x10, 0x2e, 0xbe, 0x02, 0x13, 0x5f, + 0x88, 0x6f, 0xc3, 0x23, 0x89, 0x17, 0x8f, 0x06, 0x7c, 0x0b, 0xde, 0xcd, 0xce, 0x4c, 0x77, 0xdb, + 0xb2, 0xc5, 0x5b, 0xe7, 0xf9, 0xf3, 0xfd, 0x3c, 0x33, 0xf3, 0x9d, 0x02, 0x22, 0x8c, 0xb8, 0xe9, + 0xa6, 0x7b, 0x9c, 0xd0, 0x28, 0xeb, 0x86, 0x91, 0x90, 0x02, 0x35, 0x09, 0x23, 0xdd, 0x74, 0xd3, + 0x5e, 0xee, 0x09, 0xd1, 0xeb, 0x53, 0xd7, 0x0f, 0x99, 0xeb, 0x73, 0x2e, 0xa4, 0x2f, 0x99, 0xe0, + 0xb1, 0xae, 0xb2, 0xdb, 0xa6, 0xb3, 0x47, 0x39, 0x8d, 0x59, 0x1e, 0xcd, 0xf5, 0x64, 0x16, 0x52, + 0x13, 0xc3, 0x6d, 0x40, 0xef, 0x06, 0xf2, 0x6f, 0xfd, 0xc8, 0x3f, 0x8a, 0x3d, 0x7a, 0x9c, 0xd0, + 0x58, 0xe2, 0xa7, 0x30, 0x57, 0x8a, 0xc6, 0xa1, 0xe0, 0x31, 0x45, 0x77, 0xa0, 0x19, 0xaa, 0x48, + 0xc7, 0x5a, 0xb3, 0x36, 0x5a, 0x5b, 0xb7, 0xba, 0x7a, 0x9a, 0xae, 0xa9, 0x33, 0x59, 0xbc, 0x01, + 0x6d, 0xd5, 0xfe, 0x3c, 0x08, 0x44, 0xc2, 0x65, 0x2e, 0x8b, 0x66, 0x61, 0x92, 0x30, 0xa2, 0x9a, + 0xff, 0xf7, 0x06, 0x9f, 0xd8, 0x85, 0xf9, 0x4a, 0xa5, 0x41, 0x2d, 0x40, 0x93, 0x9e, 0xb0, 0x58, + 0x6a, 0xd4, 0x8c, 0x67, 0x56, 0x78, 0x1b, 0x16, 0x55, 0xc3, 0x76, 0x44, 0x09, 0xe5, 0x92, 0xf9, + 0xfd, 0x7a, 0xf5, 0x81, 0x88, 0x88, 0x58, 0x8f, 0xf1, 0x4e, 0x43, 0x05, 0xcd, 0x0a, 0x7f, 0xb3, + 0xa0, 0x73, 0x55, 0xc5, 0x90, 0x77, 0xa1, 0x15, 0x8c, 0xc2, 0x1d, 0x6b, 0x6d, 0x72, 0xa3, 0xb5, + 0xb5, 0x99, 0xef, 0xb4, 0xae, 0xad, 0x5b, 0x88, 0xbd, 0xe4, 0x32, 0xca, 0xbc, 0xa2, 0x8a, 0xfd, + 0x0c, 0x66, 0xab, 0x05, 0x83, 0x79, 0x0f, 0x69, 0x96, 0xcf, 0x7b, 0x48, 0x33, 0xd4, 0x86, 0xa9, + 0xd4, 0xef, 0x27, 0x54, 0x8d, 0x7b, 0xc3, 0xd3, 0x8b, 0xc7, 0x8d, 0x47, 0x16, 0xbe, 0x0b, 0x0b, + 0x8a, 0xfc, 0x4a, 0x49, 0x48, 0x46, 0xaf, 0x39, 0xd3, 0x33, 0x73, 0x44, 0xc5, 0xda, 0xeb, 0x4f, + 0x15, 0xbd, 0x06, 0x94, 0xd2, 0x88, 0x7d, 0x64, 0x81, 0xb2, 0xd1, 0x1b, 0x2a, 0x0f, 0x04, 0xe9, + 0x34, 0xd4, 0xd6, 0xed, 0x7c, 0xeb, 0x7b, 0x57, 0x2a, 0xbc, 0x31, 0x5d, 0x78, 0xdd, 0x78, 0xc7, + 0xa3, 0xb1, 0xe8, 0xa7, 0xb4, 0x7e, 0xce, 0x1d, 0xe3, 0x92, 0x61, 0xa1, 0x19, 0xf2, 0x1e, 0xcc, + 0x10, 0x11, 0x24, 0x47, 0x94, 0x4b, 0xe3, 0xb3, 0xd9, 0x7c, 0x84, 0x1d, 0x13, 0xf7, 0x86, 0x15, + 0xf8, 0xbe, 0xc1, 0xed, 0xd2, 0x28, 0x65, 0xc1, 0x10, 0x37, 0xba, 0x7a, 0xab, 0x74, 0xf5, 0x0f, + 0x0c, 0x74, 0x58, 0x6e, 0xa0, 0x1d, 0x98, 0x16, 0xa1, 0x7a, 0x42, 0xa6, 0x21, 0x5f, 0x6e, 0xfd, + 0xf9, 0x0f, 0xa6, 0x54, 0x0b, 0xda, 0x83, 0xa6, 0x36, 0x3a, 0xb2, 0x4b, 0x76, 0x28, 0xbd, 0x1d, + 0x7b, 0x69, 0x6c, 0x4e, 0x63, 0xf0, 0xdc, 0xe7, 0x1f, 0xbf, 0xbf, 0x36, 0x6e, 0xa2, 0x96, 0x3b, + 0x78, 0x8b, 0xfa, 0xb9, 0x20, 0x02, 0x33, 0xb9, 0xff, 0xd1, 0x72, 0xa9, 0xbb, 0xf2, 0x80, 0xec, + 0x95, 0x9a, 0xac, 0x51, 0x5f, 0x52, 0xea, 0xf3, 0x68, 0x4e, 0xa9, 0x9f, 0x12, 0x46, 0xce, 0x5c, + 0x3f, 0x57, 0xce, 0xa0, 0x55, 0xb0, 0x20, 0x5a, 0xad, 0x77, 0xb4, 0x66, 0xad, 0xfd, 0xcb, 0xf2, + 0x78, 0x5d, 0xe1, 0x6e, 0xa3, 0xd5, 0x02, 0xee, 0x54, 0x9f, 0xf3, 0x99, 0x5b, 0x70, 0x3f, 0xea, + 0x03, 0x8c, 0xcc, 0x88, 0x9c, 0x92, 0xf0, 0x15, 0x47, 0xdb, 0xab, 0xb5, 0x79, 0xc3, 0x5d, 0x51, + 0xdc, 0x45, 0x34, 0x5f, 0xe0, 0xb2, 0x91, 0xfe, 0x07, 0x98, 0x36, 0x96, 0x42, 0xe5, 0xbb, 0x28, + 0x3b, 0xd2, 0x5e, 0x1e, 0x9f, 0x34, 0x10, 0x5b, 0x41, 0xda, 0x08, 0x29, 0x48, 0xa4, 0xb3, 0x1a, + 0x86, 0x02, 0x98, 0x36, 0xfe, 0xa9, 0x10, 0xca, 0x26, 0xac, 0x10, 0x2a, 0x96, 0xab, 0x6c, 0x23, + 0xd6, 0xd9, 0xe1, 0x01, 0xbe, 0x78, 0xf2, 0xfd, 0xc2, 0xb1, 0xce, 0x2f, 0x1c, 0xeb, 0xd7, 0x85, + 0x63, 0x7d, 0xb9, 0x74, 0x26, 0xce, 0x2f, 0x9d, 0x89, 0x9f, 0x97, 0xce, 0xc4, 0x7b, 0xdc, 0x63, + 0xf2, 0x20, 0xd9, 0xef, 0x06, 0xe2, 0xc8, 0x15, 0x3c, 0x16, 0x3c, 0x72, 0x0f, 0x3e, 0xf9, 0x99, + 0x7b, 0xa2, 0x84, 0xd4, 0xdf, 0x7d, 0xbf, 0xa9, 0x7e, 0xef, 0x0f, 0xff, 0x06, 0x00, 0x00, 0xff, + 0xff, 0x70, 0x63, 0x8a, 0x47, 0x44, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -451,10 +657,16 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Accounts returns associated wallet accounts with the DID. + Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) + // Credentials returns associated credentials with the DID and Service Origin. + Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) + // Identities returns associated identity with the DID. + Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) // Resolve queries the DID document by its id. - ResolveIdentifier(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. - WitnessCredential(ctx context.Context, in *QueryWitnessCredentialRequest, opts ...grpc.CallOption) (*QueryWitnessCredentialResponse, error) + Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) + // Service returns associated ServiceInfo for a given Origin + Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) } type queryClient struct { @@ -474,18 +686,45 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) ResolveIdentifier(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { - out := new(QueryResolveResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/ResolveIdentifier", in, out, opts...) +func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { + out := new(QueryAccountsResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Accounts", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) WitnessCredential(ctx context.Context, in *QueryWitnessCredentialRequest, opts ...grpc.CallOption) (*QueryWitnessCredentialResponse, error) { - out := new(QueryWitnessCredentialResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/WitnessCredential", in, out, opts...) +func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { + out := new(QueryCredentialsResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Credentials", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) { + out := new(QueryIdentitiesResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Identities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { + out := new(QueryResolveResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Resolve", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { + out := new(QueryServiceResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Service", in, out, opts...) if err != nil { return nil, err } @@ -496,10 +735,16 @@ func (c *queryClient) WitnessCredential(ctx context.Context, in *QueryWitnessCre type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Accounts returns associated wallet accounts with the DID. + Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) + // Credentials returns associated credentials with the DID and Service Origin. + Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) + // Identities returns associated identity with the DID. + Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) // Resolve queries the DID document by its id. - ResolveIdentifier(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) - // LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. - WitnessCredential(context.Context, *QueryWitnessCredentialRequest) (*QueryWitnessCredentialResponse, error) + Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) + // Service returns associated ServiceInfo for a given Origin + Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -509,11 +754,20 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) ResolveIdentifier(ctx context.Context, req *QueryResolveRequest) (*QueryResolveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResolveIdentifier not implemented") +func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccountsRequest) (*QueryAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") } -func (*UnimplementedQueryServer) WitnessCredential(ctx context.Context, req *QueryWitnessCredentialRequest) (*QueryWitnessCredentialResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WitnessCredential not implemented") +func (*UnimplementedQueryServer) Credentials(ctx context.Context, req *QueryCredentialsRequest) (*QueryCredentialsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") +} +func (*UnimplementedQueryServer) Identities(ctx context.Context, req *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Identities not implemented") +} +func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryResolveRequest) (*QueryResolveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") +} +func (*UnimplementedQueryServer) Service(ctx context.Context, req *QueryServiceRequest) (*QueryServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -538,38 +792,92 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_ResolveIdentifier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Accounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Accounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCredentialsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Credentials(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Credentials", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Credentials(ctx, req.(*QueryCredentialsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Identities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIdentitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Identities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Identities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Identities(ctx, req.(*QueryIdentitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryResolveRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ResolveIdentifier(ctx, in) + return srv.(QueryServer).Resolve(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/did.v1.Query/ResolveIdentifier", + FullMethod: "/did.v1.Query/Resolve", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ResolveIdentifier(ctx, req.(*QueryResolveRequest)) + return srv.(QueryServer).Resolve(ctx, req.(*QueryResolveRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_WitnessCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryWitnessCredentialRequest) +func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryServiceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).WitnessCredential(ctx, in) + return srv.(QueryServer).Service(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/did.v1.Query/WitnessCredential", + FullMethod: "/did.v1.Query/Service", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).WitnessCredential(ctx, req.(*QueryWitnessCredentialRequest)) + return srv.(QueryServer).Service(ctx, req.(*QueryServiceRequest)) } return interceptor(ctx, in, info, handler) } @@ -583,12 +891,24 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "ResolveIdentifier", - Handler: _Query_ResolveIdentifier_Handler, + MethodName: "Accounts", + Handler: _Query_Accounts_Handler, }, { - MethodName: "WitnessCredential", - Handler: _Query_WitnessCredential_Handler, + MethodName: "Credentials", + Handler: _Query_Credentials_Handler, + }, + { + MethodName: "Identities", + Handler: _Query_Identities_Handler, + }, + { + MethodName: "Resolve", + Handler: _Query_Resolve_Handler, + }, + { + MethodName: "Service", + Handler: _Query_Service_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -653,7 +973,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryExistsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAccountsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -663,34 +983,27 @@ func (m *QueryExistsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryExistsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAccountsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryExistsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAccountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Kind))) + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryExistsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAccountsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -700,12 +1013,12 @@ func (m *QueryExistsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryExistsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAccountsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryExistsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -723,6 +1036,164 @@ func (m *QueryExistsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryCredentialsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCredentialsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCredentialsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCredentialsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCredentialsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCredentialsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Credentials) > 0 { + for k := range m.Credentials { + v := m.Credentials[k] + baseI := i + if len(v) > 0 { + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryIdentitiesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIdentitiesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIdentitiesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIdentitiesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIdentitiesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIdentitiesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VerificationMethod) > 0 { + for iNdEx := len(m.VerificationMethod) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VerificationMethod[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Exists { + i-- + if m.Exists { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *QueryResolveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -743,10 +1214,10 @@ func (m *QueryResolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) i-- dAtA[i] = 0xa } @@ -773,17 +1244,22 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Document) > 0 { - i -= len(m.Document) - copy(dAtA[i:], m.Document) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Document))) + if m.Document != nil { + { + size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryWitnessCredentialRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -793,27 +1269,27 @@ func (m *QueryWitnessCredentialRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryWitnessCredentialRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryServiceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryWitnessCredentialRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryWitnessCredentialResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -823,12 +1299,12 @@ func (m *QueryWitnessCredentialResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryWitnessCredentialResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryServiceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryWitnessCredentialResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -876,24 +1352,20 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryExistsRequest) Size() (n int) { +func (m *QueryAccountsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Value) + l = len(m.Did) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryExistsResponse) Size() (n int) { +func (m *QueryAccountsResponse) Size() (n int) { if m == nil { return 0 } @@ -905,13 +1377,82 @@ func (m *QueryExistsResponse) Size() (n int) { return n } +func (m *QueryCredentialsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCredentialsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Credentials) > 0 { + for k, v := range m.Credentials { + _ = k + _ = v + l = 0 + if len(v) > 0 { + l = 1 + len(v) + sovQuery(uint64(len(v))) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryIdentitiesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryIdentitiesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Exists { + n += 2 + } + if len(m.VerificationMethod) > 0 { + for _, e := range m.VerificationMethod { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryResolveRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Id) + l = len(m.Did) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -924,27 +1465,27 @@ func (m *QueryResolveResponse) Size() (n int) { } var l int _ = l - l = len(m.Document) - if l > 0 { + if m.Document != nil { + l = m.Document.Size() n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryWitnessCredentialRequest) Size() (n int) { +func (m *QueryServiceRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Id) + l = len(m.Origin) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryWitnessCredentialResponse) Size() (n int) { +func (m *QueryServiceResponse) Size() (n int) { if m == nil { return 0 } @@ -1099,7 +1640,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryExistsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAccountsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1122,15 +1663,15 @@ func (m *QueryExistsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryExistsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAccountsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExistsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAccountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1158,39 +1699,7 @@ func (m *QueryExistsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) + m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1213,7 +1722,7 @@ func (m *QueryExistsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryExistsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1236,10 +1745,10 @@ func (m *QueryExistsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryExistsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAccountsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExistsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1283,6 +1792,484 @@ func (m *QueryExistsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryCredentialsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCredentialsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCredentialsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCredentialsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCredentialsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCredentialsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Credentials == nil { + m.Credentials = make(map[string][]byte) + } + var mapkey string + mapvalue := []byte{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapbyteLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return ErrInvalidLengthQuery + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return ErrInvalidLengthQuery + } + if postbytesIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Credentials[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIdentitiesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIdentitiesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIdentitiesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIdentitiesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIdentitiesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIdentitiesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exists = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerificationMethod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VerificationMethod = append(m.VerificationMethod, &VerificationMethod{}) + if err := m.VerificationMethod[len(m.VerificationMethod)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryResolveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1314,7 +2301,7 @@ func (m *QueryResolveRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1342,7 +2329,7 @@ func (m *QueryResolveRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1398,7 +2385,7 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1408,23 +2395,27 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Document = string(dAtA[iNdEx:postIndex]) + if m.Document == nil { + m.Document = &Document{} + } + if err := m.Document.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1447,7 +2438,7 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWitnessCredentialRequest) Unmarshal(dAtA []byte) error { +func (m *QueryServiceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1470,15 +2461,15 @@ func (m *QueryWitnessCredentialRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWitnessCredentialRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryServiceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWitnessCredentialRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1506,7 +2497,7 @@ func (m *QueryWitnessCredentialRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1529,7 +2520,7 @@ func (m *QueryWitnessCredentialRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWitnessCredentialResponse) Unmarshal(dAtA []byte) error { +func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1552,10 +2543,10 @@ func (m *QueryWitnessCredentialResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWitnessCredentialResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryServiceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWitnessCredentialResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/did/types/query.pb.gw.go b/x/did/types/query.pb.gw.go index eddb7e149..5a8f31c40 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -51,7 +51,191 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + msg, err := client.Accounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + msg, err := server.Accounts(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Credentials_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCredentialsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + val, ok = pathParams["origin"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") + } + + protoReq.Origin, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) + } + + msg, err := client.Credentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Credentials_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCredentialsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + val, ok = pathParams["origin"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") + } + + protoReq.Origin, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) + } + + msg, err := server.Credentials(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Identities_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIdentitiesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + msg, err := client.Identities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Identities_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIdentitiesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + msg, err := server.Identities(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryResolveRequest var metadata runtime.ServerMetadata @@ -62,23 +246,23 @@ func request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runtime.Ma _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["did"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") } - protoReq.Id, err = runtime.String(val) + protoReq.Did, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) } - msg, err := client.ResolveIdentifier(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Resolve(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryResolveRequest var metadata runtime.ServerMetadata @@ -89,24 +273,24 @@ func local_request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["did"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") } - protoReq.Id, err = runtime.String(val) + protoReq.Did, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) } - msg, err := server.ResolveIdentifier(ctx, &protoReq) + msg, err := server.Resolve(ctx, &protoReq) return msg, metadata, err } -func request_Query_WitnessCredential_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryWitnessCredentialRequest +func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryServiceRequest var metadata runtime.ServerMetadata var ( @@ -116,24 +300,24 @@ func request_Query_WitnessCredential_0(ctx context.Context, marshaler runtime.Ma _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["origin"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") } - protoReq.Id, err = runtime.String(val) + protoReq.Origin, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) } - msg, err := client.WitnessCredential(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_WitnessCredential_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryWitnessCredentialRequest +func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryServiceRequest var metadata runtime.ServerMetadata var ( @@ -143,18 +327,18 @@ func local_request_Query_WitnessCredential_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["origin"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") } - protoReq.Id, err = runtime.String(val) + protoReq.Origin, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) } - msg, err := server.WitnessCredential(ctx, &protoReq) + msg, err := server.Service(ctx, &protoReq) return msg, metadata, err } @@ -188,7 +372,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_ResolveIdentifier_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -199,7 +383,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ResolveIdentifier_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Accounts_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -207,11 +391,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ResolveIdentifier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_WitnessCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Credentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -222,7 +406,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_WitnessCredential_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Credentials_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -230,7 +414,76 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_WitnessCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Identities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Identities_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Identities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Resolve_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Resolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Service_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -295,7 +548,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_ResolveIdentifier_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -304,18 +557,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ResolveIdentifier_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_Accounts_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_ResolveIdentifier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_WitnessCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Credentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -324,14 +577,74 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_WitnessCredential_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_Credentials_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_WitnessCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Identities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Identities_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Identities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Resolve_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Resolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Service_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -341,15 +654,27 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"did", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ResolveIdentifier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"did", "resolve", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Accounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "accounts"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_WitnessCredential_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"did", "assertion", "id", "witness"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Credentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"did", "origin", "credentials"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Identities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "identities"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 0}, []string{"did", "resolve"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"did", "service", "origin"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_ResolveIdentifier_0 = runtime.ForwardResponseMessage + forward_Query_Accounts_0 = runtime.ForwardResponseMessage - forward_Query_WitnessCredential_0 = runtime.ForwardResponseMessage + forward_Query_Credentials_0 = runtime.ForwardResponseMessage + + forward_Query_Identities_0 = runtime.ForwardResponseMessage + + forward_Query_Resolve_0 = runtime.ForwardResponseMessage + + forward_Query_Service_0 = runtime.ForwardResponseMessage ) diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index 426fd4d0e..7acc6adfb 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -29,8 +29,8 @@ type Aliases struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Origin is the Alias provider Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - // Handle is the user defined alias - Handle string `protobuf:"bytes,3,opt,name=handle,proto3" json:"handle,omitempty"` + // Subject is the user defined alias + Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` // Controller of the alias Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` // Expiration of the alias @@ -84,9 +84,9 @@ func (m *Aliases) GetOrigin() string { return "" } -func (m *Aliases) GetHandle() string { +func (m *Aliases) GetSubject() string { if m != nil { - return m.Handle + return m.Subject } return "" } @@ -566,55 +566,55 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 755 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x3f, 0x6f, 0x3b, 0x35, - 0x18, 0xc7, 0x7b, 0xb9, 0xfc, 0x7d, 0xf2, 0x87, 0x60, 0x95, 0x5f, 0x8f, 0x40, 0x43, 0x08, 0xaa, - 0x94, 0x29, 0x47, 0xcb, 0x82, 0x5a, 0x06, 0x42, 0xdb, 0x01, 0x50, 0xa5, 0x2a, 0x85, 0x85, 0x25, - 0xba, 0x9c, 0xdd, 0xc4, 0xe4, 0xce, 0x3e, 0xd9, 0x4e, 0xda, 0xdb, 0xd8, 0x91, 0x10, 0x03, 0x33, - 0x2b, 0x23, 0x6f, 0x83, 0xb1, 0x12, 0x0b, 0x03, 0x03, 0x6a, 0xdf, 0x01, 0xaf, 0x00, 0xdd, 0xd9, - 0xd7, 0x5c, 0x93, 0x02, 0xfa, 0xa9, 0x53, 0xe2, 0xcf, 0xf3, 0xd8, 0xcf, 0xf7, 0xf9, 0xfa, 0x49, - 0x0c, 0x08, 0x53, 0xec, 0xae, 0x0e, 0x5d, 0xa9, 0x3c, 0x45, 0x86, 0x91, 0xe0, 0x8a, 0xa3, 0x32, - 0xa6, 0x78, 0xb8, 0x3a, 0xec, 0xec, 0xf9, 0x5c, 0x86, 0x5c, 0xba, 0x5c, 0x84, 0x49, 0x0a, 0x17, - 0xa1, 0x4e, 0xe8, 0xec, 0x9a, 0x4d, 0x33, 0xc2, 0x88, 0xa4, 0xd2, 0xd0, 0xec, 0x28, 0xc2, 0x96, - 0xa1, 0x61, 0xfd, 0x5f, 0x2c, 0xa8, 0x8c, 0x02, 0xea, 0x49, 0x22, 0x51, 0x0b, 0x0a, 0x14, 0x3b, - 0x56, 0xcf, 0x1a, 0xd4, 0xc6, 0x05, 0x8a, 0xd1, 0x2b, 0x28, 0x73, 0x41, 0x67, 0x94, 0x39, 0x85, - 0x94, 0x99, 0x55, 0xc2, 0xe7, 0x1e, 0xc3, 0x01, 0x71, 0x6c, 0xcd, 0xf5, 0x0a, 0x75, 0x01, 0x7c, - 0xce, 0x94, 0xe0, 0x41, 0x40, 0x84, 0x53, 0x4c, 0x63, 0x39, 0x92, 0xc4, 0xc9, 0x6d, 0x44, 0x85, - 0xa7, 0x28, 0x67, 0x4e, 0xa9, 0x67, 0x0d, 0x8a, 0xe3, 0x1c, 0x39, 0x7e, 0xf7, 0xef, 0x9f, 0x7f, - 0xff, 0xc1, 0x7e, 0x05, 0xc5, 0x44, 0x07, 0x6a, 0x64, 0x55, 0xda, 0x96, 0x63, 0x39, 0x56, 0xff, - 0xbb, 0x02, 0xd4, 0x46, 0x52, 0x12, 0x91, 0xe4, 0x6e, 0x69, 0x7d, 0x1b, 0xaa, 0x0b, 0x12, 0x4f, - 0x54, 0x1c, 0x11, 0xa3, 0xb6, 0xb2, 0x20, 0xf1, 0x57, 0x71, 0xa4, 0x65, 0x09, 0x82, 0x09, 0x53, - 0xd4, 0x0b, 0x52, 0xc9, 0x8d, 0x71, 0x8e, 0xa0, 0x13, 0xa8, 0x86, 0x44, 0x79, 0xd8, 0x53, 0x9e, - 0x53, 0xec, 0xd9, 0x83, 0xfa, 0xd1, 0x7b, 0x43, 0x6d, 0xf0, 0xf0, 0xb1, 0xde, 0xf0, 0xc2, 0x64, - 0x9c, 0x33, 0x25, 0xe2, 0xf1, 0xe3, 0x86, 0x8d, 0x9e, 0x4b, 0x9b, 0x3d, 0x77, 0x4e, 0xa0, 0xf9, - 0x64, 0x2b, 0x6a, 0x83, 0xbd, 0x20, 0xb1, 0x51, 0x9e, 0x7c, 0x45, 0xbb, 0x50, 0x5a, 0x79, 0xc1, - 0x32, 0xd3, 0xad, 0x17, 0xc7, 0x85, 0x8f, 0xad, 0xe3, 0x56, 0x6a, 0x48, 0x55, 0x1b, 0xe2, 0x14, - 0xfa, 0x3f, 0x59, 0x50, 0x1f, 0x29, 0x45, 0x92, 0x59, 0x78, 0x4d, 0x13, 0x1e, 0x8b, 0xd8, 0xb9, - 0x22, 0x09, 0x8d, 0x04, 0xe7, 0xd7, 0xe6, 0xb2, 0xf4, 0xe2, 0xff, 0x7a, 0xda, 0x90, 0x65, 0xf7, - 0x7f, 0xb5, 0x00, 0x4e, 0xd7, 0xd7, 0xbc, 0xa9, 0xaa, 0x0d, 0x36, 0x4e, 0xe4, 0xeb, 0x8e, 0x31, - 0xc5, 0xe8, 0x43, 0xd8, 0x8d, 0x96, 0xd3, 0x80, 0xfa, 0x93, 0x44, 0x6e, 0xb8, 0x0c, 0x14, 0x9d, - 0x7a, 0x32, 0xd3, 0x86, 0x74, 0xec, 0x4b, 0x12, 0x5f, 0x64, 0x11, 0xf4, 0x0e, 0xd4, 0x56, 0xde, - 0x32, 0x50, 0x13, 0x9f, 0x62, 0x23, 0xb6, 0x9a, 0x82, 0x53, 0x8a, 0x51, 0x0f, 0xea, 0xd7, 0x94, - 0xcd, 0x88, 0x88, 0x04, 0x65, 0x2a, 0x15, 0xdc, 0x18, 0xe7, 0xd1, 0x86, 0xe2, 0x62, 0xff, 0x7b, - 0x1b, 0xe0, 0x8c, 0x04, 0x64, 0xf6, 0xbc, 0x8f, 0xdb, 0x8a, 0xf7, 0x01, 0xfc, 0xb9, 0x47, 0x99, - 0xf6, 0x56, 0xeb, 0xac, 0xa5, 0x24, 0x75, 0xf7, 0x03, 0x68, 0xea, 0xb0, 0x87, 0xb1, 0x20, 0x52, - 0x1a, 0x89, 0x8d, 0x14, 0x8e, 0x34, 0x43, 0x07, 0xd0, 0x5a, 0x9b, 0x38, 0x49, 0x0a, 0x68, 0x6b, - 0x9b, 0x6b, 0x7a, 0xf6, 0x1f, 0xe6, 0x94, 0xff, 0xd5, 0x9c, 0x0b, 0x78, 0x23, 0xb7, 0xe3, 0xdb, - 0x9b, 0x85, 0x74, 0x2a, 0xe9, 0x1c, 0x1f, 0x64, 0x73, 0xbc, 0xee, 0x75, 0x78, 0x99, 0xed, 0xff, - 0xe2, 0x66, 0x21, 0xf5, 0x34, 0x37, 0xa3, 0x3c, 0x33, 0xbd, 0x32, 0x46, 0x82, 0x09, 0xc5, 0x4e, - 0x35, 0xfd, 0x99, 0xd6, 0x0c, 0xf9, 0x1c, 0x77, 0x3e, 0x05, 0xb4, 0x7d, 0xc6, 0x0b, 0xc6, 0xba, - 0xd4, 0xff, 0xb3, 0x00, 0x95, 0x2b, 0x22, 0x56, 0xd4, 0x27, 0x5b, 0x57, 0xf1, 0x3e, 0x34, 0xa4, - 0x0e, 0xe5, 0xc7, 0xba, 0x6e, 0x58, 0x6a, 0xfe, 0xb6, 0xaf, 0xf6, 0x73, 0xbe, 0xee, 0x03, 0xe8, - 0xff, 0xaf, 0xc9, 0x52, 0x50, 0x73, 0x41, 0x35, 0x4d, 0xbe, 0x16, 0x14, 0x8d, 0xe1, 0xcd, 0xac, - 0x10, 0x61, 0x38, 0xe2, 0x94, 0x29, 0xe9, 0x94, 0x9e, 0xda, 0x68, 0x44, 0x66, 0x9f, 0xe7, 0x59, - 0x9e, 0xb6, 0xb1, 0x2d, 0x37, 0x30, 0x72, 0xa1, 0x2c, 0x7d, 0x1e, 0x11, 0xe9, 0x94, 0x7b, 0xf6, - 0xa0, 0x75, 0xb4, 0x97, 0x1d, 0x74, 0x49, 0x44, 0x48, 0xa5, 0xa4, 0x9c, 0x5d, 0x25, 0xf1, 0xb1, - 0x49, 0xeb, 0x9c, 0xc2, 0x5b, 0xcf, 0x9e, 0xfd, 0x02, 0x7b, 0xcb, 0x9f, 0x7d, 0xf2, 0xdb, 0x7d, - 0xd7, 0xba, 0xbb, 0xef, 0x5a, 0x7f, 0xdd, 0x77, 0xad, 0x1f, 0x1f, 0xba, 0x3b, 0x77, 0x0f, 0xdd, - 0x9d, 0x3f, 0x1e, 0xba, 0x3b, 0xdf, 0xf4, 0x67, 0x54, 0xcd, 0x97, 0xd3, 0xa1, 0xcf, 0x43, 0x97, - 0x33, 0xc9, 0x99, 0x70, 0xe7, 0x37, 0x5e, 0xec, 0xde, 0xba, 0xc9, 0x4b, 0x91, 0xf8, 0x2d, 0xa7, - 0xe5, 0xf4, 0x9d, 0xf8, 0xe8, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x5a, 0x9d, 0xc9, 0x88, - 0x06, 0x00, 0x00, + // 760 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0xbd, 0x6e, 0x2b, 0x45, + 0x14, 0xc7, 0xb3, 0x5e, 0x7f, 0x1e, 0x7f, 0x60, 0x46, 0x81, 0x2c, 0x46, 0x31, 0xc6, 0xe8, 0x4a, + 0xae, 0xbc, 0xdc, 0x4b, 0x83, 0x72, 0x29, 0x30, 0x49, 0x0a, 0x40, 0x91, 0x22, 0x07, 0x1a, 0x1a, + 0x6b, 0xbd, 0x33, 0x71, 0x26, 0xde, 0x9d, 0x59, 0xcd, 0xcc, 0x3a, 0xd9, 0x8e, 0x1e, 0x09, 0x51, + 0x50, 0xf3, 0x00, 0x34, 0xbc, 0x06, 0x65, 0x24, 0x1a, 0x0a, 0x0a, 0x94, 0xbc, 0x01, 0x4f, 0x80, + 0x76, 0x67, 0xd6, 0xde, 0xd8, 0x01, 0x84, 0x52, 0xd9, 0xf3, 0x3f, 0x67, 0xe6, 0xfc, 0xce, 0x7f, + 0x8e, 0x3d, 0x80, 0x30, 0xc5, 0xee, 0xea, 0xa5, 0x2b, 0x95, 0xa7, 0xc8, 0x38, 0x12, 0x5c, 0x71, + 0x54, 0xc5, 0x14, 0x8f, 0x57, 0x2f, 0x7b, 0x07, 0x3e, 0x97, 0x21, 0x97, 0x2e, 0x17, 0x61, 0x9a, + 0xc2, 0x45, 0xa8, 0x13, 0x7a, 0xfb, 0x66, 0xd3, 0x82, 0x30, 0x22, 0xa9, 0x34, 0x6a, 0x7e, 0x14, + 0x61, 0x71, 0x68, 0xb4, 0xe1, 0xcf, 0x16, 0xd4, 0x26, 0x01, 0xf5, 0x24, 0x91, 0xa8, 0x03, 0x25, + 0x8a, 0x1d, 0x6b, 0x60, 0x8d, 0x1a, 0xd3, 0x12, 0xc5, 0xe8, 0x6d, 0xa8, 0x72, 0x41, 0x17, 0x94, + 0x39, 0xa5, 0x4c, 0x33, 0x2b, 0xe4, 0x40, 0x4d, 0xc6, 0xf3, 0x6b, 0xe2, 0x2b, 0xc7, 0xce, 0x02, + 0xf9, 0x12, 0xf5, 0x01, 0x7c, 0xce, 0x94, 0xe0, 0x41, 0x40, 0x84, 0x53, 0xce, 0x82, 0x05, 0x25, + 0x8d, 0x93, 0xdb, 0x88, 0x0a, 0x4f, 0x51, 0xce, 0x9c, 0xca, 0xc0, 0x1a, 0x95, 0xa7, 0x05, 0xe5, + 0xe8, 0xf0, 0xaf, 0x9f, 0x7e, 0xfb, 0xde, 0x3e, 0x80, 0x72, 0x4a, 0x82, 0xda, 0xeb, 0x3a, 0x5d, + 0xcb, 0xb1, 0x1c, 0x6b, 0xf8, 0x6d, 0x09, 0x1a, 0x13, 0x29, 0x89, 0x48, 0x93, 0x77, 0x70, 0xdf, + 0x81, 0xfa, 0x92, 0x24, 0x33, 0x95, 0x44, 0xc4, 0x00, 0xd7, 0x96, 0x24, 0xf9, 0x2a, 0x89, 0x48, + 0xc6, 0x25, 0x08, 0x26, 0x4c, 0x51, 0x2f, 0xc8, 0xa0, 0x5b, 0xd3, 0x82, 0x82, 0x5e, 0x43, 0x3d, + 0x24, 0xca, 0xc3, 0x9e, 0xf2, 0x9c, 0xf2, 0xc0, 0x1e, 0x35, 0x5f, 0xbd, 0x37, 0xd6, 0x1e, 0x8f, + 0xd7, 0xf5, 0xc6, 0x67, 0x26, 0xe3, 0x94, 0x29, 0x91, 0x4c, 0xd7, 0x1b, 0xb6, 0x9a, 0xae, 0x6c, + 0x37, 0xdd, 0x7b, 0x0d, 0xed, 0x47, 0x5b, 0x51, 0x17, 0xec, 0x25, 0x49, 0x0c, 0x79, 0xfa, 0x15, + 0xed, 0x43, 0x65, 0xe5, 0x05, 0x71, 0xce, 0xad, 0x17, 0x47, 0xa5, 0x8f, 0xad, 0xa3, 0x4e, 0xe6, + 0x48, 0x5d, 0x3b, 0xe2, 0x94, 0x86, 0x3f, 0x5a, 0xd0, 0x9c, 0x28, 0x45, 0xd2, 0x71, 0xf8, 0x9f, + 0x26, 0xac, 0x8b, 0xd8, 0x85, 0x22, 0xa9, 0x1a, 0x09, 0xce, 0x2f, 0xcd, 0x6d, 0xe9, 0xc5, 0x7f, + 0xf5, 0xb4, 0x85, 0x65, 0x0f, 0x7f, 0xb1, 0x00, 0x8e, 0x37, 0xf7, 0xbc, 0x4d, 0xd5, 0x05, 0x1b, + 0xa7, 0xf8, 0xba, 0x63, 0x4c, 0x31, 0xfa, 0x10, 0xf6, 0xa3, 0x78, 0x1e, 0x50, 0x7f, 0x96, 0xe2, + 0x86, 0x71, 0xa0, 0xe8, 0xdc, 0x93, 0x39, 0x1b, 0xd2, 0xb1, 0x2f, 0x49, 0x72, 0x96, 0x47, 0xd0, + 0xbb, 0xd0, 0x58, 0x79, 0x71, 0xa0, 0x66, 0x3e, 0xc5, 0x06, 0xb6, 0x9e, 0x09, 0xc7, 0x14, 0xa3, + 0x01, 0x34, 0x2f, 0x29, 0x5b, 0x10, 0x11, 0x09, 0xca, 0x54, 0x06, 0xdc, 0x9a, 0x16, 0xa5, 0x2d, + 0xe2, 0xf2, 0xf0, 0x3b, 0x1b, 0xe0, 0x84, 0x04, 0x64, 0xf1, 0xb4, 0x8f, 0xbb, 0xc4, 0x87, 0x00, + 0xfe, 0x95, 0x47, 0x99, 0xf6, 0x56, 0x73, 0x36, 0x32, 0x25, 0x73, 0xf7, 0x03, 0x68, 0xeb, 0xb0, + 0x87, 0xb1, 0x20, 0x52, 0x1a, 0xc4, 0x56, 0x26, 0x4e, 0xb4, 0x86, 0x5e, 0x40, 0x67, 0x63, 0xe2, + 0x2c, 0x2d, 0xa0, 0xad, 0x6d, 0x6f, 0xd4, 0x93, 0x7f, 0x31, 0xa7, 0xfa, 0x8f, 0xe6, 0x9c, 0xc1, + 0x1b, 0x85, 0x1d, 0xd7, 0x37, 0x4b, 0xe9, 0xd4, 0xb2, 0x39, 0x7e, 0x91, 0xcf, 0xf1, 0xa6, 0xd7, + 0xf1, 0x79, 0xbe, 0xff, 0x8b, 0x9b, 0xa5, 0xd4, 0xd3, 0xdc, 0x8e, 0x8a, 0x9a, 0xe9, 0x95, 0x31, + 0x12, 0xcc, 0x28, 0x76, 0xea, 0xd9, 0xef, 0xb4, 0x61, 0x94, 0xcf, 0x71, 0xef, 0x53, 0x40, 0xbb, + 0x67, 0x3c, 0x63, 0xac, 0x2b, 0xc3, 0x3f, 0x4a, 0x50, 0xbb, 0x20, 0x62, 0x45, 0x7d, 0xb2, 0x73, + 0x15, 0xef, 0x43, 0x4b, 0xea, 0x50, 0x71, 0xac, 0x9b, 0x46, 0xcb, 0xcc, 0xdf, 0xf5, 0xd5, 0x7e, + 0xca, 0xd7, 0x43, 0x00, 0xfd, 0x17, 0x36, 0x8b, 0x05, 0x35, 0x17, 0xd4, 0xd0, 0xca, 0xd7, 0x82, + 0xa2, 0x29, 0xbc, 0x99, 0x17, 0x22, 0x0c, 0x47, 0x9c, 0x32, 0x25, 0x9d, 0xca, 0x63, 0x1b, 0x0d, + 0x64, 0xfe, 0x79, 0x9a, 0xe7, 0x69, 0x1b, 0xbb, 0x72, 0x4b, 0x46, 0x2e, 0x54, 0xa5, 0xcf, 0x23, + 0x22, 0x9d, 0xea, 0xc0, 0x1e, 0x75, 0x5e, 0x1d, 0xe4, 0x07, 0x9d, 0x13, 0x11, 0x52, 0x29, 0x29, + 0x67, 0x17, 0x69, 0x7c, 0x6a, 0xd2, 0x7a, 0xc7, 0xf0, 0xd6, 0x93, 0x67, 0x3f, 0xc3, 0xde, 0xea, + 0x67, 0x9f, 0xfc, 0x7a, 0xdf, 0xb7, 0xee, 0xee, 0xfb, 0xd6, 0x9f, 0xf7, 0x7d, 0xeb, 0x87, 0x87, + 0xfe, 0xde, 0xdd, 0x43, 0x7f, 0xef, 0xf7, 0x87, 0xfe, 0xde, 0x37, 0xc3, 0x05, 0x55, 0x57, 0xf1, + 0x7c, 0xec, 0xf3, 0xd0, 0xe5, 0x4c, 0x72, 0x26, 0xdc, 0xab, 0x1b, 0x2f, 0x71, 0x6f, 0xdd, 0xf4, + 0xb1, 0x48, 0xfd, 0x96, 0xf3, 0x6a, 0xf6, 0x54, 0x7c, 0xf4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x54, 0xb1, 0xb7, 0x51, 0x8b, 0x06, 0x00, 0x00, } func (m *Aliases) Marshal() (dAtA []byte, err error) { @@ -649,10 +649,10 @@ func (m *Aliases) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if len(m.Handle) > 0 { - i -= len(m.Handle) - copy(dAtA[i:], m.Handle) - i = encodeVarintState(dAtA, i, uint64(len(m.Handle))) + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) i-- dAtA[i] = 0x1a } @@ -1061,7 +1061,7 @@ func (m *Aliases) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Handle) + l = len(m.Subject) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -1351,7 +1351,7 @@ func (m *Aliases) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Handle", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1379,7 +1379,7 @@ func (m *Aliases) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Handle = string(dAtA[iNdEx:postIndex]) + m.Subject = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { diff --git a/x/did/types/types.pb.go b/x/did/types/types.pb.go index 002d96be2..096281d36 100644 --- a/x/did/types/types.pb.go +++ b/x/did/types/types.pb.go @@ -25,28 +25,29 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// BaseDocument defines a DID document -type BaseDocument struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - VerificationMethods []*VerificationMethod `protobuf:"bytes,2,rep,name=verification_methods,json=verificationMethods,proto3" json:"verification_methods,omitempty"` - Authentication []string `protobuf:"bytes,4,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,5,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,7,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,8,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` +// Credential defines a WebAuthn credential +type Credential struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CredentialType string `protobuf:"bytes,2,opt,name=credential_type,json=credentialType,proto3" json:"credential_type,omitempty"` + CredentialId []byte `protobuf:"bytes,3,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + Transport []string `protobuf:"bytes,4,rep,name=transport,proto3" json:"transport,omitempty"` + AttestationType string `protobuf:"bytes,5,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` + DisplayName string `protobuf:"bytes,6,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Controller string `protobuf:"bytes,7,opt,name=controller,proto3" json:"controller,omitempty"` } -func (m *BaseDocument) Reset() { *m = BaseDocument{} } -func (m *BaseDocument) String() string { return proto.CompactTextString(m) } -func (*BaseDocument) ProtoMessage() {} -func (*BaseDocument) Descriptor() ([]byte, []int) { +func (m *Credential) Reset() { *m = Credential{} } +func (m *Credential) String() string { return proto.CompactTextString(m) } +func (*Credential) ProtoMessage() {} +func (*Credential) Descriptor() ([]byte, []int) { return fileDescriptor_e3176cd2dbe76ac1, []int{0} } -func (m *BaseDocument) XXX_Unmarshal(b []byte) error { +func (m *Credential) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BaseDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Credential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BaseDocument.Marshal(b, m, deterministic) + return xxx_messageInfo_Credential.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -56,60 +57,298 @@ func (m *BaseDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *BaseDocument) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseDocument.Merge(m, src) +func (m *Credential) XXX_Merge(src proto.Message) { + xxx_messageInfo_Credential.Merge(m, src) } -func (m *BaseDocument) XXX_Size() int { +func (m *Credential) XXX_Size() int { return m.Size() } -func (m *BaseDocument) XXX_DiscardUnknown() { - xxx_messageInfo_BaseDocument.DiscardUnknown(m) +func (m *Credential) XXX_DiscardUnknown() { + xxx_messageInfo_Credential.DiscardUnknown(m) } -var xxx_messageInfo_BaseDocument proto.InternalMessageInfo +var xxx_messageInfo_Credential proto.InternalMessageInfo -func (m *BaseDocument) GetId() string { +func (m *Credential) GetId() string { if m != nil { return m.Id } return "" } -func (m *BaseDocument) GetVerificationMethods() []*VerificationMethod { +func (m *Credential) GetCredentialType() string { + if m != nil { + return m.CredentialType + } + return "" +} + +func (m *Credential) GetCredentialId() []byte { + if m != nil { + return m.CredentialId + } + return nil +} + +func (m *Credential) GetTransport() []string { + if m != nil { + return m.Transport + } + return nil +} + +func (m *Credential) GetAttestationType() string { + if m != nil { + return m.AttestationType + } + return "" +} + +func (m *Credential) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Credential) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +// Document defines a DID document +type Document struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + VerificationMethods []*VerificationMethod `protobuf:"bytes,2,rep,name=verification_methods,json=verificationMethods,proto3" json:"verification_methods,omitempty"` + Authentication []string `protobuf:"bytes,4,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,5,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,7,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,8,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { + return fileDescriptor_e3176cd2dbe76ac1, []int{1} +} +func (m *Document) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Document.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Document) XXX_Merge(src proto.Message) { + xxx_messageInfo_Document.Merge(m, src) +} +func (m *Document) XXX_Size() int { + return m.Size() +} +func (m *Document) XXX_DiscardUnknown() { + xxx_messageInfo_Document.DiscardUnknown(m) +} + +var xxx_messageInfo_Document proto.InternalMessageInfo + +func (m *Document) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Document) GetVerificationMethods() []*VerificationMethod { if m != nil { return m.VerificationMethods } return nil } -func (m *BaseDocument) GetAuthentication() []string { +func (m *Document) GetAuthentication() []string { if m != nil { return m.Authentication } return nil } -func (m *BaseDocument) GetAssertionMethod() []string { +func (m *Document) GetAssertionMethod() []string { if m != nil { return m.AssertionMethod } return nil } -func (m *BaseDocument) GetCapabilityDelegation() []string { +func (m *Document) GetCapabilityDelegation() []string { if m != nil { return m.CapabilityDelegation } return nil } -func (m *BaseDocument) GetCapabilityInvocation() []string { +func (m *Document) GetCapabilityInvocation() []string { if m != nil { return m.CapabilityInvocation } return nil } +// Identity defines an associated profile for a did subject +type Identity struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + Credentials []*Credential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` + VerificationMethods []*VerificationMethod `protobuf:"bytes,5,rep,name=verification_methods,json=verificationMethods,proto3" json:"verification_methods,omitempty"` +} + +func (m *Identity) Reset() { *m = Identity{} } +func (m *Identity) String() string { return proto.CompactTextString(m) } +func (*Identity) ProtoMessage() {} +func (*Identity) Descriptor() ([]byte, []int) { + return fileDescriptor_e3176cd2dbe76ac1, []int{2} +} +func (m *Identity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Identity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Identity.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Identity) XXX_Merge(src proto.Message) { + xxx_messageInfo_Identity.Merge(m, src) +} +func (m *Identity) XXX_Size() int { + return m.Size() +} +func (m *Identity) XXX_DiscardUnknown() { + xxx_messageInfo_Identity.DiscardUnknown(m) +} + +var xxx_messageInfo_Identity proto.InternalMessageInfo + +func (m *Identity) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Identity) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *Identity) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *Identity) GetCredentials() []*Credential { + if m != nil { + return m.Credentials + } + return nil +} + +func (m *Identity) GetVerificationMethods() []*VerificationMethod { + if m != nil { + return m.VerificationMethods + } + return nil +} + +// PubKey defines a public key for a did +type PubKey struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + KeyType string `protobuf:"bytes,3,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (m *PubKey) String() string { return proto.CompactTextString(m) } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_e3176cd2dbe76ac1, []int{3} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (m *PubKey) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *PubKey) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *PubKey) GetKeyType() string { + if m != nil { + return m.KeyType + } + return "" +} + +func (m *PubKey) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + // VerificationMethod defines a verification method type VerificationMethod struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -124,7 +363,7 @@ func (m *VerificationMethod) Reset() { *m = VerificationMethod{} } func (m *VerificationMethod) String() string { return proto.CompactTextString(m) } func (*VerificationMethod) ProtoMessage() {} func (*VerificationMethod) Descriptor() ([]byte, []int) { - return fileDescriptor_e3176cd2dbe76ac1, []int{1} + return fileDescriptor_e3176cd2dbe76ac1, []int{4} } func (m *VerificationMethod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -182,7 +421,10 @@ func (m *VerificationMethod) GetPublicKeyJwks() map[string]string { } func init() { - proto.RegisterType((*BaseDocument)(nil), "did.v1.BaseDocument") + proto.RegisterType((*Credential)(nil), "did.v1.Credential") + proto.RegisterType((*Document)(nil), "did.v1.Document") + proto.RegisterType((*Identity)(nil), "did.v1.Identity") + proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") proto.RegisterType((*VerificationMethod)(nil), "did.v1.VerificationMethod") proto.RegisterMapType((map[string]string)(nil), "did.v1.VerificationMethod.PublicKeyJwksEntry") } @@ -190,39 +432,50 @@ func init() { func init() { proto.RegisterFile("did/v1/types.proto", fileDescriptor_e3176cd2dbe76ac1) } var fileDescriptor_e3176cd2dbe76ac1 = []byte{ - // 449 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0x63, 0x87, 0x16, 0xba, 0x85, 0xb6, 0x5a, 0x8c, 0x30, 0x39, 0x58, 0x51, 0x0e, 0x28, - 0x1c, 0xb0, 0x69, 0x7b, 0x41, 0x88, 0x03, 0xaa, 0xca, 0x01, 0x50, 0x24, 0x14, 0x09, 0x0e, 0x5c, - 0xac, 0xb5, 0x3d, 0x38, 0x4b, 0xec, 0x5d, 0xcb, 0xb3, 0x76, 0xf0, 0x53, 0xc0, 0x73, 0xf0, 0x24, - 0x1c, 0x7b, 0xe4, 0x88, 0x92, 0x17, 0x41, 0xd9, 0x75, 0x82, 0x95, 0xa8, 0xb7, 0xd9, 0xff, 0xff, - 0x66, 0x76, 0x66, 0x34, 0x84, 0x26, 0x3c, 0x09, 0xea, 0xf3, 0x40, 0x35, 0x05, 0xa0, 0x5f, 0x94, - 0x52, 0x49, 0x7a, 0x98, 0xf0, 0xc4, 0xaf, 0xcf, 0x07, 0x8f, 0x63, 0x89, 0xb9, 0xc4, 0x20, 0xc7, - 0x74, 0x8d, 0xe4, 0x98, 0x1a, 0x60, 0xe0, 0xb4, 0x49, 0x29, 0x08, 0x40, 0x8e, 0x1b, 0x35, 0x95, - 0xa9, 0xd4, 0x61, 0xb0, 0x8e, 0x5a, 0xf5, 0x89, 0x29, 0x12, 0x1a, 0xc3, 0x3c, 0x8c, 0x35, 0xfa, - 0x65, 0x93, 0xfb, 0x57, 0x0c, 0xe1, 0x5a, 0xc6, 0x55, 0x0e, 0x42, 0xd1, 0x13, 0x62, 0xf3, 0xc4, - 0xb5, 0x86, 0xd6, 0xf8, 0x68, 0x6a, 0xf3, 0x84, 0x4e, 0x88, 0x53, 0x43, 0xc9, 0xbf, 0xf2, 0x98, - 0x29, 0x2e, 0x45, 0x98, 0x83, 0x9a, 0xc9, 0x04, 0x5d, 0x7b, 0xd8, 0x1f, 0x1f, 0x5f, 0x0c, 0x7c, - 0xd3, 0xa7, 0xff, 0xb9, 0xc3, 0x4c, 0x34, 0x32, 0x7d, 0x58, 0xef, 0x69, 0x48, 0x9f, 0x92, 0x13, - 0x56, 0xa9, 0x19, 0x08, 0xd5, 0x1a, 0xee, 0x9d, 0x61, 0x7f, 0x7c, 0x34, 0xdd, 0x51, 0xe9, 0x33, - 0x72, 0xc6, 0x10, 0xa1, 0xec, 0xfc, 0xe9, 0x1e, 0x68, 0xf2, 0x74, 0xab, 0x9b, 0x9a, 0xf4, 0x92, - 0x3c, 0x8a, 0x59, 0xc1, 0x22, 0x9e, 0x71, 0xd5, 0x84, 0x09, 0x64, 0x90, 0x9a, 0xca, 0x77, 0x35, - 0xef, 0xfc, 0x37, 0xaf, 0xb7, 0xde, 0x4e, 0x12, 0x17, 0xb5, 0x6c, 0xdb, 0xb9, 0xb7, 0x9b, 0xf4, - 0x6e, 0xeb, 0x8d, 0x7e, 0xd8, 0x84, 0xee, 0x0f, 0xba, 0xb7, 0x32, 0x8f, 0x90, 0x58, 0x0a, 0x55, - 0xca, 0x2c, 0x83, 0xd2, 0xb5, 0xb5, 0xde, 0x51, 0xe8, 0x0b, 0xe2, 0x14, 0x55, 0x94, 0xf1, 0x38, - 0x9c, 0x43, 0x13, 0xe6, 0x55, 0xa6, 0x78, 0xc4, 0x10, 0xdc, 0xbe, 0x26, 0xa9, 0xf1, 0x3e, 0x40, - 0x33, 0xd9, 0x38, 0xf4, 0x13, 0x39, 0xed, 0x64, 0x7c, 0x5b, 0xcc, 0x51, 0xaf, 0xed, 0xf8, 0xe2, - 0xf9, 0xed, 0xfb, 0xf7, 0x3f, 0x6e, 0xea, 0xbc, 0x5f, 0xcc, 0xf1, 0xad, 0x50, 0x65, 0x33, 0x7d, - 0x50, 0x74, 0xb5, 0xc1, 0x1b, 0x42, 0xf7, 0x21, 0x7a, 0x46, 0xfa, 0x73, 0x68, 0xda, 0x79, 0xd6, - 0x21, 0x75, 0xc8, 0x41, 0xcd, 0xb2, 0x0a, 0xda, 0x59, 0xcc, 0xe3, 0x95, 0xfd, 0xd2, 0xba, 0x7a, - 0xfd, 0x7b, 0xe9, 0x59, 0x37, 0x4b, 0xcf, 0xfa, 0xbb, 0xf4, 0xac, 0x9f, 0x2b, 0xaf, 0x77, 0xb3, - 0xf2, 0x7a, 0x7f, 0x56, 0x5e, 0xef, 0xcb, 0x28, 0xe5, 0x6a, 0x56, 0x45, 0x7e, 0x2c, 0xf3, 0x40, - 0x0a, 0x94, 0xa2, 0x0c, 0x66, 0x0b, 0xd6, 0x04, 0xdf, 0x83, 0xf5, 0xe1, 0xea, 0x53, 0x8f, 0x0e, - 0xf5, 0x0d, 0x5e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x30, 0x32, 0xf6, 0x01, 0x03, 0x00, - 0x00, + // 636 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xad, 0x9d, 0xe6, 0xa7, 0x37, 0x69, 0x53, 0xcd, 0x97, 0x4f, 0xb8, 0x11, 0xb2, 0x42, 0x90, + 0x20, 0x2c, 0x88, 0x69, 0xcb, 0x02, 0x21, 0x16, 0x08, 0xca, 0xa2, 0x54, 0x45, 0x95, 0x05, 0x2c, + 0xd8, 0x44, 0x63, 0x7b, 0x70, 0xa6, 0xb1, 0x3d, 0x96, 0x67, 0x9c, 0xe2, 0xa7, 0x80, 0xa7, 0xe0, + 0x59, 0x58, 0x76, 0x09, 0x3b, 0xd4, 0xbe, 0x03, 0x6b, 0xe4, 0x99, 0x38, 0x71, 0x63, 0x75, 0xc3, + 0x6e, 0xe6, 0x9c, 0x33, 0xf7, 0xe7, 0xcc, 0xd5, 0x05, 0xe4, 0x51, 0xcf, 0x9a, 0xef, 0x5b, 0x22, + 0x8b, 0x09, 0x1f, 0xc7, 0x09, 0x13, 0x0c, 0x35, 0x3c, 0xea, 0x8d, 0xe7, 0xfb, 0xfd, 0x3b, 0x2e, + 0xe3, 0x21, 0xe3, 0x56, 0xc8, 0xfd, 0x5c, 0x12, 0x72, 0x5f, 0x09, 0xfa, 0xbd, 0xc5, 0x23, 0x9f, + 0x44, 0x84, 0x53, 0x5e, 0xa0, 0x3e, 0xf3, 0x99, 0x3c, 0x5a, 0xf9, 0x69, 0x81, 0xee, 0xa9, 0x20, + 0x13, 0x45, 0xa8, 0x8b, 0xa2, 0x86, 0x7f, 0x34, 0x80, 0xd7, 0x09, 0xf1, 0x48, 0x24, 0x28, 0x0e, + 0xd0, 0x0e, 0xe8, 0xd4, 0x33, 0xb4, 0x81, 0x36, 0xda, 0xb2, 0x75, 0xea, 0xa1, 0x87, 0xd0, 0x75, + 0x97, 0xec, 0x24, 0x2f, 0xd0, 0xd0, 0x25, 0xb9, 0xb3, 0x82, 0xdf, 0x67, 0x31, 0x41, 0xf7, 0x61, + 0xbb, 0x24, 0xa4, 0x9e, 0x51, 0x1b, 0x68, 0xa3, 0x8e, 0xdd, 0x59, 0x81, 0xc7, 0x1e, 0xba, 0x0b, + 0x5b, 0x22, 0xc1, 0x11, 0x8f, 0x59, 0x22, 0x8c, 0xcd, 0x41, 0x6d, 0xb4, 0x65, 0xaf, 0x00, 0xf4, + 0x08, 0x76, 0xb1, 0x10, 0x84, 0x0b, 0x2c, 0x28, 0x8b, 0x54, 0xb2, 0xba, 0x4c, 0xd6, 0x2d, 0xe1, + 0x32, 0xdb, 0x3d, 0xe8, 0x78, 0x94, 0xc7, 0x01, 0xce, 0x26, 0x11, 0x0e, 0x89, 0xd1, 0x90, 0xb2, + 0xf6, 0x02, 0x7b, 0x87, 0x43, 0x82, 0x4c, 0x00, 0x97, 0x45, 0x22, 0x61, 0x41, 0x40, 0x12, 0xa3, + 0x29, 0x05, 0x25, 0x64, 0xf8, 0x5d, 0x87, 0xd6, 0x11, 0x73, 0xd3, 0x90, 0x44, 0xa2, 0xd2, 0xf6, + 0x29, 0xf4, 0xe6, 0x24, 0xa1, 0x9f, 0xa9, 0xab, 0x6a, 0x09, 0x89, 0x98, 0x32, 0x8f, 0x1b, 0xfa, + 0xa0, 0x36, 0x6a, 0x1f, 0xf4, 0xc7, 0xea, 0x73, 0xc6, 0x1f, 0x4b, 0x9a, 0x53, 0x29, 0xb1, 0xff, + 0x9b, 0x57, 0x30, 0x8e, 0x1e, 0xc0, 0x0e, 0x4e, 0xc5, 0x34, 0xf7, 0x41, 0x11, 0x8b, 0xe6, 0xd7, + 0x50, 0xe9, 0x00, 0xe7, 0x24, 0x29, 0xe5, 0x34, 0xea, 0x52, 0xd9, 0x5d, 0xe2, 0x2a, 0x26, 0x3a, + 0x84, 0xff, 0x5d, 0x1c, 0x63, 0x87, 0x06, 0x54, 0x64, 0x13, 0x8f, 0x04, 0xc4, 0x57, 0x91, 0x9b, + 0x52, 0xdf, 0x5b, 0x91, 0x47, 0x4b, 0x6e, 0xed, 0x11, 0x8d, 0xe6, 0x6c, 0x51, 0x4e, 0x6b, 0xfd, + 0xd1, 0xf1, 0x92, 0x1b, 0xfe, 0xd2, 0xa0, 0x75, 0x2c, 0xff, 0x50, 0x64, 0x15, 0xa3, 0x0c, 0x68, + 0xf2, 0xd4, 0x39, 0x27, 0xae, 0x58, 0xcc, 0x45, 0x71, 0x5d, 0xf3, 0xbf, 0xb6, 0xee, 0x3f, 0x7a, + 0x0a, 0xed, 0xd5, 0x6c, 0x70, 0x69, 0x48, 0xfb, 0x00, 0x15, 0xce, 0xae, 0x46, 0xd2, 0x2e, 0xcb, + 0x6e, 0xfd, 0x98, 0xfa, 0x3f, 0x7d, 0xcc, 0x90, 0x40, 0xe3, 0x2c, 0x75, 0x4e, 0x48, 0xb5, 0xb1, + 0x5d, 0xa8, 0xcd, 0x48, 0x26, 0x9b, 0xea, 0xd8, 0xf9, 0x11, 0xed, 0x41, 0x6b, 0x46, 0x32, 0x35, + 0x96, 0xaa, 0x9d, 0xe6, 0x8c, 0x64, 0x72, 0x1c, 0x6f, 0xf6, 0xba, 0x59, 0x99, 0xb5, 0xaf, 0x3a, + 0xa0, 0x6a, 0x49, 0x95, 0x9c, 0x37, 0xc3, 0xe8, 0x15, 0xcb, 0x9e, 0x40, 0x2f, 0x4e, 0x9d, 0x80, + 0xba, 0x93, 0xbc, 0x90, 0x30, 0x0d, 0x04, 0x75, 0x30, 0x2f, 0xaa, 0x41, 0x8a, 0x3b, 0x21, 0xd9, + 0x69, 0xc1, 0xa0, 0x0f, 0xd0, 0x2d, 0xbd, 0x38, 0xbf, 0x98, 0x15, 0x46, 0x3f, 0xbe, 0xdd, 0xa9, + 0xf1, 0x59, 0x11, 0xe7, 0xed, 0xc5, 0x8c, 0xbf, 0x89, 0x44, 0x92, 0xd9, 0xdb, 0x71, 0x19, 0xeb, + 0xbf, 0x04, 0x54, 0x15, 0x15, 0x96, 0xa9, 0x7e, 0xa4, 0x65, 0x3d, 0xa8, 0xcf, 0x71, 0x90, 0x16, + 0x3b, 0x43, 0x5d, 0x9e, 0xeb, 0xcf, 0xb4, 0x57, 0x2f, 0x7e, 0x5c, 0x99, 0xda, 0xe5, 0x95, 0xa9, + 0xfd, 0xbe, 0x32, 0xb5, 0x6f, 0xd7, 0xe6, 0xc6, 0xe5, 0xb5, 0xb9, 0xf1, 0xf3, 0xda, 0xdc, 0xf8, + 0x34, 0xf4, 0xa9, 0x98, 0xa6, 0xce, 0xd8, 0x65, 0xa1, 0xc5, 0x22, 0xce, 0xa2, 0xc4, 0x9a, 0x5e, + 0xe0, 0xcc, 0xfa, 0x62, 0xe5, 0x0b, 0x4f, 0xae, 0x48, 0xa7, 0x21, 0x77, 0xd7, 0xe1, 0xdf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x39, 0xba, 0x7e, 0x40, 0x39, 0x05, 0x00, 0x00, } -func (m *BaseDocument) Marshal() (dAtA []byte, err error) { +func (m *Credential) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -232,12 +485,86 @@ func (m *BaseDocument) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BaseDocument) MarshalTo(dAtA []byte) (int, error) { +func (m *Credential) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BaseDocument) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Credential) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x3a + } + if len(m.DisplayName) > 0 { + i -= len(m.DisplayName) + copy(dAtA[i:], m.DisplayName) + i = encodeVarintTypes(dAtA, i, uint64(len(m.DisplayName))) + i-- + dAtA[i] = 0x32 + } + if len(m.AttestationType) > 0 { + i -= len(m.AttestationType) + copy(dAtA[i:], m.AttestationType) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AttestationType))) + i-- + dAtA[i] = 0x2a + } + if len(m.Transport) > 0 { + for iNdEx := len(m.Transport) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Transport[iNdEx]) + copy(dAtA[i:], m.Transport[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Transport[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.CredentialId) > 0 { + i -= len(m.CredentialId) + copy(dAtA[i:], m.CredentialId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CredentialId))) + i-- + dAtA[i] = 0x1a + } + if len(m.CredentialType) > 0 { + i -= len(m.CredentialType) + copy(dAtA[i:], m.CredentialType) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CredentialType))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Document) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Document) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -302,6 +629,129 @@ func (m *BaseDocument) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Identity) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Identity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Identity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VerificationMethods) > 0 { + for iNdEx := len(m.VerificationMethods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VerificationMethods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Credentials) > 0 { + for iNdEx := len(m.Credentials) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Credentials[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PubKey) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x22 + } + if len(m.KeyType) > 0 { + i -= len(m.KeyType) + copy(dAtA[i:], m.KeyType) + i = encodeVarintTypes(dAtA, i, uint64(len(m.KeyType))) + i-- + dAtA[i] = 0x1a + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *VerificationMethod) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -376,7 +826,46 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *BaseDocument) Size() (n int) { +func (m *Credential) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.CredentialType) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.CredentialId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Transport) > 0 { + for _, s := range m.Transport { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.AttestationType) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.DisplayName) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Document) Size() (n int) { if m == nil { return 0 } @@ -419,6 +908,64 @@ func (m *BaseDocument) Size() (n int) { return n } +func (m *Identity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Credentials) > 0 { + for _, e := range m.Credentials { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.VerificationMethods) > 0 { + for _, e := range m.VerificationMethods { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.KeyType) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + func (m *VerificationMethod) Size() (n int) { if m == nil { return 0 @@ -454,7 +1001,7 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *BaseDocument) Unmarshal(dAtA []byte) error { +func (m *Credential) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -477,10 +1024,286 @@ func (m *BaseDocument) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BaseDocument: wiretype end group for non-group") + return fmt.Errorf("proto: Credential: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BaseDocument: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Credential: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialId = append(m.CredentialId[:0], dAtA[iNdEx:postIndex]...) + if m.CredentialId == nil { + m.CredentialId = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transport", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Transport = append(m.Transport, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestationType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttestationType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Document) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -698,6 +1521,400 @@ func (m *BaseDocument) Unmarshal(dAtA []byte) error { } return nil } +func (m *Identity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Identity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Identity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credentials = append(m.Credentials, &Credential{}) + if err := m.Credentials[len(m.Credentials)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerificationMethods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VerificationMethods = append(m.VerificationMethods, &VerificationMethod{}) + if err := m.VerificationMethods[len(m.VerificationMethods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *VerificationMethod) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0