diff --git a/api/did/v1/models.pulsar.go b/api/did/v1/models.pulsar.go index 4cea413c9..50bacc469 100644 --- a/api/did/v1/models.pulsar.go +++ b/api/did/v1/models.pulsar.go @@ -14,554 +14,6 @@ import ( sync "sync" ) -var ( - md_Alias protoreflect.MessageDescriptor - fd_Alias_subject protoreflect.FieldDescriptor - fd_Alias_origin protoreflect.FieldDescriptor - fd_Alias_controller protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_Alias = File_did_v1_models_proto.Messages().ByName("Alias") - fd_Alias_subject = md_Alias.Fields().ByName("subject") - fd_Alias_origin = md_Alias.Fields().ByName("origin") - fd_Alias_controller = md_Alias.Fields().ByName("controller") -} - -var _ protoreflect.Message = (*fastReflection_Alias)(nil) - -type fastReflection_Alias Alias - -func (x *Alias) ProtoReflect() protoreflect.Message { - return (*fastReflection_Alias)(x) -} - -func (x *Alias) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Alias_messageType fastReflection_Alias_messageType -var _ protoreflect.MessageType = fastReflection_Alias_messageType{} - -type fastReflection_Alias_messageType struct{} - -func (x fastReflection_Alias_messageType) Zero() protoreflect.Message { - return (*fastReflection_Alias)(nil) -} -func (x fastReflection_Alias_messageType) New() protoreflect.Message { - return new(fastReflection_Alias) -} -func (x fastReflection_Alias_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Alias -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Alias) Descriptor() protoreflect.MessageDescriptor { - return md_Alias -} - -// 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_Alias) Type() protoreflect.MessageType { - return _fastReflection_Alias_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Alias) New() protoreflect.Message { - return new(fastReflection_Alias) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Alias) Interface() protoreflect.ProtoMessage { - return (*Alias)(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_Alias) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Subject != "" { - value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Alias_subject, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Alias_origin, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Alias_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_Alias) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Alias.subject": - return x.Subject != "" - case "did.v1.Alias.origin": - return x.Origin != "" - case "did.v1.Alias.controller": - return x.Controller != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) - } - panic(fmt.Errorf("message did.v1.Alias 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_Alias) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Alias.subject": - x.Subject = "" - case "did.v1.Alias.origin": - x.Origin = "" - case "did.v1.Alias.controller": - x.Controller = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) - } - panic(fmt.Errorf("message did.v1.Alias 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_Alias) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Alias.subject": - value := x.Subject - return protoreflect.ValueOfString(value) - case "did.v1.Alias.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.Alias.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) - } - panic(fmt.Errorf("message did.v1.Alias 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_Alias) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Alias.subject": - x.Subject = value.Interface().(string) - case "did.v1.Alias.origin": - x.Origin = value.Interface().(string) - case "did.v1.Alias.controller": - x.Controller = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) - } - panic(fmt.Errorf("message did.v1.Alias 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_Alias) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Alias.subject": - panic(fmt.Errorf("field subject of message did.v1.Alias is not mutable")) - case "did.v1.Alias.origin": - panic(fmt.Errorf("field origin of message did.v1.Alias is not mutable")) - case "did.v1.Alias.controller": - panic(fmt.Errorf("field controller of message did.v1.Alias is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) - } - panic(fmt.Errorf("message did.v1.Alias 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_Alias) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Alias.subject": - return protoreflect.ValueOfString("") - case "did.v1.Alias.origin": - return protoreflect.ValueOfString("") - case "did.v1.Alias.controller": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) - } - panic(fmt.Errorf("message did.v1.Alias 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_Alias) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Alias", 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_Alias) 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_Alias) 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_Alias) 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_Alias) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Alias) - 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.Subject) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - 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().(*Alias) - 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] = 0x1a - } - 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.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) - 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().(*Alias) - 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: Alias: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Alias: 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 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 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 - 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 - 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 = (*_Credential_6_list)(nil) type _Credential_6_list struct { @@ -650,7 +102,7 @@ func (x *Credential) ProtoReflect() protoreflect.Message { } func (x *Credential) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[1] + mi := &file_did_v1_models_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1946,7 +1398,7 @@ func (x *Document) ProtoReflect() protoreflect.Message { } func (x *Document) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[2] + mi := &file_did_v1_models_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2982,7 +2434,7 @@ func (x *Keyshare) ProtoReflect() protoreflect.Message { } func (x *Keyshare) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[3] + mi := &file_did_v1_models_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4094,7 +3546,7 @@ func (x *Permissions) ProtoReflect() protoreflect.Message { } func (x *Permissions) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[4] + mi := &file_did_v1_models_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4716,7 +4168,7 @@ func (x *PubKey) ProtoReflect() protoreflect.Message { } func (x *PubKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[5] + mi := &file_did_v1_models_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5455,7 +4907,7 @@ func (x *PubKey_JWK) ProtoReflect() protoreflect.Message { } func (x *PubKey_JWK) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[12] + mi := &file_did_v1_models_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6279,7 +5731,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { } func (x *Service) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[6] + mi := &file_did_v1_models_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7250,7 +6702,7 @@ func (x *ServiceInfo) ProtoReflect() protoreflect.Message { } func (x *ServiceInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[7] + mi := &file_did_v1_models_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7867,7 +7319,7 @@ func (x *FirstPartyCaveat) ProtoReflect() protoreflect.Message { } func (x *FirstPartyCaveat) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[8] + mi := &file_did_v1_models_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8478,7 +7930,7 @@ func (x *ThirdPartyCaveat) ProtoReflect() protoreflect.Message { } func (x *ThirdPartyCaveat) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[9] + mi := &file_did_v1_models_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9076,58 +8528,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Alias defines a subject/origin pair -type Alias struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` -} - -func (x *Alias) Reset() { - *x = Alias{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Alias) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Alias) ProtoMessage() {} - -// Deprecated: Use Alias.ProtoReflect.Descriptor instead. -func (*Alias) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{0} -} - -func (x *Alias) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -func (x *Alias) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *Alias) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - type Credential struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9150,7 +8550,7 @@ type Credential struct { func (x *Credential) Reset() { *x = Credential{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[1] + mi := &file_did_v1_models_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9164,7 +8564,7 @@ func (*Credential) ProtoMessage() {} // Deprecated: Use Credential.ProtoReflect.Descriptor instead. func (*Credential) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{1} + return file_did_v1_models_proto_rawDescGZIP(), []int{0} } func (x *Credential) GetSubject() string { @@ -9269,7 +8669,7 @@ type Document struct { func (x *Document) Reset() { *x = Document{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[2] + mi := &file_did_v1_models_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9283,7 +8683,7 @@ func (*Document) ProtoMessage() {} // Deprecated: Use Document.ProtoReflect.Descriptor instead. func (*Document) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{2} + return file_did_v1_models_proto_rawDescGZIP(), []int{1} } func (x *Document) GetId() string { @@ -9352,7 +8752,7 @@ type Keyshare struct { func (x *Keyshare) Reset() { *x = Keyshare{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[3] + mi := &file_did_v1_models_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9366,7 +8766,7 @@ func (*Keyshare) ProtoMessage() {} // Deprecated: Use Keyshare.ProtoReflect.Descriptor instead. func (*Keyshare) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{3} + return file_did_v1_models_proto_rawDescGZIP(), []int{2} } func (x *Keyshare) GetMetadata() map[string]string { @@ -9425,7 +8825,7 @@ type Permissions struct { func (x *Permissions) Reset() { *x = Permissions{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[4] + mi := &file_did_v1_models_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9439,7 +8839,7 @@ func (*Permissions) ProtoMessage() {} // Deprecated: Use Permissions.ProtoReflect.Descriptor instead. func (*Permissions) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{4} + return file_did_v1_models_proto_rawDescGZIP(), []int{3} } func (x *Permissions) GetGrants() []DIDNamespace { @@ -9474,7 +8874,7 @@ type PubKey struct { func (x *PubKey) Reset() { *x = PubKey{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[5] + mi := &file_did_v1_models_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9488,7 +8888,7 @@ func (*PubKey) ProtoMessage() {} // Deprecated: Use PubKey.ProtoReflect.Descriptor instead. func (*PubKey) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{5} + return file_did_v1_models_proto_rawDescGZIP(), []int{4} } func (x *PubKey) GetRole() KeyRole { @@ -9558,7 +8958,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[6] + mi := &file_did_v1_models_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9572,7 +8972,7 @@ func (*Service) ProtoMessage() {} // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{6} + return file_did_v1_models_proto_rawDescGZIP(), []int{5} } func (x *Service) GetId() string { @@ -9639,7 +9039,7 @@ type ServiceInfo struct { func (x *ServiceInfo) Reset() { *x = ServiceInfo{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[7] + mi := &file_did_v1_models_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9653,7 +9053,7 @@ func (*ServiceInfo) ProtoMessage() {} // Deprecated: Use ServiceInfo.ProtoReflect.Descriptor instead. func (*ServiceInfo) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{7} + return file_did_v1_models_proto_rawDescGZIP(), []int{6} } func (x *ServiceInfo) GetExists() bool { @@ -9699,7 +9099,7 @@ type FirstPartyCaveat struct { func (x *FirstPartyCaveat) Reset() { *x = FirstPartyCaveat{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[8] + mi := &file_did_v1_models_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9713,7 +9113,7 @@ func (*FirstPartyCaveat) ProtoMessage() {} // Deprecated: Use FirstPartyCaveat.ProtoReflect.Descriptor instead. func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{8} + return file_did_v1_models_proto_rawDescGZIP(), []int{7} } func (x *FirstPartyCaveat) GetScope() *Permissions { @@ -9759,7 +9159,7 @@ type ThirdPartyCaveat struct { func (x *ThirdPartyCaveat) Reset() { *x = ThirdPartyCaveat{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[9] + mi := &file_did_v1_models_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9773,7 +9173,7 @@ func (*ThirdPartyCaveat) ProtoMessage() {} // Deprecated: Use ThirdPartyCaveat.ProtoReflect.Descriptor instead. func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{9} + return file_did_v1_models_proto_rawDescGZIP(), []int{8} } func (x *ThirdPartyCaveat) GetScope() *Permissions { @@ -9821,7 +9221,7 @@ type PubKey_JWK struct { func (x *PubKey_JWK) Reset() { *x = PubKey_JWK{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[12] + mi := &file_did_v1_models_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9835,7 +9235,7 @@ func (*PubKey_JWK) ProtoMessage() {} // Deprecated: Use PubKey_JWK.ProtoReflect.Descriptor instead. func (*PubKey_JWK) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{5, 0} + return file_did_v1_models_proto_rawDescGZIP(), []int{4, 0} } func (x *PubKey_JWK) GetKty() string { @@ -9887,164 +9287,158 @@ var file_did_v1_models_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 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, 0x22, 0x59, 0x0a, 0x05, 0x41, 0x6c, 0x69, - 0x61, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x03, 0x0a, 0x0a, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x73, + 0x65, 0x72, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x27, + 0x0a, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x45, + 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, + 0x6f, 0x6e, 0x65, 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x22, + 0x91, 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, 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, 0x26, 0x0a, 0x0e, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 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, 0x04, 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, 0x05, 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, 0x06, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x22, 0xe5, 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, + 0x68, 0x61, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 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, 0x1a, 0x3b, + 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 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, 0x6c, 0x0a, 0x0b, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x18, 0x02, 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, 0x22, 0x81, 0x03, 0x0a, 0x06, 0x50, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, + 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, 0x0a, + 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x26, + 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x52, + 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x2a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x03, 0x72, 0x61, 0x77, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x2e, 0x4a, 0x57, 0x4b, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, 0x4a, 0x57, + 0x4b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, + 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, + 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0xe4, 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, 0x1c, 0x0a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 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, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, 0x22, 0x8a, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 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, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 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, 0x22, 0xa3, 0x03, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x0a, - 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, - 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x65, - 0x73, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x73, 0x65, - 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, - 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x5f, 0x77, - 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x63, 0x6c, - 0x6f, 0x6e, 0x65, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0x91, 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, 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, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 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, 0x04, 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, 0x05, 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, 0x06, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xe5, - 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 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, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 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, 0x6c, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x06, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 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, 0x22, 0x81, 0x03, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, - 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, - 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, - 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x05, 0x63, 0x75, 0x72, - 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, - 0x65, 0x12, 0x2a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, - 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b, - 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, 0x4a, 0x57, 0x4b, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, - 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, - 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0xe4, 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, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 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, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, - 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, 0x22, - 0x8a, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 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, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, - 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, - 0x74, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x73, 0x0a, 0x10, - 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, - 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, - 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, - 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6e, 0x66, 0x12, - 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x75, - 0x64, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, + 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x22, 0x73, 0x0a, 0x10, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x42, 0x7b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 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, 0x73, 0x6f, 0x6e, 0x72, 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, + 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, + 0x61, 0x72, 0x74, 0x79, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x42, 0x7b, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, + 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, 0x73, 0x6f, 0x6e, 0x72, + 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 ( @@ -10059,46 +9453,45 @@ func file_did_v1_models_proto_rawDescGZIP() []byte { return file_did_v1_models_proto_rawDescData } -var file_did_v1_models_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_did_v1_models_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_did_v1_models_proto_goTypes = []interface{}{ - (*Alias)(nil), // 0: did.v1.Alias - (*Credential)(nil), // 1: did.v1.Credential - (*Document)(nil), // 2: did.v1.Document - (*Keyshare)(nil), // 3: did.v1.Keyshare - (*Permissions)(nil), // 4: did.v1.Permissions - (*PubKey)(nil), // 5: did.v1.PubKey - (*Service)(nil), // 6: did.v1.Service - (*ServiceInfo)(nil), // 7: did.v1.ServiceInfo - (*FirstPartyCaveat)(nil), // 8: did.v1.FirstPartyCaveat - (*ThirdPartyCaveat)(nil), // 9: did.v1.ThirdPartyCaveat - nil, // 10: did.v1.Keyshare.MetadataEntry - nil, // 11: did.v1.Keyshare.PayloadsEntry - (*PubKey_JWK)(nil), // 12: did.v1.PubKey.JWK - nil, // 13: did.v1.Service.ServiceEndpointsEntry - (DIDNamespace)(0), // 14: did.v1.DIDNamespace - (PermissionScope)(0), // 15: did.v1.PermissionScope - (KeyRole)(0), // 16: did.v1.KeyRole - (KeyAlgorithm)(0), // 17: did.v1.KeyAlgorithm - (KeyEncoding)(0), // 18: did.v1.KeyEncoding - (KeyCurve)(0), // 19: did.v1.KeyCurve - (KeyType)(0), // 20: did.v1.KeyType + (*Credential)(nil), // 0: did.v1.Credential + (*Document)(nil), // 1: did.v1.Document + (*Keyshare)(nil), // 2: did.v1.Keyshare + (*Permissions)(nil), // 3: did.v1.Permissions + (*PubKey)(nil), // 4: did.v1.PubKey + (*Service)(nil), // 5: did.v1.Service + (*ServiceInfo)(nil), // 6: did.v1.ServiceInfo + (*FirstPartyCaveat)(nil), // 7: did.v1.FirstPartyCaveat + (*ThirdPartyCaveat)(nil), // 8: did.v1.ThirdPartyCaveat + nil, // 9: did.v1.Keyshare.MetadataEntry + nil, // 10: did.v1.Keyshare.PayloadsEntry + (*PubKey_JWK)(nil), // 11: did.v1.PubKey.JWK + nil, // 12: did.v1.Service.ServiceEndpointsEntry + (DIDNamespace)(0), // 13: did.v1.DIDNamespace + (PermissionScope)(0), // 14: did.v1.PermissionScope + (KeyRole)(0), // 15: did.v1.KeyRole + (KeyAlgorithm)(0), // 16: did.v1.KeyAlgorithm + (KeyEncoding)(0), // 17: did.v1.KeyEncoding + (KeyCurve)(0), // 18: did.v1.KeyCurve + (KeyType)(0), // 19: did.v1.KeyType } var file_did_v1_models_proto_depIdxs = []int32{ - 10, // 0: did.v1.Keyshare.metadata:type_name -> did.v1.Keyshare.MetadataEntry - 11, // 1: did.v1.Keyshare.payloads:type_name -> did.v1.Keyshare.PayloadsEntry - 14, // 2: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace - 15, // 3: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope - 16, // 4: did.v1.PubKey.role:type_name -> did.v1.KeyRole - 17, // 5: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm - 18, // 6: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding - 19, // 7: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve - 20, // 8: did.v1.PubKey.key_type:type_name -> did.v1.KeyType - 12, // 9: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK - 13, // 10: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry - 4, // 11: did.v1.Service.permissions:type_name -> did.v1.Permissions - 6, // 12: did.v1.ServiceInfo.service:type_name -> did.v1.Service - 4, // 13: did.v1.FirstPartyCaveat.scope:type_name -> did.v1.Permissions - 4, // 14: did.v1.ThirdPartyCaveat.scope:type_name -> did.v1.Permissions + 9, // 0: did.v1.Keyshare.metadata:type_name -> did.v1.Keyshare.MetadataEntry + 10, // 1: did.v1.Keyshare.payloads:type_name -> did.v1.Keyshare.PayloadsEntry + 13, // 2: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace + 14, // 3: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope + 15, // 4: did.v1.PubKey.role:type_name -> did.v1.KeyRole + 16, // 5: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm + 17, // 6: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding + 18, // 7: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve + 19, // 8: did.v1.PubKey.key_type:type_name -> did.v1.KeyType + 11, // 9: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK + 12, // 10: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry + 3, // 11: did.v1.Service.permissions:type_name -> did.v1.Permissions + 5, // 12: did.v1.ServiceInfo.service:type_name -> did.v1.Service + 3, // 13: did.v1.FirstPartyCaveat.scope:type_name -> did.v1.Permissions + 3, // 14: did.v1.ThirdPartyCaveat.scope:type_name -> did.v1.Permissions 15, // [15:15] is the sub-list for method output_type 15, // [15:15] is the sub-list for method input_type 15, // [15:15] is the sub-list for extension type_name @@ -10114,18 +9507,6 @@ func file_did_v1_models_proto_init() { file_did_v1_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_models_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Alias); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Credential); i { case 0: return &v.state @@ -10137,7 +9518,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Document); i { case 0: return &v.state @@ -10149,7 +9530,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Keyshare); i { case 0: return &v.state @@ -10161,7 +9542,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Permissions); i { case 0: return &v.state @@ -10173,7 +9554,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PubKey); i { case 0: return &v.state @@ -10185,7 +9566,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service); i { case 0: return &v.state @@ -10197,7 +9578,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceInfo); i { case 0: return &v.state @@ -10209,7 +9590,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FirstPartyCaveat); i { case 0: return &v.state @@ -10221,7 +9602,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ThirdPartyCaveat); i { case 0: return &v.state @@ -10233,7 +9614,7 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PubKey_JWK); i { case 0: return &v.state @@ -10252,7 +9633,7 @@ func file_did_v1_models_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_models_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index a01c68768..6b5fd2f70 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -9,191 +9,123 @@ import ( ormerrors "cosmossdk.io/orm/types/ormerrors" ) -type AccountTable interface { - Insert(ctx context.Context, account *Account) error - Update(ctx context.Context, account *Account) error - Save(ctx context.Context, account *Account) error - Delete(ctx context.Context, account *Account) error +type AliasTable interface { + Insert(ctx context.Context, alias *Alias) error + Update(ctx context.Context, alias *Alias) error + Save(ctx context.Context, alias *Alias) error + Delete(ctx context.Context, alias *Alias) error 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) (*Account, error) - HasByControllerLabel(ctx context.Context, controller string, label string) (found bool, err error) - // GetByControllerLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerLabel(ctx context.Context, controller string, label string) (*Account, error) - HasByControllerAddress(ctx context.Context, controller string, address string) (found bool, err error) - // GetByControllerAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerAddress(ctx context.Context, controller string, address string) (*Account, error) - HasByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (found bool, err error) - // GetByControllerChainCodeIndex returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (*Account, error) - HasByNamespaceAddress(ctx context.Context, namespace string, address string) (found bool, err error) - // GetByNamespaceAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByNamespaceAddress(ctx context.Context, namespace string, address string) (*Account, error) - List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) - ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) - DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error - DeleteRange(ctx context.Context, from, to AccountIndexKey) error + Get(ctx context.Context, id string) (*Alias, error) + HasByDidAlias(ctx context.Context, did string, alias string) (found bool, err error) + // GetByDidAlias returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByDidAlias(ctx context.Context, did string, alias string) (*Alias, error) + List(ctx context.Context, prefixKey AliasIndexKey, opts ...ormlist.Option) (AliasIterator, error) + ListRange(ctx context.Context, from, to AliasIndexKey, opts ...ormlist.Option) (AliasIterator, error) + DeleteBy(ctx context.Context, prefixKey AliasIndexKey) error + DeleteRange(ctx context.Context, from, to AliasIndexKey) error doNotImplement() } -type AccountIterator struct { +type AliasIterator struct { ormtable.Iterator } -func (i AccountIterator) Value() (*Account, error) { - var account Account - err := i.UnmarshalMessage(&account) - return &account, err +func (i AliasIterator) Value() (*Alias, error) { + var alias Alias + err := i.UnmarshalMessage(&alias) + return &alias, err } -type AccountIndexKey interface { +type AliasIndexKey interface { id() uint32 values() []interface{} - accountIndexKey() + aliasIndexKey() } // primary key starting index.. -type AccountPrimaryKey = AccountIdIndexKey +type AliasPrimaryKey = AliasIdIndexKey -type AccountIdIndexKey struct { +type AliasIdIndexKey struct { vs []interface{} } -func (x AccountIdIndexKey) id() uint32 { return 0 } -func (x AccountIdIndexKey) values() []interface{} { return x.vs } -func (x AccountIdIndexKey) accountIndexKey() {} +func (x AliasIdIndexKey) id() uint32 { return 0 } +func (x AliasIdIndexKey) values() []interface{} { return x.vs } +func (x AliasIdIndexKey) aliasIndexKey() {} -func (this AccountIdIndexKey) WithId(id string) AccountIdIndexKey { +func (this AliasIdIndexKey) WithId(id string) AliasIdIndexKey { this.vs = []interface{}{id} return this } -type AccountControllerLabelIndexKey struct { +type AliasDidAliasIndexKey struct { vs []interface{} } -func (x AccountControllerLabelIndexKey) id() uint32 { return 1 } -func (x AccountControllerLabelIndexKey) values() []interface{} { return x.vs } -func (x AccountControllerLabelIndexKey) accountIndexKey() {} +func (x AliasDidAliasIndexKey) id() uint32 { return 1 } +func (x AliasDidAliasIndexKey) values() []interface{} { return x.vs } +func (x AliasDidAliasIndexKey) aliasIndexKey() {} -func (this AccountControllerLabelIndexKey) WithController(controller string) AccountControllerLabelIndexKey { - this.vs = []interface{}{controller} +func (this AliasDidAliasIndexKey) WithDid(did string) AliasDidAliasIndexKey { + this.vs = []interface{}{did} return this } -func (this AccountControllerLabelIndexKey) WithControllerLabel(controller string, label string) AccountControllerLabelIndexKey { - this.vs = []interface{}{controller, label} +func (this AliasDidAliasIndexKey) WithDidAlias(did string, alias string) AliasDidAliasIndexKey { + this.vs = []interface{}{did, alias} return this } -type AccountControllerAddressIndexKey struct { - vs []interface{} -} - -func (x AccountControllerAddressIndexKey) id() uint32 { return 2 } -func (x AccountControllerAddressIndexKey) values() []interface{} { return x.vs } -func (x AccountControllerAddressIndexKey) accountIndexKey() {} - -func (this AccountControllerAddressIndexKey) WithController(controller string) AccountControllerAddressIndexKey { - this.vs = []interface{}{controller} - return this -} - -func (this AccountControllerAddressIndexKey) WithControllerAddress(controller string, address string) AccountControllerAddressIndexKey { - this.vs = []interface{}{controller, address} - return this -} - -type AccountControllerChainCodeIndexIndexKey struct { - vs []interface{} -} - -func (x AccountControllerChainCodeIndexIndexKey) id() uint32 { return 3 } -func (x AccountControllerChainCodeIndexIndexKey) values() []interface{} { return x.vs } -func (x AccountControllerChainCodeIndexIndexKey) accountIndexKey() {} - -func (this AccountControllerChainCodeIndexIndexKey) WithController(controller string) AccountControllerChainCodeIndexIndexKey { - this.vs = []interface{}{controller} - return this -} - -func (this AccountControllerChainCodeIndexIndexKey) WithControllerChainCode(controller string, chain_code uint32) AccountControllerChainCodeIndexIndexKey { - this.vs = []interface{}{controller, chain_code} - return this -} - -func (this AccountControllerChainCodeIndexIndexKey) WithControllerChainCodeIndex(controller string, chain_code uint32, index uint32) AccountControllerChainCodeIndexIndexKey { - this.vs = []interface{}{controller, chain_code, index} - return this -} - -type AccountNamespaceAddressIndexKey struct { - vs []interface{} -} - -func (x AccountNamespaceAddressIndexKey) id() uint32 { return 4 } -func (x AccountNamespaceAddressIndexKey) values() []interface{} { return x.vs } -func (x AccountNamespaceAddressIndexKey) accountIndexKey() {} - -func (this AccountNamespaceAddressIndexKey) WithNamespace(namespace string) AccountNamespaceAddressIndexKey { - this.vs = []interface{}{namespace} - return this -} - -func (this AccountNamespaceAddressIndexKey) WithNamespaceAddress(namespace string, address string) AccountNamespaceAddressIndexKey { - this.vs = []interface{}{namespace, address} - return this -} - -type accountTable struct { +type aliasTable struct { table ormtable.Table } -func (this accountTable) Insert(ctx context.Context, account *Account) error { - return this.table.Insert(ctx, account) +func (this aliasTable) Insert(ctx context.Context, alias *Alias) error { + return this.table.Insert(ctx, alias) } -func (this accountTable) Update(ctx context.Context, account *Account) error { - return this.table.Update(ctx, account) +func (this aliasTable) Update(ctx context.Context, alias *Alias) error { + return this.table.Update(ctx, alias) } -func (this accountTable) Save(ctx context.Context, account *Account) error { - return this.table.Save(ctx, account) +func (this aliasTable) Save(ctx context.Context, alias *Alias) error { + return this.table.Save(ctx, alias) } -func (this accountTable) Delete(ctx context.Context, account *Account) error { - return this.table.Delete(ctx, account) +func (this aliasTable) Delete(ctx context.Context, alias *Alias) error { + return this.table.Delete(ctx, alias) } -func (this accountTable) Has(ctx context.Context, id string) (found bool, err error) { +func (this aliasTable) Has(ctx context.Context, id string) (found bool, err error) { return this.table.PrimaryKey().Has(ctx, id) } -func (this accountTable) Get(ctx context.Context, id string) (*Account, error) { - var account Account - found, err := this.table.PrimaryKey().Get(ctx, &account, id) +func (this aliasTable) Get(ctx context.Context, id string) (*Alias, error) { + var alias Alias + found, err := this.table.PrimaryKey().Get(ctx, &alias, id) if err != nil { return nil, err } if !found { return nil, ormerrors.NotFound } - return &account, nil + return &alias, nil } -func (this accountTable) HasByControllerLabel(ctx context.Context, controller string, label string) (found bool, err error) { +func (this aliasTable) HasByDidAlias(ctx context.Context, did string, alias string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - controller, - label, + did, + alias, ) } -func (this accountTable) GetByControllerLabel(ctx context.Context, controller string, label string) (*Account, error) { - var account Account - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &account, - controller, - label, +func (this aliasTable) GetByDidAlias(ctx context.Context, did string, alias string) (*Alias, error) { + var alias Alias + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &alias, + did, + alias, ) if err != nil { return nil, err @@ -201,105 +133,37 @@ func (this accountTable) GetByControllerLabel(ctx context.Context, controller st if !found { return nil, ormerrors.NotFound } - return &account, nil + return &alias, nil } -func (this accountTable) HasByControllerAddress(ctx context.Context, controller string, address string) (found bool, err error) { - return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, - controller, - address, - ) -} - -func (this accountTable) GetByControllerAddress(ctx context.Context, controller string, address string) (*Account, error) { - var account Account - found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &account, - controller, - address, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &account, nil -} - -func (this accountTable) HasByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (found bool, err error) { - return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx, - controller, - chain_code, - index, - ) -} - -func (this accountTable) GetByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (*Account, error) { - var account Account - found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &account, - controller, - chain_code, - index, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &account, nil -} - -func (this accountTable) HasByNamespaceAddress(ctx context.Context, namespace string, address string) (found bool, err error) { - return this.table.GetIndexByID(4).(ormtable.UniqueIndex).Has(ctx, - namespace, - address, - ) -} - -func (this accountTable) GetByNamespaceAddress(ctx context.Context, namespace string, address string) (*Account, error) { - var account Account - found, err := this.table.GetIndexByID(4).(ormtable.UniqueIndex).Get(ctx, &account, - namespace, - address, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &account, nil -} - -func (this accountTable) List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) { +func (this aliasTable) List(ctx context.Context, prefixKey AliasIndexKey, opts ...ormlist.Option) (AliasIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return AccountIterator{it}, err + return AliasIterator{it}, err } -func (this accountTable) ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) { +func (this aliasTable) ListRange(ctx context.Context, from, to AliasIndexKey, opts ...ormlist.Option) (AliasIterator, error) { it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return AccountIterator{it}, err + return AliasIterator{it}, err } -func (this accountTable) DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error { +func (this aliasTable) DeleteBy(ctx context.Context, prefixKey AliasIndexKey) error { return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) } -func (this accountTable) DeleteRange(ctx context.Context, from, to AccountIndexKey) error { +func (this aliasTable) DeleteRange(ctx context.Context, from, to AliasIndexKey) error { return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) } -func (this accountTable) doNotImplement() {} +func (this aliasTable) doNotImplement() {} -var _ AccountTable = accountTable{} +var _ AliasTable = aliasTable{} -func NewAccountTable(db ormtable.Schema) (AccountTable, error) { - table := db.GetTable(&Account{}) +func NewAliasTable(db ormtable.Schema) (AliasTable, error) { + table := db.GetTable(&Alias{}) if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Account{}).ProtoReflect().Descriptor().FullName())) + return nil, ormerrors.TableNotFound.Wrap(string((&Alias{}).ProtoReflect().Descriptor().FullName())) } - return accountTable{table}, nil + return aliasTable{table}, nil } type ControllerTable interface { @@ -382,6 +246,19 @@ func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) Controller return this } +type ControllerStatusIndexKey struct { + vs []interface{} +} + +func (x ControllerStatusIndexKey) id() uint32 { return 3 } +func (x ControllerStatusIndexKey) values() []interface{} { return x.vs } +func (x ControllerStatusIndexKey) controllerIndexKey() {} + +func (this ControllerStatusIndexKey) WithStatus(status string) ControllerStatusIndexKey { + this.vs = []interface{}{status} + return this +} + type controllerTable struct { table ormtable.Table } @@ -488,479 +365,122 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) { return controllerTable{table}, nil } -type ProofTable interface { - Insert(ctx context.Context, proof *Proof) error - Update(ctx context.Context, proof *Proof) error - Save(ctx context.Context, proof *Proof) error - Delete(ctx context.Context, proof *Proof) error +type VerificationTable interface { + Insert(ctx context.Context, verification *Verification) error + Update(ctx context.Context, verification *Verification) error + Save(ctx context.Context, verification *Verification) error + Delete(ctx context.Context, verification *Verification) error 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) (*Proof, error) - HasByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (found bool, err error) - // GetByControllerIssuerProperty returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (*Proof, error) - List(ctx context.Context, prefixKey ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) - ListRange(ctx context.Context, from, to ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) - DeleteBy(ctx context.Context, prefixKey ProofIndexKey) error - DeleteRange(ctx context.Context, from, to ProofIndexKey) error - - doNotImplement() -} - -type ProofIterator struct { - ormtable.Iterator -} - -func (i ProofIterator) Value() (*Proof, error) { - var proof Proof - err := i.UnmarshalMessage(&proof) - return &proof, err -} - -type ProofIndexKey interface { - id() uint32 - values() []interface{} - proofIndexKey() -} - -// primary key starting index.. -type ProofPrimaryKey = ProofIdIndexKey - -type ProofIdIndexKey struct { - vs []interface{} -} - -func (x ProofIdIndexKey) id() uint32 { return 0 } -func (x ProofIdIndexKey) values() []interface{} { return x.vs } -func (x ProofIdIndexKey) proofIndexKey() {} - -func (this ProofIdIndexKey) WithId(id string) ProofIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ProofControllerIssuerPropertyIndexKey struct { - vs []interface{} -} - -func (x ProofControllerIssuerPropertyIndexKey) id() uint32 { return 1 } -func (x ProofControllerIssuerPropertyIndexKey) values() []interface{} { return x.vs } -func (x ProofControllerIssuerPropertyIndexKey) proofIndexKey() {} - -func (this ProofControllerIssuerPropertyIndexKey) WithController(controller string) ProofControllerIssuerPropertyIndexKey { - this.vs = []interface{}{controller} - return this -} - -func (this ProofControllerIssuerPropertyIndexKey) WithControllerIssuer(controller string, issuer string) ProofControllerIssuerPropertyIndexKey { - this.vs = []interface{}{controller, issuer} - return this -} - -func (this ProofControllerIssuerPropertyIndexKey) WithControllerIssuerProperty(controller string, issuer string, property string) ProofControllerIssuerPropertyIndexKey { - this.vs = []interface{}{controller, issuer, property} - return this -} - -type proofTable struct { - table ormtable.Table -} - -func (this proofTable) Insert(ctx context.Context, proof *Proof) error { - return this.table.Insert(ctx, proof) -} - -func (this proofTable) Update(ctx context.Context, proof *Proof) error { - return this.table.Update(ctx, proof) -} - -func (this proofTable) Save(ctx context.Context, proof *Proof) error { - return this.table.Save(ctx, proof) -} - -func (this proofTable) Delete(ctx context.Context, proof *Proof) error { - return this.table.Delete(ctx, proof) -} - -func (this proofTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this proofTable) Get(ctx context.Context, id string) (*Proof, error) { - var proof Proof - found, err := this.table.PrimaryKey().Get(ctx, &proof, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &proof, nil -} - -func (this proofTable) HasByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - controller, - issuer, - property, - ) -} - -func (this proofTable) GetByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (*Proof, error) { - var proof Proof - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &proof, - controller, - issuer, - property, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &proof, nil -} - -func (this proofTable) List(ctx context.Context, prefixKey ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ProofIterator{it}, err -} - -func (this proofTable) ListRange(ctx context.Context, from, to ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ProofIterator{it}, err -} - -func (this proofTable) DeleteBy(ctx context.Context, prefixKey ProofIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this proofTable) DeleteRange(ctx context.Context, from, to ProofIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this proofTable) doNotImplement() {} - -var _ ProofTable = proofTable{} - -func NewProofTable(db ormtable.Schema) (ProofTable, error) { - table := db.GetTable(&Proof{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Proof{}).ProtoReflect().Descriptor().FullName())) - } - return proofTable{table}, nil -} - -type ServiceRecordTable interface { - Insert(ctx context.Context, serviceRecord *ServiceRecord) error - Update(ctx context.Context, serviceRecord *ServiceRecord) error - Save(ctx context.Context, serviceRecord *ServiceRecord) error - Delete(ctx context.Context, serviceRecord *ServiceRecord) error - 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) (*ServiceRecord, error) - HasByOrigin(ctx context.Context, origin string) (found bool, err error) - // GetByOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByOrigin(ctx context.Context, origin string) (*ServiceRecord, error) - HasByAuthorityOrigin(ctx context.Context, authority string, origin string) (found bool, err error) - // GetByAuthorityOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByAuthorityOrigin(ctx context.Context, authority string, origin string) (*ServiceRecord, error) - List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) - ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) - DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error - DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error - - doNotImplement() -} - -type ServiceRecordIterator struct { - ormtable.Iterator -} - -func (i ServiceRecordIterator) Value() (*ServiceRecord, error) { - var serviceRecord ServiceRecord - err := i.UnmarshalMessage(&serviceRecord) - return &serviceRecord, err -} - -type ServiceRecordIndexKey interface { - id() uint32 - values() []interface{} - serviceRecordIndexKey() -} - -// primary key starting index.. -type ServiceRecordPrimaryKey = ServiceRecordIdIndexKey - -type ServiceRecordIdIndexKey struct { - vs []interface{} -} - -func (x ServiceRecordIdIndexKey) id() uint32 { return 0 } -func (x ServiceRecordIdIndexKey) values() []interface{} { return x.vs } -func (x ServiceRecordIdIndexKey) serviceRecordIndexKey() {} - -func (this ServiceRecordIdIndexKey) WithId(id string) ServiceRecordIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ServiceRecordOriginIndexKey struct { - vs []interface{} -} - -func (x ServiceRecordOriginIndexKey) id() uint32 { return 1 } -func (x ServiceRecordOriginIndexKey) values() []interface{} { return x.vs } -func (x ServiceRecordOriginIndexKey) serviceRecordIndexKey() {} - -func (this ServiceRecordOriginIndexKey) WithOrigin(origin string) ServiceRecordOriginIndexKey { - this.vs = []interface{}{origin} - return this -} - -type ServiceRecordAuthorityOriginIndexKey struct { - vs []interface{} -} - -func (x ServiceRecordAuthorityOriginIndexKey) id() uint32 { return 2 } -func (x ServiceRecordAuthorityOriginIndexKey) values() []interface{} { return x.vs } -func (x ServiceRecordAuthorityOriginIndexKey) serviceRecordIndexKey() {} - -func (this ServiceRecordAuthorityOriginIndexKey) WithAuthority(authority string) ServiceRecordAuthorityOriginIndexKey { - this.vs = []interface{}{authority} - return this -} - -func (this ServiceRecordAuthorityOriginIndexKey) WithAuthorityOrigin(authority string, origin string) ServiceRecordAuthorityOriginIndexKey { - this.vs = []interface{}{authority, origin} - return this -} - -type serviceRecordTable struct { - table ormtable.Table -} - -func (this serviceRecordTable) Insert(ctx context.Context, serviceRecord *ServiceRecord) error { - return this.table.Insert(ctx, serviceRecord) -} - -func (this serviceRecordTable) Update(ctx context.Context, serviceRecord *ServiceRecord) error { - return this.table.Update(ctx, serviceRecord) -} - -func (this serviceRecordTable) Save(ctx context.Context, serviceRecord *ServiceRecord) error { - return this.table.Save(ctx, serviceRecord) -} - -func (this serviceRecordTable) Delete(ctx context.Context, serviceRecord *ServiceRecord) error { - return this.table.Delete(ctx, serviceRecord) -} - -func (this serviceRecordTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this serviceRecordTable) Get(ctx context.Context, id string) (*ServiceRecord, error) { - var serviceRecord ServiceRecord - found, err := this.table.PrimaryKey().Get(ctx, &serviceRecord, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &serviceRecord, nil -} - -func (this serviceRecordTable) HasByOrigin(ctx context.Context, origin string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - origin, - ) -} - -func (this serviceRecordTable) GetByOrigin(ctx context.Context, origin string) (*ServiceRecord, error) { - var serviceRecord ServiceRecord - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &serviceRecord, - origin, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &serviceRecord, nil -} - -func (this serviceRecordTable) HasByAuthorityOrigin(ctx context.Context, authority string, origin string) (found bool, err error) { - return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, - authority, - origin, - ) -} - -func (this serviceRecordTable) GetByAuthorityOrigin(ctx context.Context, authority string, origin string) (*ServiceRecord, error) { - var serviceRecord ServiceRecord - found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &serviceRecord, - authority, - origin, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &serviceRecord, nil -} - -func (this serviceRecordTable) List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ServiceRecordIterator{it}, err -} - -func (this serviceRecordTable) ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ServiceRecordIterator{it}, err -} - -func (this serviceRecordTable) DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this serviceRecordTable) DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this serviceRecordTable) doNotImplement() {} - -var _ ServiceRecordTable = serviceRecordTable{} - -func NewServiceRecordTable(db ormtable.Schema) (ServiceRecordTable, error) { - table := db.GetTable(&ServiceRecord{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ServiceRecord{}).ProtoReflect().Descriptor().FullName())) - } - return serviceRecordTable{table}, nil -} - -type VerificationMethodTable interface { - Insert(ctx context.Context, verificationMethod *VerificationMethod) error - Update(ctx context.Context, verificationMethod *VerificationMethod) error - Save(ctx context.Context, verificationMethod *VerificationMethod) error - Delete(ctx context.Context, verificationMethod *VerificationMethod) error - 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) (*VerificationMethod, error) + Get(ctx context.Context, id string) (*Verification, error) HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) // GetByControllerMethodIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*VerificationMethod, error) - List(ctx context.Context, prefixKey VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) - ListRange(ctx context.Context, from, to VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) - DeleteBy(ctx context.Context, prefixKey VerificationMethodIndexKey) error - DeleteRange(ctx context.Context, from, to VerificationMethodIndexKey) error + GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*Verification, error) + List(ctx context.Context, prefixKey VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) + ListRange(ctx context.Context, from, to VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) + DeleteBy(ctx context.Context, prefixKey VerificationIndexKey) error + DeleteRange(ctx context.Context, from, to VerificationIndexKey) error doNotImplement() } -type VerificationMethodIterator struct { +type VerificationIterator struct { ormtable.Iterator } -func (i VerificationMethodIterator) Value() (*VerificationMethod, error) { - var verificationMethod VerificationMethod - err := i.UnmarshalMessage(&verificationMethod) - return &verificationMethod, err +func (i VerificationIterator) Value() (*Verification, error) { + var verification Verification + err := i.UnmarshalMessage(&verification) + return &verification, err } -type VerificationMethodIndexKey interface { +type VerificationIndexKey interface { id() uint32 values() []interface{} - verificationMethodIndexKey() + verificationIndexKey() } // primary key starting index.. -type VerificationMethodPrimaryKey = VerificationMethodIdIndexKey +type VerificationPrimaryKey = VerificationIdIndexKey -type VerificationMethodIdIndexKey struct { +type VerificationIdIndexKey struct { vs []interface{} } -func (x VerificationMethodIdIndexKey) id() uint32 { return 0 } -func (x VerificationMethodIdIndexKey) values() []interface{} { return x.vs } -func (x VerificationMethodIdIndexKey) verificationMethodIndexKey() {} +func (x VerificationIdIndexKey) id() uint32 { return 0 } +func (x VerificationIdIndexKey) values() []interface{} { return x.vs } +func (x VerificationIdIndexKey) verificationIndexKey() {} -func (this VerificationMethodIdIndexKey) WithId(id string) VerificationMethodIdIndexKey { +func (this VerificationIdIndexKey) WithId(id string) VerificationIdIndexKey { this.vs = []interface{}{id} return this } -type VerificationMethodControllerMethodIssuerSubjectIndexKey struct { +type VerificationControllerMethodIssuerSubjectIndexKey struct { vs []interface{} } -func (x VerificationMethodControllerMethodIssuerSubjectIndexKey) id() uint32 { return 1 } -func (x VerificationMethodControllerMethodIssuerSubjectIndexKey) values() []interface{} { return x.vs } -func (x VerificationMethodControllerMethodIssuerSubjectIndexKey) verificationMethodIndexKey() {} +func (x VerificationControllerMethodIssuerSubjectIndexKey) id() uint32 { return 1 } +func (x VerificationControllerMethodIssuerSubjectIndexKey) values() []interface{} { return x.vs } +func (x VerificationControllerMethodIssuerSubjectIndexKey) verificationIndexKey() {} -func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithController(controller string) VerificationMethodControllerMethodIssuerSubjectIndexKey { +func (this VerificationControllerMethodIssuerSubjectIndexKey) WithController(controller string) VerificationControllerMethodIssuerSubjectIndexKey { this.vs = []interface{}{controller} return this } -func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithControllerMethod(controller string, method DIDNamespace) VerificationMethodControllerMethodIssuerSubjectIndexKey { +func (this VerificationControllerMethodIssuerSubjectIndexKey) WithControllerMethod(controller string, method DIDNamespace) VerificationControllerMethodIssuerSubjectIndexKey { this.vs = []interface{}{controller, method} return this } -func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuer(controller string, method DIDNamespace, issuer string) VerificationMethodControllerMethodIssuerSubjectIndexKey { +func (this VerificationControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuer(controller string, method DIDNamespace, issuer string) VerificationControllerMethodIssuerSubjectIndexKey { this.vs = []interface{}{controller, method, issuer} return this } -func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuerSubject(controller string, method DIDNamespace, issuer string, subject string) VerificationMethodControllerMethodIssuerSubjectIndexKey { +func (this VerificationControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuerSubject(controller string, method DIDNamespace, issuer string, subject string) VerificationControllerMethodIssuerSubjectIndexKey { this.vs = []interface{}{controller, method, issuer, subject} return this } -type verificationMethodTable struct { +type verificationTable struct { table ormtable.Table } -func (this verificationMethodTable) Insert(ctx context.Context, verificationMethod *VerificationMethod) error { - return this.table.Insert(ctx, verificationMethod) +func (this verificationTable) Insert(ctx context.Context, verification *Verification) error { + return this.table.Insert(ctx, verification) } -func (this verificationMethodTable) Update(ctx context.Context, verificationMethod *VerificationMethod) error { - return this.table.Update(ctx, verificationMethod) +func (this verificationTable) Update(ctx context.Context, verification *Verification) error { + return this.table.Update(ctx, verification) } -func (this verificationMethodTable) Save(ctx context.Context, verificationMethod *VerificationMethod) error { - return this.table.Save(ctx, verificationMethod) +func (this verificationTable) Save(ctx context.Context, verification *Verification) error { + return this.table.Save(ctx, verification) } -func (this verificationMethodTable) Delete(ctx context.Context, verificationMethod *VerificationMethod) error { - return this.table.Delete(ctx, verificationMethod) +func (this verificationTable) Delete(ctx context.Context, verification *Verification) error { + return this.table.Delete(ctx, verification) } -func (this verificationMethodTable) Has(ctx context.Context, id string) (found bool, err error) { +func (this verificationTable) Has(ctx context.Context, id string) (found bool, err error) { return this.table.PrimaryKey().Has(ctx, id) } -func (this verificationMethodTable) Get(ctx context.Context, id string) (*VerificationMethod, error) { - var verificationMethod VerificationMethod - found, err := this.table.PrimaryKey().Get(ctx, &verificationMethod, id) +func (this verificationTable) Get(ctx context.Context, id string) (*Verification, error) { + var verification Verification + found, err := this.table.PrimaryKey().Get(ctx, &verification, id) if err != nil { return nil, err } if !found { return nil, ormerrors.NotFound } - return &verificationMethod, nil + return &verification, nil } -func (this verificationMethodTable) HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) { +func (this verificationTable) HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, controller, method, @@ -969,9 +489,9 @@ func (this verificationMethodTable) HasByControllerMethodIssuerSubject(ctx conte ) } -func (this verificationMethodTable) GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*VerificationMethod, error) { - var verificationMethod VerificationMethod - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &verificationMethod, +func (this verificationTable) GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*Verification, error) { + var verification Verification + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &verification, controller, method, issuer, @@ -983,75 +503,63 @@ func (this verificationMethodTable) GetByControllerMethodIssuerSubject(ctx conte if !found { return nil, ormerrors.NotFound } - return &verificationMethod, nil + return &verification, nil } -func (this verificationMethodTable) List(ctx context.Context, prefixKey VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) { +func (this verificationTable) List(ctx context.Context, prefixKey VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return VerificationMethodIterator{it}, err + return VerificationIterator{it}, err } -func (this verificationMethodTable) ListRange(ctx context.Context, from, to VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) { +func (this verificationTable) ListRange(ctx context.Context, from, to VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) { it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return VerificationMethodIterator{it}, err + return VerificationIterator{it}, err } -func (this verificationMethodTable) DeleteBy(ctx context.Context, prefixKey VerificationMethodIndexKey) error { +func (this verificationTable) DeleteBy(ctx context.Context, prefixKey VerificationIndexKey) error { return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) } -func (this verificationMethodTable) DeleteRange(ctx context.Context, from, to VerificationMethodIndexKey) error { +func (this verificationTable) DeleteRange(ctx context.Context, from, to VerificationIndexKey) error { return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) } -func (this verificationMethodTable) doNotImplement() {} +func (this verificationTable) doNotImplement() {} -var _ VerificationMethodTable = verificationMethodTable{} +var _ VerificationTable = verificationTable{} -func NewVerificationMethodTable(db ormtable.Schema) (VerificationMethodTable, error) { - table := db.GetTable(&VerificationMethod{}) +func NewVerificationTable(db ormtable.Schema) (VerificationTable, error) { + table := db.GetTable(&Verification{}) if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&VerificationMethod{}).ProtoReflect().Descriptor().FullName())) + return nil, ormerrors.TableNotFound.Wrap(string((&Verification{}).ProtoReflect().Descriptor().FullName())) } - return verificationMethodTable{table}, nil + return verificationTable{table}, nil } type StateStore interface { - AccountTable() AccountTable + AliasTable() AliasTable ControllerTable() ControllerTable - ProofTable() ProofTable - ServiceRecordTable() ServiceRecordTable - VerificationMethodTable() VerificationMethodTable + VerificationTable() VerificationTable doNotImplement() } type stateStore struct { - account AccountTable - controller ControllerTable - proof ProofTable - serviceRecord ServiceRecordTable - verificationMethod VerificationMethodTable + alias AliasTable + controller ControllerTable + verification VerificationTable } -func (x stateStore) AccountTable() AccountTable { - return x.account +func (x stateStore) AliasTable() AliasTable { + return x.alias } func (x stateStore) ControllerTable() ControllerTable { return x.controller } -func (x stateStore) ProofTable() ProofTable { - return x.proof -} - -func (x stateStore) ServiceRecordTable() ServiceRecordTable { - return x.serviceRecord -} - -func (x stateStore) VerificationMethodTable() VerificationMethodTable { - return x.verificationMethod +func (x stateStore) VerificationTable() VerificationTable { + return x.verification } func (stateStore) doNotImplement() {} @@ -1059,7 +567,7 @@ func (stateStore) doNotImplement() {} var _ StateStore = stateStore{} func NewStateStore(db ormtable.Schema) (StateStore, error) { - accountTable, err := NewAccountTable(db) + aliasTable, err := NewAliasTable(db) if err != nil { return nil, err } @@ -1069,26 +577,14 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { return nil, err } - proofTable, err := NewProofTable(db) - if err != nil { - return nil, err - } - - serviceRecordTable, err := NewServiceRecordTable(db) - if err != nil { - return nil, err - } - - verificationMethodTable, err := NewVerificationMethodTable(db) + verificationTable, err := NewVerificationTable(db) if err != nil { return nil, err } return stateStore{ - accountTable, + aliasTable, controllerTable, - proofTable, - serviceRecordTable, - verificationMethodTable, + verificationTable, }, nil } diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 275f4ad97..dd314c728 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -10,42 +10,85 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" - sort "sort" sync "sync" ) +var _ protoreflect.List = (*_Alias_5_list)(nil) + +type _Alias_5_list struct { + list *[]string +} + +func (x *_Alias_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Alias_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Alias_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Alias_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Alias_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Alias at list field Scopes as it is not of Message kind")) +} + +func (x *_Alias_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Alias_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Alias_5_list) IsValid() bool { + return x.list != nil +} + var ( - md_Account protoreflect.MessageDescriptor - fd_Account_id protoreflect.FieldDescriptor - fd_Account_address protoreflect.FieldDescriptor - fd_Account_label protoreflect.FieldDescriptor - fd_Account_controller protoreflect.FieldDescriptor - fd_Account_namespace protoreflect.FieldDescriptor - fd_Account_chain_code protoreflect.FieldDescriptor - fd_Account_index protoreflect.FieldDescriptor + md_Alias protoreflect.MessageDescriptor + fd_Alias_id protoreflect.FieldDescriptor + fd_Alias_did protoreflect.FieldDescriptor + fd_Alias_alias protoreflect.FieldDescriptor + fd_Alias_origin protoreflect.FieldDescriptor + fd_Alias_scopes protoreflect.FieldDescriptor + fd_Alias_expiration protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Account = File_did_v1_state_proto.Messages().ByName("Account") - fd_Account_id = md_Account.Fields().ByName("id") - fd_Account_address = md_Account.Fields().ByName("address") - fd_Account_label = md_Account.Fields().ByName("label") - fd_Account_controller = md_Account.Fields().ByName("controller") - fd_Account_namespace = md_Account.Fields().ByName("namespace") - fd_Account_chain_code = md_Account.Fields().ByName("chain_code") - fd_Account_index = md_Account.Fields().ByName("index") + md_Alias = File_did_v1_state_proto.Messages().ByName("Alias") + fd_Alias_id = md_Alias.Fields().ByName("id") + fd_Alias_did = md_Alias.Fields().ByName("did") + fd_Alias_alias = md_Alias.Fields().ByName("alias") + fd_Alias_origin = md_Alias.Fields().ByName("origin") + fd_Alias_scopes = md_Alias.Fields().ByName("scopes") + fd_Alias_expiration = md_Alias.Fields().ByName("expiration") } -var _ protoreflect.Message = (*fastReflection_Account)(nil) +var _ protoreflect.Message = (*fastReflection_Alias)(nil) -type fastReflection_Account Account +type fastReflection_Alias Alias -func (x *Account) ProtoReflect() protoreflect.Message { - return (*fastReflection_Account)(x) +func (x *Alias) ProtoReflect() protoreflect.Message { + return (*fastReflection_Alias)(x) } -func (x *Account) slowProtoReflect() protoreflect.Message { +func (x *Alias) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -57,43 +100,43 @@ func (x *Account) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Account_messageType fastReflection_Account_messageType -var _ protoreflect.MessageType = fastReflection_Account_messageType{} +var _fastReflection_Alias_messageType fastReflection_Alias_messageType +var _ protoreflect.MessageType = fastReflection_Alias_messageType{} -type fastReflection_Account_messageType struct{} +type fastReflection_Alias_messageType struct{} -func (x fastReflection_Account_messageType) Zero() protoreflect.Message { - return (*fastReflection_Account)(nil) +func (x fastReflection_Alias_messageType) Zero() protoreflect.Message { + return (*fastReflection_Alias)(nil) } -func (x fastReflection_Account_messageType) New() protoreflect.Message { - return new(fastReflection_Account) +func (x fastReflection_Alias_messageType) New() protoreflect.Message { + return new(fastReflection_Alias) } -func (x fastReflection_Account_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Account +func (x fastReflection_Alias_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Alias } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Account) Descriptor() protoreflect.MessageDescriptor { - return md_Account +func (x *fastReflection_Alias) Descriptor() protoreflect.MessageDescriptor { + return md_Alias } // 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_Account) Type() protoreflect.MessageType { - return _fastReflection_Account_messageType +func (x *fastReflection_Alias) Type() protoreflect.MessageType { + return _fastReflection_Alias_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Account) New() protoreflect.Message { - return new(fastReflection_Account) +func (x *fastReflection_Alias) New() protoreflect.Message { + return new(fastReflection_Alias) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Account) Interface() protoreflect.ProtoMessage { - return (*Account)(x) +func (x *fastReflection_Alias) Interface() protoreflect.ProtoMessage { + return (*Alias)(x) } // Range iterates over every populated field in an undefined order, @@ -101,46 +144,40 @@ func (x *fastReflection_Account) 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_Account) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Alias) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_Account_id, value) { + if !f(fd_Alias_id, value) { return } } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_Account_address, value) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_Alias_did, value) { return } } - if x.Label != "" { - value := protoreflect.ValueOfString(x.Label) - if !f(fd_Account_label, value) { + if x.Alias != "" { + value := protoreflect.ValueOfString(x.Alias) + if !f(fd_Alias_alias, value) { return } } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Account_controller, value) { + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Alias_origin, value) { return } } - if x.Namespace != "" { - value := protoreflect.ValueOfString(x.Namespace) - if !f(fd_Account_namespace, value) { + if len(x.Scopes) != 0 { + value := protoreflect.ValueOfList(&_Alias_5_list{list: &x.Scopes}) + if !f(fd_Alias_scopes, value) { return } } - if x.ChainCode != uint32(0) { - value := protoreflect.ValueOfUint32(x.ChainCode) - if !f(fd_Account_chain_code, value) { - return - } - } - if x.Index != uint32(0) { - value := protoreflect.ValueOfUint32(x.Index) - if !f(fd_Account_index, value) { + if x.Expiration != int64(0) { + value := protoreflect.ValueOfInt64(x.Expiration) + if !f(fd_Alias_expiration, value) { return } } @@ -157,27 +194,25 @@ func (x *fastReflection_Account) Range(f func(protoreflect.FieldDescriptor, prot // 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_Account) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Alias) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Account.id": + case "did.v1.Alias.id": return x.Id != "" - case "did.v1.Account.address": - return x.Address != "" - case "did.v1.Account.label": - return x.Label != "" - case "did.v1.Account.controller": - return x.Controller != "" - case "did.v1.Account.namespace": - return x.Namespace != "" - case "did.v1.Account.chain_code": - return x.ChainCode != uint32(0) - case "did.v1.Account.index": - return x.Index != uint32(0) + case "did.v1.Alias.did": + return x.Did != "" + case "did.v1.Alias.alias": + return x.Alias != "" + case "did.v1.Alias.origin": + return x.Origin != "" + case "did.v1.Alias.scopes": + return len(x.Scopes) != 0 + case "did.v1.Alias.expiration": + return x.Expiration != int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) } - panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Alias does not contain field %s", fd.FullName())) } } @@ -187,27 +222,25 @@ func (x *fastReflection_Account) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Account) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Alias) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Account.id": + case "did.v1.Alias.id": x.Id = "" - case "did.v1.Account.address": - x.Address = "" - case "did.v1.Account.label": - x.Label = "" - case "did.v1.Account.controller": - x.Controller = "" - case "did.v1.Account.namespace": - x.Namespace = "" - case "did.v1.Account.chain_code": - x.ChainCode = uint32(0) - case "did.v1.Account.index": - x.Index = uint32(0) + case "did.v1.Alias.did": + x.Did = "" + case "did.v1.Alias.alias": + x.Alias = "" + case "did.v1.Alias.origin": + x.Origin = "" + case "did.v1.Alias.scopes": + x.Scopes = nil + case "did.v1.Alias.expiration": + x.Expiration = int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) } - panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Alias does not contain field %s", fd.FullName())) } } @@ -217,34 +250,34 @@ func (x *fastReflection_Account) 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_Account) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Alias) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Account.id": + case "did.v1.Alias.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Account.address": - value := x.Address + case "did.v1.Alias.did": + value := x.Did return protoreflect.ValueOfString(value) - case "did.v1.Account.label": - value := x.Label + case "did.v1.Alias.alias": + value := x.Alias return protoreflect.ValueOfString(value) - case "did.v1.Account.controller": - value := x.Controller + case "did.v1.Alias.origin": + value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.Account.namespace": - value := x.Namespace - return protoreflect.ValueOfString(value) - case "did.v1.Account.chain_code": - value := x.ChainCode - return protoreflect.ValueOfUint32(value) - case "did.v1.Account.index": - value := x.Index - return protoreflect.ValueOfUint32(value) + case "did.v1.Alias.scopes": + if len(x.Scopes) == 0 { + return protoreflect.ValueOfList(&_Alias_5_list{}) + } + listValue := &_Alias_5_list{list: &x.Scopes} + return protoreflect.ValueOfList(listValue) + case "did.v1.Alias.expiration": + value := x.Expiration + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) } - panic(fmt.Errorf("message did.v1.Account does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Alias does not contain field %s", descriptor.FullName())) } } @@ -258,27 +291,27 @@ func (x *fastReflection_Account) Get(descriptor protoreflect.FieldDescriptor) pr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Account) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Alias) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Account.id": + case "did.v1.Alias.id": x.Id = value.Interface().(string) - case "did.v1.Account.address": - x.Address = value.Interface().(string) - case "did.v1.Account.label": - x.Label = value.Interface().(string) - case "did.v1.Account.controller": - x.Controller = value.Interface().(string) - case "did.v1.Account.namespace": - x.Namespace = value.Interface().(string) - case "did.v1.Account.chain_code": - x.ChainCode = uint32(value.Uint()) - case "did.v1.Account.index": - x.Index = uint32(value.Uint()) + case "did.v1.Alias.did": + x.Did = value.Interface().(string) + case "did.v1.Alias.alias": + x.Alias = value.Interface().(string) + case "did.v1.Alias.origin": + x.Origin = value.Interface().(string) + case "did.v1.Alias.scopes": + lv := value.List() + clv := lv.(*_Alias_5_list) + x.Scopes = *clv.list + case "did.v1.Alias.expiration": + x.Expiration = value.Int() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) } - panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Alias does not contain field %s", fd.FullName())) } } @@ -292,64 +325,65 @@ func (x *fastReflection_Account) Set(fd protoreflect.FieldDescriptor, value prot // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Account) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Alias) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Account.id": - panic(fmt.Errorf("field id of message did.v1.Account is not mutable")) - case "did.v1.Account.address": - panic(fmt.Errorf("field address of message did.v1.Account is not mutable")) - case "did.v1.Account.label": - panic(fmt.Errorf("field label of message did.v1.Account is not mutable")) - case "did.v1.Account.controller": - panic(fmt.Errorf("field controller of message did.v1.Account is not mutable")) - case "did.v1.Account.namespace": - panic(fmt.Errorf("field namespace of message did.v1.Account is not mutable")) - case "did.v1.Account.chain_code": - panic(fmt.Errorf("field chain_code of message did.v1.Account is not mutable")) - case "did.v1.Account.index": - panic(fmt.Errorf("field index of message did.v1.Account is not mutable")) + case "did.v1.Alias.scopes": + if x.Scopes == nil { + x.Scopes = []string{} + } + value := &_Alias_5_list{list: &x.Scopes} + return protoreflect.ValueOfList(value) + case "did.v1.Alias.id": + panic(fmt.Errorf("field id of message did.v1.Alias is not mutable")) + case "did.v1.Alias.did": + panic(fmt.Errorf("field did of message did.v1.Alias is not mutable")) + case "did.v1.Alias.alias": + panic(fmt.Errorf("field alias of message did.v1.Alias is not mutable")) + case "did.v1.Alias.origin": + panic(fmt.Errorf("field origin of message did.v1.Alias is not mutable")) + case "did.v1.Alias.expiration": + panic(fmt.Errorf("field expiration of message did.v1.Alias is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) } - panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Alias 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_Account) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Alias) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Account.id": + case "did.v1.Alias.id": return protoreflect.ValueOfString("") - case "did.v1.Account.address": + case "did.v1.Alias.did": return protoreflect.ValueOfString("") - case "did.v1.Account.label": + case "did.v1.Alias.alias": return protoreflect.ValueOfString("") - case "did.v1.Account.controller": + case "did.v1.Alias.origin": return protoreflect.ValueOfString("") - case "did.v1.Account.namespace": - return protoreflect.ValueOfString("") - case "did.v1.Account.chain_code": - return protoreflect.ValueOfUint32(uint32(0)) - case "did.v1.Account.index": - return protoreflect.ValueOfUint32(uint32(0)) + case "did.v1.Alias.scopes": + list := []string{} + return protoreflect.ValueOfList(&_Alias_5_list{list: &list}) + case "did.v1.Alias.expiration": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) } - panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Alias 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_Account) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Alias) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Account", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Alias", d.FullName())) } panic("unreachable") } @@ -357,7 +391,7 @@ func (x *fastReflection_Account) WhichOneof(d protoreflect.OneofDescriptor) prot // 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_Account) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Alias) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -368,7 +402,7 @@ func (x *fastReflection_Account) 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_Account) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Alias) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -380,7 +414,7 @@ func (x *fastReflection_Account) 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_Account) IsValid() bool { +func (x *fastReflection_Alias) IsValid() bool { return x != nil } @@ -390,9 +424,9 @@ func (x *fastReflection_Account) 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_Account) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Account) + x := input.Message.Interface().(*Alias) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -408,27 +442,26 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Address) + l = len(x.Did) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Label) + l = len(x.Alias) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Controller) + l = len(x.Origin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Namespace) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Scopes) > 0 { + for _, s := range x.Scopes { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } } - if x.ChainCode != 0 { - n += 1 + runtime.Sov(uint64(x.ChainCode)) - } - if x.Index != 0 { - n += 1 + runtime.Sov(uint64(x.Index)) + if x.Expiration != 0 { + n += 1 + runtime.Sov(uint64(x.Expiration)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -440,7 +473,7 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Account) + x := input.Message.Interface().(*Alias) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -459,41 +492,38 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Index != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Index)) - i-- - dAtA[i] = 0x38 - } - if x.ChainCode != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ChainCode)) + if x.Expiration != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Expiration)) i-- dAtA[i] = 0x30 } - if len(x.Namespace) > 0 { - i -= len(x.Namespace) - copy(dAtA[i:], x.Namespace) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Namespace))) - i-- - dAtA[i] = 0x2a + if len(x.Scopes) > 0 { + for iNdEx := len(x.Scopes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Scopes[iNdEx]) + copy(dAtA[i:], x.Scopes[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Scopes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } - if len(x.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + 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] = 0x22 } - if len(x.Label) > 0 { - i -= len(x.Label) - copy(dAtA[i:], x.Label) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Label))) + if len(x.Alias) > 0 { + i -= len(x.Alias) + copy(dAtA[i:], x.Alias) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Alias))) i-- dAtA[i] = 0x1a } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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] = 0x12 } @@ -515,7 +545,7 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Account) + x := input.Message.Interface().(*Alias) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -547,10 +577,10 @@ func (x *fastReflection_Account) 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: Account: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Alias: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Alias: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -587,7 +617,7 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", 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 { @@ -615,11 +645,11 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.Did = 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 Label", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Alias", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -647,11 +677,11 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Label = string(dAtA[iNdEx:postIndex]) + x.Alias = 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) + 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 { @@ -679,11 +709,11 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Controller = string(dAtA[iNdEx:postIndex]) + x.Origin = 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 Namespace", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -711,13 +741,13 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Namespace = string(dAtA[iNdEx:postIndex]) + x.Scopes = append(x.Scopes, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 6: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainCode", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) } - x.ChainCode = 0 + x.Expiration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -727,26 +757,7 @@ func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.ChainCode |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - x.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Index |= uint32(b&0x7F) << shift + x.Expiration |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -896,6 +907,7 @@ var ( fd_Controller_public_key protoreflect.FieldDescriptor fd_Controller_vault_cid protoreflect.FieldDescriptor fd_Controller_authentication protoreflect.FieldDescriptor + fd_Controller_status protoreflect.FieldDescriptor ) func init() { @@ -907,6 +919,7 @@ func init() { fd_Controller_public_key = md_Controller.Fields().ByName("public_key") fd_Controller_vault_cid = md_Controller.Fields().ByName("vault_cid") fd_Controller_authentication = md_Controller.Fields().ByName("authentication") + fd_Controller_status = md_Controller.Fields().ByName("status") } var _ protoreflect.Message = (*fastReflection_Controller)(nil) @@ -1010,6 +1023,12 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } + if x.Status != "" { + value := protoreflect.ValueOfString(x.Status) + if !f(fd_Controller_status, value) { + return + } + } } // Has reports whether a field is populated. @@ -1037,6 +1056,8 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { return x.VaultCid != "" case "did.v1.Controller.authentication": return len(x.Authentication) != 0 + case "did.v1.Controller.status": + return x.Status != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1065,6 +1086,8 @@ func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { x.VaultCid = "" case "did.v1.Controller.authentication": x.Authentication = nil + case "did.v1.Controller.status": + x.Status = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1105,6 +1128,9 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) } listValue := &_Controller_6_list{list: &x.Authentication} return protoreflect.ValueOfList(listValue) + case "did.v1.Controller.status": + value := x.Status + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1141,6 +1167,8 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p lv := value.List() clv := lv.(*_Controller_6_list) x.Authentication = *clv.list + case "did.v1.Controller.status": + x.Status = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1184,6 +1212,8 @@ func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) pro panic(fmt.Errorf("field address of message did.v1.Controller is not mutable")) case "did.v1.Controller.vault_cid": panic(fmt.Errorf("field vault_cid of message did.v1.Controller is not mutable")) + case "did.v1.Controller.status": + panic(fmt.Errorf("field status of message did.v1.Controller is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1212,6 +1242,8 @@ func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) pr case "did.v1.Controller.authentication": list := []*Credential{} return protoreflect.ValueOfList(&_Controller_6_list{list: &list}) + case "did.v1.Controller.status": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1309,6 +1341,10 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + l = len(x.Status) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1338,6 +1374,13 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Status) > 0 { + i -= len(x.Status) + copy(dAtA[i:], x.Status) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Status))) + i-- + dAtA[i] = 0x3a + } if len(x.Authentication) > 0 { for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Authentication[iNdEx]) @@ -1654,6 +1697,38 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1690,35 +1765,37 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } var ( - md_Proof protoreflect.MessageDescriptor - fd_Proof_id protoreflect.FieldDescriptor - fd_Proof_controller protoreflect.FieldDescriptor - fd_Proof_issuer protoreflect.FieldDescriptor - fd_Proof_property protoreflect.FieldDescriptor - fd_Proof_accumulator protoreflect.FieldDescriptor - fd_Proof_key protoreflect.FieldDescriptor + md_Verification protoreflect.MessageDescriptor + fd_Verification_id protoreflect.FieldDescriptor + fd_Verification_controller protoreflect.FieldDescriptor + fd_Verification_method protoreflect.FieldDescriptor + fd_Verification_issuer protoreflect.FieldDescriptor + fd_Verification_subject protoreflect.FieldDescriptor + fd_Verification_public_key protoreflect.FieldDescriptor + fd_Verification_kind protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Proof = File_did_v1_state_proto.Messages().ByName("Proof") - fd_Proof_id = md_Proof.Fields().ByName("id") - fd_Proof_controller = md_Proof.Fields().ByName("controller") - fd_Proof_issuer = md_Proof.Fields().ByName("issuer") - fd_Proof_property = md_Proof.Fields().ByName("property") - fd_Proof_accumulator = md_Proof.Fields().ByName("accumulator") - fd_Proof_key = md_Proof.Fields().ByName("key") + md_Verification = File_did_v1_state_proto.Messages().ByName("Verification") + fd_Verification_id = md_Verification.Fields().ByName("id") + fd_Verification_controller = md_Verification.Fields().ByName("controller") + fd_Verification_method = md_Verification.Fields().ByName("method") + fd_Verification_issuer = md_Verification.Fields().ByName("issuer") + fd_Verification_subject = md_Verification.Fields().ByName("subject") + fd_Verification_public_key = md_Verification.Fields().ByName("public_key") + fd_Verification_kind = md_Verification.Fields().ByName("kind") } -var _ protoreflect.Message = (*fastReflection_Proof)(nil) +var _ protoreflect.Message = (*fastReflection_Verification)(nil) -type fastReflection_Proof Proof +type fastReflection_Verification Verification -func (x *Proof) ProtoReflect() protoreflect.Message { - return (*fastReflection_Proof)(x) +func (x *Verification) ProtoReflect() protoreflect.Message { + return (*fastReflection_Verification)(x) } -func (x *Proof) slowProtoReflect() protoreflect.Message { +func (x *Verification) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1730,43 +1807,43 @@ func (x *Proof) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Proof_messageType fastReflection_Proof_messageType -var _ protoreflect.MessageType = fastReflection_Proof_messageType{} +var _fastReflection_Verification_messageType fastReflection_Verification_messageType +var _ protoreflect.MessageType = fastReflection_Verification_messageType{} -type fastReflection_Proof_messageType struct{} +type fastReflection_Verification_messageType struct{} -func (x fastReflection_Proof_messageType) Zero() protoreflect.Message { - return (*fastReflection_Proof)(nil) +func (x fastReflection_Verification_messageType) Zero() protoreflect.Message { + return (*fastReflection_Verification)(nil) } -func (x fastReflection_Proof_messageType) New() protoreflect.Message { - return new(fastReflection_Proof) +func (x fastReflection_Verification_messageType) New() protoreflect.Message { + return new(fastReflection_Verification) } -func (x fastReflection_Proof_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Proof +func (x fastReflection_Verification_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Verification } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Proof) Descriptor() protoreflect.MessageDescriptor { - return md_Proof +func (x *fastReflection_Verification) Descriptor() protoreflect.MessageDescriptor { + return md_Verification } // 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_Proof) Type() protoreflect.MessageType { - return _fastReflection_Proof_messageType +func (x *fastReflection_Verification) Type() protoreflect.MessageType { + return _fastReflection_Verification_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Proof) New() protoreflect.Message { - return new(fastReflection_Proof) +func (x *fastReflection_Verification) New() protoreflect.Message { + return new(fastReflection_Verification) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Proof) Interface() protoreflect.ProtoMessage { - return (*Proof)(x) +func (x *fastReflection_Verification) Interface() protoreflect.ProtoMessage { + return (*Verification)(x) } // Range iterates over every populated field in an undefined order, @@ -1774,1843 +1851,46 @@ func (x *fastReflection_Proof) 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_Proof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_Proof_id, value) { + if !f(fd_Verification_id, value) { return } } if x.Controller != "" { value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Proof_controller, value) { - return - } - } - if x.Issuer != "" { - value := protoreflect.ValueOfString(x.Issuer) - if !f(fd_Proof_issuer, value) { - return - } - } - if x.Property != "" { - value := protoreflect.ValueOfString(x.Property) - if !f(fd_Proof_property, value) { - return - } - } - if len(x.Accumulator) != 0 { - value := protoreflect.ValueOfBytes(x.Accumulator) - if !f(fd_Proof_accumulator, value) { - return - } - } - if len(x.Key) != 0 { - value := protoreflect.ValueOfBytes(x.Key) - if !f(fd_Proof_key, 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_Proof) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Proof.id": - return x.Id != "" - case "did.v1.Proof.controller": - return x.Controller != "" - case "did.v1.Proof.issuer": - return x.Issuer != "" - case "did.v1.Proof.property": - return x.Property != "" - case "did.v1.Proof.accumulator": - return len(x.Accumulator) != 0 - case "did.v1.Proof.key": - return len(x.Key) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) - } - panic(fmt.Errorf("message did.v1.Proof 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_Proof) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Proof.id": - x.Id = "" - case "did.v1.Proof.controller": - x.Controller = "" - case "did.v1.Proof.issuer": - x.Issuer = "" - case "did.v1.Proof.property": - x.Property = "" - case "did.v1.Proof.accumulator": - x.Accumulator = nil - case "did.v1.Proof.key": - x.Key = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) - } - panic(fmt.Errorf("message did.v1.Proof 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_Proof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Proof.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Proof.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - case "did.v1.Proof.issuer": - value := x.Issuer - return protoreflect.ValueOfString(value) - case "did.v1.Proof.property": - value := x.Property - return protoreflect.ValueOfString(value) - case "did.v1.Proof.accumulator": - value := x.Accumulator - return protoreflect.ValueOfBytes(value) - case "did.v1.Proof.key": - value := x.Key - return protoreflect.ValueOfBytes(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) - } - panic(fmt.Errorf("message did.v1.Proof 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_Proof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Proof.id": - x.Id = value.Interface().(string) - case "did.v1.Proof.controller": - x.Controller = value.Interface().(string) - case "did.v1.Proof.issuer": - x.Issuer = value.Interface().(string) - case "did.v1.Proof.property": - x.Property = value.Interface().(string) - case "did.v1.Proof.accumulator": - x.Accumulator = value.Bytes() - case "did.v1.Proof.key": - x.Key = value.Bytes() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) - } - panic(fmt.Errorf("message did.v1.Proof 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_Proof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Proof.id": - panic(fmt.Errorf("field id of message did.v1.Proof is not mutable")) - case "did.v1.Proof.controller": - panic(fmt.Errorf("field controller of message did.v1.Proof is not mutable")) - case "did.v1.Proof.issuer": - panic(fmt.Errorf("field issuer of message did.v1.Proof is not mutable")) - case "did.v1.Proof.property": - panic(fmt.Errorf("field property of message did.v1.Proof is not mutable")) - case "did.v1.Proof.accumulator": - panic(fmt.Errorf("field accumulator of message did.v1.Proof is not mutable")) - case "did.v1.Proof.key": - panic(fmt.Errorf("field key of message did.v1.Proof is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) - } - panic(fmt.Errorf("message did.v1.Proof 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_Proof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Proof.id": - return protoreflect.ValueOfString("") - case "did.v1.Proof.controller": - return protoreflect.ValueOfString("") - case "did.v1.Proof.issuer": - return protoreflect.ValueOfString("") - case "did.v1.Proof.property": - return protoreflect.ValueOfString("") - case "did.v1.Proof.accumulator": - return protoreflect.ValueOfBytes(nil) - case "did.v1.Proof.key": - return protoreflect.ValueOfBytes(nil) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) - } - panic(fmt.Errorf("message did.v1.Proof 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_Proof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Proof", 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_Proof) 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_Proof) 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_Proof) 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_Proof) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Proof) - 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.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Issuer) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Property) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Accumulator) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Key) - 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().(*Proof) - 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.Key) > 0 { - i -= len(x.Key) - copy(dAtA[i:], x.Key) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) - i-- - dAtA[i] = 0x32 - } - if len(x.Accumulator) > 0 { - i -= len(x.Accumulator) - copy(dAtA[i:], x.Accumulator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Accumulator))) - i-- - dAtA[i] = 0x2a - } - if len(x.Property) > 0 { - i -= len(x.Property) - copy(dAtA[i:], x.Property) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Property))) - i-- - dAtA[i] = 0x22 - } - if len(x.Issuer) > 0 { - i -= len(x.Issuer) - copy(dAtA[i:], x.Issuer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Issuer))) - i-- - dAtA[i] = 0x1a - } - 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] = 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().(*Proof) - 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: Proof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Proof: 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 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 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Issuer", 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.Issuer = 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 Property", 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.Property = 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 Accumulator", 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.Accumulator = append(x.Accumulator[:0], dAtA[iNdEx:postIndex]...) - if x.Accumulator == nil { - x.Accumulator = []byte{} - } - iNdEx = postIndex - case 6: - 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 - 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 = (*_ServiceRecord_6_map)(nil) - -type _ServiceRecord_6_map struct { - m *map[string]string -} - -func (x *_ServiceRecord_6_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_ServiceRecord_6_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.ValueOfString(v) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_ServiceRecord_6_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 *_ServiceRecord_6_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_ServiceRecord_6_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.ValueOfString(v) -} - -func (x *_ServiceRecord_6_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.String() - concreteValue := valueUnwrapped - (*x.m)[concreteKey] = concreteValue -} - -func (x *_ServiceRecord_6_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 *_ServiceRecord_6_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_ServiceRecord_6_map) IsValid() bool { - return x.m != nil -} - -var ( - md_ServiceRecord protoreflect.MessageDescriptor - fd_ServiceRecord_id protoreflect.FieldDescriptor - fd_ServiceRecord_service_type protoreflect.FieldDescriptor - fd_ServiceRecord_authority protoreflect.FieldDescriptor - fd_ServiceRecord_origin protoreflect.FieldDescriptor - fd_ServiceRecord_description protoreflect.FieldDescriptor - fd_ServiceRecord_service_endpoints protoreflect.FieldDescriptor - fd_ServiceRecord_permissions protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_ServiceRecord = File_did_v1_state_proto.Messages().ByName("ServiceRecord") - fd_ServiceRecord_id = md_ServiceRecord.Fields().ByName("id") - fd_ServiceRecord_service_type = md_ServiceRecord.Fields().ByName("service_type") - fd_ServiceRecord_authority = md_ServiceRecord.Fields().ByName("authority") - fd_ServiceRecord_origin = md_ServiceRecord.Fields().ByName("origin") - fd_ServiceRecord_description = md_ServiceRecord.Fields().ByName("description") - fd_ServiceRecord_service_endpoints = md_ServiceRecord.Fields().ByName("service_endpoints") - fd_ServiceRecord_permissions = md_ServiceRecord.Fields().ByName("permissions") -} - -var _ protoreflect.Message = (*fastReflection_ServiceRecord)(nil) - -type fastReflection_ServiceRecord ServiceRecord - -func (x *ServiceRecord) ProtoReflect() protoreflect.Message { - return (*fastReflection_ServiceRecord)(x) -} - -func (x *ServiceRecord) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_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_ServiceRecord_messageType fastReflection_ServiceRecord_messageType -var _ protoreflect.MessageType = fastReflection_ServiceRecord_messageType{} - -type fastReflection_ServiceRecord_messageType struct{} - -func (x fastReflection_ServiceRecord_messageType) Zero() protoreflect.Message { - return (*fastReflection_ServiceRecord)(nil) -} -func (x fastReflection_ServiceRecord_messageType) New() protoreflect.Message { - return new(fastReflection_ServiceRecord) -} -func (x fastReflection_ServiceRecord_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ServiceRecord -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ServiceRecord) Descriptor() protoreflect.MessageDescriptor { - return md_ServiceRecord -} - -// 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_ServiceRecord) Type() protoreflect.MessageType { - return _fastReflection_ServiceRecord_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ServiceRecord) New() protoreflect.Message { - return new(fastReflection_ServiceRecord) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ServiceRecord) Interface() protoreflect.ProtoMessage { - return (*ServiceRecord)(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_ServiceRecord) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_ServiceRecord_id, value) { - return - } - } - if x.ServiceType != "" { - value := protoreflect.ValueOfString(x.ServiceType) - if !f(fd_ServiceRecord_service_type, value) { - return - } - } - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_ServiceRecord_authority, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_ServiceRecord_origin, value) { - return - } - } - if x.Description != "" { - value := protoreflect.ValueOfString(x.Description) - if !f(fd_ServiceRecord_description, value) { - return - } - } - if len(x.ServiceEndpoints) != 0 { - value := protoreflect.ValueOfMap(&_ServiceRecord_6_map{m: &x.ServiceEndpoints}) - if !f(fd_ServiceRecord_service_endpoints, value) { - return - } - } - if x.Permissions != nil { - value := protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) - if !f(fd_ServiceRecord_permissions, 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_ServiceRecord) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.ServiceRecord.id": - return x.Id != "" - case "did.v1.ServiceRecord.service_type": - return x.ServiceType != "" - case "did.v1.ServiceRecord.authority": - return x.Authority != "" - case "did.v1.ServiceRecord.origin": - return x.Origin != "" - case "did.v1.ServiceRecord.description": - return x.Description != "" - case "did.v1.ServiceRecord.service_endpoints": - return len(x.ServiceEndpoints) != 0 - case "did.v1.ServiceRecord.permissions": - return x.Permissions != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) - } - panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.ServiceRecord.id": - x.Id = "" - case "did.v1.ServiceRecord.service_type": - x.ServiceType = "" - case "did.v1.ServiceRecord.authority": - x.Authority = "" - case "did.v1.ServiceRecord.origin": - x.Origin = "" - case "did.v1.ServiceRecord.description": - x.Description = "" - case "did.v1.ServiceRecord.service_endpoints": - x.ServiceEndpoints = nil - case "did.v1.ServiceRecord.permissions": - x.Permissions = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) - } - panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.ServiceRecord.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.ServiceRecord.service_type": - value := x.ServiceType - return protoreflect.ValueOfString(value) - case "did.v1.ServiceRecord.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "did.v1.ServiceRecord.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.ServiceRecord.description": - value := x.Description - return protoreflect.ValueOfString(value) - case "did.v1.ServiceRecord.service_endpoints": - if len(x.ServiceEndpoints) == 0 { - return protoreflect.ValueOfMap(&_ServiceRecord_6_map{}) - } - mapValue := &_ServiceRecord_6_map{m: &x.ServiceEndpoints} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.ServiceRecord.permissions": - value := x.Permissions - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) - } - panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.ServiceRecord.id": - x.Id = value.Interface().(string) - case "did.v1.ServiceRecord.service_type": - x.ServiceType = value.Interface().(string) - case "did.v1.ServiceRecord.authority": - x.Authority = value.Interface().(string) - case "did.v1.ServiceRecord.origin": - x.Origin = value.Interface().(string) - case "did.v1.ServiceRecord.description": - x.Description = value.Interface().(string) - case "did.v1.ServiceRecord.service_endpoints": - mv := value.Map() - cmv := mv.(*_ServiceRecord_6_map) - x.ServiceEndpoints = *cmv.m - case "did.v1.ServiceRecord.permissions": - x.Permissions = value.Message().Interface().(*Permissions) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) - } - panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ServiceRecord.service_endpoints": - if x.ServiceEndpoints == nil { - x.ServiceEndpoints = make(map[string]string) - } - value := &_ServiceRecord_6_map{m: &x.ServiceEndpoints} - return protoreflect.ValueOfMap(value) - case "did.v1.ServiceRecord.permissions": - if x.Permissions == nil { - x.Permissions = new(Permissions) - } - return protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) - case "did.v1.ServiceRecord.id": - panic(fmt.Errorf("field id of message did.v1.ServiceRecord is not mutable")) - case "did.v1.ServiceRecord.service_type": - panic(fmt.Errorf("field service_type of message did.v1.ServiceRecord is not mutable")) - case "did.v1.ServiceRecord.authority": - panic(fmt.Errorf("field authority of message did.v1.ServiceRecord is not mutable")) - case "did.v1.ServiceRecord.origin": - panic(fmt.Errorf("field origin of message did.v1.ServiceRecord is not mutable")) - case "did.v1.ServiceRecord.description": - panic(fmt.Errorf("field description of message did.v1.ServiceRecord is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) - } - panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ServiceRecord.id": - return protoreflect.ValueOfString("") - case "did.v1.ServiceRecord.service_type": - return protoreflect.ValueOfString("") - case "did.v1.ServiceRecord.authority": - return protoreflect.ValueOfString("") - case "did.v1.ServiceRecord.origin": - return protoreflect.ValueOfString("") - case "did.v1.ServiceRecord.description": - return protoreflect.ValueOfString("") - case "did.v1.ServiceRecord.service_endpoints": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_ServiceRecord_6_map{m: &m}) - case "did.v1.ServiceRecord.permissions": - m := new(Permissions) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) - } - panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.ServiceRecord", 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_ServiceRecord) 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_ServiceRecord) 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_ServiceRecord) 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_ServiceRecord) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ServiceRecord) - 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.ServiceType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Description) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.ServiceEndpoints) > 0 { - SiZeMaP := func(k string, v string) { - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.ServiceEndpoints)) - for k := range x.ServiceEndpoints { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.ServiceEndpoints[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.ServiceEndpoints { - SiZeMaP(k, v) - } - } - } - if x.Permissions != nil { - l = options.Size(x.Permissions) - 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().(*ServiceRecord) - 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 x.Permissions != nil { - encoded, err := options.Marshal(x.Permissions) - 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] = 0x3a - } - if len(x.ServiceEndpoints) > 0 { - MaRsHaLmAp := func(k string, v string) (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] = 0x32 - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForServiceEndpoints := make([]string, 0, len(x.ServiceEndpoints)) - for k := range x.ServiceEndpoints { - keysForServiceEndpoints = append(keysForServiceEndpoints, string(k)) - } - sort.Slice(keysForServiceEndpoints, func(i, j int) bool { - return keysForServiceEndpoints[i] < keysForServiceEndpoints[j] - }) - for iNdEx := len(keysForServiceEndpoints) - 1; iNdEx >= 0; iNdEx-- { - v := x.ServiceEndpoints[string(keysForServiceEndpoints[iNdEx])] - out, err := MaRsHaLmAp(keysForServiceEndpoints[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.ServiceEndpoints { - v := x.ServiceEndpoints[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Description) > 0 { - i -= len(x.Description) - copy(dAtA[i:], x.Description) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) - i-- - dAtA[i] = 0x2a - } - 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] = 0x22 - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0x1a - } - if len(x.ServiceType) > 0 { - i -= len(x.ServiceType) - copy(dAtA[i:], x.ServiceType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) - 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().(*ServiceRecord) - 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: ServiceRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ServiceRecord: 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 ServiceType", 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.ServiceType = 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 Authority", 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.Authority = 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 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 - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = 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 ServiceEndpoints", 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.ServiceEndpoints == nil { - x.ServiceEndpoints = make(map[string]string) - } - var mapkey string - var mapvalue string - 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 stringLenmapvalue 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++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapvalue > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } 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.ServiceEndpoints[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permissions", 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.Permissions == nil { - x.Permissions = &Permissions{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Permissions); 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_VerificationMethod protoreflect.MessageDescriptor - fd_VerificationMethod_id protoreflect.FieldDescriptor - fd_VerificationMethod_controller protoreflect.FieldDescriptor - fd_VerificationMethod_method protoreflect.FieldDescriptor - fd_VerificationMethod_issuer protoreflect.FieldDescriptor - fd_VerificationMethod_subject protoreflect.FieldDescriptor - fd_VerificationMethod_public_key protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_VerificationMethod = File_did_v1_state_proto.Messages().ByName("VerificationMethod") - fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id") - fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller") - fd_VerificationMethod_method = md_VerificationMethod.Fields().ByName("method") - fd_VerificationMethod_issuer = md_VerificationMethod.Fields().ByName("issuer") - fd_VerificationMethod_subject = md_VerificationMethod.Fields().ByName("subject") - fd_VerificationMethod_public_key = md_VerificationMethod.Fields().ByName("public_key") -} - -var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil) - -type fastReflection_VerificationMethod VerificationMethod - -func (x *VerificationMethod) ProtoReflect() protoreflect.Message { - return (*fastReflection_VerificationMethod)(x) -} - -func (x *VerificationMethod) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_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_VerificationMethod_messageType fastReflection_VerificationMethod_messageType -var _ protoreflect.MessageType = fastReflection_VerificationMethod_messageType{} - -type fastReflection_VerificationMethod_messageType struct{} - -func (x fastReflection_VerificationMethod_messageType) Zero() protoreflect.Message { - return (*fastReflection_VerificationMethod)(nil) -} -func (x fastReflection_VerificationMethod_messageType) New() protoreflect.Message { - return new(fastReflection_VerificationMethod) -} -func (x fastReflection_VerificationMethod_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_VerificationMethod -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_VerificationMethod) Descriptor() protoreflect.MessageDescriptor { - return md_VerificationMethod -} - -// 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_VerificationMethod) Type() protoreflect.MessageType { - return _fastReflection_VerificationMethod_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_VerificationMethod) New() protoreflect.Message { - return new(fastReflection_VerificationMethod) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_VerificationMethod) Interface() protoreflect.ProtoMessage { - return (*VerificationMethod)(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_VerificationMethod) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_VerificationMethod_id, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_VerificationMethod_controller, value) { + if !f(fd_Verification_controller, value) { return } } if x.Method != 0 { value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Method)) - if !f(fd_VerificationMethod_method, value) { + if !f(fd_Verification_method, value) { return } } if x.Issuer != "" { value := protoreflect.ValueOfString(x.Issuer) - if !f(fd_VerificationMethod_issuer, value) { + if !f(fd_Verification_issuer, value) { return } } if x.Subject != "" { value := protoreflect.ValueOfString(x.Subject) - if !f(fd_VerificationMethod_subject, value) { + if !f(fd_Verification_subject, value) { return } } if x.PublicKey != nil { value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_VerificationMethod_public_key, value) { + if !f(fd_Verification_public_key, value) { + return + } + } + if x.Kind != "" { + value := protoreflect.ValueOfString(x.Kind) + if !f(fd_Verification_kind, value) { return } } @@ -3627,25 +1907,27 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Verification) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.VerificationMethod.id": + case "did.v1.Verification.id": return x.Id != "" - case "did.v1.VerificationMethod.controller": + case "did.v1.Verification.controller": return x.Controller != "" - case "did.v1.VerificationMethod.method": + case "did.v1.Verification.method": return x.Method != 0 - case "did.v1.VerificationMethod.issuer": + case "did.v1.Verification.issuer": return x.Issuer != "" - case "did.v1.VerificationMethod.subject": + case "did.v1.Verification.subject": return x.Subject != "" - case "did.v1.VerificationMethod.public_key": + case "did.v1.Verification.public_key": return x.PublicKey != nil + case "did.v1.Verification.kind": + return x.Kind != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) } - panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Verification does not contain field %s", fd.FullName())) } } @@ -3655,25 +1937,27 @@ func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Verification) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.VerificationMethod.id": + case "did.v1.Verification.id": x.Id = "" - case "did.v1.VerificationMethod.controller": + case "did.v1.Verification.controller": x.Controller = "" - case "did.v1.VerificationMethod.method": + case "did.v1.Verification.method": x.Method = 0 - case "did.v1.VerificationMethod.issuer": + case "did.v1.Verification.issuer": x.Issuer = "" - case "did.v1.VerificationMethod.subject": + case "did.v1.Verification.subject": x.Subject = "" - case "did.v1.VerificationMethod.public_key": + case "did.v1.Verification.public_key": x.PublicKey = nil + case "did.v1.Verification.kind": + x.Kind = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) } - panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Verification does not contain field %s", fd.FullName())) } } @@ -3683,31 +1967,34 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.VerificationMethod.id": + case "did.v1.Verification.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.VerificationMethod.controller": + case "did.v1.Verification.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.VerificationMethod.method": + case "did.v1.Verification.method": value := x.Method return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "did.v1.VerificationMethod.issuer": + case "did.v1.Verification.issuer": value := x.Issuer return protoreflect.ValueOfString(value) - case "did.v1.VerificationMethod.subject": + case "did.v1.Verification.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.VerificationMethod.public_key": + case "did.v1.Verification.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Verification.kind": + value := x.Kind + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) } - panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Verification does not contain field %s", descriptor.FullName())) } } @@ -3721,25 +2008,27 @@ func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDes // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Verification) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.VerificationMethod.id": + case "did.v1.Verification.id": x.Id = value.Interface().(string) - case "did.v1.VerificationMethod.controller": + case "did.v1.Verification.controller": x.Controller = value.Interface().(string) - case "did.v1.VerificationMethod.method": + case "did.v1.Verification.method": x.Method = (DIDNamespace)(value.Enum()) - case "did.v1.VerificationMethod.issuer": + case "did.v1.Verification.issuer": x.Issuer = value.Interface().(string) - case "did.v1.VerificationMethod.subject": + case "did.v1.Verification.subject": x.Subject = value.Interface().(string) - case "did.v1.VerificationMethod.public_key": + case "did.v1.Verification.public_key": x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Verification.kind": + x.Kind = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) } - panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Verification does not contain field %s", fd.FullName())) } } @@ -3753,64 +2042,68 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.VerificationMethod.public_key": + case "did.v1.Verification.public_key": if x.PublicKey == nil { x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.VerificationMethod.id": - panic(fmt.Errorf("field id of message did.v1.VerificationMethod is not mutable")) - case "did.v1.VerificationMethod.controller": - panic(fmt.Errorf("field controller of message did.v1.VerificationMethod is not mutable")) - case "did.v1.VerificationMethod.method": - panic(fmt.Errorf("field method of message did.v1.VerificationMethod is not mutable")) - case "did.v1.VerificationMethod.issuer": - panic(fmt.Errorf("field issuer of message did.v1.VerificationMethod is not mutable")) - case "did.v1.VerificationMethod.subject": - panic(fmt.Errorf("field subject of message did.v1.VerificationMethod is not mutable")) + case "did.v1.Verification.id": + panic(fmt.Errorf("field id of message did.v1.Verification is not mutable")) + case "did.v1.Verification.controller": + panic(fmt.Errorf("field controller of message did.v1.Verification is not mutable")) + case "did.v1.Verification.method": + panic(fmt.Errorf("field method of message did.v1.Verification is not mutable")) + case "did.v1.Verification.issuer": + panic(fmt.Errorf("field issuer of message did.v1.Verification is not mutable")) + case "did.v1.Verification.subject": + panic(fmt.Errorf("field subject of message did.v1.Verification is not mutable")) + case "did.v1.Verification.kind": + panic(fmt.Errorf("field kind of message did.v1.Verification is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) } - panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Verification 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_VerificationMethod) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Verification) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.VerificationMethod.id": + case "did.v1.Verification.id": return protoreflect.ValueOfString("") - case "did.v1.VerificationMethod.controller": + case "did.v1.Verification.controller": return protoreflect.ValueOfString("") - case "did.v1.VerificationMethod.method": + case "did.v1.Verification.method": return protoreflect.ValueOfEnum(0) - case "did.v1.VerificationMethod.issuer": + case "did.v1.Verification.issuer": return protoreflect.ValueOfString("") - case "did.v1.VerificationMethod.subject": + case "did.v1.Verification.subject": return protoreflect.ValueOfString("") - case "did.v1.VerificationMethod.public_key": + case "did.v1.Verification.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Verification.kind": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) } - panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Verification 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_VerificationMethod) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Verification) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.VerificationMethod", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Verification", d.FullName())) } panic("unreachable") } @@ -3818,7 +2111,7 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Verification) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3829,7 +2122,7 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Verification) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3841,7 +2134,7 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) IsValid() bool { +func (x *fastReflection_Verification) IsValid() bool { return x != nil } @@ -3851,9 +2144,9 @@ func (x *fastReflection_VerificationMethod) 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_VerificationMethod) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*VerificationMethod) + x := input.Message.Interface().(*Verification) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3888,6 +2181,10 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { l = options.Size(x.PublicKey) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Kind) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -3898,7 +2195,7 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*VerificationMethod) + x := input.Message.Interface().(*Verification) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3917,6 +2214,13 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Kind) > 0 { + i -= len(x.Kind) + copy(dAtA[i:], x.Kind) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + i-- + dAtA[i] = 0x3a + } if x.PublicKey != nil { encoded, err := options.Marshal(x.PublicKey) if err != nil { @@ -3975,7 +2279,7 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*VerificationMethod) + x := input.Message.Interface().(*Verification) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4007,10 +2311,10 @@ func (x *fastReflection_VerificationMethod) 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: VerificationMethod: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Verification: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VerificationMethod: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Verification: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4196,6 +2500,38 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", 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.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4244,27 +2580,28 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Account represents a wallet account associated with a DID Controller -type Account struct { +// Alias represents a DID alias +type Alias struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The unique identifier of the alias Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Origin is the Alias provider - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Subject is the user defined alias - Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` - // Controller of the alias - Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` - Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` - ChainCode uint32 `protobuf:"varint,6,opt,name=chain_code,json=chainCode,proto3" json:"chain_code,omitempty"` - Index uint32 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` + // The DID of the alias + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + // The alias of the DID + Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"` + // Origin of the alias + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // Permissions of the alias + Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"` + // Expiration of the alias + Expiration int64 `protobuf:"varint,6,opt,name=expiration,proto3" json:"expiration,omitempty"` } -func (x *Account) Reset() { - *x = Account{} +func (x *Alias) Reset() { + *x = Alias{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_state_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4272,62 +2609,55 @@ func (x *Account) Reset() { } } -func (x *Account) String() string { +func (x *Alias) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Account) ProtoMessage() {} +func (*Alias) ProtoMessage() {} -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { +// Deprecated: Use Alias.ProtoReflect.Descriptor instead. +func (*Alias) Descriptor() ([]byte, []int) { return file_did_v1_state_proto_rawDescGZIP(), []int{0} } -func (x *Account) GetId() string { +func (x *Alias) GetId() string { if x != nil { return x.Id } return "" } -func (x *Account) GetAddress() string { +func (x *Alias) GetDid() string { if x != nil { - return x.Address + return x.Did } return "" } -func (x *Account) GetLabel() string { +func (x *Alias) GetAlias() string { if x != nil { - return x.Label + return x.Alias } return "" } -func (x *Account) GetController() string { +func (x *Alias) GetOrigin() string { if x != nil { - return x.Controller + return x.Origin } return "" } -func (x *Account) GetNamespace() string { +func (x *Alias) GetScopes() []string { if x != nil { - return x.Namespace + return x.Scopes } - return "" + return nil } -func (x *Account) GetChainCode() uint32 { +func (x *Alias) GetExpiration() int64 { if x != nil { - return x.ChainCode - } - return 0 -} - -func (x *Account) GetIndex() uint32 { - if x != nil { - return x.Index + return x.Expiration } return 0 } @@ -4350,6 +2680,8 @@ type Controller struct { VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` // The Authentications of the controller Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"` + // The Status of the claims for the controller + Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` } func (x *Controller) Reset() { @@ -4414,181 +2746,15 @@ func (x *Controller) GetAuthentication() []*Credential { return nil } -// Proof represents a verifiable credential -type Proof struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The unique identifier of the proof - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The controller of the proof - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // The value of the linked identifier - Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` - // The property of the proof - Property string `protobuf:"bytes,4,opt,name=property,proto3" json:"property,omitempty"` - // The accumulator of the proof - Accumulator []byte `protobuf:"bytes,5,opt,name=accumulator,proto3" json:"accumulator,omitempty"` - // The secret key of the proof - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *Proof) Reset() { - *x = Proof{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Proof) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Proof) ProtoMessage() {} - -// Deprecated: Use Proof.ProtoReflect.Descriptor instead. -func (*Proof) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{2} -} - -func (x *Proof) GetId() string { +func (x *Controller) GetStatus() string { if x != nil { - return x.Id + return x.Status } return "" } -func (x *Proof) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *Proof) GetIssuer() string { - if x != nil { - return x.Issuer - } - return "" -} - -func (x *Proof) GetProperty() string { - if x != nil { - return x.Property - } - return "" -} - -func (x *Proof) GetAccumulator() []byte { - if x != nil { - return x.Accumulator - } - return nil -} - -func (x *Proof) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -// ServiceRecord represents a decentralized service in a DID Document -type ServiceRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the service - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The type of the service - ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - // The authority DID of the service - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` - // The domain name of the service - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // The description of the service - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // The service endpoint - ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Scopes is the Authorization Grants of the service - Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (x *ServiceRecord) Reset() { - *x = ServiceRecord{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceRecord) ProtoMessage() {} - -// Deprecated: Use ServiceRecord.ProtoReflect.Descriptor instead. -func (*ServiceRecord) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{3} -} - -func (x *ServiceRecord) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ServiceRecord) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *ServiceRecord) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *ServiceRecord) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *ServiceRecord) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ServiceRecord) GetServiceEndpoints() map[string]string { - if x != nil { - return x.ServiceEndpoints - } - return nil -} - -func (x *ServiceRecord) GetPermissions() *Permissions { - if x != nil { - return x.Permissions - } - return nil -} - // Verification reprsents a method of verifying membership in a DID -type VerificationMethod struct { +type Verification struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -4604,71 +2770,80 @@ type VerificationMethod struct { // The subject of the verification Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // The controller DID of the service + PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` } -func (x *VerificationMethod) Reset() { - *x = VerificationMethod{} +func (x *Verification) Reset() { + *x = Verification{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[4] + mi := &file_did_v1_state_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *VerificationMethod) String() string { +func (x *Verification) String() string { return protoimpl.X.MessageStringOf(x) } -func (*VerificationMethod) ProtoMessage() {} +func (*Verification) ProtoMessage() {} -// Deprecated: Use VerificationMethod.ProtoReflect.Descriptor instead. -func (*VerificationMethod) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{4} +// Deprecated: Use Verification.ProtoReflect.Descriptor instead. +func (*Verification) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{2} } -func (x *VerificationMethod) GetId() string { +func (x *Verification) GetId() string { if x != nil { return x.Id } return "" } -func (x *VerificationMethod) GetController() string { +func (x *Verification) GetController() string { if x != nil { return x.Controller } return "" } -func (x *VerificationMethod) GetMethod() DIDNamespace { +func (x *Verification) GetMethod() DIDNamespace { if x != nil { return x.Method } return DIDNamespace_DID_NAMESPACE_UNSPECIFIED } -func (x *VerificationMethod) GetIssuer() string { +func (x *Verification) GetIssuer() string { if x != nil { return x.Issuer } return "" } -func (x *VerificationMethod) GetSubject() string { +func (x *Verification) GetSubject() string { if x != nil { return x.Subject } return "" } -func (x *VerificationMethod) GetPublicKey() *PubKey { +func (x *Verification) GetPublicKey() *PubKey { if x != nil { return x.PublicKey } return nil } +func (x *Verification) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + var File_did_v1_state_proto protoreflect.FileDescriptor var file_did_v1_state_proto_rawDesc = []byte{ @@ -4678,109 +2853,64 @@ 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, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xba, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 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, 0x1c, 0x0a, 0x09, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, - 0x7c, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x76, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, - 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x10, 0x01, 0x18, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, - 0x21, 0x0a, 0x1b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x10, 0x03, - 0x18, 0x01, 0x12, 0x17, 0x0a, 0x11, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x04, 0x18, 0x01, 0x18, 0x01, 0x22, 0x97, 0x02, - 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, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, - 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, - 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, - 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x61, - 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 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, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x2e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x28, 0x0a, - 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x10, 0x01, 0x18, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, - 0x64, 0x10, 0x02, 0x18, 0x01, 0x18, 0x02, 0x22, 0xd1, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 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, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, - 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, - 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x3a, 0x30, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, - 0x2a, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x10, 0x01, 0x18, 0x01, 0x18, 0x04, 0x22, 0xa6, 0x03, 0x0a, 0x0d, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 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, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, - 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 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, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, 0x34, - 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x2e, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x02, - 0x18, 0x01, 0x18, 0x03, 0x22, 0x8b, 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, 0x2c, 0x0a, 0x06, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x3a, 0x36, 0xf2, 0x9e, 0xd3, 0x8e, - 0x03, 0x30, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, - 0x73, 0x75, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, - 0x18, 0x05, 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, 0x73, 0x6f, 0x6e, 0x72, 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, + 0x22, 0xb0, 0x01, 0x0a, 0x05, 0x41, 0x6c, 0x69, 0x61, 0x73, 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, 0x14, 0x0a, 0x05, + 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, + 0x61, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, + 0x12, 0x0f, 0x0a, 0x09, 0x64, 0x69, 0x64, 0x2c, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x10, 0x01, 0x18, + 0x01, 0x18, 0x01, 0x22, 0xbb, 0x02, 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, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x07, + 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x07, 0x61, 0x6c, + 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, + 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x06, 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, 0x0e, 0x61, + 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3a, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x34, 0x0a, 0x04, 0x0a, + 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, + 0x18, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x10, + 0x02, 0x18, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x10, 0x03, 0x18, + 0x02, 0x22, 0x99, 0x02, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 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, 0x2c, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x3a, 0x36, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x30, 0x0a, 0x04, 0x0a, + 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x05, 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, 0x73, 0x6f, 0x6e, + 0x72, 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 ( @@ -4795,33 +2925,26 @@ func file_did_v1_state_proto_rawDescGZIP() []byte { return file_did_v1_state_proto_rawDescData } -var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_did_v1_state_proto_goTypes = []interface{}{ - (*Account)(nil), // 0: did.v1.Account - (*Controller)(nil), // 1: did.v1.Controller - (*Proof)(nil), // 2: did.v1.Proof - (*ServiceRecord)(nil), // 3: did.v1.ServiceRecord - (*VerificationMethod)(nil), // 4: did.v1.VerificationMethod - nil, // 5: did.v1.ServiceRecord.ServiceEndpointsEntry - (*Alias)(nil), // 6: did.v1.Alias - (*PubKey)(nil), // 7: did.v1.PubKey - (*Credential)(nil), // 8: did.v1.Credential - (*Permissions)(nil), // 9: did.v1.Permissions - (DIDNamespace)(0), // 10: did.v1.DIDNamespace + (*Alias)(nil), // 0: did.v1.Alias + (*Controller)(nil), // 1: did.v1.Controller + (*Verification)(nil), // 2: did.v1.Verification + (*PubKey)(nil), // 3: did.v1.PubKey + (*Credential)(nil), // 4: did.v1.Credential + (DIDNamespace)(0), // 5: did.v1.DIDNamespace } var file_did_v1_state_proto_depIdxs = []int32{ - 6, // 0: did.v1.Controller.aliases:type_name -> did.v1.Alias - 7, // 1: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 8, // 2: did.v1.Controller.authentication:type_name -> did.v1.Credential - 5, // 3: did.v1.ServiceRecord.service_endpoints:type_name -> did.v1.ServiceRecord.ServiceEndpointsEntry - 9, // 4: did.v1.ServiceRecord.permissions:type_name -> did.v1.Permissions - 10, // 5: did.v1.VerificationMethod.method:type_name -> did.v1.DIDNamespace - 7, // 6: did.v1.VerificationMethod.public_key:type_name -> did.v1.PubKey - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 0, // 0: did.v1.Controller.aliases:type_name -> did.v1.Alias + 3, // 1: did.v1.Controller.public_key:type_name -> did.v1.PubKey + 4, // 2: did.v1.Controller.authentication:type_name -> did.v1.Credential + 5, // 3: did.v1.Verification.method:type_name -> did.v1.DIDNamespace + 3, // 4: did.v1.Verification.public_key:type_name -> did.v1.PubKey + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_did_v1_state_proto_init() } @@ -4833,7 +2956,7 @@ func file_did_v1_state_proto_init() { file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { + switch v := v.(*Alias); i { case 0: return &v.state case 1: @@ -4857,31 +2980,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Proof); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceRecord); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerificationMethod); i { + switch v := v.(*Verification); i { case 0: return &v.state case 1: @@ -4899,7 +2998,7 @@ func file_did_v1_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_state_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/did/v1/models.proto b/proto/did/v1/models.proto index 798784e36..68f899d11 100644 --- a/proto/did/v1/models.proto +++ b/proto/did/v1/models.proto @@ -7,13 +7,6 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; -// Alias defines a subject/origin pair -message Alias { - string subject = 1; - string origin = 2; - string controller = 3; -} - message Credential { string subject = 1; string attestation_type = 2; diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 73560ab28..08a52fee0 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -19,13 +19,6 @@ service Query { option (google.api.http).get = "/did/{did}"; } - // Service returns associated ServiceInfo for a given Origin - // if the servie is not found, a fingerprint is generated to be used - // as a TXT record in DNS. v=sonr, o=origin, p=protocol - rpc Service(QueryRequest) returns (QueryServiceResponse) { - option (google.api.http).get = "/service/{origin}"; - } - // Sync queries the DID document by its id. And returns the required PKL information rpc Sync(SyncRequest) returns (SyncResponse) { option (google.api.http).post = "/sync"; @@ -54,20 +47,6 @@ message QueryParamsResponse { Params params = 1; } -// QueryResolveResponse is the response type for the Query/Resolve RPC method. -message QueryResolveResponse { - // document is the DID document - Document document = 1; -} - -// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. -message QueryServiceResponse { - // options is the PublicKeyCredentialAttestationOptions - bool existing = 1; - ServiceInfo service = 2; - string txt_record = 3; -} - // SyncRequest is the request type for the Sync RPC method. message SyncRequest { string did = 1; diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index ccdeadd30..917ee35a7 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -8,29 +8,14 @@ import "did/v1/models.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; -// Account represents a wallet account associated with a DID Controller -message Account { +// Alias represents a DID alias +message Alias { option (cosmos.orm.v1.table) = { id: 1 primary_key: {fields: "id"} index: { id: 1 - fields: "controller,label" - unique: true - } - index: { - id: 2 - fields: "controller,address" - unique: true - } - index: { - id: 3 - fields: "controller,chain_code,index" - unique: true - } - index: { - id: 4 - fields: "namespace,address" + fields: "did,alias" unique: true } }; @@ -38,20 +23,20 @@ message Account { // The unique identifier of the alias string id = 1; - // Origin is the Alias provider - string address = 2; + // The DID of the alias + string did = 2; - // Subject is the user defined alias - string label = 3; + // The alias of the DID + string alias = 3; - // Controller of the alias - string controller = 4; + // Origin of the alias + string origin = 4; - string namespace = 5; + // Permissions of the alias + repeated string scopes = 5; - uint32 chain_code = 6; - - uint32 index = 7; + // Expiration of the alias + int64 expiration = 6; } // Controller represents a Sonr DWN Vault @@ -69,6 +54,11 @@ message Controller { fields: "vault_cid" unique: true } + index: { + id: 3 + fields: "status,vault_cid" + unique: true + } }; // The unique identifier of the controller @@ -88,80 +78,13 @@ message Controller { // The Authentications of the controller repeated Credential authentication = 6; -} -// Proof represents a verifiable credential -message Proof { - option (cosmos.orm.v1.table) = { - id: 4 - primary_key: {fields: "id"} - index: { - id: 1 - fields: "controller,issuer,property" - unique: true - } - }; - - // The unique identifier of the proof - string id = 1; - - // The controller of the proof - string controller = 2; - - // The value of the linked identifier - string issuer = 3; - - // The property of the proof - string property = 4; - - // The accumulator of the proof - bytes accumulator = 5; - - // The secret key of the proof - bytes key = 6; -} - -// ServiceRecord represents a decentralized service in a DID Document -message ServiceRecord { - option (cosmos.orm.v1.table) = { - id: 3 - primary_key: {fields: "id"} - index: { - id: 1 - fields: "origin" - unique: true - } - index: { - id: 2 - fields: "authority,origin" - unique: true - } - }; - - // The ID of the service - string id = 1; - - // The type of the service - string service_type = 2; - - // The authority DID of the service - string authority = 3; - - // The domain name of the service - string origin = 4; - - // The description of the service - string description = 5; - - // The service endpoint - map service_endpoints = 6; - - // Scopes is the Authorization Grants of the service - Permissions permissions = 7; + // The Status of the claims for the controller + string status = 7; } // Verification reprsents a method of verifying membership in a DID -message VerificationMethod { +message Verification { option (cosmos.orm.v1.table) = { id: 5 primary_key: {fields: "id"} @@ -189,5 +112,7 @@ message VerificationMethod { // The public key of the verification PubKey public_key = 6; - // The controller DID of the service + + // The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + string kind = 7; } diff --git a/x/did/builder/api.go b/x/did/builder/api.go index d042ba441..115b02cdd 100644 --- a/x/did/builder/api.go +++ b/x/did/builder/api.go @@ -66,18 +66,6 @@ func APIFormatPermissionScopes(scopes []types.PermissionScope) []didv1.Permissio return s } -func APIFormatServiceRecord(service *types.Service) *didv1.ServiceRecord { - return &didv1.ServiceRecord{ - Id: service.Id, - ServiceType: service.ServiceType, - Authority: service.Authority, - Origin: service.Origin, - Description: service.Description, - ServiceEndpoints: service.ServiceEndpoints, - Permissions: APIFormatPermissions(service.Permissions), - } -} - func APIFormatPubKeyJWK(jwk *types.PubKey_JWK) *didv1.PubKey_JWK { return &didv1.PubKey_JWK{ Kty: jwk.Kty, @@ -202,19 +190,6 @@ func ModuleTransportsToProtocol(transport []string) []protocol.AuthenticatorTran return tss } -// ModuleFormatAPIServiceRecord formats a service record for the module -func ModuleFormatAPIServiceRecord(service *didv1.ServiceRecord) *types.Service { - return &types.Service{ - Id: service.Id, - ServiceType: service.ServiceType, - Authority: service.Authority, - Origin: service.Origin, - Description: service.Description, - ServiceEndpoints: service.ServiceEndpoints, - Permissions: ModuleFormatAPIPermissions(service.Permissions), - } -} - func ModuleFormatAPIPermissions(permissions *didv1.Permissions) *types.Permissions { if permissions == nil { return nil diff --git a/x/did/builder/pubkey.go b/x/did/builder/pubkey.go index 2c408b1ab..f53f6ff9a 100644 --- a/x/did/builder/pubkey.go +++ b/x/did/builder/pubkey.go @@ -23,8 +23,8 @@ type PublicKey interface { } // CreateAuthnVerification creates a new verification method for an authn method -func CreateAuthnVerification(namespace types.DIDNamespace, issuer string, controller string, pubkey *types.PubKey, identifier string) *types.VerificationMethod { - return &types.VerificationMethod{ +func CreateAuthnVerification(namespace types.DIDNamespace, issuer string, controller string, pubkey *types.PubKey, identifier string) *types.Verification { + return &types.Verification{ Method: namespace, Controller: controller, PublicKey: pubkey, @@ -34,8 +34,8 @@ func CreateAuthnVerification(namespace types.DIDNamespace, issuer string, contro } // CreateWalletVerification creates a new verification method for a wallet -func CreateWalletVerification(namespace types.DIDNamespace, controller string, pubkey *types.PubKey, identifier string) *didv1.VerificationMethod { - return &didv1.VerificationMethod{ +func CreateWalletVerification(namespace types.DIDNamespace, controller string, pubkey *types.PubKey, identifier string) *didv1.Verification { + return &didv1.Verification{ Method: APIFormatDIDNamespace(namespace), Controller: controller, PublicKey: APIFormatPubKey(pubkey), @@ -63,8 +63,8 @@ func ExtractWebAuthnPublicKey(keyBytes []byte) (*types.PubKey_JWK, error) { } // NewInitialWalletAccounts creates a new set of verification methods for a wallet -func NewInitialWalletAccounts(controller string, pubkey *types.PubKey) ([]*didv1.VerificationMethod, error) { - var verificationMethods []*didv1.VerificationMethod +func NewInitialWalletAccounts(controller string, pubkey *types.PubKey) ([]*didv1.Verification, error) { + var verificationMethods []*didv1.Verification for method, chain := range types.InitialChainCodes { nk, err := computeBip32AccountPublicKey(pubkey, chain, 0) if err != nil { diff --git a/x/did/keeper/context.go b/x/did/keeper/context.go index 07bc22f72..be42a917a 100644 --- a/x/did/keeper/context.go +++ b/x/did/keeper/context.go @@ -4,7 +4,6 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/onsonr/sonr/x/did/builder" "github.com/onsonr/sonr/x/did/types" "google.golang.org/grpc/peer" ) @@ -42,19 +41,3 @@ func (c Context) PeerID() string { } return c.Peer.Addr.String() } - -func (c Context) GetService(origin string) (*types.Service, error) { - rec, err := c.Keeper.OrmDB.ServiceRecordTable().GetByOrigin(c.SDK(), origin) - if err != nil { - return nil, err - } - return builder.ModuleFormatAPIServiceRecord(rec), nil -} - -func (c Context) GetServiceInfo(origin string) *types.ServiceInfo { - rec, _ := c.GetService(origin) - if rec == nil { - return &types.ServiceInfo{Exists: false, Origin: origin, Fingerprint: types.ComputeOriginTXTRecord(origin)} - } - return &types.ServiceInfo{Exists: true, Origin: origin, Fingerprint: types.ComputeOriginTXTRecord(origin), Service: rec} -} diff --git a/x/did/keeper/genesis.go b/x/did/keeper/genesis.go index 381f971e5..b727c262b 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -21,7 +21,6 @@ func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) erro if err := data.Params.Validate(); err != nil { return err } - return k.Params.Set(ctx, data.Params) } diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index 8ca420cb8..39de55e1a 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -92,24 +92,6 @@ func NewKeeper( return k } -// IsClaimedServiceOrigin checks if a service origin is unclaimed -func (k Keeper) IsUnclaimedServiceOrigin(ctx sdk.Context, origin string) bool { - rec, _ := k.OrmDB.ServiceRecordTable().GetByOrigin(ctx, origin) - return rec == nil -} - -// IsValidServiceOrigin checks if a service origin is valid -func (k Keeper) IsValidServiceOrigin(ctx sdk.Context, origin string) bool { - rec, err := k.OrmDB.ServiceRecordTable().GetByOrigin(ctx, origin) - if err != nil { - return false - } - if rec == nil { - return false - } - return true -} - // VerifyMinimumStake checks if a validator has a minimum stake func (k Keeper) VerifyMinimumStake(ctx sdk.Context, addr string) bool { address, err := sdk.AccAddressFromBech32(addr) diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index df4801076..9b62f17f4 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -39,8 +39,8 @@ func (k Querier) Service( goCtx context.Context, req *types.QueryRequest, ) (*types.QueryServiceResponse, error) { - ctx := k.CurrentCtx(goCtx) - return &types.QueryServiceResponse{Service: ctx.GetServiceInfo(req.GetOrigin())}, nil + // ctx := k.CurrentCtx(goCtx) + return &types.QueryServiceResponse{}, nil } // Sync implements types.QueryServer. diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index 11f64f17d..d05543592 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -47,9 +47,9 @@ func (ms msgServer) AllocateVault( ) (*types.MsgAllocateVaultResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // 1.Check if the service origin is valid - if ms.k.IsValidServiceOrigin(ctx, msg.Origin) { - return nil, types.ErrInvalidServiceOrigin - } + // if ms.k.IsValidServiceOrigin(ctx, msg.Origin) { + // return nil, types.ErrInvalidServiceOrigin + // } cid, expiryBlock, err := ms.k.assembleInitialVault(ctx) if err != nil { @@ -92,13 +92,13 @@ func (ms msgServer) RegisterService( goCtx context.Context, msg *types.MsgRegisterService, ) (*types.MsgRegisterServiceResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) + // ctx := sdk.UnwrapSDKContext(goCtx) // 1.Check if the service origin is valid - if !ms.k.IsValidServiceOrigin(ctx, msg.Service.Origin) { - return nil, types.ErrInvalidServiceOrigin - } - return ms.k.insertService(ctx, msg.Service) + // if !ms.k.IsValidServiceOrigin(ctx, msg.Service.Origin) { + // return nil, types.ErrInvalidServiceOrigin + // } + return nil, errors.Wrapf(types.ErrInvalidServiceOrigin, "invalid service origin") } // # UpdateParams diff --git a/x/did/keeper/state.go b/x/did/keeper/state.go deleted file mode 100644 index 8ddcda5ab..000000000 --- a/x/did/keeper/state.go +++ /dev/null @@ -1,24 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/onsonr/sonr/x/did/builder" - "github.com/onsonr/sonr/x/did/types" -) - -// insertService inserts a service record into the database -func (k Keeper) insertService( - ctx sdk.Context, - svc *types.Service, -) (*types.MsgRegisterServiceResponse, error) { - record := builder.APIFormatServiceRecord(svc) - err := k.OrmDB.ServiceRecordTable().Insert(ctx, record) - if err != nil { - return nil, err - } - return &types.MsgRegisterServiceResponse{ - Success: true, - Did: record.Id, - }, nil -} diff --git a/x/did/types/integrity.go b/x/did/types/integrity.go deleted file mode 100644 index e7eeb1eff..000000000 --- a/x/did/types/integrity.go +++ /dev/null @@ -1,27 +0,0 @@ -package types - -import "lukechampine.com/blake3" - -func (g *GlobalIntegrity) Update(address string) bool { - return true -} - -func (g *GlobalIntegrity) getProof() (*Proof, error) { - if g.Accumulator == nil { - return NewProof(g.Controller, g.proofProperty(), g.seedKdf()) - } - return &Proof{ - Issuer: g.Controller, - Property: g.proofProperty(), - Accumulator: g.Accumulator, - }, nil -} - -func (g *GlobalIntegrity) proofProperty() string { - return "did:sonr:integrity" -} - -func (g *GlobalIntegrity) seedKdf() []byte { - res := blake3.Sum256([]byte(g.Seed)) - return res[:] -} diff --git a/x/did/types/models.pb.go b/x/did/types/models.pb.go index ba75c43a3..5c971ead1 100644 --- a/x/did/types/models.pb.go +++ b/x/did/types/models.pb.go @@ -23,67 +23,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Alias defines a subject/origin pair -type Alias struct { - Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` -} - -func (m *Alias) Reset() { *m = Alias{} } -func (m *Alias) String() string { return proto.CompactTextString(m) } -func (*Alias) ProtoMessage() {} -func (*Alias) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{0} -} -func (m *Alias) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Alias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Alias.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 *Alias) XXX_Merge(src proto.Message) { - xxx_messageInfo_Alias.Merge(m, src) -} -func (m *Alias) XXX_Size() int { - return m.Size() -} -func (m *Alias) XXX_DiscardUnknown() { - xxx_messageInfo_Alias.DiscardUnknown(m) -} - -var xxx_messageInfo_Alias proto.InternalMessageInfo - -func (m *Alias) GetSubject() string { - if m != nil { - return m.Subject - } - return "" -} - -func (m *Alias) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *Alias) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - type Credential struct { Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` AttestationType string `protobuf:"bytes,2,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` @@ -103,7 +42,7 @@ 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_739bb5ab5cb60751, []int{1} + return fileDescriptor_739bb5ab5cb60751, []int{0} } func (m *Credential) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +170,7 @@ 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_739bb5ab5cb60751, []int{2} + return fileDescriptor_739bb5ab5cb60751, []int{1} } func (m *Document) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -323,7 +262,7 @@ func (m *Keyshare) Reset() { *m = Keyshare{} } func (m *Keyshare) String() string { return proto.CompactTextString(m) } func (*Keyshare) ProtoMessage() {} func (*Keyshare) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{3} + return fileDescriptor_739bb5ab5cb60751, []int{2} } func (m *Keyshare) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +344,7 @@ func (m *Permissions) Reset() { *m = Permissions{} } func (m *Permissions) String() string { return proto.CompactTextString(m) } func (*Permissions) ProtoMessage() {} func (*Permissions) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{4} + return fileDescriptor_739bb5ab5cb60751, []int{3} } func (m *Permissions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -463,7 +402,7 @@ 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_739bb5ab5cb60751, []int{5} + return fileDescriptor_739bb5ab5cb60751, []int{4} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +494,7 @@ func (m *PubKey_JWK) Reset() { *m = PubKey_JWK{} } func (m *PubKey_JWK) String() string { return proto.CompactTextString(m) } func (*PubKey_JWK) ProtoMessage() {} func (*PubKey_JWK) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{5, 0} + return fileDescriptor_739bb5ab5cb60751, []int{4, 0} } func (m *PubKey_JWK) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -641,7 +580,7 @@ func (m *Service) Reset() { *m = Service{} } func (m *Service) String() string { return proto.CompactTextString(m) } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{6} + return fileDescriptor_739bb5ab5cb60751, []int{5} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -731,7 +670,7 @@ func (m *ServiceInfo) Reset() { *m = ServiceInfo{} } func (m *ServiceInfo) String() string { return proto.CompactTextString(m) } func (*ServiceInfo) ProtoMessage() {} func (*ServiceInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{7} + return fileDescriptor_739bb5ab5cb60751, []int{6} } func (m *ServiceInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -800,7 +739,7 @@ func (m *FirstPartyCaveat) Reset() { *m = FirstPartyCaveat{} } func (m *FirstPartyCaveat) String() string { return proto.CompactTextString(m) } func (*FirstPartyCaveat) ProtoMessage() {} func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{8} + return fileDescriptor_739bb5ab5cb60751, []int{7} } func (m *FirstPartyCaveat) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -869,7 +808,7 @@ func (m *ThirdPartyCaveat) Reset() { *m = ThirdPartyCaveat{} } func (m *ThirdPartyCaveat) String() string { return proto.CompactTextString(m) } func (*ThirdPartyCaveat) ProtoMessage() {} func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{9} + return fileDescriptor_739bb5ab5cb60751, []int{8} } func (m *ThirdPartyCaveat) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -927,7 +866,6 @@ func (m *ThirdPartyCaveat) GetAud() string { } func init() { - proto.RegisterType((*Alias)(nil), "did.v1.Alias") proto.RegisterType((*Credential)(nil), "did.v1.Credential") proto.RegisterType((*Document)(nil), "did.v1.Document") proto.RegisterType((*Keyshare)(nil), "did.v1.Keyshare") @@ -946,123 +884,78 @@ func init() { func init() { proto.RegisterFile("did/v1/models.proto", fileDescriptor_739bb5ab5cb60751) } var fileDescriptor_739bb5ab5cb60751 = []byte{ - // 1146 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6e, 0xdb, 0xc6, - 0x13, 0x0e, 0x45, 0x4b, 0x96, 0x46, 0x8a, 0xec, 0xdf, 0xc6, 0xf9, 0x95, 0x30, 0x52, 0x41, 0x51, - 0xda, 0x54, 0x29, 0x0a, 0x09, 0x51, 0x50, 0xa0, 0x48, 0x7b, 0x49, 0x6d, 0x17, 0x70, 0x8c, 0x14, - 0x06, 0x13, 0x34, 0x68, 0x2f, 0xc2, 0x8a, 0x1c, 0xcb, 0x1b, 0x53, 0x5c, 0x62, 0x77, 0xa9, 0x98, - 0xc7, 0x5e, 0x7b, 0x6a, 0x9f, 0xa1, 0x2f, 0xd3, 0x63, 0x8e, 0x3d, 0x16, 0x49, 0xfb, 0x1e, 0xc5, - 0xfe, 0xa1, 0x44, 0x2b, 0x4d, 0x8b, 0x5e, 0x7a, 0xb1, 0x77, 0xbe, 0xf9, 0x86, 0x33, 0xfc, 0x66, - 0x66, 0x29, 0xb8, 0x11, 0xb3, 0x78, 0xbc, 0xbc, 0x3f, 0x5e, 0xf0, 0x18, 0x13, 0x39, 0xca, 0x04, - 0x57, 0x9c, 0x34, 0x62, 0x16, 0x8f, 0x96, 0xf7, 0xf7, 0xf7, 0x9c, 0x73, 0x8e, 0x29, 0x4a, 0xe6, - 0xbc, 0xfb, 0x7b, 0x73, 0x3e, 0xe7, 0xe6, 0x38, 0xd6, 0x27, 0x8b, 0x0e, 0xbe, 0x85, 0xfa, 0xa3, - 0x84, 0x51, 0x49, 0x02, 0xd8, 0x96, 0xf9, 0xec, 0x05, 0x46, 0x2a, 0xf0, 0xfa, 0xde, 0xb0, 0x15, - 0x96, 0x26, 0xf9, 0x3f, 0x34, 0xb8, 0x60, 0x73, 0x96, 0x06, 0x35, 0xe3, 0x70, 0x16, 0xe9, 0x01, - 0x44, 0x3c, 0x55, 0x82, 0x27, 0x09, 0x8a, 0xc0, 0x37, 0xbe, 0x0a, 0x32, 0xf8, 0xd9, 0x07, 0x38, - 0x10, 0x18, 0x63, 0xaa, 0x18, 0x4d, 0xfe, 0x26, 0xc1, 0x3d, 0xd8, 0xa5, 0x4a, 0xa1, 0x54, 0x54, - 0x31, 0x9e, 0x4e, 0x55, 0x91, 0xa1, 0x4b, 0xb5, 0x53, 0xc1, 0x9f, 0x15, 0x19, 0x56, 0x6a, 0xf1, - 0xaf, 0xd4, 0x72, 0x07, 0xae, 0x47, 0xab, 0x54, 0x53, 0x16, 0x07, 0x5b, 0x7d, 0x6f, 0xd8, 0x09, - 0x3b, 0x6b, 0xf0, 0x38, 0x26, 0xef, 0x03, 0x64, 0xf9, 0x2c, 0x61, 0xd1, 0xf4, 0x02, 0x8b, 0xa0, - 0x6e, 0x18, 0x2d, 0x8b, 0x9c, 0x60, 0x41, 0x6e, 0x41, 0x4b, 0x09, 0x9a, 0xca, 0x8c, 0x0b, 0x15, - 0x34, 0xfa, 0xfe, 0xb0, 0x15, 0xae, 0x01, 0x1d, 0x2c, 0xd9, 0x3c, 0x9d, 0x46, 0x3c, 0x4f, 0x55, - 0xb0, 0xdd, 0xf7, 0x86, 0xd7, 0xc3, 0x96, 0x46, 0x0e, 0x34, 0x40, 0x6e, 0x43, 0x27, 0x97, 0x28, - 0xa6, 0x99, 0x40, 0x89, 0xa9, 0x0a, 0x9a, 0x7d, 0x6f, 0xd8, 0x0c, 0xdb, 0x1a, 0x3b, 0xb5, 0x90, - 0xae, 0xd1, 0x50, 0x96, 0x28, 0xd8, 0x19, 0xc3, 0x38, 0x68, 0x19, 0x8e, 0x89, 0xfb, 0xc6, 0x61, - 0xe4, 0x23, 0xd8, 0x99, 0xd1, 0xe8, 0x22, 0xcf, 0xa6, 0x98, 0xb0, 0x39, 0x9b, 0x25, 0x18, 0x80, - 0xa1, 0x75, 0x2d, 0x7c, 0xe4, 0x50, 0x9d, 0xd0, 0x11, 0xb5, 0x3e, 0x18, 0xb4, 0x6d, 0x42, 0x8b, - 0x3d, 0xd5, 0x90, 0x11, 0x25, 0xe1, 0x29, 0x4e, 0x5f, 0x52, 0x91, 0xb2, 0x74, 0x1e, 0x74, 0x6c, - 0x42, 0x03, 0x3e, 0xb7, 0xd8, 0xe0, 0xa7, 0x1a, 0x34, 0x0f, 0x79, 0x94, 0x2f, 0x74, 0x89, 0x5d, - 0xa8, 0xb1, 0xd8, 0xb5, 0xa7, 0xc6, 0xe2, 0x8d, 0x16, 0xd7, 0x36, 0x5b, 0x4c, 0xee, 0x42, 0x97, - 0xe6, 0xea, 0x5c, 0x2b, 0x1c, 0x99, 0x26, 0x05, 0xbe, 0xd1, 0x6d, 0x03, 0x35, 0x1d, 0x96, 0x12, - 0x85, 0xe9, 0xef, 0x02, 0xd5, 0x39, 0xd7, 0x1d, 0xf2, 0x4d, 0x87, 0x4b, 0xfc, 0x89, 0x81, 0xc9, - 0x03, 0xb8, 0x19, 0xd1, 0x8c, 0xce, 0x58, 0xc2, 0x54, 0x31, 0x8d, 0x31, 0xc1, 0xb9, 0x7d, 0x72, - 0xdd, 0xf0, 0xf7, 0xd6, 0xce, 0xc3, 0x95, 0x6f, 0x23, 0x88, 0xa5, 0x4b, 0xee, 0xca, 0x69, 0x6c, - 0x06, 0x1d, 0xaf, 0x7c, 0x66, 0x20, 0x51, 0x2c, 0x59, 0x84, 0xc1, 0xb6, 0xa1, 0x95, 0xe6, 0xe0, - 0x8f, 0x1a, 0x34, 0x4f, 0xb0, 0x90, 0xe7, 0x54, 0x20, 0x79, 0x08, 0xcd, 0x05, 0x2a, 0x1a, 0x53, - 0x45, 0x03, 0xaf, 0xef, 0x0f, 0xdb, 0x93, 0xde, 0xc8, 0x2e, 0xda, 0xa8, 0xe4, 0x8c, 0x9e, 0x38, - 0xc2, 0x51, 0xaa, 0x44, 0x11, 0xae, 0xf8, 0x3a, 0x36, 0xa3, 0x45, 0xc2, 0x69, 0x2c, 0x83, 0xda, - 0x3b, 0x62, 0x4f, 0x1d, 0xc1, 0xc5, 0x96, 0x7c, 0xb2, 0x0f, 0x4d, 0xb3, 0xa2, 0x11, 0x4f, 0xdc, - 0xb0, 0xaf, 0xec, 0x8d, 0x49, 0xde, 0xda, 0x9c, 0xe4, 0x00, 0xb6, 0x97, 0x28, 0xa4, 0x55, 0x4d, - 0x0f, 0x6a, 0x69, 0x12, 0x02, 0x5b, 0x82, 0x27, 0x18, 0x34, 0xfa, 0xde, 0xb0, 0x1e, 0x9a, 0xf3, - 0xfe, 0xe7, 0x70, 0xfd, 0x4a, 0xfd, 0x64, 0x17, 0x7c, 0xfd, 0x58, 0x3b, 0x06, 0xfa, 0x48, 0xf6, - 0xa0, 0xbe, 0xa4, 0x49, 0x5e, 0xae, 0xa5, 0x35, 0x1e, 0xd6, 0x3e, 0xf3, 0x74, 0xf0, 0x95, 0x17, - 0xf8, 0xa7, 0xe0, 0x4e, 0x25, 0x78, 0x90, 0x40, 0xfb, 0x14, 0xc5, 0x82, 0x49, 0x5d, 0x9b, 0x24, - 0x9f, 0x40, 0x63, 0x2e, 0x68, 0xaa, 0xa4, 0xd1, 0xb9, 0x3b, 0xd9, 0x2b, 0xb5, 0x3a, 0x3c, 0x3e, - 0xfc, 0x9a, 0x2e, 0x50, 0x66, 0x34, 0xc2, 0xd0, 0x71, 0xc8, 0x18, 0x1a, 0x32, 0xe2, 0x19, 0x5a, - 0x65, 0xbb, 0x93, 0xf7, 0x4a, 0xf6, 0xfa, 0x91, 0x4f, 0xb5, 0x3f, 0x74, 0xb4, 0xc1, 0xf7, 0x3e, - 0x34, 0x4e, 0xf3, 0x99, 0x16, 0xe8, 0x8e, 0x93, 0x41, 0x57, 0xd9, 0x9d, 0xec, 0x54, 0x7a, 0x12, - 0xf2, 0x04, 0xad, 0x2e, 0x64, 0x02, 0x2d, 0x9a, 0xcc, 0xb9, 0x60, 0xea, 0x7c, 0x61, 0x6a, 0xaf, - 0x54, 0x74, 0x82, 0xc5, 0xa3, 0xd2, 0x17, 0xae, 0x69, 0x64, 0x0c, 0x4d, 0x4c, 0x23, 0x1e, 0xeb, - 0x6d, 0xf3, 0x4d, 0xc8, 0x8d, 0x4a, 0xc8, 0x91, 0x73, 0x85, 0x2b, 0x12, 0xb9, 0x0b, 0xf5, 0x28, - 0x17, 0x4b, 0x34, 0x4d, 0xec, 0x4e, 0x76, 0x2b, 0xec, 0x03, 0x8d, 0x87, 0xd6, 0x4d, 0x3e, 0x86, - 0xe6, 0x05, 0x16, 0xf6, 0x6e, 0xac, 0xbf, 0x55, 0xb5, 0xbe, 0x1b, 0xc3, 0xed, 0x0b, 0x7b, 0xd0, - 0x2d, 0x10, 0xf4, 0xa5, 0xe9, 0x71, 0x27, 0xd4, 0x47, 0xf2, 0x01, 0xf8, 0x2f, 0x5e, 0x5e, 0x98, - 0x5b, 0xab, 0x3d, 0x21, 0x2b, 0xa1, 0x8c, 0x18, 0xa3, 0xc7, 0xcf, 0x4f, 0x42, 0xed, 0xde, 0xa7, - 0xe0, 0x3f, 0x7e, 0x7e, 0x62, 0x3a, 0xa8, 0xd6, 0x1d, 0x54, 0xa6, 0xa7, 0x91, 0x58, 0xba, 0xe6, - 0xeb, 0x23, 0xe9, 0x80, 0x77, 0xe9, 0xa6, 0xd2, 0xbb, 0xd4, 0x96, 0x9d, 0xc2, 0x56, 0xe8, 0x15, - 0xda, 0xb2, 0x73, 0xd7, 0x0a, 0xbd, 0x54, 0x5b, 0x76, 0xdc, 0x5a, 0xa1, 0x87, 0x83, 0xdf, 0x6b, - 0xb0, 0xfd, 0xd4, 0x6e, 0xd9, 0x5b, 0x97, 0xcd, 0x6d, 0xe8, 0xb8, 0x05, 0xac, 0x7e, 0x02, 0xda, - 0x0e, 0x33, 0x6f, 0x76, 0x0b, 0x5a, 0xfa, 0x66, 0xd1, 0x62, 0x17, 0x2e, 0xfd, 0x1a, 0xa8, 0x7c, - 0x1c, 0xb6, 0xae, 0x7c, 0x1c, 0xfa, 0xd0, 0x8e, 0x51, 0x46, 0x82, 0x65, 0xaa, 0x5c, 0x89, 0x56, - 0x58, 0x85, 0x48, 0x08, 0xff, 0x2b, 0x53, 0x63, 0x1a, 0x67, 0x9c, 0xe9, 0x21, 0x6c, 0x98, 0x85, - 0xfd, 0xb0, 0x54, 0xcb, 0x95, 0x5d, 0xfe, 0x3f, 0x2a, 0x79, 0x76, 0x6f, 0x77, 0xe5, 0x06, 0x4c, - 0x3e, 0x85, 0x76, 0xb6, 0x1e, 0x6e, 0xa7, 0xfd, 0x8d, 0xb7, 0x87, 0x54, 0x86, 0x55, 0xde, 0xfe, - 0x01, 0xdc, 0xfc, 0xcb, 0x0c, 0xff, 0x66, 0x2b, 0x07, 0x3f, 0x78, 0xd0, 0x76, 0x4f, 0x39, 0x4e, - 0xcf, 0xb8, 0x56, 0x06, 0x2f, 0x99, 0x34, 0x9b, 0xa5, 0x3f, 0x01, 0xce, 0x7a, 0xe7, 0xa7, 0xbd, - 0x0f, 0xed, 0x33, 0x96, 0xce, 0x51, 0x64, 0x82, 0xa5, 0xca, 0x29, 0x5d, 0x85, 0xc8, 0xbd, 0xf5, - 0xe5, 0xb9, 0x65, 0xde, 0x6c, 0x67, 0x43, 0xa7, 0xf5, 0x6d, 0x2a, 0x61, 0xf7, 0x2b, 0x26, 0xa4, - 0x3a, 0xa5, 0x42, 0x15, 0x07, 0x74, 0x89, 0x54, 0x87, 0xd7, 0xcd, 0x56, 0x9a, 0x7a, 0xde, 0x21, - 0x8b, 0x65, 0xe8, 0xf7, 0xc6, 0xcb, 0xcc, 0x14, 0xe8, 0x87, 0xfa, 0x68, 0xc6, 0x31, 0x3d, 0x73, - 0x55, 0xe9, 0xa3, 0x46, 0x68, 0x1e, 0xbb, 0xb6, 0xeb, 0xa3, 0x4e, 0xfa, 0xec, 0x9c, 0x89, 0xf8, - 0xbf, 0x4c, 0xfa, 0xe5, 0x17, 0xbf, 0xbc, 0xee, 0x79, 0xaf, 0x5e, 0xf7, 0xbc, 0xdf, 0x5e, 0xf7, - 0xbc, 0x1f, 0xdf, 0xf4, 0xae, 0xbd, 0x7a, 0xd3, 0xbb, 0xf6, 0xeb, 0x9b, 0xde, 0xb5, 0xef, 0x06, - 0x73, 0xa6, 0xce, 0xf3, 0xd9, 0x28, 0xe2, 0x8b, 0x31, 0x4f, 0x25, 0x4f, 0xc5, 0xd8, 0xfc, 0xb9, - 0x1c, 0xeb, 0xdf, 0x6a, 0x7a, 0xdc, 0xe5, 0xac, 0x61, 0xae, 0xf7, 0x07, 0x7f, 0x06, 0x00, 0x00, - 0xff, 0xff, 0x38, 0x84, 0xad, 0x32, 0xdc, 0x09, 0x00, 0x00, -} - -func (m *Alias) 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 *Alias) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Alias) 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 = encodeVarintModels(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0x1a - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x12 - } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintModels(dAtA, i, uint64(len(m.Subject))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + // 1125 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xef, 0x7a, 0x63, 0xc7, 0x3b, 0x76, 0x9d, 0x30, 0x4d, 0x61, 0x15, 0x15, 0xcb, 0x75, 0xa1, + 0xb8, 0x08, 0xd9, 0xaa, 0x2b, 0x24, 0x54, 0xb8, 0x40, 0x12, 0xa4, 0x34, 0x2a, 0x8a, 0xb6, 0x15, + 0x95, 0xb8, 0x58, 0xe3, 0xdd, 0x97, 0xf5, 0x34, 0xeb, 0x99, 0xd5, 0xcc, 0xac, 0x9b, 0x3d, 0x72, + 0xe5, 0x04, 0x9f, 0x81, 0x2f, 0xc3, 0xb1, 0x47, 0x8e, 0xa8, 0x85, 0xef, 0x81, 0xe6, 0xcf, 0xda, + 0x5b, 0x97, 0x0a, 0x71, 0xe1, 0x92, 0xbc, 0xf7, 0x7b, 0xbf, 0xb7, 0xf3, 0xf6, 0xf7, 0xde, 0x9b, + 0x35, 0xba, 0x91, 0xd0, 0x64, 0xb2, 0xba, 0x3f, 0x59, 0xf2, 0x04, 0x32, 0x39, 0xce, 0x05, 0x57, + 0x1c, 0xb7, 0x12, 0x9a, 0x8c, 0x57, 0xf7, 0x0f, 0x0f, 0x5c, 0x30, 0x05, 0x06, 0x92, 0xba, 0xe8, + 0xe1, 0x41, 0xca, 0x53, 0x6e, 0xcc, 0x89, 0xb6, 0x2c, 0x3a, 0xfc, 0xd5, 0x47, 0xe8, 0x48, 0x40, + 0x02, 0x4c, 0x51, 0x92, 0xe1, 0x10, 0xed, 0xca, 0x62, 0xfe, 0x1c, 0x62, 0x15, 0x7a, 0x03, 0x6f, + 0x14, 0x44, 0x95, 0x8b, 0xef, 0xa1, 0x7d, 0xa2, 0x14, 0x48, 0x45, 0x14, 0xe5, 0x6c, 0xa6, 0xca, + 0x1c, 0xc2, 0x86, 0xa1, 0xec, 0xd5, 0xf0, 0xa7, 0x65, 0x0e, 0xf8, 0x7d, 0xd4, 0xe2, 0x82, 0xa6, + 0x94, 0x85, 0xbe, 0x21, 0x38, 0x0f, 0xdf, 0x41, 0xd7, 0xe3, 0xf5, 0x51, 0x33, 0x9a, 0x84, 0x3b, + 0x03, 0x6f, 0xd4, 0x8d, 0xba, 0x1b, 0xf0, 0x34, 0xc1, 0x1f, 0x22, 0x94, 0x17, 0xf3, 0x8c, 0xc6, + 0xb3, 0x4b, 0x28, 0xc3, 0xa6, 0x61, 0x04, 0x16, 0x39, 0x83, 0x12, 0xdf, 0x42, 0x81, 0x12, 0x84, + 0xc9, 0x9c, 0x0b, 0x15, 0xb6, 0x06, 0xfe, 0x28, 0x88, 0x36, 0x80, 0x4e, 0x96, 0x34, 0x65, 0xb3, + 0x98, 0x17, 0x4c, 0x85, 0xbb, 0x03, 0x6f, 0x74, 0x3d, 0x0a, 0x34, 0x72, 0xa4, 0x01, 0x7c, 0x1b, + 0x75, 0x0b, 0x09, 0x62, 0x96, 0x0b, 0x90, 0xc0, 0x54, 0xd8, 0x1e, 0x78, 0xa3, 0x76, 0xd4, 0xd1, + 0xd8, 0xb9, 0x85, 0x74, 0x8d, 0x86, 0xb2, 0x02, 0x41, 0x2f, 0x28, 0x24, 0x61, 0x60, 0x38, 0x26, + 0xef, 0x7b, 0x87, 0xe1, 0x4f, 0xd0, 0xde, 0x9c, 0xc4, 0x97, 0x45, 0x3e, 0x83, 0x8c, 0xa6, 0x74, + 0x9e, 0x41, 0x88, 0x0c, 0xad, 0x67, 0xe1, 0x13, 0x87, 0xea, 0x03, 0x1d, 0x51, 0xeb, 0x03, 0x61, + 0xc7, 0x1e, 0x68, 0xb1, 0x27, 0x1a, 0x32, 0xa2, 0x64, 0x9c, 0xc1, 0xec, 0x05, 0x11, 0x8c, 0xb2, + 0x34, 0xec, 0xda, 0x03, 0x0d, 0xf8, 0xcc, 0x62, 0xc3, 0x5f, 0x1a, 0xa8, 0x7d, 0xcc, 0xe3, 0x62, + 0xa9, 0x4b, 0xec, 0xa1, 0x06, 0x4d, 0x5c, 0x7b, 0x1a, 0x34, 0xc1, 0x7d, 0x84, 0x62, 0xce, 0x94, + 0xe0, 0x59, 0x06, 0xc2, 0xf5, 0xa4, 0x86, 0xe0, 0xbb, 0xa8, 0x47, 0x0a, 0xb5, 0xd0, 0x0a, 0xc7, + 0xa6, 0x49, 0xa1, 0x6f, 0x74, 0xdb, 0x42, 0x4d, 0x87, 0xa5, 0x04, 0x61, 0xfa, 0xbb, 0x04, 0xb5, + 0xe0, 0xba, 0x43, 0xbe, 0xe9, 0x70, 0x85, 0x3f, 0x36, 0x30, 0x7e, 0x80, 0x6e, 0xc6, 0x24, 0x27, + 0x73, 0x9a, 0x51, 0x55, 0xce, 0x12, 0xc8, 0x20, 0xb5, 0x4f, 0x6e, 0x1a, 0xfe, 0xc1, 0x26, 0x78, + 0xbc, 0x8e, 0x6d, 0x25, 0x51, 0xb6, 0xe2, 0xae, 0x9c, 0xd6, 0x76, 0xd2, 0xe9, 0x3a, 0x66, 0x06, + 0x12, 0xc4, 0x8a, 0xc6, 0x10, 0xee, 0x1a, 0x5a, 0xe5, 0x0e, 0xff, 0x6a, 0xa0, 0xf6, 0x19, 0x94, + 0x72, 0x41, 0x04, 0xe0, 0x87, 0xa8, 0xbd, 0x04, 0x45, 0x12, 0xa2, 0x48, 0xe8, 0x0d, 0xfc, 0x51, + 0x67, 0xda, 0x1f, 0xdb, 0x6d, 0x18, 0x57, 0x9c, 0xf1, 0x63, 0x47, 0x38, 0x61, 0x4a, 0x94, 0xd1, + 0x9a, 0xaf, 0x73, 0x73, 0x52, 0x66, 0x9c, 0x24, 0x32, 0x6c, 0xbc, 0x23, 0xf7, 0xdc, 0x11, 0x5c, + 0x6e, 0xc5, 0xc7, 0x87, 0xa8, 0x6d, 0xf6, 0x28, 0xe6, 0x99, 0x1b, 0xf6, 0xb5, 0xbf, 0x35, 0xc9, + 0x3b, 0xdb, 0x93, 0x1c, 0xa2, 0xdd, 0x15, 0x08, 0x69, 0x55, 0xd3, 0x83, 0x5a, 0xb9, 0x18, 0xa3, + 0x1d, 0xc1, 0x33, 0x08, 0x5b, 0x03, 0x6f, 0xd4, 0x8c, 0x8c, 0x7d, 0xf8, 0x25, 0xba, 0xfe, 0x46, + 0xfd, 0x78, 0x1f, 0xf9, 0xfa, 0xb1, 0x76, 0x0c, 0xb4, 0x89, 0x0f, 0x50, 0x73, 0x45, 0xb2, 0xa2, + 0x5a, 0x4b, 0xeb, 0x3c, 0x6c, 0x7c, 0xe1, 0xe9, 0xe4, 0x37, 0x5e, 0xe0, 0xdf, 0x92, 0xbb, 0xb5, + 0xe4, 0x61, 0x86, 0x3a, 0xe7, 0x20, 0x96, 0x54, 0xea, 0xda, 0x24, 0xfe, 0x0c, 0xb5, 0x52, 0x41, + 0x98, 0x92, 0x46, 0xe7, 0xde, 0xf4, 0xa0, 0xd2, 0xea, 0xf8, 0xf4, 0xf8, 0x3b, 0xb2, 0x04, 0x99, + 0x93, 0x18, 0x22, 0xc7, 0xc1, 0x13, 0xd4, 0x92, 0x31, 0xcf, 0xc1, 0x2a, 0xdb, 0x9b, 0x7e, 0x50, + 0xb1, 0x37, 0x8f, 0x7c, 0xa2, 0xe3, 0x91, 0xa3, 0x0d, 0x7f, 0xf4, 0x51, 0xeb, 0xbc, 0x98, 0x6b, + 0x81, 0xee, 0x38, 0x19, 0x74, 0x95, 0xbd, 0xe9, 0x5e, 0xad, 0x27, 0x11, 0xcf, 0xc0, 0xea, 0x82, + 0xa7, 0x28, 0x20, 0x59, 0xca, 0x05, 0x55, 0x8b, 0xa5, 0xa9, 0xbd, 0x56, 0xd1, 0x19, 0x94, 0x5f, + 0x57, 0xb1, 0x68, 0x43, 0xc3, 0x13, 0xd4, 0x06, 0x16, 0xf3, 0x44, 0x6f, 0x9b, 0x6f, 0x52, 0x6e, + 0xd4, 0x52, 0x4e, 0x5c, 0x28, 0x5a, 0x93, 0xf0, 0x5d, 0xd4, 0x8c, 0x0b, 0xb1, 0x02, 0xd3, 0xc4, + 0xde, 0x74, 0xbf, 0xc6, 0x3e, 0xd2, 0x78, 0x64, 0xc3, 0xf8, 0x53, 0xd4, 0xbe, 0x84, 0xd2, 0xde, + 0x8d, 0xcd, 0xb7, 0xaa, 0xd6, 0x77, 0x63, 0xb4, 0x7b, 0x69, 0x0d, 0xdd, 0x02, 0x41, 0x5e, 0x98, + 0x1e, 0x77, 0x23, 0x6d, 0xe2, 0x8f, 0x90, 0xff, 0xfc, 0xc5, 0xa5, 0xb9, 0xb5, 0x3a, 0x53, 0xbc, + 0x16, 0xca, 0x88, 0x31, 0x7e, 0xf4, 0xec, 0x2c, 0xd2, 0xe1, 0x43, 0x82, 0xfc, 0x47, 0xcf, 0xce, + 0x4c, 0x07, 0xd5, 0xa6, 0x83, 0xca, 0xf4, 0x34, 0x16, 0x2b, 0xd7, 0x7c, 0x6d, 0xe2, 0x2e, 0xf2, + 0xae, 0xdc, 0x54, 0x7a, 0x57, 0xda, 0xb3, 0x53, 0x18, 0x44, 0x5e, 0xa9, 0x3d, 0x3b, 0x77, 0x41, + 0xe4, 0x31, 0xed, 0xd9, 0x71, 0x0b, 0x22, 0x0f, 0x86, 0x7f, 0x36, 0xd0, 0xee, 0x13, 0xbb, 0x65, + 0x6f, 0x5d, 0x36, 0xb7, 0x51, 0xd7, 0x2d, 0x60, 0xfd, 0x13, 0xd0, 0x71, 0x98, 0x79, 0xb3, 0x5b, + 0x28, 0xd0, 0x37, 0x8b, 0x16, 0xbb, 0x74, 0xc7, 0x6f, 0x80, 0xda, 0xc7, 0x61, 0xe7, 0x8d, 0x8f, + 0xc3, 0x00, 0x75, 0x12, 0x90, 0xb1, 0xa0, 0xb9, 0xaa, 0x56, 0x22, 0x88, 0xea, 0x10, 0x8e, 0xd0, + 0x7b, 0xd5, 0xd1, 0xc0, 0x92, 0x9c, 0x53, 0x3d, 0x84, 0x2d, 0xb3, 0xb0, 0x1f, 0x57, 0x6a, 0xb9, + 0xb2, 0xab, 0xff, 0x27, 0x15, 0xcf, 0xee, 0xed, 0xbe, 0xdc, 0x82, 0xf1, 0xe7, 0xa8, 0x93, 0x6f, + 0x86, 0xdb, 0x69, 0x7f, 0xe3, 0xed, 0x21, 0x95, 0x51, 0x9d, 0x77, 0x78, 0x84, 0x6e, 0xfe, 0xe3, + 0x09, 0xff, 0x65, 0x2b, 0x87, 0x3f, 0x79, 0xa8, 0xe3, 0x9e, 0x72, 0xca, 0x2e, 0xb8, 0x56, 0x06, + 0xae, 0xa8, 0x34, 0x9b, 0xa5, 0x3f, 0x01, 0xce, 0xab, 0x29, 0xd6, 0xd8, 0x56, 0xec, 0x82, 0xb2, + 0x14, 0x44, 0x2e, 0x28, 0x53, 0x4e, 0xe9, 0x3a, 0x84, 0xef, 0x6d, 0x2e, 0xcf, 0x1d, 0xf3, 0x66, + 0x7b, 0x5b, 0x3a, 0x6d, 0x6e, 0x53, 0x89, 0xf6, 0xbf, 0xa5, 0x42, 0xaa, 0x73, 0x22, 0x54, 0x79, + 0x44, 0x56, 0x40, 0x74, 0x7a, 0xd3, 0x6c, 0xa5, 0xa9, 0xe7, 0x1d, 0xb2, 0x58, 0x86, 0x7e, 0x6f, + 0xb8, 0xca, 0x4d, 0x81, 0x7e, 0xa4, 0x4d, 0x33, 0x8e, 0xec, 0xc2, 0x55, 0xa5, 0x4d, 0x8d, 0x90, + 0x22, 0x71, 0x6d, 0xd7, 0xa6, 0x3e, 0xf4, 0xe9, 0x82, 0x8a, 0xe4, 0xff, 0x3c, 0xf4, 0x9b, 0xaf, + 0x7e, 0x7b, 0xd5, 0xf7, 0x5e, 0xbe, 0xea, 0x7b, 0x7f, 0xbc, 0xea, 0x7b, 0x3f, 0xbf, 0xee, 0x5f, + 0x7b, 0xf9, 0xba, 0x7f, 0xed, 0xf7, 0xd7, 0xfd, 0x6b, 0x3f, 0x0c, 0x53, 0xaa, 0x16, 0xc5, 0x7c, + 0x1c, 0xf3, 0xe5, 0x84, 0x33, 0xc9, 0x99, 0x98, 0x98, 0x3f, 0x57, 0x13, 0xfd, 0x83, 0x4a, 0x8f, + 0xbb, 0x9c, 0xb7, 0xcc, 0xf5, 0xfe, 0xe0, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x9b, 0xe9, + 0xda, 0x81, 0x09, 0x00, 0x00, } func (m *Credential) Marshal() (dAtA []byte, err error) { @@ -1814,27 +1707,6 @@ func encodeVarintModels(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Alias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subject) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - return n -} - func (m *Credential) Size() (n int) { if m == nil { return 0 @@ -2185,152 +2057,6 @@ func sovModels(x uint64) (n int) { func sozModels(x uint64) (n int) { return sovModels(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Alias) 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 ErrIntOverflowModels - } - 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: Alias: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Alias: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowModels - } - 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 ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subject = 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 ErrIntOverflowModels - } - 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 ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = 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 ErrIntOverflowModels - } - 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 ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Credential) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index a97ecc259..eaa582b3a 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -23,33 +23,34 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Account represents a wallet account associated with a DID Controller -type Account struct { +// Alias represents a DID alias +type Alias struct { // The unique identifier of the alias Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Origin is the Alias provider - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // Subject is the user defined alias - Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` - // Controller of the alias - Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` - Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` - ChainCode uint32 `protobuf:"varint,6,opt,name=chain_code,json=chainCode,proto3" json:"chain_code,omitempty"` - Index uint32 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` + // The DID of the alias + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + // The alias of the DID + Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"` + // Origin of the alias + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // Permissions of the alias + Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"` + // Expiration of the alias + Expiration int64 `protobuf:"varint,6,opt,name=expiration,proto3" json:"expiration,omitempty"` } -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { +func (m *Alias) Reset() { *m = Alias{} } +func (m *Alias) String() string { return proto.CompactTextString(m) } +func (*Alias) ProtoMessage() {} +func (*Alias) Descriptor() ([]byte, []int) { return fileDescriptor_f44bb702879c34b4, []int{0} } -func (m *Account) XXX_Unmarshal(b []byte) error { +func (m *Alias) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Alias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Account.Marshal(b, m, deterministic) + return xxx_messageInfo_Alias.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -59,63 +60,56 @@ func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(m, src) +func (m *Alias) XXX_Merge(src proto.Message) { + xxx_messageInfo_Alias.Merge(m, src) } -func (m *Account) XXX_Size() int { +func (m *Alias) XXX_Size() int { return m.Size() } -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) +func (m *Alias) XXX_DiscardUnknown() { + xxx_messageInfo_Alias.DiscardUnknown(m) } -var xxx_messageInfo_Account proto.InternalMessageInfo +var xxx_messageInfo_Alias proto.InternalMessageInfo -func (m *Account) GetId() string { +func (m *Alias) GetId() string { if m != nil { return m.Id } return "" } -func (m *Account) GetAddress() string { +func (m *Alias) GetDid() string { if m != nil { - return m.Address + return m.Did } return "" } -func (m *Account) GetLabel() string { +func (m *Alias) GetAlias() string { if m != nil { - return m.Label + return m.Alias } return "" } -func (m *Account) GetController() string { +func (m *Alias) GetOrigin() string { if m != nil { - return m.Controller + return m.Origin } return "" } -func (m *Account) GetNamespace() string { +func (m *Alias) GetScopes() []string { if m != nil { - return m.Namespace + return m.Scopes } - return "" + return nil } -func (m *Account) GetChainCode() uint32 { +func (m *Alias) GetExpiration() int64 { if m != nil { - return m.ChainCode - } - return 0 -} - -func (m *Account) GetIndex() uint32 { - if m != nil { - return m.Index + return m.Expiration } return 0 } @@ -134,6 +128,8 @@ type Controller struct { VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` // The Authentications of the controller Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"` + // The Status of the claims for the controller + Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` } func (m *Controller) Reset() { *m = Controller{} } @@ -211,199 +207,15 @@ func (m *Controller) GetAuthentication() []*Credential { return nil } -// Proof represents a verifiable credential -type Proof struct { - // The unique identifier of the proof - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The controller of the proof - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // The value of the linked identifier - Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` - // The property of the proof - Property string `protobuf:"bytes,4,opt,name=property,proto3" json:"property,omitempty"` - // The accumulator of the proof - Accumulator []byte `protobuf:"bytes,5,opt,name=accumulator,proto3" json:"accumulator,omitempty"` - // The secret key of the proof - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *Proof) Reset() { *m = Proof{} } -func (m *Proof) String() string { return proto.CompactTextString(m) } -func (*Proof) ProtoMessage() {} -func (*Proof) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{2} -} -func (m *Proof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proof.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 *Proof) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proof.Merge(m, src) -} -func (m *Proof) XXX_Size() int { - return m.Size() -} -func (m *Proof) XXX_DiscardUnknown() { - xxx_messageInfo_Proof.DiscardUnknown(m) -} - -var xxx_messageInfo_Proof proto.InternalMessageInfo - -func (m *Proof) GetId() string { +func (m *Controller) GetStatus() string { if m != nil { - return m.Id + return m.Status } return "" } -func (m *Proof) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Proof) GetIssuer() string { - if m != nil { - return m.Issuer - } - return "" -} - -func (m *Proof) GetProperty() string { - if m != nil { - return m.Property - } - return "" -} - -func (m *Proof) GetAccumulator() []byte { - if m != nil { - return m.Accumulator - } - return nil -} - -func (m *Proof) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -// ServiceRecord represents a decentralized service in a DID Document -type ServiceRecord struct { - // The ID of the service - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The type of the service - ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - // The authority DID of the service - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` - // The domain name of the service - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // The description of the service - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // The service endpoint - ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Scopes is the Authorization Grants of the service - Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (m *ServiceRecord) Reset() { *m = ServiceRecord{} } -func (m *ServiceRecord) String() string { return proto.CompactTextString(m) } -func (*ServiceRecord) ProtoMessage() {} -func (*ServiceRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{3} -} -func (m *ServiceRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceRecord.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 *ServiceRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceRecord.Merge(m, src) -} -func (m *ServiceRecord) XXX_Size() int { - return m.Size() -} -func (m *ServiceRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceRecord proto.InternalMessageInfo - -func (m *ServiceRecord) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *ServiceRecord) GetServiceType() string { - if m != nil { - return m.ServiceType - } - return "" -} - -func (m *ServiceRecord) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *ServiceRecord) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *ServiceRecord) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ServiceRecord) GetServiceEndpoints() map[string]string { - if m != nil { - return m.ServiceEndpoints - } - return nil -} - -func (m *ServiceRecord) GetPermissions() *Permissions { - if m != nil { - return m.Permissions - } - return nil -} - // Verification reprsents a method of verifying membership in a DID -type VerificationMethod struct { +type Verification struct { // The unique identifier of the verification Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The controller of the verification @@ -416,20 +228,22 @@ type VerificationMethod struct { Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` } -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_f44bb702879c34b4, []int{4} +func (m *Verification) Reset() { *m = Verification{} } +func (m *Verification) String() string { return proto.CompactTextString(m) } +func (*Verification) ProtoMessage() {} +func (*Verification) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{2} } -func (m *VerificationMethod) XXX_Unmarshal(b []byte) error { +func (m *Verification) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *VerificationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Verification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_VerificationMethod.Marshal(b, m, deterministic) + return xxx_messageInfo_Verification.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -439,128 +253,116 @@ func (m *VerificationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *VerificationMethod) XXX_Merge(src proto.Message) { - xxx_messageInfo_VerificationMethod.Merge(m, src) +func (m *Verification) XXX_Merge(src proto.Message) { + xxx_messageInfo_Verification.Merge(m, src) } -func (m *VerificationMethod) XXX_Size() int { +func (m *Verification) XXX_Size() int { return m.Size() } -func (m *VerificationMethod) XXX_DiscardUnknown() { - xxx_messageInfo_VerificationMethod.DiscardUnknown(m) +func (m *Verification) XXX_DiscardUnknown() { + xxx_messageInfo_Verification.DiscardUnknown(m) } -var xxx_messageInfo_VerificationMethod proto.InternalMessageInfo +var xxx_messageInfo_Verification proto.InternalMessageInfo -func (m *VerificationMethod) GetId() string { +func (m *Verification) GetId() string { if m != nil { return m.Id } return "" } -func (m *VerificationMethod) GetController() string { +func (m *Verification) GetController() string { if m != nil { return m.Controller } return "" } -func (m *VerificationMethod) GetMethod() DIDNamespace { +func (m *Verification) GetMethod() DIDNamespace { if m != nil { return m.Method } return DIDNamespace_DID_NAMESPACE_UNSPECIFIED } -func (m *VerificationMethod) GetIssuer() string { +func (m *Verification) GetIssuer() string { if m != nil { return m.Issuer } return "" } -func (m *VerificationMethod) GetSubject() string { +func (m *Verification) GetSubject() string { if m != nil { return m.Subject } return "" } -func (m *VerificationMethod) GetPublicKey() *PubKey { +func (m *Verification) GetPublicKey() *PubKey { if m != nil { return m.PublicKey } return nil } +func (m *Verification) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + func init() { - proto.RegisterType((*Account)(nil), "did.v1.Account") + proto.RegisterType((*Alias)(nil), "did.v1.Alias") proto.RegisterType((*Controller)(nil), "did.v1.Controller") - proto.RegisterType((*Proof)(nil), "did.v1.Proof") - proto.RegisterType((*ServiceRecord)(nil), "did.v1.ServiceRecord") - proto.RegisterMapType((map[string]string)(nil), "did.v1.ServiceRecord.ServiceEndpointsEntry") - proto.RegisterType((*VerificationMethod)(nil), "did.v1.VerificationMethod") + proto.RegisterType((*Verification)(nil), "did.v1.Verification") } func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 830 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xce, 0x8c, 0x9d, 0xf1, 0xba, 0x9c, 0x04, 0x6f, 0x6f, 0xc8, 0xb6, 0xbc, 0x60, 0x79, 0x7d, - 0x80, 0x08, 0x8c, 0xbd, 0x1b, 0x7e, 0x84, 0x2c, 0x2e, 0x8b, 0x77, 0x0f, 0x68, 0x05, 0x5a, 0x0d, - 0x08, 0x21, 0x2e, 0xd1, 0xb8, 0xbb, 0x37, 0x6e, 0x98, 0x99, 0x1e, 0x75, 0xf7, 0x58, 0x3b, 0x12, - 0x6f, 0x80, 0x84, 0xb8, 0x71, 0xe3, 0xc8, 0x43, 0xf0, 0x04, 0x1c, 0x83, 0xb8, 0x70, 0x44, 0xc9, - 0x1b, 0xf0, 0x04, 0xa8, 0x7b, 0xba, 0xed, 0x49, 0x82, 0x04, 0x7b, 0xb1, 0xa6, 0xbe, 0xaa, 0xe9, - 0xea, 0xef, 0xab, 0xaf, 0x3c, 0x80, 0x28, 0xa7, 0xb3, 0xf5, 0xc3, 0x99, 0xd2, 0x89, 0x66, 0xd3, - 0x42, 0x0a, 0x2d, 0x50, 0x44, 0x39, 0x9d, 0xae, 0x1f, 0x0e, 0xee, 0x12, 0xa1, 0x32, 0xa1, 0x66, - 0x42, 0x66, 0xa6, 0x44, 0xc8, 0xac, 0x2e, 0x18, 0x1c, 0xba, 0x97, 0xce, 0x58, 0xce, 0x14, 0x57, - 0x0e, 0xbd, 0xe3, 0xd0, 0x4c, 0x50, 0x96, 0x3a, 0x70, 0xfc, 0x6b, 0x08, 0x9d, 0x47, 0x84, 0x88, - 0x32, 0xd7, 0xe8, 0x00, 0x42, 0x4e, 0x71, 0x30, 0x0a, 0x8e, 0xbb, 0x71, 0xc8, 0x29, 0xc2, 0xd0, - 0x49, 0x28, 0x95, 0x4c, 0x29, 0x1c, 0x5a, 0xd0, 0x87, 0xe8, 0x10, 0x76, 0xd3, 0x64, 0xc9, 0x52, - 0xdc, 0xb2, 0x78, 0x1d, 0xa0, 0x21, 0x00, 0x11, 0xb9, 0x96, 0x22, 0x4d, 0x99, 0xc4, 0x6d, 0x9b, - 0x6a, 0x20, 0xe8, 0x35, 0xe8, 0xe6, 0x49, 0xc6, 0x54, 0x91, 0x10, 0x86, 0x77, 0x6d, 0x7a, 0x0b, - 0xa0, 0xd7, 0x01, 0xc8, 0x2a, 0xe1, 0xf9, 0x29, 0x11, 0x94, 0xe1, 0x68, 0x14, 0x1c, 0xef, 0xc7, - 0x5d, 0x8b, 0x2c, 0x04, 0x65, 0xa6, 0x25, 0xcf, 0x29, 0x7b, 0x81, 0x3b, 0x36, 0x53, 0x07, 0xf3, - 0xef, 0xfe, 0xfe, 0xf9, 0x8f, 0x1f, 0x5a, 0x6b, 0x68, 0x9b, 0xab, 0xa3, 0x23, 0xe8, 0x6f, 0xdb, - 0x4d, 0xec, 0xa5, 0xfa, 0x01, 0x0e, 0x10, 0x06, 0xd4, 0xc0, 0x1d, 0x89, 0x7e, 0x88, 0x03, 0x74, - 0x1f, 0xee, 0x35, 0x32, 0xdb, 0xfe, 0x13, 0x7b, 0x7c, 0xbf, 0x85, 0x03, 0x74, 0x17, 0x6e, 0x6f, - 0x2e, 0xb9, 0x79, 0xb7, 0x8d, 0x03, 0x1c, 0x8c, 0x7f, 0x0a, 0x01, 0x16, 0x5b, 0x7e, 0xff, 0x5f, - 0xbf, 0x37, 0xa1, 0x93, 0xa4, 0x3c, 0x51, 0x4c, 0xe1, 0xd6, 0xa8, 0x75, 0xdc, 0x3b, 0xd9, 0x9f, - 0xd6, 0x33, 0x9d, 0x3e, 0x32, 0x70, 0xec, 0xb3, 0xe8, 0x1d, 0x80, 0xa2, 0x5c, 0xa6, 0x9c, 0x9c, - 0x7e, 0xcb, 0x2a, 0x2b, 0x69, 0xef, 0xe4, 0xc0, 0xd7, 0x3e, 0x2b, 0x97, 0x4f, 0x59, 0x15, 0x77, - 0xeb, 0x8a, 0xa7, 0xac, 0x42, 0xf7, 0xa0, 0xbb, 0x4e, 0xca, 0x54, 0x9f, 0x12, 0x4e, 0x9d, 0xc2, - 0xb7, 0x2c, 0xb0, 0xe0, 0x14, 0xcd, 0xe1, 0x20, 0x29, 0xf5, 0x8a, 0xe5, 0x9a, 0x93, 0x44, 0x73, - 0x91, 0xe3, 0xc8, 0xf6, 0x46, 0xfe, 0xbc, 0x85, 0x64, 0xd4, 0x64, 0x93, 0x34, 0xbe, 0x56, 0x39, - 0x9f, 0x5a, 0x9d, 0x8f, 0x9d, 0xce, 0xfb, 0x1b, 0x62, 0x56, 0xde, 0x57, 0x1a, 0x5d, 0x8d, 0xaa, - 0x38, 0x1c, 0xff, 0x1e, 0xc0, 0xee, 0x33, 0x29, 0xc4, 0xf3, 0x1b, 0xa2, 0x5c, 0x35, 0x49, 0x78, - 0xc3, 0x24, 0x47, 0x10, 0x71, 0xa5, 0x4a, 0x26, 0x9d, 0xb7, 0x5c, 0x84, 0x06, 0x70, 0xab, 0x90, - 0xa2, 0x60, 0x52, 0x57, 0xce, 0x5a, 0x9b, 0x18, 0x8d, 0xa0, 0x97, 0x10, 0x52, 0x66, 0x65, 0x9a, - 0x68, 0x21, 0x2d, 0xf1, 0xbd, 0xb8, 0x09, 0xa1, 0x3e, 0xb4, 0x8c, 0x80, 0x91, 0xcd, 0x98, 0xc7, - 0xf9, 0x03, 0xcb, 0xe8, 0x2d, 0xc7, 0x68, 0x04, 0x83, 0x86, 0x0f, 0xea, 0x96, 0x13, 0x7f, 0xbe, - 0x21, 0x89, 0xdb, 0xe3, 0x5f, 0x5a, 0xb0, 0xff, 0x39, 0x93, 0x6b, 0x4e, 0x58, 0xcc, 0x88, 0x90, - 0xf4, 0x06, 0xb7, 0xfb, 0xb0, 0xa7, 0xea, 0x82, 0x53, 0x5d, 0x15, 0xcc, 0xb1, 0xeb, 0x39, 0xec, - 0x8b, 0xaa, 0x60, 0x66, 0x07, 0x8c, 0xb4, 0x42, 0x72, 0x5d, 0x39, 0x86, 0x5b, 0xc0, 0x90, 0x17, - 0x92, 0x9f, 0xf1, 0xdc, 0x51, 0x74, 0x91, 0x21, 0x48, 0x99, 0x22, 0x92, 0x17, 0x76, 0x6e, 0xf5, - 0x64, 0x9b, 0x10, 0xfa, 0x0a, 0x6e, 0xfb, 0xd6, 0x2c, 0xa7, 0x85, 0xe0, 0xb9, 0x56, 0x6e, 0xbe, - 0x6f, 0xfb, 0xf9, 0x5e, 0xb9, 0xbc, 0x8f, 0x9e, 0xf8, 0xea, 0x27, 0xb9, 0x96, 0x55, 0xdc, 0x57, - 0xd7, 0x60, 0xf4, 0x3e, 0xf4, 0x0a, 0x26, 0x33, 0xae, 0x14, 0x17, 0xb9, 0xb2, 0xeb, 0xd7, 0x3b, - 0xb9, 0xb3, 0xf1, 0xe0, 0x36, 0x15, 0x37, 0xeb, 0x06, 0x0b, 0x78, 0xf5, 0x5f, 0x3b, 0xf8, 0x51, - 0xd4, 0xaa, 0x99, 0x47, 0xb3, 0xda, 0xeb, 0x24, 0x2d, 0xbd, 0x5e, 0x75, 0x30, 0x0f, 0x3f, 0x0c, - 0xe6, 0xef, 0xd9, 0x21, 0x4d, 0xdd, 0x90, 0xf6, 0xbc, 0x3a, 0xd6, 0x75, 0x47, 0xd0, 0xdf, 0x08, - 0x37, 0x71, 0xb8, 0x31, 0x5f, 0x6b, 0xfc, 0x7d, 0x08, 0xe8, 0x4b, 0x26, 0xf9, 0x73, 0xe7, 0xde, - 0x4f, 0x99, 0x5e, 0x09, 0xfa, 0xd2, 0x4e, 0x9c, 0x40, 0x94, 0xd9, 0x37, 0xed, 0x9c, 0x0e, 0x4e, - 0x0e, 0x3d, 0xe7, 0xc7, 0x9f, 0x3c, 0xfe, 0xcc, 0xff, 0x23, 0xc4, 0xae, 0xa6, 0xe1, 0xdb, 0xf6, - 0x15, 0xdf, 0x62, 0xe8, 0xa8, 0x72, 0xf9, 0x0d, 0x23, 0xda, 0x8d, 0xcd, 0x87, 0xd7, 0x76, 0x3b, - 0xfa, 0x8f, 0xdd, 0x9e, 0x7f, 0x60, 0xb5, 0x78, 0xe0, 0xb4, 0x78, 0x03, 0x46, 0x0d, 0xc3, 0xd6, - 0x77, 0xf0, 0xbe, 0x75, 0x0d, 0xac, 0x6d, 0x77, 0x3f, 0xfe, 0xe8, 0xb7, 0x8b, 0x61, 0x70, 0x7e, - 0x31, 0x0c, 0xfe, 0xba, 0x18, 0x06, 0x3f, 0x5e, 0x0e, 0x77, 0xce, 0x2f, 0x87, 0x3b, 0x7f, 0x5e, - 0x0e, 0x77, 0xbe, 0x1e, 0x9f, 0x71, 0xbd, 0x2a, 0x97, 0x53, 0x22, 0xb2, 0x99, 0xc8, 0x95, 0xc8, - 0xe5, 0xcc, 0xfe, 0xbc, 0x98, 0x99, 0x2f, 0x85, 0x71, 0xb0, 0x5a, 0x46, 0xf6, 0x33, 0xf1, 0xee, - 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xab, 0x9c, 0x6f, 0x88, 0x06, 0x00, 0x00, + // 561 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x31, 0x8f, 0xd3, 0x3e, + 0x18, 0xc6, 0x2f, 0x49, 0x9b, 0xfe, 0xfb, 0xde, 0xff, 0x4a, 0x65, 0x2a, 0x30, 0x87, 0x14, 0xaa, + 0x0e, 0xd0, 0xa1, 0x34, 0x5c, 0x41, 0x0c, 0x15, 0x0b, 0xf4, 0x16, 0x74, 0x12, 0x42, 0x19, 0x18, + 0x58, 0x4e, 0x69, 0x6c, 0x5a, 0x73, 0x49, 0x1c, 0xd9, 0x4e, 0x75, 0xfd, 0x12, 0x88, 0x95, 0x85, + 0xcf, 0xc0, 0xce, 0x17, 0x60, 0x3c, 0x89, 0x85, 0x11, 0xb5, 0xdf, 0x80, 0x4f, 0x80, 0xec, 0x38, + 0xe5, 0x54, 0x06, 0x96, 0xca, 0xef, 0xe3, 0xa7, 0x7e, 0x9f, 0xf7, 0x17, 0x1b, 0x10, 0x61, 0x24, + 0x5c, 0x9d, 0x84, 0x52, 0xc5, 0x8a, 0x8e, 0x0b, 0xc1, 0x15, 0x47, 0x3e, 0x61, 0x64, 0xbc, 0x3a, + 0x39, 0xbe, 0x9d, 0x70, 0x99, 0x71, 0x19, 0x72, 0x91, 0x69, 0x0b, 0x17, 0x59, 0x65, 0x38, 0xee, + 0xd9, 0x3f, 0x2d, 0x68, 0x4e, 0x25, 0x93, 0x56, 0xbd, 0x69, 0xd5, 0x8c, 0x13, 0x9a, 0x5a, 0x71, + 0xf0, 0xc5, 0x81, 0xe6, 0xf3, 0x94, 0xc5, 0x12, 0x75, 0xc0, 0x65, 0x04, 0x3b, 0x7d, 0x67, 0xd8, + 0x8e, 0x5c, 0x46, 0x50, 0x17, 0x3c, 0xc2, 0x08, 0x76, 0x8d, 0xa0, 0x97, 0xa8, 0x07, 0xcd, 0x58, + 0x5b, 0xb1, 0x67, 0xb4, 0xaa, 0x40, 0xb7, 0xc0, 0xe7, 0x82, 0x2d, 0x58, 0x8e, 0x1b, 0x46, 0xb6, + 0x95, 0xd6, 0x65, 0xc2, 0x0b, 0x2a, 0x71, 0xb3, 0xef, 0x69, 0xbd, 0xaa, 0x50, 0x00, 0x40, 0x2f, + 0x0b, 0x26, 0x62, 0xc5, 0x78, 0x8e, 0xfd, 0xbe, 0x33, 0xf4, 0xa2, 0x6b, 0xca, 0xf4, 0xde, 0xaf, + 0xcf, 0xdf, 0x3f, 0x78, 0x77, 0xa0, 0xa1, 0xf3, 0xa0, 0x1b, 0xd0, 0x26, 0x8c, 0x8c, 0x4c, 0xab, + 0xae, 0x83, 0x1d, 0xec, 0x0c, 0xbe, 0xba, 0x00, 0x33, 0x9e, 0x2b, 0xc1, 0xd3, 0x94, 0x8a, 0xbf, + 0x72, 0x63, 0x68, 0xc5, 0x84, 0x08, 0x2a, 0xa5, 0xcd, 0x5e, 0x97, 0xe8, 0x01, 0xb4, 0xcc, 0x39, + 0x54, 0x4f, 0xe0, 0x0d, 0x0f, 0x27, 0x47, 0xe3, 0x8a, 0xe4, 0xd8, 0x10, 0x88, 0xea, 0x5d, 0xf4, + 0x10, 0xa0, 0x28, 0xe7, 0x29, 0x4b, 0xce, 0x2f, 0xe8, 0xda, 0x8c, 0x75, 0x38, 0xe9, 0xd4, 0xde, + 0xd7, 0xe5, 0xfc, 0x8c, 0xae, 0xa3, 0x76, 0xe5, 0x38, 0xa3, 0x6b, 0x74, 0x17, 0xda, 0xab, 0xb8, + 0x4c, 0xd5, 0x79, 0xc2, 0x08, 0x6e, 0x9a, 0x9e, 0xff, 0x19, 0x61, 0xc6, 0x08, 0x9a, 0x42, 0x27, + 0x2e, 0xd5, 0x92, 0xe6, 0x8a, 0x25, 0xf5, 0xc8, 0xba, 0x37, 0xaa, 0xcf, 0x9b, 0x09, 0x4a, 0xf4, + 0x6e, 0x9c, 0x46, 0x7b, 0x4e, 0x83, 0x50, 0xc5, 0xaa, 0x94, 0xb8, 0x55, 0xa1, 0xad, 0xaa, 0xe9, + 0xd4, 0x20, 0x7a, 0x62, 0x11, 0x1d, 0xed, 0x06, 0xd6, 0x80, 0x34, 0xb1, 0x5d, 0x9a, 0xae, 0x8b, + 0x1d, 0x04, 0xf5, 0x29, 0x5d, 0x0f, 0xbb, 0x83, 0x4f, 0x2e, 0xfc, 0xff, 0x86, 0x0a, 0xf6, 0xae, + 0x6e, 0xb2, 0xcf, 0x2f, 0x00, 0x48, 0x76, 0x74, 0x2d, 0xc2, 0x6b, 0x0a, 0x1a, 0x81, 0x9f, 0x51, + 0xb5, 0xe4, 0xc4, 0x5c, 0x83, 0xce, 0xa4, 0x57, 0x0f, 0x72, 0xfa, 0xf2, 0xf4, 0x55, 0x9c, 0x51, + 0x59, 0xc4, 0x09, 0x8d, 0xac, 0x47, 0x8f, 0xc0, 0xa4, 0x2c, 0xa9, 0xa8, 0x6f, 0x47, 0x55, 0xe9, + 0xaf, 0x24, 0xcb, 0xf9, 0x7b, 0x9a, 0x28, 0x4b, 0xac, 0x2e, 0xf7, 0xe0, 0xfb, 0xff, 0x82, 0x8f, + 0xa0, 0x71, 0xc1, 0x72, 0x62, 0x09, 0x99, 0xf5, 0xf4, 0xa9, 0xe1, 0xf3, 0xc8, 0xf2, 0xb9, 0x0f, + 0xfd, 0x3f, 0xf1, 0x47, 0x55, 0xae, 0x51, 0x15, 0x63, 0x64, 0x9b, 0x9a, 0x9b, 0xd5, 0x7c, 0xf1, + 0xec, 0xdb, 0x26, 0x70, 0xae, 0x36, 0x81, 0xf3, 0x73, 0x13, 0x38, 0x1f, 0xb7, 0xc1, 0xc1, 0xd5, + 0x36, 0x38, 0xf8, 0xb1, 0x0d, 0x0e, 0xde, 0x0e, 0x16, 0x4c, 0x2d, 0xcb, 0xf9, 0x38, 0xe1, 0x59, + 0xc8, 0x73, 0xc9, 0x73, 0x11, 0x9a, 0x9f, 0xcb, 0x50, 0x3f, 0x2a, 0xb5, 0x2e, 0xa8, 0x9c, 0xfb, + 0xe6, 0x45, 0x3d, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x70, 0x7b, 0x75, 0x51, 0xb3, 0x03, 0x00, + 0x00, } -func (m *Account) Marshal() (dAtA []byte, err error) { +func (m *Alias) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -570,51 +372,48 @@ func (m *Account) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Account) MarshalTo(dAtA []byte) (int, error) { +func (m *Alias) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Alias) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Index != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x38 - } - if m.ChainCode != 0 { - i = encodeVarintState(dAtA, i, uint64(m.ChainCode)) + if m.Expiration != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Expiration)) i-- dAtA[i] = 0x30 } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintState(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x2a + if len(m.Scopes) > 0 { + for iNdEx := len(m.Scopes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Scopes[iNdEx]) + copy(dAtA[i:], m.Scopes[iNdEx]) + i = encodeVarintState(dAtA, i, uint64(len(m.Scopes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) i-- dAtA[i] = 0x22 } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintState(dAtA, i, uint64(len(m.Label))) + if len(m.Alias) > 0 { + i -= len(m.Alias) + copy(dAtA[i:], m.Alias) + i = encodeVarintState(dAtA, i, uint64(len(m.Alias))) i-- dAtA[i] = 0x1a } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintState(dAtA, i, uint64(len(m.Address))) + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintState(dAtA, i, uint64(len(m.Did))) i-- dAtA[i] = 0x12 } @@ -648,6 +447,13 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintState(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x3a + } if len(m.Authentication) > 0 { for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { { @@ -712,7 +518,7 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Proof) Marshal() (dAtA []byte, err error) { +func (m *Verification) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -722,170 +528,23 @@ func (m *Proof) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Proof) MarshalTo(dAtA []byte) (int, error) { +func (m *Verification) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintState(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x32 - } - if len(m.Accumulator) > 0 { - i -= len(m.Accumulator) - copy(dAtA[i:], m.Accumulator) - i = encodeVarintState(dAtA, i, uint64(len(m.Accumulator))) - i-- - dAtA[i] = 0x2a - } - if len(m.Property) > 0 { - i -= len(m.Property) - copy(dAtA[i:], m.Property) - i = encodeVarintState(dAtA, i, uint64(len(m.Property))) - i-- - dAtA[i] = 0x22 - } - if len(m.Issuer) > 0 { - i -= len(m.Issuer) - copy(dAtA[i:], m.Issuer) - i = encodeVarintState(dAtA, i, uint64(len(m.Issuer))) - i-- - dAtA[i] = 0x1a - } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintState(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ServiceRecord) 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 *ServiceRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Permissions != nil { - { - size, err := m.Permissions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintState(dAtA, i, uint64(len(m.Kind))) i-- dAtA[i] = 0x3a } - if len(m.ServiceEndpoints) > 0 { - for k := range m.ServiceEndpoints { - v := m.ServiceEndpoints[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintState(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintState(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintState(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintState(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x2a - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x22 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintState(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1a - } - if len(m.ServiceType) > 0 { - i -= len(m.ServiceType) - copy(dAtA[i:], m.ServiceType) - i = encodeVarintState(dAtA, i, uint64(len(m.ServiceType))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintState(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) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VerificationMethod) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l if m.PublicKey != nil { { size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) @@ -945,7 +604,7 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Account) Size() (n int) { +func (m *Alias) Size() (n int) { if m == nil { return 0 } @@ -955,27 +614,26 @@ func (m *Account) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Address) + l = len(m.Did) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Label) + l = len(m.Alias) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Controller) + l = len(m.Origin) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovState(uint64(l)) + if len(m.Scopes) > 0 { + for _, s := range m.Scopes { + l = len(s) + n += 1 + l + sovState(uint64(l)) + } } - if m.ChainCode != 0 { - n += 1 + sovState(uint64(m.ChainCode)) - } - if m.Index != 0 { - n += 1 + sovState(uint64(m.Index)) + if m.Expiration != 0 { + n += 1 + sovState(uint64(m.Expiration)) } return n } @@ -1014,84 +672,14 @@ func (m *Controller) Size() (n int) { n += 1 + l + sovState(uint64(l)) } } - return n -} - -func (m *Proof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Issuer) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Property) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Accumulator) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Key) + l = len(m.Status) if l > 0 { n += 1 + l + sovState(uint64(l)) } return n } -func (m *ServiceRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.ServiceType) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - if len(m.ServiceEndpoints) > 0 { - for k, v := range m.ServiceEndpoints { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v))) - n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) - } - } - if m.Permissions != nil { - l = m.Permissions.Size() - n += 1 + l + sovState(uint64(l)) - } - return n -} - -func (m *VerificationMethod) Size() (n int) { +func (m *Verification) Size() (n int) { if m == nil { return 0 } @@ -1120,6 +708,10 @@ func (m *VerificationMethod) Size() (n int) { l = m.PublicKey.Size() n += 1 + l + sovState(uint64(l)) } + l = len(m.Kind) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } return n } @@ -1129,7 +721,7 @@ func sovState(x uint64) (n int) { func sozState(x uint64) (n int) { return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Account) Unmarshal(dAtA []byte) error { +func (m *Alias) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1152,10 +744,10 @@ func (m *Account) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Account: wiretype end group for non-group") + return fmt.Errorf("proto: Alias: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Alias: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1192,7 +784,7 @@ func (m *Account) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1220,11 +812,11 @@ func (m *Account) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Alias", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1252,11 +844,11 @@ func (m *Account) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Label = string(dAtA[iNdEx:postIndex]) + m.Alias = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1284,11 +876,11 @@ func (m *Account) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Controller = string(dAtA[iNdEx:postIndex]) + m.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1316,13 +908,13 @@ func (m *Account) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Namespace = string(dAtA[iNdEx:postIndex]) + m.Scopes = append(m.Scopes, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainCode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) } - m.ChainCode = 0 + m.Expiration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1332,26 +924,7 @@ func (m *Account) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ChainCode |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift + m.Expiration |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -1606,594 +1179,11 @@ func (m *Controller) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Proof) 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 ErrIntOverflowState - } - 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: Proof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proof: 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 ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - 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 Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Issuer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Property", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Property = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Accumulator = append(m.Accumulator[:0], dAtA[iNdEx:postIndex]...) - if m.Accumulator == nil { - m.Accumulator = []byte{} - } - iNdEx = postIndex - case 6: - 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 ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceRecord) 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 ErrIntOverflowState - } - 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: ServiceRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceRecord: 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 ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - 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 ServiceType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ServiceEndpoints == nil { - m.ServiceEndpoints = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - 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 ErrIntOverflowState - } - 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 ErrInvalidLengthState - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthState - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthState - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthState - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.ServiceEndpoints[mapkey] = mapvalue - iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2203,27 +1193,23 @@ func (m *ServiceRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Permissions == nil { - m.Permissions = &Permissions{} - } - if err := m.Permissions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Status = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2246,7 +1232,7 @@ func (m *ServiceRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *VerificationMethod) Unmarshal(dAtA []byte) error { +func (m *Verification) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2269,10 +1255,10 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VerificationMethod: wiretype end group for non-group") + return fmt.Errorf("proto: Verification: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VerificationMethod: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Verification: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2458,6 +1444,38 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) diff --git a/x/did/types/zkprop.go b/x/did/types/zkprop.go deleted file mode 100644 index 2674cd60b..000000000 --- a/x/did/types/zkprop.go +++ /dev/null @@ -1,155 +0,0 @@ -package types - -import ( - "fmt" - - "github.com/onsonr/crypto/accumulator" - "github.com/onsonr/crypto/core/curves" -) - -// Accumulator is the accumulator for the ZKP -type Accumulator []byte - -// Element is the element for the BLS scheme -type Element = accumulator.Element - -// Witness is the witness for the ZKP -type Witness []byte - -// NewProof creates a new Proof which is used for ZKP -func NewProof(issuer, property string, pubKey []byte) (*Proof, error) { - input := append(pubKey, []byte(property)...) - hash := []byte(input) - - curve := curves.BLS12381(&curves.PointBls12381G1{}) - key, err := new(accumulator.SecretKey).New(curve, hash[:]) - if err != nil { - return nil, fmt.Errorf("failed to create secret key: %w", err) - } - - keyBytes, err := key.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("failed to marshal secret key: %w", err) - } - - return &Proof{ - Issuer: issuer, - Property: property, - Accumulator: keyBytes, - }, nil -} - -// CreateAccumulator creates a new accumulator for a Proof -func CreateAccumulator(proof *Proof, values ...string) error { - curve := curves.BLS12381(&curves.PointBls12381G1{}) - acc, err := new(accumulator.Accumulator).New(curve) - if err != nil { - return err - } - - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { - return err - } - - fin, _, err := acc.Update(secretKey, ConvertValuesToZeroKnowledgeElements(values), nil) - if err != nil { - return err - } - - accBytes, err := fin.MarshalBinary() - if err != nil { - return fmt.Errorf("failed to marshal accumulator: %w", err) - } - - proof.Accumulator = accBytes - return nil -} - -// CreateWitness creates a witness for the accumulator in a Proof for a given value -func CreateWitness(proof *Proof, value string) ([]byte, error) { - curve := curves.BLS12381(&curves.PointBls12381G1{}) - element := curve.Scalar.Hash([]byte(value)) - - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { - return nil, err - } - - accObj := new(accumulator.Accumulator) - if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { - return nil, fmt.Errorf("failed to unmarshal accumulator: %w", err) - } - - mw, err := new(accumulator.MembershipWitness).New(element, accObj, secretKey) - if err != nil { - return nil, err - } - - witnessBytes, err := mw.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("failed to marshal witness: %w", err) - } - return witnessBytes, nil -} - -// VerifyWitness proves that a value is a member of the accumulator -func VerifyWitness(proof *Proof, acc Accumulator, witness Witness) error { - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary([]byte(proof.Id)); err != nil { - return err - } - - curve := curves.BLS12381(&curves.PointBls12381G1{}) - publicKey, err := secretKey.GetPublicKey(curve) - if err != nil { - return err - } - - accObj := new(accumulator.Accumulator) - if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { - return fmt.Errorf("failed to unmarshal accumulator: %w", err) - } - - witnessObj := new(accumulator.MembershipWitness) - if err := witnessObj.UnmarshalBinary(witness); err != nil { - return fmt.Errorf("failed to unmarshal witness: %w", err) - } - return witnessObj.Verify(publicKey, accObj) -} - -// UpdateAccumulator updates the accumulator in a Proof with new values -func UpdateAccumulator(proof *Proof, addValues []string, removeValues []string) error { - secretKey := new(accumulator.SecretKey) - if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { - return err - } - - accObj := new(accumulator.Accumulator) - if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { - return fmt.Errorf("failed to unmarshal accumulator: %w", err) - } - - updatedAcc, _, err := accObj.Update(secretKey, ConvertValuesToZeroKnowledgeElements(addValues), ConvertValuesToZeroKnowledgeElements(removeValues)) - if err != nil { - return err - } - - updatedAccBytes, err := updatedAcc.MarshalBinary() - if err != nil { - return fmt.Errorf("failed to marshal updated accumulator: %w", err) - } - - proof.Accumulator = updatedAccBytes - return nil -} - -// ConvertValuesToZeroKnowledgeElements converts a slice of strings to a slice of accumulator elements -func ConvertValuesToZeroKnowledgeElements(values []string) []Element { - curve := curves.BLS12381(&curves.PointBls12381G1{}) - elements := make([]accumulator.Element, len(values)) - for i, value := range values { - elements[i] = curve.Scalar.Hash([]byte(value)) - } - return elements -}