diff --git a/api/did/v1/account.pulsar.go b/api/did/v1/account.pulsar.go index eda9bf608..6a0288ea2 100644 --- a/api/did/v1/account.pulsar.go +++ b/api/did/v1/account.pulsar.go @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" + sort "sort" sync "sync" ) @@ -1068,11 +1069,94 @@ func (x *fastReflection_DIDDocument) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.Map = (*_VerificationMethod_4_map)(nil) + +type _VerificationMethod_4_map struct { + m *map[string]string +} + +func (x *_VerificationMethod_4_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_VerificationMethod_4_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 *_VerificationMethod_4_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 *_VerificationMethod_4_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_VerificationMethod_4_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 *_VerificationMethod_4_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 *_VerificationMethod_4_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 *_VerificationMethod_4_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_VerificationMethod_4_map) IsValid() bool { + return x.m != nil +} + var ( - md_VerificationMethod protoreflect.MessageDescriptor - fd_VerificationMethod_id protoreflect.FieldDescriptor - fd_VerificationMethod_controller protoreflect.FieldDescriptor - fd_VerificationMethod_public_key protoreflect.FieldDescriptor + md_VerificationMethod protoreflect.MessageDescriptor + fd_VerificationMethod_id protoreflect.FieldDescriptor + fd_VerificationMethod_controller protoreflect.FieldDescriptor + fd_VerificationMethod_public_key_multibase protoreflect.FieldDescriptor + fd_VerificationMethod_public_key_jwks protoreflect.FieldDescriptor ) func init() { @@ -1080,7 +1164,8 @@ func init() { md_VerificationMethod = File_did_v1_account_proto.Messages().ByName("VerificationMethod") fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id") fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller") - fd_VerificationMethod_public_key = md_VerificationMethod.Fields().ByName("public_key") + fd_VerificationMethod_public_key_multibase = md_VerificationMethod.Fields().ByName("public_key_multibase") + fd_VerificationMethod_public_key_jwks = md_VerificationMethod.Fields().ByName("public_key_jwks") } var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil) @@ -1160,9 +1245,15 @@ func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescr return } } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_VerificationMethod_public_key, value) { + if x.PublicKeyMultibase != "" { + value := protoreflect.ValueOfString(x.PublicKeyMultibase) + if !f(fd_VerificationMethod_public_key_multibase, value) { + return + } + } + if len(x.PublicKeyJwks) != 0 { + value := protoreflect.ValueOfMap(&_VerificationMethod_4_map{m: &x.PublicKeyJwks}) + if !f(fd_VerificationMethod_public_key_jwks, value) { return } } @@ -1185,8 +1276,10 @@ func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor) return x.Id != "" case "did.v1.VerificationMethod.controller": return x.Controller != "" - case "did.v1.VerificationMethod.public_key": - return x.PublicKey != nil + case "did.v1.VerificationMethod.public_key_multibase": + return x.PublicKeyMultibase != "" + case "did.v1.VerificationMethod.public_key_jwks": + return len(x.PublicKeyJwks) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -1207,8 +1300,10 @@ func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescripto x.Id = "" case "did.v1.VerificationMethod.controller": x.Controller = "" - case "did.v1.VerificationMethod.public_key": - x.PublicKey = nil + case "did.v1.VerificationMethod.public_key_multibase": + x.PublicKeyMultibase = "" + case "did.v1.VerificationMethod.public_key_jwks": + x.PublicKeyJwks = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -1231,9 +1326,15 @@ func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDes case "did.v1.VerificationMethod.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.VerificationMethod.public_key": - value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.VerificationMethod.public_key_multibase": + value := x.PublicKeyMultibase + return protoreflect.ValueOfString(value) + case "did.v1.VerificationMethod.public_key_jwks": + if len(x.PublicKeyJwks) == 0 { + return protoreflect.ValueOfMap(&_VerificationMethod_4_map{}) + } + mapValue := &_VerificationMethod_4_map{m: &x.PublicKeyJwks} + return protoreflect.ValueOfMap(mapValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -1258,8 +1359,12 @@ func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor, x.Id = value.Interface().(string) case "did.v1.VerificationMethod.controller": x.Controller = value.Interface().(string) - case "did.v1.VerificationMethod.public_key": - x.PublicKey = value.Message().Interface().(*PublicKey) + case "did.v1.VerificationMethod.public_key_multibase": + x.PublicKeyMultibase = value.Interface().(string) + case "did.v1.VerificationMethod.public_key_jwks": + mv := value.Map() + cmv := mv.(*_VerificationMethod_4_map) + x.PublicKeyJwks = *cmv.m default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -1280,15 +1385,18 @@ func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor, // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.VerificationMethod.public_key": - if x.PublicKey == nil { - x.PublicKey = new(PublicKey) + case "did.v1.VerificationMethod.public_key_jwks": + if x.PublicKeyJwks == nil { + x.PublicKeyJwks = make(map[string]string) } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + value := &_VerificationMethod_4_map{m: &x.PublicKeyJwks} + return protoreflect.ValueOfMap(value) 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.public_key_multibase": + panic(fmt.Errorf("field public_key_multibase of message did.v1.VerificationMethod is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -1306,9 +1414,11 @@ func (x *fastReflection_VerificationMethod) NewField(fd protoreflect.FieldDescri return protoreflect.ValueOfString("") case "did.v1.VerificationMethod.controller": return protoreflect.ValueOfString("") - case "did.v1.VerificationMethod.public_key": - m := new(PublicKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.VerificationMethod.public_key_multibase": + return protoreflect.ValueOfString("") + case "did.v1.VerificationMethod.public_key_jwks": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_VerificationMethod_4_map{m: &m}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -1386,10 +1496,31 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) + l = len(x.PublicKeyMultibase) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.PublicKeyJwks) > 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.PublicKeyJwks)) + for k := range x.PublicKeyJwks { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.PublicKeyJwks[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.PublicKeyJwks { + SiZeMaP(k, v) + } + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1419,17 +1550,53 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.PublicKeyJwks) > 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] = 0x22 + return protoiface.MarshalOutput{}, nil } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if options.Deterministic { + keysForPublicKeyJwks := make([]string, 0, len(x.PublicKeyJwks)) + for k := range x.PublicKeyJwks { + keysForPublicKeyJwks = append(keysForPublicKeyJwks, string(k)) + } + sort.Slice(keysForPublicKeyJwks, func(i, j int) bool { + return keysForPublicKeyJwks[i] < keysForPublicKeyJwks[j] + }) + for iNdEx := len(keysForPublicKeyJwks) - 1; iNdEx >= 0; iNdEx-- { + v := x.PublicKeyJwks[string(keysForPublicKeyJwks[iNdEx])] + out, err := MaRsHaLmAp(keysForPublicKeyJwks[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.PublicKeyJwks { + v := x.PublicKeyJwks[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.PublicKeyMultibase) > 0 { + i -= len(x.PublicKeyMultibase) + copy(dAtA[i:], x.PublicKeyMultibase) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyMultibase))) i-- dAtA[i] = 0x1a } @@ -1562,7 +1729,39 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", 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.PublicKeyMultibase = 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 PublicKeyJwks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1589,12 +1788,103 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.PublicKey == nil { - x.PublicKey = &PublicKey{} + if x.PublicKeyJwks == nil { + x.PublicKeyJwks = make(map[string]string) } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + 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.PublicKeyJwks[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1729,9 +2019,12 @@ type VerificationMethod struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - PublicKey *PublicKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The delegation proof or verification method + PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` + // Public Key JWKS is a map of the associated public keys + PublicKeyJwks map[string]string `protobuf:"bytes,4,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *VerificationMethod) Reset() { @@ -1768,9 +2061,16 @@ func (x *VerificationMethod) GetController() string { return "" } -func (x *VerificationMethod) GetPublicKey() *PublicKey { +func (x *VerificationMethod) GetPublicKeyMultibase() string { if x != nil { - return x.PublicKey + return x.PublicKeyMultibase + } + return "" +} + +func (x *VerificationMethod) GetPublicKeyJwks() map[string]string { + if x != nil { + return x.PublicKeyJwks } return nil } @@ -1803,22 +2103,32 @@ var file_did_v1_account_proto_rawDesc = []byte{ 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x76, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, - 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x22, 0x8f, 0x02, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, + 0x73, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, + 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1833,15 +2143,15 @@ func file_did_v1_account_proto_rawDescGZIP() []byte { return file_did_v1_account_proto_rawDescData } -var file_did_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_did_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_did_v1_account_proto_goTypes = []interface{}{ (*DIDDocument)(nil), // 0: did.v1.DIDDocument (*VerificationMethod)(nil), // 1: did.v1.VerificationMethod - (*PublicKey)(nil), // 2: did.v1.PublicKey + nil, // 2: did.v1.VerificationMethod.PublicKeyJwksEntry } var file_did_v1_account_proto_depIdxs = []int32{ 1, // 0: did.v1.DIDDocument.verification_methods:type_name -> did.v1.VerificationMethod - 2, // 1: did.v1.VerificationMethod.public_key:type_name -> did.v1.PublicKey + 2, // 1: did.v1.VerificationMethod.public_key_jwks:type_name -> did.v1.VerificationMethod.PublicKeyJwksEntry 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -1887,7 +2197,7 @@ func file_did_v1_account_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_account_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 99d860b46..8f4557a54 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -1137,556 +1137,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } -var ( - md_PublicKey protoreflect.MessageDescriptor - fd_PublicKey_key protoreflect.FieldDescriptor - fd_PublicKey_key_type protoreflect.FieldDescriptor - fd_PublicKey_did protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_PublicKey = File_did_v1_genesis_proto.Messages().ByName("PublicKey") - fd_PublicKey_key = md_PublicKey.Fields().ByName("key") - fd_PublicKey_key_type = md_PublicKey.Fields().ByName("key_type") - fd_PublicKey_did = md_PublicKey.Fields().ByName("did") -} - -var _ protoreflect.Message = (*fastReflection_PublicKey)(nil) - -type fastReflection_PublicKey PublicKey - -func (x *PublicKey) ProtoReflect() protoreflect.Message { - return (*fastReflection_PublicKey)(x) -} - -func (x *PublicKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_PublicKey_messageType fastReflection_PublicKey_messageType -var _ protoreflect.MessageType = fastReflection_PublicKey_messageType{} - -type fastReflection_PublicKey_messageType struct{} - -func (x fastReflection_PublicKey_messageType) Zero() protoreflect.Message { - return (*fastReflection_PublicKey)(nil) -} -func (x fastReflection_PublicKey_messageType) New() protoreflect.Message { - return new(fastReflection_PublicKey) -} -func (x fastReflection_PublicKey_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_PublicKey -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_PublicKey) Descriptor() protoreflect.MessageDescriptor { - return md_PublicKey -} - -// 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_PublicKey) Type() protoreflect.MessageType { - return _fastReflection_PublicKey_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_PublicKey) New() protoreflect.Message { - return new(fastReflection_PublicKey) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_PublicKey) Interface() protoreflect.ProtoMessage { - return (*PublicKey)(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_PublicKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Key) != 0 { - value := protoreflect.ValueOfBytes(x.Key) - if !f(fd_PublicKey_key, value) { - return - } - } - if x.KeyType != "" { - value := protoreflect.ValueOfString(x.KeyType) - if !f(fd_PublicKey_key_type, value) { - return - } - } - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_PublicKey_did, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_PublicKey) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.PublicKey.key": - return len(x.Key) != 0 - case "did.v1.PublicKey.key_type": - return x.KeyType != "" - case "did.v1.PublicKey.did": - return x.Did != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey")) - } - panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.PublicKey.key": - x.Key = nil - case "did.v1.PublicKey.key_type": - x.KeyType = "" - case "did.v1.PublicKey.did": - x.Did = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey")) - } - panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.PublicKey.key": - value := x.Key - return protoreflect.ValueOfBytes(value) - case "did.v1.PublicKey.key_type": - value := x.KeyType - return protoreflect.ValueOfString(value) - case "did.v1.PublicKey.did": - value := x.Did - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey")) - } - panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.PublicKey.key": - x.Key = value.Bytes() - case "did.v1.PublicKey.key_type": - x.KeyType = value.Interface().(string) - case "did.v1.PublicKey.did": - x.Did = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey")) - } - panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PublicKey.key": - panic(fmt.Errorf("field key of message did.v1.PublicKey is not mutable")) - case "did.v1.PublicKey.key_type": - panic(fmt.Errorf("field key_type of message did.v1.PublicKey is not mutable")) - case "did.v1.PublicKey.did": - panic(fmt.Errorf("field did of message did.v1.PublicKey is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey")) - } - panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PublicKey.key": - return protoreflect.ValueOfBytes(nil) - case "did.v1.PublicKey.key_type": - return protoreflect.ValueOfString("") - case "did.v1.PublicKey.did": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey")) - } - panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.PublicKey", 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_PublicKey) 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_PublicKey) 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_PublicKey) 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_PublicKey) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*PublicKey) - 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.Key) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.KeyType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Did) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*PublicKey) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) - i-- - dAtA[i] = 0x1a - } - if len(x.KeyType) > 0 { - i -= len(x.KeyType) - copy(dAtA[i:], x.KeyType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyType))) - i-- - dAtA[i] = 0x12 - } - 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] = 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().(*PublicKey) - 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: PublicKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PublicKey: 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 Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) - if x.Key == nil { - x.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.KeyType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -1801,61 +1251,6 @@ func (x *Params) GetEncryptionRewardRate() float64 { return 0 } -// PublicKey is the struct that represents a public key -type PublicKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Key is the public key - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Type is the type of the public key - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - // DID is the DID of the public key - Did string `protobuf:"bytes,3,opt,name=did,proto3" json:"did,omitempty"` -} - -func (x *PublicKey) Reset() { - *x = PublicKey{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublicKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublicKey) ProtoMessage() {} - -// Deprecated: Use PublicKey.ProtoReflect.Descriptor instead. -func (*PublicKey) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} -} - -func (x *PublicKey) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *PublicKey) GetKeyType() string { - if x != nil { - return x.KeyType - } - return "" -} - -func (x *PublicKey) GetDid() string { - if x != nil { - return x.Did - } - return "" -} - var File_did_v1_genesis_proto protoreflect.FileDescriptor var file_did_v1_genesis_proto_rawDesc = []byte{ @@ -1882,22 +1277,15 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x01, 0x52, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x22, 0x70, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x3a, - 0x24, 0x98, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x79, 0x92, 0xe7, 0xb0, 0x2a, 0x09, 0x6b, 0x65, 0x79, 0x5f, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, - 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, - 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x73, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1912,11 +1300,10 @@ func file_did_v1_genesis_proto_rawDescGZIP() []byte { return file_did_v1_genesis_proto_rawDescData } -var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_did_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: did.v1.GenesisState (*Params)(nil), // 1: did.v1.Params - (*PublicKey)(nil), // 2: did.v1.PublicKey } var file_did_v1_genesis_proto_depIdxs = []int32{ 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params @@ -1957,18 +1344,6 @@ func file_did_v1_genesis_proto_init() { return nil } } - file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublicKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1976,7 +1351,7 @@ func file_did_v1_genesis_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index ec97549d3..d21f63157 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -9,6 +9,120 @@ import ( ormerrors "cosmossdk.io/orm/types/ormerrors" ) +type AssertionTable interface { + Insert(ctx context.Context, assertion *Assertion) error + Update(ctx context.Context, assertion *Assertion) error + Save(ctx context.Context, assertion *Assertion) error + Delete(ctx context.Context, assertion *Assertion) 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) (*Assertion, error) + List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) + ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) + DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error + DeleteRange(ctx context.Context, from, to AssertionIndexKey) error + + doNotImplement() +} + +type AssertionIterator struct { + ormtable.Iterator +} + +func (i AssertionIterator) Value() (*Assertion, error) { + var assertion Assertion + err := i.UnmarshalMessage(&assertion) + return &assertion, err +} + +type AssertionIndexKey interface { + id() uint32 + values() []interface{} + assertionIndexKey() +} + +// primary key starting index.. +type AssertionPrimaryKey = AssertionIdIndexKey + +type AssertionIdIndexKey struct { + vs []interface{} +} + +func (x AssertionIdIndexKey) id() uint32 { return 0 } +func (x AssertionIdIndexKey) values() []interface{} { return x.vs } +func (x AssertionIdIndexKey) assertionIndexKey() {} + +func (this AssertionIdIndexKey) WithId(id string) AssertionIdIndexKey { + this.vs = []interface{}{id} + return this +} + +type assertionTable struct { + table ormtable.Table +} + +func (this assertionTable) Insert(ctx context.Context, assertion *Assertion) error { + return this.table.Insert(ctx, assertion) +} + +func (this assertionTable) Update(ctx context.Context, assertion *Assertion) error { + return this.table.Update(ctx, assertion) +} + +func (this assertionTable) Save(ctx context.Context, assertion *Assertion) error { + return this.table.Save(ctx, assertion) +} + +func (this assertionTable) Delete(ctx context.Context, assertion *Assertion) error { + return this.table.Delete(ctx, assertion) +} + +func (this assertionTable) Has(ctx context.Context, id string) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, id) +} + +func (this assertionTable) Get(ctx context.Context, id string) (*Assertion, error) { + var assertion Assertion + found, err := this.table.PrimaryKey().Get(ctx, &assertion, id) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &assertion, nil +} + +func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) { + it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) + return AssertionIterator{it}, err +} + +func (this assertionTable) ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) { + it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) + return AssertionIterator{it}, err +} + +func (this assertionTable) DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error { + return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) +} + +func (this assertionTable) DeleteRange(ctx context.Context, from, to AssertionIndexKey) error { + return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) +} + +func (this assertionTable) doNotImplement() {} + +var _ AssertionTable = assertionTable{} + +func NewAssertionTable(db ormtable.Schema) (AssertionTable, error) { + table := db.GetTable(&Assertion{}) + if table == nil { + return nil, ormerrors.TableNotFound.Wrap(string((&Assertion{}).ProtoReflect().Descriptor().FullName())) + } + return assertionTable{table}, nil +} + type AttestationTable interface { Insert(ctx context.Context, attestation *Attestation) error Update(ctx context.Context, attestation *Attestation) error @@ -466,6 +580,7 @@ func NewServiceTable(db ormtable.Schema) (ServiceTable, error) { } type StateStore interface { + AssertionTable() AssertionTable AttestationTable() AttestationTable ControllerTable() ControllerTable DelegationTable() DelegationTable @@ -475,12 +590,17 @@ type StateStore interface { } type stateStore struct { + assertion AssertionTable attestation AttestationTable controller ControllerTable delegation DelegationTable service ServiceTable } +func (x stateStore) AssertionTable() AssertionTable { + return x.assertion +} + func (x stateStore) AttestationTable() AttestationTable { return x.attestation } @@ -502,6 +622,11 @@ func (stateStore) doNotImplement() {} var _ StateStore = stateStore{} func NewStateStore(db ormtable.Schema) (StateStore, error) { + assertionTable, err := NewAssertionTable(db) + if err != nil { + return nil, err + } + attestationTable, err := NewAttestationTable(db) if err != nil { return nil, err @@ -523,6 +648,7 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { } return stateStore{ + assertionTable, attestationTable, controllerTable, delegationTable, diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 6fc698836..3d938a951 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -10,9 +10,928 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" + sort "sort" sync "sync" ) +var _ protoreflect.Map = (*_Assertion_4_map)(nil) + +type _Assertion_4_map struct { + m *map[string]string +} + +func (x *_Assertion_4_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Assertion_4_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 *_Assertion_4_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 *_Assertion_4_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Assertion_4_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 *_Assertion_4_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 *_Assertion_4_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 *_Assertion_4_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Assertion_4_map) IsValid() bool { + return x.m != nil +} + +var ( + md_Assertion protoreflect.MessageDescriptor + fd_Assertion_id protoreflect.FieldDescriptor + fd_Assertion_key_type protoreflect.FieldDescriptor + fd_Assertion_credential protoreflect.FieldDescriptor + fd_Assertion_metadata protoreflect.FieldDescriptor + fd_Assertion_controller protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_state_proto_init() + md_Assertion = File_did_v1_state_proto.Messages().ByName("Assertion") + fd_Assertion_id = md_Assertion.Fields().ByName("id") + fd_Assertion_key_type = md_Assertion.Fields().ByName("key_type") + fd_Assertion_credential = md_Assertion.Fields().ByName("credential") + fd_Assertion_metadata = md_Assertion.Fields().ByName("metadata") + fd_Assertion_controller = md_Assertion.Fields().ByName("controller") +} + +var _ protoreflect.Message = (*fastReflection_Assertion)(nil) + +type fastReflection_Assertion Assertion + +func (x *Assertion) ProtoReflect() protoreflect.Message { + return (*fastReflection_Assertion)(x) +} + +func (x *Assertion) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_state_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_Assertion_messageType fastReflection_Assertion_messageType +var _ protoreflect.MessageType = fastReflection_Assertion_messageType{} + +type fastReflection_Assertion_messageType struct{} + +func (x fastReflection_Assertion_messageType) Zero() protoreflect.Message { + return (*fastReflection_Assertion)(nil) +} +func (x fastReflection_Assertion_messageType) New() protoreflect.Message { + return new(fastReflection_Assertion) +} +func (x fastReflection_Assertion_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Assertion +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Assertion) Descriptor() protoreflect.MessageDescriptor { + return md_Assertion +} + +// 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_Assertion) Type() protoreflect.MessageType { + return _fastReflection_Assertion_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Assertion) New() protoreflect.Message { + return new(fastReflection_Assertion) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Assertion) Interface() protoreflect.ProtoMessage { + return (*Assertion)(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_Assertion) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Assertion_id, value) { + return + } + } + if x.KeyType != "" { + value := protoreflect.ValueOfString(x.KeyType) + if !f(fd_Assertion_key_type, value) { + return + } + } + if len(x.Credential) != 0 { + value := protoreflect.ValueOfBytes(x.Credential) + if !f(fd_Assertion_credential, value) { + return + } + } + if len(x.Metadata) != 0 { + value := protoreflect.ValueOfMap(&_Assertion_4_map{m: &x.Metadata}) + if !f(fd_Assertion_metadata, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Assertion_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_Assertion) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Assertion.id": + return x.Id != "" + case "did.v1.Assertion.key_type": + return x.KeyType != "" + case "did.v1.Assertion.credential": + return len(x.Credential) != 0 + case "did.v1.Assertion.metadata": + return len(x.Metadata) != 0 + case "did.v1.Assertion.controller": + return x.Controller != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + } + panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Assertion.id": + x.Id = "" + case "did.v1.Assertion.key_type": + x.KeyType = "" + case "did.v1.Assertion.credential": + x.Credential = nil + case "did.v1.Assertion.metadata": + x.Metadata = nil + case "did.v1.Assertion.controller": + x.Controller = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + } + panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Assertion.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Assertion.key_type": + value := x.KeyType + return protoreflect.ValueOfString(value) + case "did.v1.Assertion.credential": + value := x.Credential + return protoreflect.ValueOfBytes(value) + case "did.v1.Assertion.metadata": + if len(x.Metadata) == 0 { + return protoreflect.ValueOfMap(&_Assertion_4_map{}) + } + mapValue := &_Assertion_4_map{m: &x.Metadata} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Assertion.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + } + panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Assertion.id": + x.Id = value.Interface().(string) + case "did.v1.Assertion.key_type": + x.KeyType = value.Interface().(string) + case "did.v1.Assertion.credential": + x.Credential = value.Bytes() + case "did.v1.Assertion.metadata": + mv := value.Map() + cmv := mv.(*_Assertion_4_map) + x.Metadata = *cmv.m + case "did.v1.Assertion.controller": + x.Controller = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + } + panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Assertion.metadata": + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + value := &_Assertion_4_map{m: &x.Metadata} + return protoreflect.ValueOfMap(value) + case "did.v1.Assertion.id": + panic(fmt.Errorf("field id of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.key_type": + panic(fmt.Errorf("field key_type of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.credential": + panic(fmt.Errorf("field credential of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.controller": + panic(fmt.Errorf("field controller of message did.v1.Assertion is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + } + panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Assertion.id": + return protoreflect.ValueOfString("") + case "did.v1.Assertion.key_type": + return protoreflect.ValueOfString("") + case "did.v1.Assertion.credential": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Assertion.metadata": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Assertion_4_map{m: &m}) + case "did.v1.Assertion.controller": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + } + panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Assertion", 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_Assertion) 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_Assertion) 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_Assertion) 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_Assertion) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Assertion) + 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.KeyType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Credential) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Metadata) > 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.Metadata)) + for k := range x.Metadata { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Metadata[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Metadata { + SiZeMaP(k, v) + } + } + } + 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().(*Assertion) + 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] = 0x2a + } + if len(x.Metadata) > 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] = 0x22 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForMetadata := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + sort.Slice(keysForMetadata, func(i, j int) bool { + return keysForMetadata[i] < keysForMetadata[j] + }) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := x.Metadata[string(keysForMetadata[iNdEx])] + out, err := MaRsHaLmAp(keysForMetadata[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Metadata { + v := x.Metadata[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.Credential) > 0 { + i -= len(x.Credential) + copy(dAtA[i:], x.Credential) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Credential))) + i-- + dAtA[i] = 0x1a + } + if len(x.KeyType) > 0 { + i -= len(x.KeyType) + copy(dAtA[i:], x.KeyType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyType))) + i-- + dAtA[i] = 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().(*Assertion) + 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: Assertion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assertion: 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 KeyType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.KeyType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credential", 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.Credential = append(x.Credential[:0], dAtA[iNdEx:postIndex]...) + if x.Credential == nil { + x.Credential = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata == nil { + x.Metadata = 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.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 5: + 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 ( md_Attestation protoreflect.MessageDescriptor fd_Attestation_id protoreflect.FieldDescriptor @@ -41,7 +960,7 @@ func (x *Attestation) ProtoReflect() protoreflect.Message { } func (x *Attestation) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[0] + mi := &file_did_v1_state_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -690,12 +1609,12 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { } var ( - md_Controller protoreflect.MessageDescriptor - fd_Controller_id protoreflect.FieldDescriptor - fd_Controller_did protoreflect.FieldDescriptor - fd_Controller_public_key protoreflect.FieldDescriptor - fd_Controller_vault_cid protoreflect.FieldDescriptor - fd_Controller_fingerprint protoreflect.FieldDescriptor + md_Controller protoreflect.MessageDescriptor + fd_Controller_id protoreflect.FieldDescriptor + fd_Controller_did protoreflect.FieldDescriptor + fd_Controller_public_key_multibase protoreflect.FieldDescriptor + fd_Controller_vault_cid protoreflect.FieldDescriptor + fd_Controller_fingerprint protoreflect.FieldDescriptor ) func init() { @@ -703,7 +1622,7 @@ func init() { md_Controller = File_did_v1_state_proto.Messages().ByName("Controller") fd_Controller_id = md_Controller.Fields().ByName("id") fd_Controller_did = md_Controller.Fields().ByName("did") - fd_Controller_public_key = md_Controller.Fields().ByName("public_key") + fd_Controller_public_key_multibase = md_Controller.Fields().ByName("public_key_multibase") fd_Controller_vault_cid = md_Controller.Fields().ByName("vault_cid") fd_Controller_fingerprint = md_Controller.Fields().ByName("fingerprint") } @@ -717,7 +1636,7 @@ func (x *Controller) ProtoReflect() protoreflect.Message { } func (x *Controller) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[1] + mi := &file_did_v1_state_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -785,9 +1704,9 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } - if len(x.PublicKey) != 0 { - value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_Controller_public_key, value) { + if x.PublicKeyMultibase != "" { + value := protoreflect.ValueOfString(x.PublicKeyMultibase) + if !f(fd_Controller_public_key_multibase, value) { return } } @@ -822,8 +1741,8 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { return x.Id != "" case "did.v1.Controller.did": return x.Did != "" - case "did.v1.Controller.public_key": - return len(x.PublicKey) != 0 + case "did.v1.Controller.public_key_multibase": + return x.PublicKeyMultibase != "" case "did.v1.Controller.vault_cid": return x.VaultCid != "" case "did.v1.Controller.fingerprint": @@ -848,8 +1767,8 @@ func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { x.Id = "" case "did.v1.Controller.did": x.Did = "" - case "did.v1.Controller.public_key": - x.PublicKey = nil + case "did.v1.Controller.public_key_multibase": + x.PublicKeyMultibase = "" case "did.v1.Controller.vault_cid": x.VaultCid = "" case "did.v1.Controller.fingerprint": @@ -876,9 +1795,9 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Controller.did": value := x.Did return protoreflect.ValueOfString(value) - case "did.v1.Controller.public_key": - value := x.PublicKey - return protoreflect.ValueOfBytes(value) + case "did.v1.Controller.public_key_multibase": + value := x.PublicKeyMultibase + return protoreflect.ValueOfString(value) case "did.v1.Controller.vault_cid": value := x.VaultCid return protoreflect.ValueOfString(value) @@ -909,8 +1828,8 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p x.Id = value.Interface().(string) case "did.v1.Controller.did": x.Did = value.Interface().(string) - case "did.v1.Controller.public_key": - x.PublicKey = value.Bytes() + case "did.v1.Controller.public_key_multibase": + x.PublicKeyMultibase = value.Interface().(string) case "did.v1.Controller.vault_cid": x.VaultCid = value.Interface().(string) case "did.v1.Controller.fingerprint": @@ -939,8 +1858,8 @@ func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) pro panic(fmt.Errorf("field id of message did.v1.Controller is not mutable")) case "did.v1.Controller.did": panic(fmt.Errorf("field did of message did.v1.Controller is not mutable")) - case "did.v1.Controller.public_key": - panic(fmt.Errorf("field public_key of message did.v1.Controller is not mutable")) + case "did.v1.Controller.public_key_multibase": + panic(fmt.Errorf("field public_key_multibase 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.fingerprint": @@ -962,8 +1881,8 @@ func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) pr return protoreflect.ValueOfString("") case "did.v1.Controller.did": return protoreflect.ValueOfString("") - case "did.v1.Controller.public_key": - return protoreflect.ValueOfBytes(nil) + case "did.v1.Controller.public_key_multibase": + return protoreflect.ValueOfString("") case "did.v1.Controller.vault_cid": return protoreflect.ValueOfString("") case "did.v1.Controller.fingerprint": @@ -1045,7 +1964,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.PublicKey) + l = len(x.PublicKeyMultibase) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1100,10 +2019,10 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x22 } - if len(x.PublicKey) > 0 { - i -= len(x.PublicKey) - copy(dAtA[i:], x.PublicKey) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + if len(x.PublicKeyMultibase) > 0 { + i -= len(x.PublicKeyMultibase) + copy(dAtA[i:], x.PublicKeyMultibase) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyMultibase))) i-- dAtA[i] = 0x1a } @@ -1236,9 +2155,9 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1248,25 +2167,23 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if x.PublicKey == nil { - x.PublicKey = []byte{} - } + x.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -1369,15 +2286,98 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.Map = (*_Delegation_7_map)(nil) + +type _Delegation_7_map struct { + m *map[string]string +} + +func (x *_Delegation_7_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Delegation_7_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 *_Delegation_7_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 *_Delegation_7_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Delegation_7_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 *_Delegation_7_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 *_Delegation_7_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 *_Delegation_7_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Delegation_7_map) IsValid() bool { + return x.m != nil +} + var ( - md_Delegation protoreflect.MessageDescriptor - fd_Delegation_id protoreflect.FieldDescriptor - fd_Delegation_did protoreflect.FieldDescriptor - fd_Delegation_chain_type protoreflect.FieldDescriptor - fd_Delegation_chain_address protoreflect.FieldDescriptor - fd_Delegation_controller_did protoreflect.FieldDescriptor - fd_Delegation_public_key protoreflect.FieldDescriptor - fd_Delegation_channel_id protoreflect.FieldDescriptor + md_Delegation protoreflect.MessageDescriptor + fd_Delegation_id protoreflect.FieldDescriptor + fd_Delegation_did protoreflect.FieldDescriptor + fd_Delegation_chain_type protoreflect.FieldDescriptor + fd_Delegation_chain_address protoreflect.FieldDescriptor + fd_Delegation_controller_did protoreflect.FieldDescriptor + fd_Delegation_public_key_multibase protoreflect.FieldDescriptor + fd_Delegation_public_key_jwks protoreflect.FieldDescriptor + fd_Delegation_channel_id protoreflect.FieldDescriptor ) func init() { @@ -1388,7 +2388,8 @@ func init() { fd_Delegation_chain_type = md_Delegation.Fields().ByName("chain_type") fd_Delegation_chain_address = md_Delegation.Fields().ByName("chain_address") fd_Delegation_controller_did = md_Delegation.Fields().ByName("controller_did") - fd_Delegation_public_key = md_Delegation.Fields().ByName("public_key") + fd_Delegation_public_key_multibase = md_Delegation.Fields().ByName("public_key_multibase") + fd_Delegation_public_key_jwks = md_Delegation.Fields().ByName("public_key_jwks") fd_Delegation_channel_id = md_Delegation.Fields().ByName("channel_id") } @@ -1401,7 +2402,7 @@ func (x *Delegation) ProtoReflect() protoreflect.Message { } func (x *Delegation) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[2] + mi := &file_did_v1_state_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1487,9 +2488,15 @@ func (x *fastReflection_Delegation) Range(f func(protoreflect.FieldDescriptor, p return } } - if len(x.PublicKey) != 0 { - value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_Delegation_public_key, value) { + if x.PublicKeyMultibase != "" { + value := protoreflect.ValueOfString(x.PublicKeyMultibase) + if !f(fd_Delegation_public_key_multibase, value) { + return + } + } + if len(x.PublicKeyJwks) != 0 { + value := protoreflect.ValueOfMap(&_Delegation_7_map{m: &x.PublicKeyJwks}) + if !f(fd_Delegation_public_key_jwks, value) { return } } @@ -1524,8 +2531,10 @@ func (x *fastReflection_Delegation) Has(fd protoreflect.FieldDescriptor) bool { return x.ChainAddress != "" case "did.v1.Delegation.controller_did": return x.ControllerDid != "" - case "did.v1.Delegation.public_key": - return len(x.PublicKey) != 0 + case "did.v1.Delegation.public_key_multibase": + return x.PublicKeyMultibase != "" + case "did.v1.Delegation.public_key_jwks": + return len(x.PublicKeyJwks) != 0 case "did.v1.Delegation.channel_id": return x.ChannelId != uint64(0) default: @@ -1554,8 +2563,10 @@ func (x *fastReflection_Delegation) Clear(fd protoreflect.FieldDescriptor) { x.ChainAddress = "" case "did.v1.Delegation.controller_did": x.ControllerDid = "" - case "did.v1.Delegation.public_key": - x.PublicKey = nil + case "did.v1.Delegation.public_key_multibase": + x.PublicKeyMultibase = "" + case "did.v1.Delegation.public_key_jwks": + x.PublicKeyJwks = nil case "did.v1.Delegation.channel_id": x.ChannelId = uint64(0) default: @@ -1589,9 +2600,15 @@ func (x *fastReflection_Delegation) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Delegation.controller_did": value := x.ControllerDid return protoreflect.ValueOfString(value) - case "did.v1.Delegation.public_key": - value := x.PublicKey - return protoreflect.ValueOfBytes(value) + case "did.v1.Delegation.public_key_multibase": + value := x.PublicKeyMultibase + return protoreflect.ValueOfString(value) + case "did.v1.Delegation.public_key_jwks": + if len(x.PublicKeyJwks) == 0 { + return protoreflect.ValueOfMap(&_Delegation_7_map{}) + } + mapValue := &_Delegation_7_map{m: &x.PublicKeyJwks} + return protoreflect.ValueOfMap(mapValue) case "did.v1.Delegation.channel_id": value := x.ChannelId return protoreflect.ValueOfUint64(value) @@ -1625,8 +2642,12 @@ func (x *fastReflection_Delegation) Set(fd protoreflect.FieldDescriptor, value p x.ChainAddress = value.Interface().(string) case "did.v1.Delegation.controller_did": x.ControllerDid = value.Interface().(string) - case "did.v1.Delegation.public_key": - x.PublicKey = value.Bytes() + case "did.v1.Delegation.public_key_multibase": + x.PublicKeyMultibase = value.Interface().(string) + case "did.v1.Delegation.public_key_jwks": + mv := value.Map() + cmv := mv.(*_Delegation_7_map) + x.PublicKeyJwks = *cmv.m case "did.v1.Delegation.channel_id": x.ChannelId = value.Uint() default: @@ -1649,6 +2670,12 @@ func (x *fastReflection_Delegation) Set(fd protoreflect.FieldDescriptor, value p // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Delegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.Delegation.public_key_jwks": + if x.PublicKeyJwks == nil { + x.PublicKeyJwks = make(map[string]string) + } + value := &_Delegation_7_map{m: &x.PublicKeyJwks} + return protoreflect.ValueOfMap(value) case "did.v1.Delegation.id": panic(fmt.Errorf("field id of message did.v1.Delegation is not mutable")) case "did.v1.Delegation.did": @@ -1659,8 +2686,8 @@ func (x *fastReflection_Delegation) Mutable(fd protoreflect.FieldDescriptor) pro panic(fmt.Errorf("field chain_address of message did.v1.Delegation is not mutable")) case "did.v1.Delegation.controller_did": panic(fmt.Errorf("field controller_did of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.public_key": - panic(fmt.Errorf("field public_key of message did.v1.Delegation is not mutable")) + case "did.v1.Delegation.public_key_multibase": + panic(fmt.Errorf("field public_key_multibase of message did.v1.Delegation is not mutable")) case "did.v1.Delegation.channel_id": panic(fmt.Errorf("field channel_id of message did.v1.Delegation is not mutable")) default: @@ -1686,8 +2713,11 @@ func (x *fastReflection_Delegation) NewField(fd protoreflect.FieldDescriptor) pr return protoreflect.ValueOfString("") case "did.v1.Delegation.controller_did": return protoreflect.ValueOfString("") - case "did.v1.Delegation.public_key": - return protoreflect.ValueOfBytes(nil) + case "did.v1.Delegation.public_key_multibase": + return protoreflect.ValueOfString("") + case "did.v1.Delegation.public_key_jwks": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Delegation_7_map{m: &m}) case "did.v1.Delegation.channel_id": return protoreflect.ValueOfUint64(uint64(0)) default: @@ -1779,10 +2809,31 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.PublicKey) + l = len(x.PublicKeyMultibase) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.PublicKeyJwks) > 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.PublicKeyJwks)) + for k := range x.PublicKeyJwks { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.PublicKeyJwks[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.PublicKeyJwks { + SiZeMaP(k, v) + } + } + } if x.ChannelId != 0 { n += 1 + runtime.Sov(uint64(x.ChannelId)) } @@ -1818,12 +2869,55 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if x.ChannelId != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ChannelId)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x40 } - if len(x.PublicKey) > 0 { - i -= len(x.PublicKey) - copy(dAtA[i:], x.PublicKey) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + if len(x.PublicKeyJwks) > 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] = 0x3a + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForPublicKeyJwks := make([]string, 0, len(x.PublicKeyJwks)) + for k := range x.PublicKeyJwks { + keysForPublicKeyJwks = append(keysForPublicKeyJwks, string(k)) + } + sort.Slice(keysForPublicKeyJwks, func(i, j int) bool { + return keysForPublicKeyJwks[i] < keysForPublicKeyJwks[j] + }) + for iNdEx := len(keysForPublicKeyJwks) - 1; iNdEx >= 0; iNdEx-- { + v := x.PublicKeyJwks[string(keysForPublicKeyJwks[iNdEx])] + out, err := MaRsHaLmAp(keysForPublicKeyJwks[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.PublicKeyJwks { + v := x.PublicKeyJwks[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.PublicKeyMultibase) > 0 { + i -= len(x.PublicKeyMultibase) + copy(dAtA[i:], x.PublicKeyMultibase) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyMultibase))) i-- dAtA[i] = 0x32 } @@ -2073,9 +3167,9 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2085,27 +3179,152 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if x.PublicKey == nil { - x.PublicKey = []byte{} - } + x.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyJwks", 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.PublicKeyJwks == nil { + x.PublicKeyJwks = 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.PublicKeyJwks[mapkey] = mapvalue + iNdEx = postIndex + case 8: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) } @@ -2185,7 +3404,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { } func (x *Service) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2784,6 +4003,79 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) +type Assertion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of the attestation + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") + KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + // The value of the linked identifier + Credential []byte `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"` + // Metadata is optional additional information about the assertion + Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The controller of the attestation + Controller string `protobuf:"bytes,5,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (x *Assertion) Reset() { + *x = Assertion{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_state_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Assertion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Assertion) ProtoMessage() {} + +// Deprecated: Use Assertion.ProtoReflect.Descriptor instead. +func (*Assertion) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{0} +} + +func (x *Assertion) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Assertion) GetKeyType() string { + if x != nil { + return x.KeyType + } + return "" +} + +func (x *Assertion) GetCredential() []byte { + if x != nil { + return x.Credential + } + return nil +} + +func (x *Assertion) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Assertion) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) type Attestation struct { state protoimpl.MessageState @@ -2805,7 +4097,7 @@ type Attestation struct { func (x *Attestation) Reset() { *x = Attestation{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[0] + mi := &file_did_v1_state_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2819,7 +4111,7 @@ func (*Attestation) ProtoMessage() {} // Deprecated: Use Attestation.ProtoReflect.Descriptor instead. func (*Attestation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{0} + return file_did_v1_state_proto_rawDescGZIP(), []int{1} } func (x *Attestation) GetId() string { @@ -2868,7 +4160,7 @@ type Controller struct { // The DID of the controller Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // The public key of the controller - PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` // The vault address or identifier VaultCid string `protobuf:"bytes,4,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` // Fingerprint is the Accumulator of discrete credential identifiers @@ -2878,7 +4170,7 @@ type Controller struct { func (x *Controller) Reset() { *x = Controller{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[1] + mi := &file_did_v1_state_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2892,7 +4184,7 @@ func (*Controller) ProtoMessage() {} // Deprecated: Use Controller.ProtoReflect.Descriptor instead. func (*Controller) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{1} + return file_did_v1_state_proto_rawDescGZIP(), []int{2} } func (x *Controller) GetId() string { @@ -2909,11 +4201,11 @@ func (x *Controller) GetDid() string { return "" } -func (x *Controller) GetPublicKey() []byte { +func (x *Controller) GetPublicKeyMultibase() string { if x != nil { - return x.PublicKey + return x.PublicKeyMultibase } - return nil + return "" } func (x *Controller) GetVaultCid() string { @@ -2947,15 +4239,17 @@ type Delegation struct { // The controller DID ControllerDid string `protobuf:"bytes,5,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` // The delegation proof or verification method - PublicKey []byte `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKeyMultibase string `protobuf:"bytes,6,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` + // Public Key JWKS is a map of the associated public keys + PublicKeyJwks map[string]string `protobuf:"bytes,7,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // IBC Channel ID - ChannelId uint64 `protobuf:"varint,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ChannelId uint64 `protobuf:"varint,8,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` } func (x *Delegation) Reset() { *x = Delegation{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[2] + mi := &file_did_v1_state_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2969,7 +4263,7 @@ func (*Delegation) ProtoMessage() {} // Deprecated: Use Delegation.ProtoReflect.Descriptor instead. func (*Delegation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{2} + return file_did_v1_state_proto_rawDescGZIP(), []int{3} } func (x *Delegation) GetId() string { @@ -3007,9 +4301,16 @@ func (x *Delegation) GetControllerDid() string { return "" } -func (x *Delegation) GetPublicKey() []byte { +func (x *Delegation) GetPublicKeyMultibase() string { if x != nil { - return x.PublicKey + return x.PublicKeyMultibase + } + return "" +} + +func (x *Delegation) GetPublicKeyJwks() map[string]string { + if x != nil { + return x.PublicKeyJwks } return nil } @@ -3040,7 +4341,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3054,7 +4355,7 @@ func (*Service) ProtoMessage() {} // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{3} + return file_did_v1_state_proto_rawDescGZIP(), []int{4} } func (x *Service) GetId() string { @@ -3092,59 +4393,87 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, 0x0b, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6b, - 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, - 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x22, 0x9c, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x64, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 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, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, - 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, - 0x74, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x02, 0x22, 0xe7, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, - 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x44, 0x69, 0x64, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x22, 0x9e, 0x01, 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, 0x29, 0x0a, 0x10, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x44, 0x69, 0x64, 0x3a, 0x0e, 0xf2, 0x9e, - 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x42, 0x7a, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x02, 0x0a, 0x09, + 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0e, + 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x22, 0x94, + 0x01, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, + 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x22, 0xaf, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4d, + 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, + 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, + 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x22, 0x8b, 0x03, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x44, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x4a, 0x77, 0x6b, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x49, 0x64, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x03, 0x22, 0x9e, 0x01, 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, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x44, 0x69, 0x64, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, + 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, + 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3159,19 +4488,24 @@ 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, 4) +var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_did_v1_state_proto_goTypes = []interface{}{ - (*Attestation)(nil), // 0: did.v1.Attestation - (*Controller)(nil), // 1: did.v1.Controller - (*Delegation)(nil), // 2: did.v1.Delegation - (*Service)(nil), // 3: did.v1.Service + (*Assertion)(nil), // 0: did.v1.Assertion + (*Attestation)(nil), // 1: did.v1.Attestation + (*Controller)(nil), // 2: did.v1.Controller + (*Delegation)(nil), // 3: did.v1.Delegation + (*Service)(nil), // 4: did.v1.Service + nil, // 5: did.v1.Assertion.MetadataEntry + nil, // 6: did.v1.Delegation.PublicKeyJwksEntry } var file_did_v1_state_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 5, // 0: did.v1.Assertion.metadata:type_name -> did.v1.Assertion.MetadataEntry + 6, // 1: did.v1.Delegation.public_key_jwks:type_name -> did.v1.Delegation.PublicKeyJwksEntry + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_did_v1_state_proto_init() } @@ -3182,7 +4516,7 @@ func file_did_v1_state_proto_init() { file_did_v1_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Attestation); i { + switch v := v.(*Assertion); i { case 0: return &v.state case 1: @@ -3194,7 +4528,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Controller); i { + switch v := v.(*Attestation); i { case 0: return &v.state case 1: @@ -3206,7 +4540,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.(*Delegation); i { + switch v := v.(*Controller); i { case 0: return &v.state case 1: @@ -3218,6 +4552,18 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Delegation); 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.(*Service); i { case 0: return &v.state @@ -3236,7 +4582,7 @@ func file_did_v1_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_state_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/did/v1/account.proto b/proto/did/v1/account.proto index 2976951cb..b4223f4bd 100644 --- a/proto/did/v1/account.proto +++ b/proto/did/v1/account.proto @@ -23,7 +23,12 @@ message DIDDocument { message VerificationMethod { string id = 1; string controller = 2; - PublicKey public_key = 3; + + // The delegation proof or verification method + string public_key_multibase = 3; + + // Public Key JWKS is a map of the associated public keys + map public_key_jwks = 4; } diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 7ef40a0ee..88ec7241b 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -30,18 +30,4 @@ message Params { double encryption_reward_rate = 5; } -// PublicKey is the struct that represents a public key -message PublicKey { - option (amino.name) = "did/publickey"; - option (amino.message_encoding) = "key_field"; - option (gogoproto.goproto_stringer) = false; - // Key is the public key - bytes key = 1; - - // Type is the type of the public key - string key_type = 2; - - // DID is the DID of the public key - string did = 3; -} diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 126e21053..8b305d8b3 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -6,6 +6,30 @@ option go_package = "github.com/onsonr/hway/x/did/types"; import "cosmos/orm/v1/orm.proto"; import "did/v1/genesis.proto"; +// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) +message Assertion { + option (cosmos.orm.v1.table) = { + id: 1 + primary_key: {fields: "id"} + }; + + // The unique identifier of the attestation + string id = 1; + + // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") + string key_type = 2; + + // The value of the linked identifier + bytes credential = 3; + + // Metadata is optional additional information about the assertion + map metadata = 4; + + // The controller of the attestation + string controller = 5; +} + + // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) message Attestation { option (cosmos.orm.v1.table) = { @@ -29,6 +53,7 @@ message Attestation { string controller = 5; } + // Controller represents a Sonr DWN Vault message Controller { option (cosmos.orm.v1.table) = { @@ -43,7 +68,7 @@ message Controller { string did = 2; // The public key of the controller - bytes public_key = 3; + string public_key_multibase = 3; // The vault address or identifier string vault_cid = 4; @@ -75,10 +100,13 @@ message Delegation { string controller_did = 5; // The delegation proof or verification method - bytes public_key = 6; + string public_key_multibase = 6; + + // Public Key JWKS is a map of the associated public keys + map public_key_jwks = 7; // IBC Channel ID - uint64 channel_id = 7; + uint64 channel_id = 8; } // Service represents a service in a DID Document diff --git a/x/did/types/account.pb.go b/x/did/types/account.pb.go index 902a39c19..b0d79fd0a 100644 --- a/x/did/types/account.pb.go +++ b/x/did/types/account.pb.go @@ -5,18 +5,21 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -40,9 +43,11 @@ func (*DIDDocument) ProtoMessage() {} func (*DIDDocument) Descriptor() ([]byte, []int) { return fileDescriptor_f1c7ebf7d0ca3c72, []int{0} } + func (m *DIDDocument) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *DIDDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DIDDocument.Marshal(b, m, deterministic) @@ -55,12 +60,15 @@ func (m *DIDDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } + func (m *DIDDocument) XXX_Merge(src proto.Message) { xxx_messageInfo_DIDDocument.Merge(m, src) } + func (m *DIDDocument) XXX_Size() int { return m.Size() } + func (m *DIDDocument) XXX_DiscardUnknown() { xxx_messageInfo_DIDDocument.DiscardUnknown(m) } @@ -111,9 +119,12 @@ func (m *DIDDocument) GetCapabilityInvocation() []string { // VerificationMethod defines a verification method type VerificationMethod struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - PublicKey *PublicKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The delegation proof or verification method + PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` + // Public Key JWKS is a map of the associated public keys + PublicKeyJwks map[string]string `protobuf:"bytes,4,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *VerificationMethod) Reset() { *m = VerificationMethod{} } @@ -122,9 +133,11 @@ func (*VerificationMethod) ProtoMessage() {} func (*VerificationMethod) Descriptor() ([]byte, []int) { return fileDescriptor_f1c7ebf7d0ca3c72, []int{1} } + func (m *VerificationMethod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *VerificationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_VerificationMethod.Marshal(b, m, deterministic) @@ -137,12 +150,15 @@ 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 *VerificationMethod) XXX_Size() int { return m.Size() } + func (m *VerificationMethod) XXX_DiscardUnknown() { xxx_messageInfo_VerificationMethod.DiscardUnknown(m) } @@ -163,9 +179,16 @@ func (m *VerificationMethod) GetController() string { return "" } -func (m *VerificationMethod) GetPublicKey() *PublicKey { +func (m *VerificationMethod) GetPublicKeyMultibase() string { if m != nil { - return m.PublicKey + return m.PublicKeyMultibase + } + return "" +} + +func (m *VerificationMethod) GetPublicKeyJwks() map[string]string { + if m != nil { + return m.PublicKeyJwks } return nil } @@ -173,36 +196,41 @@ func (m *VerificationMethod) GetPublicKey() *PublicKey { func init() { proto.RegisterType((*DIDDocument)(nil), "did.v1.DIDDocument") proto.RegisterType((*VerificationMethod)(nil), "did.v1.VerificationMethod") + proto.RegisterMapType((map[string]string)(nil), "did.v1.VerificationMethod.PublicKeyJwksEntry") } func init() { proto.RegisterFile("did/v1/account.proto", fileDescriptor_f1c7ebf7d0ca3c72) } var fileDescriptor_f1c7ebf7d0ca3c72 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xb1, 0x8e, 0x9b, 0x40, - 0x10, 0x86, 0x0d, 0x4e, 0x9c, 0x78, 0x2d, 0x39, 0xc9, 0x86, 0x48, 0xc4, 0x05, 0x42, 0x2e, 0x22, - 0xd2, 0x40, 0x6c, 0xb7, 0xa9, 0x22, 0x1a, 0x2b, 0xb2, 0x14, 0x51, 0xa4, 0x48, 0x83, 0x60, 0x77, - 0x03, 0xab, 0x83, 0x1d, 0xc4, 0x2e, 0xdc, 0xf1, 0x16, 0xf7, 0x1a, 0xf7, 0x26, 0x57, 0xba, 0xbc, - 0xf2, 0x64, 0xbf, 0xc8, 0xc9, 0x80, 0x7d, 0x96, 0xdd, 0x0d, 0xdf, 0xff, 0xcf, 0xcf, 0xec, 0x0c, - 0x32, 0x28, 0xa7, 0x5e, 0xbd, 0xf0, 0x22, 0x42, 0xa0, 0x12, 0xca, 0x2d, 0x4a, 0x50, 0x80, 0x47, - 0x94, 0x53, 0xb7, 0x5e, 0xcc, 0xbe, 0x12, 0x90, 0x39, 0xc8, 0xb0, 0xa5, 0x5e, 0xf7, 0xd1, 0x59, - 0x66, 0x46, 0x02, 0x09, 0x74, 0xfc, 0x50, 0x1d, 0x69, 0x1f, 0x97, 0x30, 0xc1, 0x24, 0xef, 0xbd, - 0xf3, 0x07, 0x1d, 0x4d, 0xfc, 0xb5, 0xef, 0x03, 0xa9, 0x72, 0x26, 0x14, 0x9e, 0x22, 0x9d, 0x53, - 0x53, 0xb3, 0x35, 0x67, 0x1c, 0xe8, 0x9c, 0xe2, 0x0d, 0x32, 0x6a, 0x56, 0xf2, 0xff, 0x9c, 0x44, - 0x8a, 0x83, 0x08, 0x73, 0xa6, 0x52, 0xa0, 0xd2, 0xd4, 0xed, 0xa1, 0x33, 0x59, 0xce, 0xdc, 0x6e, - 0x1a, 0xf7, 0xef, 0x99, 0x67, 0xd3, 0x5a, 0x82, 0xcf, 0xf5, 0x15, 0x93, 0xf8, 0x1b, 0x9a, 0x46, - 0x95, 0x4a, 0x99, 0x50, 0xbd, 0x60, 0xbe, 0xb1, 0x87, 0xce, 0x38, 0xb8, 0xa0, 0xf8, 0x3b, 0xfa, - 0x18, 0x49, 0xc9, 0xca, 0xb3, 0x7f, 0x9a, 0x6f, 0x5b, 0xe7, 0x87, 0x13, 0xef, 0x32, 0xf1, 0x0a, - 0x7d, 0x21, 0x51, 0x11, 0xc5, 0x3c, 0xe3, 0xaa, 0x09, 0x29, 0xcb, 0x58, 0xd2, 0x25, 0xbf, 0x6b, - 0xfd, 0xc6, 0xab, 0xe8, 0x9f, 0xb4, 0x8b, 0x26, 0x2e, 0x6a, 0xe8, 0xc7, 0x79, 0x7f, 0xd9, 0xb4, - 0x3e, 0x69, 0xf3, 0x1a, 0xe1, 0xeb, 0x77, 0x5e, 0x6d, 0xcc, 0x42, 0x88, 0x80, 0x50, 0x25, 0x64, - 0x19, 0x2b, 0x4d, 0xbd, 0xe5, 0x67, 0x04, 0xff, 0x40, 0xa8, 0xa8, 0xe2, 0x8c, 0x93, 0xf0, 0x86, - 0x35, 0xe6, 0xd0, 0xd6, 0x9c, 0xc9, 0xf2, 0xd3, 0x71, 0x8f, 0x7f, 0x5a, 0xe5, 0x37, 0x6b, 0x82, - 0x71, 0x71, 0x2c, 0x7f, 0xfd, 0x7c, 0xdc, 0x59, 0xda, 0x76, 0x67, 0x69, 0xcf, 0x3b, 0x4b, 0xbb, - 0xdf, 0x5b, 0x83, 0xed, 0xde, 0x1a, 0x3c, 0xed, 0xad, 0xc1, 0xbf, 0x79, 0xc2, 0x55, 0x5a, 0xc5, - 0x2e, 0x81, 0xdc, 0x03, 0x21, 0x41, 0x94, 0x5e, 0x7a, 0x1b, 0x35, 0xde, 0x9d, 0x77, 0x38, 0xb6, - 0x6a, 0x0a, 0x26, 0xe3, 0x51, 0x7b, 0xe8, 0xd5, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x30, 0x7a, - 0x87, 0xb1, 0x4f, 0x02, 0x00, 0x00, + // 440 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0x8e, 0xd3, 0x40, + 0x10, 0x86, 0x63, 0x87, 0x3b, 0xb8, 0x8d, 0xb8, 0x3b, 0x2d, 0x46, 0x32, 0x29, 0xac, 0x28, 0x05, + 0x0a, 0x05, 0x36, 0x77, 0xd7, 0x20, 0x44, 0x81, 0x50, 0x28, 0x0e, 0x14, 0x09, 0x45, 0x82, 0x82, + 0xc6, 0x5a, 0xaf, 0x07, 0x67, 0x89, 0xbd, 0x63, 0x79, 0xd7, 0x0e, 0x7e, 0x0a, 0x78, 0x0d, 0xde, + 0x84, 0x32, 0x25, 0x25, 0x4a, 0x5e, 0x04, 0xc5, 0x76, 0x82, 0x15, 0xeb, 0xba, 0xdd, 0xef, 0xff, + 0xe7, 0xdf, 0x9d, 0xd1, 0x10, 0x2b, 0x14, 0xa1, 0x57, 0x5c, 0x79, 0x8c, 0x73, 0xcc, 0xa5, 0x76, + 0xd3, 0x0c, 0x35, 0xd2, 0xd3, 0x50, 0x84, 0x6e, 0x71, 0x35, 0x7c, 0xc2, 0x51, 0x25, 0xa8, 0xfc, + 0x8a, 0x7a, 0xf5, 0xa5, 0xb6, 0x0c, 0xad, 0x08, 0x23, 0xac, 0xf9, 0xee, 0xb4, 0xa7, 0x4d, 0x5c, + 0x04, 0x12, 0x94, 0x68, 0xbc, 0xe3, 0x5f, 0x26, 0x19, 0x4c, 0x6f, 0xa7, 0x53, 0xe4, 0x79, 0x02, + 0x52, 0xd3, 0x73, 0x62, 0x8a, 0xd0, 0x36, 0x46, 0xc6, 0xe4, 0x6c, 0x6e, 0x8a, 0x90, 0xce, 0x88, + 0x55, 0x40, 0x26, 0xbe, 0x0a, 0xce, 0xb4, 0x40, 0xe9, 0x27, 0xa0, 0x17, 0x18, 0x2a, 0xdb, 0x1c, + 0xf5, 0x27, 0x83, 0xeb, 0xa1, 0x5b, 0xff, 0xc6, 0xfd, 0xdc, 0xf2, 0xcc, 0x2a, 0xcb, 0xfc, 0x51, + 0xd1, 0x61, 0x8a, 0x3e, 0x25, 0xe7, 0x2c, 0xd7, 0x0b, 0x90, 0xba, 0x11, 0xec, 0x7b, 0xa3, 0xfe, + 0xe4, 0x6c, 0x7e, 0x44, 0xe9, 0x33, 0x72, 0xc9, 0x94, 0x82, 0xac, 0xf5, 0xa6, 0x7d, 0x52, 0x39, + 0x2f, 0x0e, 0xbc, 0xce, 0xa4, 0x37, 0xe4, 0x31, 0x67, 0x29, 0x0b, 0x44, 0x2c, 0x74, 0xe9, 0x87, + 0x10, 0x43, 0x54, 0x27, 0xdf, 0xaf, 0xfc, 0xd6, 0x7f, 0x71, 0x7a, 0xd0, 0x8e, 0x8a, 0x84, 0x2c, + 0xb0, 0xf9, 0xce, 0x83, 0xe3, 0xa2, 0xdb, 0x83, 0x36, 0xfe, 0x61, 0x12, 0xda, 0x6d, 0xb4, 0x33, + 0x32, 0x87, 0x10, 0x8e, 0x52, 0x67, 0x18, 0xc7, 0x90, 0xd9, 0x66, 0xc5, 0x5b, 0x84, 0xbe, 0x20, + 0x56, 0x9a, 0x07, 0xb1, 0xe0, 0xfe, 0x12, 0x4a, 0x3f, 0xc9, 0x63, 0x2d, 0x02, 0xa6, 0xc0, 0xee, + 0x57, 0x4e, 0x5a, 0x6b, 0x1f, 0xa0, 0x9c, 0xed, 0x15, 0xfa, 0x89, 0x5c, 0xb4, 0x2a, 0xbe, 0xad, + 0x96, 0xaa, 0x1a, 0xdb, 0xe0, 0xfa, 0xf9, 0xdd, 0xf3, 0x77, 0x3f, 0xee, 0x73, 0xde, 0xaf, 0x96, + 0xea, 0x9d, 0xd4, 0x59, 0x39, 0x7f, 0x98, 0xb6, 0xd9, 0xf0, 0x0d, 0xa1, 0x5d, 0x13, 0xbd, 0x24, + 0xfd, 0x25, 0x94, 0x4d, 0x3f, 0xbb, 0x23, 0xb5, 0xc8, 0x49, 0xc1, 0xe2, 0x1c, 0x9a, 0x5e, 0xea, + 0xcb, 0x2b, 0xf3, 0xa5, 0xf1, 0xf6, 0xf5, 0xef, 0x8d, 0x63, 0xac, 0x37, 0x8e, 0xf1, 0x77, 0xe3, + 0x18, 0x3f, 0xb7, 0x4e, 0x6f, 0xbd, 0x75, 0x7a, 0x7f, 0xb6, 0x4e, 0xef, 0xcb, 0x38, 0x12, 0x7a, + 0x91, 0x07, 0x2e, 0xc7, 0xc4, 0x43, 0xa9, 0x50, 0x66, 0xde, 0x62, 0xc5, 0x4a, 0xef, 0xbb, 0xb7, + 0x5b, 0x43, 0x5d, 0xa6, 0xa0, 0x82, 0xd3, 0x6a, 0x05, 0x6f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, + 0x27, 0xff, 0x98, 0x0b, 0xe9, 0x02, 0x00, 0x00, } func (m *DIDDocument) Marshal() (dAtA []byte, err error) { @@ -305,15 +333,29 @@ func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAccount(dAtA, i, uint64(size)) + if len(m.PublicKeyJwks) > 0 { + for k := range m.PublicKeyJwks { + v := m.PublicKeyJwks[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintAccount(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintAccount(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintAccount(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } + } + if len(m.PublicKeyMultibase) > 0 { + i -= len(m.PublicKeyMultibase) + copy(dAtA[i:], m.PublicKeyMultibase) + i = encodeVarintAccount(dAtA, i, uint64(len(m.PublicKeyMultibase))) i-- dAtA[i] = 0x1a } @@ -345,6 +387,7 @@ func encodeVarintAccount(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *DIDDocument) Size() (n int) { if m == nil { return 0 @@ -402,19 +445,29 @@ func (m *VerificationMethod) Size() (n int) { if l > 0 { n += 1 + l + sovAccount(uint64(l)) } - if m.PublicKey != nil { - l = m.PublicKey.Size() + l = len(m.PublicKeyMultibase) + if l > 0 { n += 1 + l + sovAccount(uint64(l)) } + if len(m.PublicKeyJwks) > 0 { + for k, v := range m.PublicKeyJwks { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovAccount(uint64(len(k))) + 1 + len(v) + sovAccount(uint64(len(v))) + n += mapEntrySize + 1 + sovAccount(uint64(mapEntrySize)) + } + } return n } func sovAccount(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozAccount(x uint64) (n int) { return sovAccount(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *DIDDocument) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -659,6 +712,7 @@ func (m *DIDDocument) Unmarshal(dAtA []byte) error { } return nil } + func (m *VerificationMethod) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -754,7 +808,39 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccount + } + 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 ErrInvalidLengthAccount + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccount + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyJwks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -781,12 +867,103 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PublicKey == nil { - m.PublicKey = &PublicKey{} + if m.PublicKeyJwks == nil { + m.PublicKeyJwks = make(map[string]string) } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccount + } + 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 ErrIntOverflowAccount + } + 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 ErrInvalidLengthAccount + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthAccount + } + 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 ErrIntOverflowAccount + } + 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 ErrInvalidLengthAccount + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthAccount + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipAccount(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccount + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.PublicKeyJwks[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -809,6 +986,7 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { } return nil } + func skipAccount(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index 6a098cb8d..8ec7748a4 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -143,106 +143,37 @@ func (m *Params) GetEncryptionRewardRate() float64 { return 0 } -// PublicKey is the struct that represents a public key -type PublicKey struct { - // Key is the public key - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Type is the type of the public key - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - // DID is the DID of the public key - Did string `protobuf:"bytes,3,opt,name=did,proto3" json:"did,omitempty"` -} - -func (m *PublicKey) Reset() { *m = PublicKey{} } -func (*PublicKey) ProtoMessage() {} -func (*PublicKey) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{2} -} -func (m *PublicKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PublicKey.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 *PublicKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublicKey.Merge(m, src) -} -func (m *PublicKey) XXX_Size() int { - return m.Size() -} -func (m *PublicKey) XXX_DiscardUnknown() { - xxx_messageInfo_PublicKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PublicKey proto.InternalMessageInfo - -func (m *PublicKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *PublicKey) GetKeyType() string { - if m != nil { - return m.KeyType - } - return "" -} - -func (m *PublicKey) GetDid() string { - if m != nil { - return m.Did - } - return "" -} - func init() { proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") proto.RegisterType((*Params)(nil), "did.v1.Params") - proto.RegisterType((*PublicKey)(nil), "did.v1.PublicKey") } func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 420 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xb1, 0x6e, 0x14, 0x31, - 0x10, 0x86, 0xd7, 0xb9, 0x70, 0x70, 0x26, 0x20, 0xe2, 0x1c, 0xb0, 0xa4, 0xd8, 0x3b, 0x9d, 0x28, - 0x56, 0x11, 0xac, 0x95, 0x40, 0x15, 0xa5, 0x21, 0x0d, 0x05, 0x05, 0xd1, 0x42, 0x45, 0xb3, 0xf2, - 0x9d, 0x87, 0x3d, 0x6b, 0xf7, 0xd6, 0x96, 0xed, 0x64, 0xf1, 0x2b, 0x50, 0x21, 0x2a, 0xca, 0x3c, - 0x42, 0x1e, 0x23, 0x65, 0x4a, 0x2a, 0x84, 0xee, 0x8a, 0x20, 0xf1, 0x12, 0xc8, 0xde, 0x84, 0x20, - 0xd1, 0x58, 0xe3, 0xff, 0x9b, 0xf9, 0xc7, 0x33, 0xc6, 0x43, 0x2e, 0x38, 0x3d, 0xd9, 0xa5, 0x25, - 0x34, 0x60, 0x84, 0xc9, 0x94, 0x96, 0x56, 0x92, 0x3e, 0x17, 0x3c, 0x3b, 0xd9, 0xdd, 0x1e, 0x96, - 0xb2, 0x94, 0x41, 0xa2, 0x3e, 0xea, 0xe8, 0xf6, 0x26, 0x5b, 0x88, 0x46, 0xd2, 0x70, 0x76, 0xd2, - 0xe4, 0x00, 0x6f, 0xbc, 0xee, 0x1c, 0xde, 0x59, 0x66, 0x81, 0x3c, 0xc3, 0x7d, 0xc5, 0x34, 0x5b, - 0x98, 0x18, 0x8d, 0x51, 0x7a, 0x77, 0xef, 0x7e, 0xd6, 0x39, 0x66, 0x47, 0x41, 0x3d, 0x5c, 0x3f, - 0xff, 0x31, 0x8a, 0xf2, 0xab, 0x9c, 0xc9, 0x6f, 0x84, 0xfb, 0x1d, 0x20, 0xcf, 0x31, 0x51, 0x5a, - 0x2a, 0xd0, 0xd6, 0x15, 0xac, 0xae, 0x65, 0x5b, 0x0b, 0x63, 0xe3, 0xb5, 0x71, 0x2f, 0x1d, 0xe4, - 0x9b, 0xd7, 0xe4, 0xd5, 0x35, 0x20, 0x14, 0x6f, 0xb5, 0x73, 0x61, 0xc1, 0x5f, 0x80, 0x17, 0x52, - 0x8b, 0x52, 0x34, 0x26, 0xee, 0x85, 0x7c, 0xf2, 0x0f, 0x7a, 0xdb, 0x11, 0xb2, 0x87, 0x1f, 0x32, - 0x63, 0x40, 0x5b, 0x21, 0x9b, 0x42, 0x43, 0xcb, 0x34, 0x2f, 0x34, 0xb3, 0x10, 0xaf, 0x8f, 0x51, - 0x8a, 0xf2, 0xad, 0xbf, 0x30, 0x0f, 0x2c, 0xf7, 0xc3, 0xbc, 0xc4, 0x8f, 0xa0, 0x99, 0x69, 0xa7, - 0xfe, 0x2b, 0xba, 0x15, 0x8a, 0x86, 0x37, 0xf4, 0xa6, 0x6a, 0xff, 0xf1, 0xb7, 0xd3, 0x51, 0xf4, - 0xeb, 0x74, 0x84, 0x3e, 0x5f, 0x9e, 0xed, 0x60, 0xbf, 0xe6, 0xab, 0x69, 0x15, 0x1e, 0x1c, 0x1d, - 0x4f, 0x6b, 0x31, 0x7b, 0x03, 0x8e, 0x3c, 0xc0, 0xbd, 0x0a, 0x5c, 0xd8, 0xd2, 0x46, 0xee, 0x43, - 0xf2, 0x04, 0xdf, 0xa9, 0xc0, 0x15, 0xd6, 0x29, 0x88, 0xd7, 0xc6, 0x28, 0x1d, 0xe4, 0xb7, 0x2b, - 0x70, 0xef, 0x9d, 0x02, 0x9f, 0xcc, 0x05, 0x8f, 0x7b, 0x41, 0xf5, 0xe1, 0xfe, 0x53, 0xdf, 0xc4, - 0x37, 0xb8, 0x17, 0x1a, 0x04, 0xdb, 0x0a, 0xdc, 0xd7, 0xcb, 0xb3, 0x9d, 0x81, 0x77, 0xf9, 0x28, - 0xa0, 0xe6, 0x87, 0x07, 0xe7, 0xcb, 0x04, 0x5d, 0x2c, 0x13, 0xf4, 0x73, 0x99, 0xa0, 0x2f, 0xab, - 0x24, 0xba, 0x58, 0x25, 0xd1, 0xf7, 0x55, 0x12, 0x7d, 0x98, 0x94, 0xc2, 0xce, 0x8f, 0xa7, 0xd9, - 0x4c, 0x2e, 0xa8, 0x6c, 0x8c, 0x6c, 0x34, 0x9d, 0xb7, 0xcc, 0xd1, 0x4f, 0xd4, 0xfb, 0xf9, 0x37, - 0x98, 0x69, 0x3f, 0x7c, 0xf1, 0x8b, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x1a, 0x3c, 0x3c, - 0x2b, 0x02, 0x00, 0x00, + // 338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x31, 0x4f, 0x02, 0x31, + 0x14, 0xc7, 0xaf, 0x82, 0x97, 0x58, 0x8d, 0x09, 0x05, 0xf5, 0xc2, 0x70, 0x10, 0x26, 0x62, 0xf4, + 0x1a, 0xd0, 0xc9, 0xb0, 0xc8, 0xe2, 0xa8, 0x39, 0x37, 0x97, 0x4b, 0xe1, 0x9a, 0xa3, 0x09, 0xb4, + 0x97, 0xb6, 0x72, 0xde, 0x57, 0x70, 0x72, 0x74, 0xe4, 0x23, 0xf8, 0x31, 0x18, 0x19, 0x9d, 0x8c, + 0x81, 0x41, 0x13, 0xbf, 0x84, 0xb9, 0x56, 0xc4, 0xc4, 0xa5, 0xe9, 0xfb, 0xff, 0xde, 0xef, 0x25, + 0xef, 0xc1, 0x5a, 0xcc, 0x62, 0x3c, 0xed, 0xe0, 0x84, 0x72, 0xaa, 0x98, 0x0a, 0x52, 0x29, 0xb4, + 0x40, 0x6e, 0xcc, 0xe2, 0x60, 0xda, 0xa9, 0xd7, 0x12, 0x91, 0x08, 0x13, 0xe1, 0xe2, 0x67, 0x69, + 0xbd, 0x42, 0x26, 0x8c, 0x0b, 0x6c, 0x5e, 0x1b, 0xb5, 0x7a, 0x70, 0xef, 0xca, 0x4e, 0xb8, 0xd5, + 0x44, 0x53, 0x74, 0x02, 0xdd, 0x94, 0x48, 0x32, 0x51, 0x1e, 0x68, 0x82, 0xf6, 0x6e, 0x77, 0x3f, + 0xb0, 0x13, 0x83, 0x1b, 0x93, 0xf6, 0xcb, 0xf3, 0xb7, 0x86, 0x13, 0xfe, 0xf4, 0xb4, 0xbe, 0x00, + 0x74, 0x2d, 0x40, 0xa7, 0x10, 0xa5, 0x52, 0xa4, 0x54, 0xea, 0x3c, 0x22, 0xe3, 0xb1, 0xc8, 0xc6, + 0x4c, 0x69, 0x6f, 0xab, 0x59, 0x6a, 0xef, 0x84, 0x95, 0x35, 0xb9, 0x5c, 0x03, 0x84, 0x61, 0x35, + 0x1b, 0x31, 0x4d, 0x8b, 0x82, 0xc6, 0x91, 0x90, 0x2c, 0x61, 0x5c, 0x79, 0x25, 0xd3, 0x8f, 0xfe, + 0xa0, 0x6b, 0x4b, 0x50, 0x17, 0x1e, 0x10, 0xa5, 0xa8, 0xd4, 0x4c, 0xf0, 0x48, 0xd2, 0x8c, 0xc8, + 0x38, 0x92, 0x44, 0x53, 0xaf, 0xdc, 0x04, 0x6d, 0x10, 0x56, 0x7f, 0x61, 0x68, 0x58, 0x58, 0x2c, + 0x73, 0x0e, 0x0f, 0x29, 0x1f, 0xca, 0x3c, 0xfd, 0x27, 0x6d, 0x1b, 0xa9, 0xb6, 0xa1, 0x1b, 0xeb, + 0xe2, 0xe8, 0x79, 0xd6, 0x70, 0x3e, 0x67, 0x0d, 0xf0, 0xf8, 0xf1, 0x72, 0x0c, 0x8b, 0x33, 0xdb, + 0x6d, 0xfb, 0xbd, 0xf9, 0xd2, 0x07, 0x8b, 0xa5, 0x0f, 0xde, 0x97, 0x3e, 0x78, 0x5a, 0xf9, 0xce, + 0x62, 0xe5, 0x3b, 0xaf, 0x2b, 0xdf, 0xb9, 0x6b, 0x25, 0x4c, 0x8f, 0xee, 0x07, 0xc1, 0x50, 0x4c, + 0xb0, 0xe0, 0x4a, 0x70, 0x89, 0x47, 0x19, 0xc9, 0xf1, 0x03, 0x2e, 0x74, 0x9d, 0xa7, 0x54, 0x0d, + 0x5c, 0x73, 0xf0, 0xb3, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xc5, 0x76, 0x33, 0xb9, 0x01, + 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -374,50 +305,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PublicKey) 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 *PublicKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Did) > 0 { - i -= len(m.Did) - copy(dAtA[i:], m.Did) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Did))) - i-- - dAtA[i] = 0x1a - } - if len(m.KeyType) > 0 { - i -= len(m.KeyType) - copy(dAtA[i:], m.KeyType) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.KeyType))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -467,27 +354,6 @@ func (m *Params) Size() (n int) { return n } -func (m *PublicKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.KeyType) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Did) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -713,154 +579,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } -func (m *PublicKey) 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 ErrIntOverflowGenesis - } - 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: PublicKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PublicKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.KeyType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index a5cb89793..6022b2759 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -23,6 +23,88 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) +type Assertion struct { + // The unique identifier of the attestation + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") + KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + // The value of the linked identifier + Credential []byte `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"` + // Metadata is optional additional information about the assertion + Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The controller of the attestation + Controller string `protobuf:"bytes,5,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (m *Assertion) Reset() { *m = Assertion{} } +func (m *Assertion) String() string { return proto.CompactTextString(m) } +func (*Assertion) ProtoMessage() {} +func (*Assertion) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{0} +} +func (m *Assertion) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Assertion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Assertion.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 *Assertion) XXX_Merge(src proto.Message) { + xxx_messageInfo_Assertion.Merge(m, src) +} +func (m *Assertion) XXX_Size() int { + return m.Size() +} +func (m *Assertion) XXX_DiscardUnknown() { + xxx_messageInfo_Assertion.DiscardUnknown(m) +} + +var xxx_messageInfo_Assertion proto.InternalMessageInfo + +func (m *Assertion) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Assertion) GetKeyType() string { + if m != nil { + return m.KeyType + } + return "" +} + +func (m *Assertion) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +func (m *Assertion) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Assertion) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) type Attestation struct { // The unique identifier of the attestation @@ -41,7 +123,7 @@ func (m *Attestation) Reset() { *m = Attestation{} } func (m *Attestation) String() string { return proto.CompactTextString(m) } func (*Attestation) ProtoMessage() {} func (*Attestation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{0} + return fileDescriptor_f44bb702879c34b4, []int{1} } func (m *Attestation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,7 +194,7 @@ type Controller struct { // The DID of the controller Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // The public key of the controller - PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` // The vault address or identifier VaultCid string `protobuf:"bytes,4,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` // Fingerprint is the Accumulator of discrete credential identifiers @@ -123,7 +205,7 @@ func (m *Controller) Reset() { *m = Controller{} } func (m *Controller) String() string { return proto.CompactTextString(m) } func (*Controller) ProtoMessage() {} func (*Controller) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{1} + return fileDescriptor_f44bb702879c34b4, []int{2} } func (m *Controller) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -166,11 +248,11 @@ func (m *Controller) GetDid() string { return "" } -func (m *Controller) GetPublicKey() []byte { +func (m *Controller) GetPublicKeyMultibase() string { if m != nil { - return m.PublicKey + return m.PublicKeyMultibase } - return nil + return "" } func (m *Controller) GetVaultCid() string { @@ -200,16 +282,18 @@ type Delegation struct { // The controller DID ControllerDid string `protobuf:"bytes,5,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` // The delegation proof or verification method - PublicKey []byte `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKeyMultibase string `protobuf:"bytes,6,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` + // Public Key JWKS is a map of the associated public keys + PublicKeyJwks map[string]string `protobuf:"bytes,7,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // IBC Channel ID - ChannelId uint64 `protobuf:"varint,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ChannelId uint64 `protobuf:"varint,8,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` } func (m *Delegation) Reset() { *m = Delegation{} } func (m *Delegation) String() string { return proto.CompactTextString(m) } func (*Delegation) ProtoMessage() {} func (*Delegation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{2} + return fileDescriptor_f44bb702879c34b4, []int{3} } func (m *Delegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -273,9 +357,16 @@ func (m *Delegation) GetControllerDid() string { return "" } -func (m *Delegation) GetPublicKey() []byte { +func (m *Delegation) GetPublicKeyMultibase() string { if m != nil { - return m.PublicKey + return m.PublicKeyMultibase + } + return "" +} + +func (m *Delegation) GetPublicKeyJwks() map[string]string { + if m != nil { + return m.PublicKeyJwks } return nil } @@ -303,7 +394,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_f44bb702879c34b4, []int{3} + return fileDescriptor_f44bb702879c34b4, []int{4} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -361,46 +452,128 @@ func (m *Service) GetControllerDid() string { } func init() { + proto.RegisterType((*Assertion)(nil), "did.v1.Assertion") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Assertion.MetadataEntry") proto.RegisterType((*Attestation)(nil), "did.v1.Attestation") proto.RegisterType((*Controller)(nil), "did.v1.Controller") proto.RegisterType((*Delegation)(nil), "did.v1.Delegation") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Delegation.PublicKeyJwksEntry") proto.RegisterType((*Service)(nil), "did.v1.Service") } func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 475 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x7b, 0x89, 0x9b, 0x3f, 0x6f, 0xd2, 0x50, 0x9d, 0x2a, 0x61, 0x8a, 0xb0, 0x82, 0x11, - 0x52, 0x59, 0x62, 0x55, 0x6c, 0x88, 0xa5, 0xb4, 0x0c, 0x88, 0x2d, 0x30, 0xb1, 0x58, 0x8e, 0xef, - 0x6d, 0x72, 0x8a, 0x73, 0x67, 0xdd, 0x5d, 0x0c, 0xfe, 0x12, 0x88, 0x81, 0x11, 0xf5, 0xf3, 0x30, - 0x56, 0x62, 0x61, 0x44, 0xc9, 0xc0, 0xce, 0x27, 0x40, 0xbe, 0x33, 0x34, 0x4a, 0xb2, 0xf9, 0x7e, - 0xef, 0xd9, 0xf7, 0x7b, 0x1e, 0xf9, 0x80, 0x32, 0xce, 0xa2, 0xe2, 0x3c, 0xd2, 0x26, 0x31, 0x38, - 0xca, 0x95, 0x34, 0x92, 0xb6, 0x18, 0x67, 0xa3, 0xe2, 0xfc, 0xf4, 0x7e, 0x2a, 0xf5, 0x42, 0xea, - 0x48, 0xaa, 0x45, 0xb5, 0x45, 0xaa, 0x85, 0xdb, 0x70, 0x7a, 0x52, 0xbf, 0x34, 0x45, 0x81, 0x9a, - 0x6b, 0x47, 0xc3, 0xaf, 0x04, 0x7a, 0x17, 0xc6, 0x60, 0xf5, 0x29, 0x2e, 0x05, 0x1d, 0x40, 0x83, - 0x33, 0x9f, 0x0c, 0xc9, 0x59, 0x77, 0xdc, 0xe0, 0x8c, 0x3e, 0x80, 0xce, 0x1c, 0xcb, 0xd8, 0x94, - 0x39, 0xfa, 0x0d, 0x4b, 0xdb, 0x73, 0x2c, 0xdf, 0x97, 0x39, 0xd2, 0x13, 0x38, 0x2c, 0x92, 0x6c, - 0x89, 0x7e, 0xd3, 0x72, 0xb7, 0xa8, 0x68, 0xae, 0xa4, 0xbc, 0xf6, 0x3d, 0x47, 0xed, 0x82, 0x06, - 0x00, 0xa9, 0x14, 0x46, 0xc9, 0x2c, 0x43, 0xe5, 0x1f, 0xda, 0xd1, 0x06, 0x79, 0x31, 0xf8, 0x73, - 0xf3, 0xe3, 0x73, 0xb3, 0x03, 0x9e, 0x3b, 0x3e, 0xfc, 0x46, 0x00, 0x2e, 0xff, 0x8f, 0x77, 0xac, - 0x8e, 0xa1, 0xc9, 0x38, 0xab, 0x85, 0xaa, 0x47, 0xfa, 0x08, 0x20, 0x5f, 0x4e, 0x32, 0x9e, 0xc6, - 0x73, 0x2c, 0xad, 0x51, 0x7f, 0xdc, 0x75, 0xe4, 0x2d, 0x96, 0xf4, 0x21, 0x74, 0x8b, 0x64, 0x99, - 0x99, 0x38, 0xe5, 0xac, 0x36, 0xeb, 0x58, 0x70, 0xc9, 0x19, 0x1d, 0x42, 0xef, 0x9a, 0x8b, 0x29, - 0xaa, 0x5c, 0x71, 0x61, 0xac, 0x5d, 0x7f, 0xbc, 0x89, 0xb6, 0xf4, 0x1a, 0xe1, 0x6f, 0x02, 0x70, - 0x85, 0x19, 0x4e, 0xf7, 0x97, 0xb6, 0x57, 0x2f, 0x9d, 0x25, 0x5c, 0xb8, 0x22, 0x5d, 0x61, 0x5d, - 0x4b, 0x6c, 0x95, 0x4f, 0xe0, 0xc8, 0x8d, 0x13, 0xc6, 0x14, 0x6a, 0x5d, 0x2b, 0xf6, 0x2d, 0xbc, - 0x70, 0x8c, 0x3e, 0x85, 0xc1, 0x5d, 0x63, 0x71, 0x75, 0x80, 0xeb, 0xf1, 0xe8, 0x8e, 0x5e, 0xed, - 0x34, 0xd1, 0xda, 0x6e, 0xc2, 0x99, 0x08, 0x81, 0x59, 0xcc, 0x99, 0xdf, 0x1e, 0x92, 0x33, 0xcf, - 0x9a, 0x54, 0xe4, 0x0d, 0xdb, 0x4a, 0xda, 0x0c, 0x6f, 0x08, 0xb4, 0xdf, 0xa1, 0x2a, 0x78, 0x8a, - 0x3b, 0x31, 0x1f, 0x43, 0x5f, 0xbb, 0xd1, 0xe6, 0xff, 0xd1, 0xab, 0x99, 0x0d, 0xf6, 0x0c, 0x8e, - 0xff, 0x6d, 0x41, 0xc1, 0x72, 0x59, 0xf5, 0xeb, 0xd2, 0xdf, 0xab, 0xf9, 0xeb, 0x1a, 0xef, 0x89, - 0xe7, 0xed, 0x89, 0xb7, 0x25, 0xe8, 0xbd, 0x7a, 0xf9, 0x7d, 0x15, 0x90, 0xdb, 0x55, 0x40, 0x7e, - 0xad, 0x02, 0xf2, 0x65, 0x1d, 0x1c, 0xdc, 0xae, 0x83, 0x83, 0x9f, 0xeb, 0xe0, 0xe0, 0x43, 0x38, - 0xe5, 0x66, 0xb6, 0x9c, 0x8c, 0x52, 0xb9, 0x88, 0xa4, 0xd0, 0x52, 0xa8, 0x68, 0xf6, 0x31, 0x29, - 0xa3, 0x4f, 0x51, 0x75, 0x13, 0x2a, 0x63, 0x3d, 0x69, 0xd9, 0x5b, 0xf0, 0xfc, 0x6f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xa0, 0x45, 0x5a, 0xc7, 0x52, 0x03, 0x00, 0x00, + // 618 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xeb, 0x38, 0x6d, 0x93, 0x49, 0xd2, 0x56, 0xab, 0x4a, 0x98, 0x20, 0x4c, 0x08, 0xaa, + 0x14, 0x2e, 0x36, 0x85, 0x0b, 0x6a, 0x39, 0x50, 0xda, 0x1e, 0x00, 0x55, 0x42, 0x81, 0x13, 0x97, + 0xc8, 0xf1, 0x6e, 0xd3, 0x25, 0xf6, 0xae, 0xb5, 0xbb, 0x49, 0xf1, 0x8d, 0x3b, 0x12, 0xe2, 0xc0, + 0xb9, 0xaf, 0xc0, 0x6b, 0x70, 0xac, 0xc4, 0x85, 0x23, 0x6a, 0xdf, 0x80, 0x27, 0x40, 0xde, 0xb5, + 0x53, 0xd3, 0x14, 0x10, 0xe2, 0x66, 0x7f, 0x33, 0xe3, 0xf9, 0xe7, 0x9f, 0x91, 0x01, 0x61, 0x8a, + 0xfd, 0xe9, 0xa6, 0x2f, 0x55, 0xa0, 0x88, 0x97, 0x08, 0xae, 0x38, 0x5a, 0xc2, 0x14, 0x7b, 0xd3, + 0xcd, 0xf6, 0xb5, 0x90, 0xcb, 0x98, 0x4b, 0x9f, 0x8b, 0x38, 0x4b, 0xe1, 0x22, 0x36, 0x09, 0xed, + 0xf5, 0xbc, 0x68, 0x44, 0x18, 0x91, 0x54, 0x1a, 0xda, 0x7d, 0x57, 0x81, 0xfa, 0x8e, 0x94, 0x44, + 0x28, 0xca, 0x19, 0x5a, 0x81, 0x0a, 0xc5, 0x8e, 0xd5, 0xb1, 0x7a, 0xf5, 0x7e, 0x85, 0x62, 0x74, + 0x1d, 0x6a, 0x63, 0x92, 0x0e, 0x54, 0x9a, 0x10, 0xa7, 0xa2, 0xe9, 0xf2, 0x98, 0xa4, 0xaf, 0xd2, + 0x84, 0x20, 0x17, 0x20, 0x14, 0x04, 0x13, 0xa6, 0x68, 0x10, 0x39, 0x76, 0xc7, 0xea, 0x35, 0xfb, + 0x25, 0x82, 0xb6, 0xa1, 0x16, 0x13, 0x15, 0xe0, 0x40, 0x05, 0x4e, 0xb5, 0x63, 0xf7, 0x1a, 0xf7, + 0x6f, 0x79, 0x46, 0xa2, 0x37, 0xeb, 0xe7, 0x1d, 0xe4, 0x19, 0xfb, 0x4c, 0x89, 0xb4, 0x3f, 0x2b, + 0xd0, 0x1f, 0xe7, 0x4c, 0x09, 0x1e, 0x45, 0x44, 0x38, 0x8b, 0xba, 0x73, 0x89, 0xb4, 0xb7, 0xa1, + 0xf5, 0x4b, 0x29, 0x5a, 0x03, 0x7b, 0x4c, 0xd2, 0x5c, 0x79, 0xf6, 0x88, 0xd6, 0x61, 0x71, 0x1a, + 0x44, 0x93, 0x42, 0xb7, 0x79, 0xd9, 0xaa, 0x3c, 0xb4, 0xb6, 0x56, 0x7e, 0x9c, 0x7c, 0xfd, 0x60, + 0xd7, 0xa0, 0x6a, 0x86, 0xed, 0x7e, 0xb2, 0xa0, 0xb1, 0xa3, 0x14, 0xc9, 0xdc, 0xfc, 0x47, 0x13, + 0x66, 0x4d, 0xec, 0x52, 0x93, 0x8c, 0x26, 0x82, 0xf3, 0x43, 0xa7, 0x6a, 0xa8, 0x7e, 0xf9, 0xdb, + 0x4c, 0x73, 0xb2, 0x3e, 0x5b, 0x00, 0xbb, 0xb3, 0xf0, 0x9c, 0xaa, 0x35, 0xb0, 0x31, 0xc5, 0xb9, + 0xa0, 0xec, 0x11, 0xdd, 0x83, 0xf5, 0x64, 0x32, 0x8c, 0x68, 0x38, 0xc8, 0xe4, 0xc6, 0x93, 0x48, + 0xd1, 0x61, 0x20, 0x0b, 0x6d, 0xc8, 0xc4, 0x9e, 0x93, 0xf4, 0xa0, 0x88, 0xa0, 0x1b, 0x50, 0x9f, + 0x06, 0x93, 0x48, 0x0d, 0x42, 0x8a, 0x73, 0xb1, 0x35, 0x0d, 0x76, 0x29, 0x46, 0x1d, 0x68, 0x1c, + 0x52, 0x36, 0x22, 0x22, 0x11, 0x94, 0x29, 0x2d, 0xb8, 0xd9, 0x2f, 0xa3, 0x4b, 0x8a, 0x2b, 0xdd, + 0xf7, 0x36, 0xc0, 0x1e, 0x89, 0xc8, 0xe8, 0x6a, 0x1f, 0xe7, 0x15, 0xdf, 0x04, 0x08, 0x8f, 0x02, + 0xca, 0x8c, 0xb7, 0x46, 0x67, 0x5d, 0x13, 0xed, 0xee, 0x1d, 0x68, 0x99, 0x70, 0x80, 0xb1, 0x20, + 0x52, 0xe6, 0x12, 0x9b, 0x1a, 0xee, 0x18, 0x86, 0x36, 0x60, 0xe5, 0xc2, 0xc4, 0x41, 0xd6, 0xc0, + 0x58, 0xdb, 0xba, 0xa0, 0x7b, 0x7f, 0x30, 0x67, 0xe9, 0xb7, 0xe6, 0x1c, 0xc0, 0x6a, 0xa9, 0xe2, + 0xcd, 0xf1, 0x58, 0x3a, 0xcb, 0xfa, 0x8e, 0x37, 0x8a, 0x3b, 0xbe, 0x98, 0xd5, 0x7b, 0x51, 0xd4, + 0x3f, 0x3b, 0x1e, 0x4b, 0x73, 0xcd, 0xad, 0xa4, 0xcc, 0xf2, 0x59, 0x19, 0x23, 0xd1, 0x80, 0x62, + 0xa7, 0xd6, 0xb1, 0x7a, 0x55, 0x3d, 0x6b, 0x46, 0x9e, 0xe2, 0xf6, 0x63, 0x40, 0xf3, 0xdf, 0xf8, + 0x8f, 0xb3, 0xb6, 0xbb, 0x27, 0x16, 0x2c, 0xbf, 0x24, 0x62, 0x4a, 0x43, 0x32, 0xb7, 0x8a, 0xdb, + 0xd0, 0x94, 0x26, 0x54, 0x3e, 0xeb, 0x46, 0xce, 0xb4, 0xf9, 0x77, 0x61, 0xad, 0x48, 0x21, 0x0c, + 0x27, 0x3c, 0xbb, 0x01, 0xb3, 0xa1, 0xd5, 0x9c, 0xef, 0xe7, 0xf8, 0x8a, 0x15, 0x54, 0xaf, 0x58, + 0xc1, 0x25, 0x81, 0xd5, 0x27, 0x8f, 0xbe, 0x9c, 0xb9, 0xd6, 0xe9, 0x99, 0x6b, 0x7d, 0x3f, 0x73, + 0xad, 0x8f, 0xe7, 0xee, 0xc2, 0xe9, 0xb9, 0xbb, 0xf0, 0xed, 0xdc, 0x5d, 0x78, 0xdd, 0x1d, 0x51, + 0x75, 0x34, 0x19, 0x7a, 0x21, 0x8f, 0x7d, 0xce, 0x24, 0x67, 0xc2, 0x3f, 0x3a, 0x0e, 0x52, 0xff, + 0xad, 0x9f, 0xfd, 0xc3, 0x32, 0xc5, 0x72, 0xb8, 0xa4, 0xff, 0x5f, 0x0f, 0x7e, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x69, 0x73, 0x3f, 0xd2, 0x0c, 0x05, 0x00, 0x00, +} + +func (m *Assertion) 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 *Assertion) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assertion) 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 = encodeVarintState(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x2a + } + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[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] = 0x22 + } + } + if len(m.Credential) > 0 { + i -= len(m.Credential) + copy(dAtA[i:], m.Credential) + i = encodeVarintState(dAtA, i, uint64(len(m.Credential))) + i-- + dAtA[i] = 0x1a + } + if len(m.KeyType) > 0 { + i -= len(m.KeyType) + copy(dAtA[i:], m.KeyType) + i = encodeVarintState(dAtA, i, uint64(len(m.KeyType))) + 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 *Attestation) Marshal() (dAtA []byte, err error) { @@ -495,10 +668,10 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintState(dAtA, i, uint64(len(m.PublicKey))) + if len(m.PublicKeyMultibase) > 0 { + i -= len(m.PublicKeyMultibase) + copy(dAtA[i:], m.PublicKeyMultibase) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyMultibase))) i-- dAtA[i] = 0x1a } @@ -542,12 +715,31 @@ func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.ChannelId != 0 { i = encodeVarintState(dAtA, i, uint64(m.ChannelId)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x40 } - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintState(dAtA, i, uint64(len(m.PublicKey))) + if len(m.PublicKeyJwks) > 0 { + for k := range m.PublicKeyJwks { + v := m.PublicKeyJwks[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] = 0x3a + } + } + if len(m.PublicKeyMultibase) > 0 { + i -= len(m.PublicKeyMultibase) + copy(dAtA[i:], m.PublicKeyMultibase) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyMultibase))) i-- dAtA[i] = 0x32 } @@ -651,6 +843,39 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *Assertion) 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.KeyType) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Credential) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v))) + n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) + } + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + return n +} + func (m *Attestation) Size() (n int) { if m == nil { return 0 @@ -694,7 +919,7 @@ func (m *Controller) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.PublicKey) + l = len(m.PublicKeyMultibase) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -735,10 +960,18 @@ func (m *Delegation) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.PublicKey) + l = len(m.PublicKeyMultibase) if l > 0 { n += 1 + l + sovState(uint64(l)) } + if len(m.PublicKeyJwks) > 0 { + for k, v := range m.PublicKeyJwks { + _ = 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.ChannelId != 0 { n += 1 + sovState(uint64(m.ChannelId)) } @@ -776,6 +1009,313 @@ func sovState(x uint64) (n int) { func sozState(x uint64) (n int) { return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *Assertion) 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: Assertion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Assertion: 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 KeyType", 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.KeyType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credential", 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.Credential = append(m.Credential[:0], dAtA[iNdEx:postIndex]...) + if m.Credential == nil { + m.Credential = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata == nil { + m.Metadata = 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.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 5: + 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 + 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 *Attestation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1081,9 +1621,9 @@ func (m *Controller) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1093,25 +1633,23 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } + m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -1391,9 +1929,9 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1403,27 +1941,152 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } + m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyJwks", 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.PublicKeyJwks == nil { + m.PublicKeyJwks = 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.PublicKeyJwks[mapkey] = mapvalue + iNdEx = postIndex + case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) }