(no commit message provided)

This commit is contained in:
Prad Nukala 2024-07-06 03:02:45 -04:00 committed by Prad Nukala (aider)
parent 775150830f
commit e127d70584
10 changed files with 3047 additions and 1312 deletions

View File

@ -11,6 +11,7 @@ import (
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io" io "io"
reflect "reflect" reflect "reflect"
sort "sort"
sync "sync" 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 ( var (
md_VerificationMethod protoreflect.MessageDescriptor md_VerificationMethod protoreflect.MessageDescriptor
fd_VerificationMethod_id protoreflect.FieldDescriptor fd_VerificationMethod_id protoreflect.FieldDescriptor
fd_VerificationMethod_controller protoreflect.FieldDescriptor fd_VerificationMethod_controller protoreflect.FieldDescriptor
fd_VerificationMethod_public_key protoreflect.FieldDescriptor fd_VerificationMethod_public_key_multibase protoreflect.FieldDescriptor
fd_VerificationMethod_public_key_jwks protoreflect.FieldDescriptor
) )
func init() { func init() {
@ -1080,7 +1164,8 @@ func init() {
md_VerificationMethod = File_did_v1_account_proto.Messages().ByName("VerificationMethod") md_VerificationMethod = File_did_v1_account_proto.Messages().ByName("VerificationMethod")
fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id") fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id")
fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller") 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) var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil)
@ -1160,9 +1245,15 @@ func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescr
return return
} }
} }
if x.PublicKey != nil { if x.PublicKeyMultibase != "" {
value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) value := protoreflect.ValueOfString(x.PublicKeyMultibase)
if !f(fd_VerificationMethod_public_key, value) { 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 return
} }
} }
@ -1185,8 +1276,10 @@ func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor)
return x.Id != "" return x.Id != ""
case "did.v1.VerificationMethod.controller": case "did.v1.VerificationMethod.controller":
return x.Controller != "" return x.Controller != ""
case "did.v1.VerificationMethod.public_key": case "did.v1.VerificationMethod.public_key_multibase":
return x.PublicKey != nil return x.PublicKeyMultibase != ""
case "did.v1.VerificationMethod.public_key_jwks":
return len(x.PublicKeyJwks) != 0
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
@ -1207,8 +1300,10 @@ func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescripto
x.Id = "" x.Id = ""
case "did.v1.VerificationMethod.controller": case "did.v1.VerificationMethod.controller":
x.Controller = "" x.Controller = ""
case "did.v1.VerificationMethod.public_key": case "did.v1.VerificationMethod.public_key_multibase":
x.PublicKey = nil x.PublicKeyMultibase = ""
case "did.v1.VerificationMethod.public_key_jwks":
x.PublicKeyJwks = nil
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
@ -1231,9 +1326,15 @@ func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDes
case "did.v1.VerificationMethod.controller": case "did.v1.VerificationMethod.controller":
value := x.Controller value := x.Controller
return protoreflect.ValueOfString(value) return protoreflect.ValueOfString(value)
case "did.v1.VerificationMethod.public_key": case "did.v1.VerificationMethod.public_key_multibase":
value := x.PublicKey value := x.PublicKeyMultibase
return protoreflect.ValueOfMessage(value.ProtoReflect()) 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: default:
if descriptor.IsExtension() { if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
@ -1258,8 +1359,12 @@ func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor,
x.Id = value.Interface().(string) x.Id = value.Interface().(string)
case "did.v1.VerificationMethod.controller": case "did.v1.VerificationMethod.controller":
x.Controller = value.Interface().(string) x.Controller = value.Interface().(string)
case "did.v1.VerificationMethod.public_key": case "did.v1.VerificationMethod.public_key_multibase":
x.PublicKey = value.Message().Interface().(*PublicKey) 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: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
@ -1280,15 +1385,18 @@ func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor,
// Mutable is a mutating operation and unsafe for concurrent use. // Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() { switch fd.FullName() {
case "did.v1.VerificationMethod.public_key": case "did.v1.VerificationMethod.public_key_jwks":
if x.PublicKey == nil { if x.PublicKeyJwks == nil {
x.PublicKey = new(PublicKey) 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": case "did.v1.VerificationMethod.id":
panic(fmt.Errorf("field id of message did.v1.VerificationMethod is not mutable")) panic(fmt.Errorf("field id of message did.v1.VerificationMethod is not mutable"))
case "did.v1.VerificationMethod.controller": case "did.v1.VerificationMethod.controller":
panic(fmt.Errorf("field controller of message did.v1.VerificationMethod is not mutable")) 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: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
@ -1306,9 +1414,11 @@ func (x *fastReflection_VerificationMethod) NewField(fd protoreflect.FieldDescri
return protoreflect.ValueOfString("") return protoreflect.ValueOfString("")
case "did.v1.VerificationMethod.controller": case "did.v1.VerificationMethod.controller":
return protoreflect.ValueOfString("") return protoreflect.ValueOfString("")
case "did.v1.VerificationMethod.public_key": case "did.v1.VerificationMethod.public_key_multibase":
m := new(PublicKey) return protoreflect.ValueOfString("")
return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.VerificationMethod.public_key_jwks":
m := make(map[string]string)
return protoreflect.ValueOfMap(&_VerificationMethod_4_map{m: &m})
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
@ -1386,10 +1496,31 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
if l > 0 { if l > 0 {
n += 1 + l + runtime.Sov(uint64(l)) n += 1 + l + runtime.Sov(uint64(l))
} }
if x.PublicKey != nil { l = len(x.PublicKeyMultibase)
l = options.Size(x.PublicKey) if l > 0 {
n += 1 + l + runtime.Sov(uint64(l)) 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 { if x.unknownFields != nil {
n += len(x.unknownFields) n += len(x.unknownFields)
} }
@ -1419,17 +1550,53 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
i -= len(x.unknownFields) i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields) copy(dAtA[i:], x.unknownFields)
} }
if x.PublicKey != nil { if len(x.PublicKeyJwks) > 0 {
encoded, err := options.Marshal(x.PublicKey) MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) {
if err != nil { baseI := i
return protoiface.MarshalOutput{ i -= len(v)
NoUnkeyedLiterals: input.NoUnkeyedLiterals, copy(dAtA[i:], v)
Buf: input.Buf, i = runtime.EncodeVarint(dAtA, i, uint64(len(v)))
}, err 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) if options.Deterministic {
copy(dAtA[i:], encoded) keysForPublicKeyJwks := make([]string, 0, len(x.PublicKeyJwks))
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) 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-- i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
} }
@ -1562,7 +1729,39 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
iNdEx = postIndex iNdEx = postIndex
case 3: case 3:
if wireType != 2 { 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 var msglen int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1589,12 +1788,103 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
if postIndex > l { if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
} }
if x.PublicKey == nil { if x.PublicKeyJwks == nil {
x.PublicKey = &PublicKey{} x.PublicKeyJwks = make(map[string]string)
} }
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { 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 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 iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
@ -1731,7 +2021,10 @@ type VerificationMethod struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,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"` 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"` // 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() { func (x *VerificationMethod) Reset() {
@ -1768,9 +2061,16 @@ func (x *VerificationMethod) GetController() string {
return "" return ""
} }
func (x *VerificationMethod) GetPublicKey() *PublicKey { func (x *VerificationMethod) GetPublicKeyMultibase() string {
if x != nil { 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 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, 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, 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, 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, 0x22, 0x8f, 0x02, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74,
0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f,
0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c,
0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65,
0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65,
0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x70, 0x75,
0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x04, 0x20,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72,
0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e,
0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74,
0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b,
0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x73, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77,
0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (
@ -1833,15 +2143,15 @@ func file_did_v1_account_proto_rawDescGZIP() []byte {
return file_did_v1_account_proto_rawDescData 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{}{ var file_did_v1_account_proto_goTypes = []interface{}{
(*DIDDocument)(nil), // 0: did.v1.DIDDocument (*DIDDocument)(nil), // 0: did.v1.DIDDocument
(*VerificationMethod)(nil), // 1: did.v1.VerificationMethod (*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{ var file_did_v1_account_proto_depIdxs = []int32{
1, // 0: did.v1.DIDDocument.verification_methods:type_name -> did.v1.VerificationMethod 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 output_type
2, // [2:2] is the sub-list for method input_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 type_name
@ -1887,7 +2197,7 @@ func file_did_v1_account_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_did_v1_account_proto_rawDesc, RawDescriptor: file_did_v1_account_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 2, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -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. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.0 // protoc-gen-go v1.27.0
@ -1801,61 +1251,6 @@ func (x *Params) GetEncryptionRewardRate() float64 {
return 0 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 protoreflect.FileDescriptor
var file_did_v1_genesis_proto_rawDesc = []byte{ 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, 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, 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, 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, 0x61, 0x6d, 0x73, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69,
0x03, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x3a, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58,
0x24, 0x98, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x75, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c,
0x62, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x79, 0x92, 0xe7, 0xb0, 0x2a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56,
0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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 ( var (
@ -1912,11 +1300,10 @@ func file_did_v1_genesis_proto_rawDescGZIP() []byte {
return file_did_v1_genesis_proto_rawDescData 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{}{ var file_did_v1_genesis_proto_goTypes = []interface{}{
(*GenesisState)(nil), // 0: did.v1.GenesisState (*GenesisState)(nil), // 0: did.v1.GenesisState
(*Params)(nil), // 1: did.v1.Params (*Params)(nil), // 1: did.v1.Params
(*PublicKey)(nil), // 2: did.v1.PublicKey
} }
var file_did_v1_genesis_proto_depIdxs = []int32{ var file_did_v1_genesis_proto_depIdxs = []int32{
1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params
@ -1957,18 +1344,6 @@ func file_did_v1_genesis_proto_init() {
return nil 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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -1976,7 +1351,7 @@ func file_did_v1_genesis_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_did_v1_genesis_proto_rawDesc, RawDescriptor: file_did_v1_genesis_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 3, NumMessages: 2,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -9,6 +9,120 @@ import (
ormerrors "cosmossdk.io/orm/types/ormerrors" 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 { type AttestationTable interface {
Insert(ctx context.Context, attestation *Attestation) error Insert(ctx context.Context, attestation *Attestation) error
Update(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 { type StateStore interface {
AssertionTable() AssertionTable
AttestationTable() AttestationTable AttestationTable() AttestationTable
ControllerTable() ControllerTable ControllerTable() ControllerTable
DelegationTable() DelegationTable DelegationTable() DelegationTable
@ -475,12 +590,17 @@ type StateStore interface {
} }
type stateStore struct { type stateStore struct {
assertion AssertionTable
attestation AttestationTable attestation AttestationTable
controller ControllerTable controller ControllerTable
delegation DelegationTable delegation DelegationTable
service ServiceTable service ServiceTable
} }
func (x stateStore) AssertionTable() AssertionTable {
return x.assertion
}
func (x stateStore) AttestationTable() AttestationTable { func (x stateStore) AttestationTable() AttestationTable {
return x.attestation return x.attestation
} }
@ -502,6 +622,11 @@ func (stateStore) doNotImplement() {}
var _ StateStore = stateStore{} var _ StateStore = stateStore{}
func NewStateStore(db ormtable.Schema) (StateStore, error) { func NewStateStore(db ormtable.Schema) (StateStore, error) {
assertionTable, err := NewAssertionTable(db)
if err != nil {
return nil, err
}
attestationTable, err := NewAttestationTable(db) attestationTable, err := NewAttestationTable(db)
if err != nil { if err != nil {
return nil, err return nil, err
@ -523,6 +648,7 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
} }
return stateStore{ return stateStore{
assertionTable,
attestationTable, attestationTable,
controllerTable, controllerTable,
delegationTable, delegationTable,

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,12 @@ message DIDDocument {
message VerificationMethod { message VerificationMethod {
string id = 1; string id = 1;
string controller = 2; 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<string, string> public_key_jwks = 4;
} }

View File

@ -30,18 +30,4 @@ message Params {
double encryption_reward_rate = 5; 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;
}

View File

@ -6,6 +6,30 @@ option go_package = "github.com/onsonr/hway/x/did/types";
import "cosmos/orm/v1/orm.proto"; import "cosmos/orm/v1/orm.proto";
import "did/v1/genesis.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<string, string> metadata = 4;
// The controller of the attestation
string controller = 5;
}
// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
message Attestation { message Attestation {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
@ -29,6 +53,7 @@ message Attestation {
string controller = 5; string controller = 5;
} }
// Controller represents a Sonr DWN Vault // Controller represents a Sonr DWN Vault
message Controller { message Controller {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
@ -43,7 +68,7 @@ message Controller {
string did = 2; string did = 2;
// The public key of the controller // The public key of the controller
bytes public_key = 3; string public_key_multibase = 3;
// The vault address or identifier // The vault address or identifier
string vault_cid = 4; string vault_cid = 4;
@ -75,10 +100,13 @@ message Delegation {
string controller_did = 5; string controller_did = 5;
// The delegation proof or verification method // 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<string, string> public_key_jwks = 7;
// IBC Channel ID // IBC Channel ID
uint64 channel_id = 7; uint64 channel_id = 8;
} }
// Service represents a service in a DID Document // Service represents a service in a DID Document

View File

@ -5,18 +5,21 @@ package types
import ( import (
fmt "fmt" fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits" 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. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
@ -40,9 +43,11 @@ func (*DIDDocument) ProtoMessage() {}
func (*DIDDocument) Descriptor() ([]byte, []int) { func (*DIDDocument) Descriptor() ([]byte, []int) {
return fileDescriptor_f1c7ebf7d0ca3c72, []int{0} return fileDescriptor_f1c7ebf7d0ca3c72, []int{0}
} }
func (m *DIDDocument) XXX_Unmarshal(b []byte) error { func (m *DIDDocument) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
} }
func (m *DIDDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *DIDDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic { if deterministic {
return xxx_messageInfo_DIDDocument.Marshal(b, m, 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 return b[:n], nil
} }
} }
func (m *DIDDocument) XXX_Merge(src proto.Message) { func (m *DIDDocument) XXX_Merge(src proto.Message) {
xxx_messageInfo_DIDDocument.Merge(m, src) xxx_messageInfo_DIDDocument.Merge(m, src)
} }
func (m *DIDDocument) XXX_Size() int { func (m *DIDDocument) XXX_Size() int {
return m.Size() return m.Size()
} }
func (m *DIDDocument) XXX_DiscardUnknown() { func (m *DIDDocument) XXX_DiscardUnknown() {
xxx_messageInfo_DIDDocument.DiscardUnknown(m) xxx_messageInfo_DIDDocument.DiscardUnknown(m)
} }
@ -113,7 +121,10 @@ func (m *DIDDocument) GetCapabilityInvocation() []string {
type VerificationMethod struct { type VerificationMethod struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,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"` 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"` // 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{} } func (m *VerificationMethod) Reset() { *m = VerificationMethod{} }
@ -122,9 +133,11 @@ func (*VerificationMethod) ProtoMessage() {}
func (*VerificationMethod) Descriptor() ([]byte, []int) { func (*VerificationMethod) Descriptor() ([]byte, []int) {
return fileDescriptor_f1c7ebf7d0ca3c72, []int{1} return fileDescriptor_f1c7ebf7d0ca3c72, []int{1}
} }
func (m *VerificationMethod) XXX_Unmarshal(b []byte) error { func (m *VerificationMethod) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
} }
func (m *VerificationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *VerificationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic { if deterministic {
return xxx_messageInfo_VerificationMethod.Marshal(b, m, 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 return b[:n], nil
} }
} }
func (m *VerificationMethod) XXX_Merge(src proto.Message) { func (m *VerificationMethod) XXX_Merge(src proto.Message) {
xxx_messageInfo_VerificationMethod.Merge(m, src) xxx_messageInfo_VerificationMethod.Merge(m, src)
} }
func (m *VerificationMethod) XXX_Size() int { func (m *VerificationMethod) XXX_Size() int {
return m.Size() return m.Size()
} }
func (m *VerificationMethod) XXX_DiscardUnknown() { func (m *VerificationMethod) XXX_DiscardUnknown() {
xxx_messageInfo_VerificationMethod.DiscardUnknown(m) xxx_messageInfo_VerificationMethod.DiscardUnknown(m)
} }
@ -163,9 +179,16 @@ func (m *VerificationMethod) GetController() string {
return "" return ""
} }
func (m *VerificationMethod) GetPublicKey() *PublicKey { func (m *VerificationMethod) GetPublicKeyMultibase() string {
if m != nil { 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 return nil
} }
@ -173,36 +196,41 @@ func (m *VerificationMethod) GetPublicKey() *PublicKey {
func init() { func init() {
proto.RegisterType((*DIDDocument)(nil), "did.v1.DIDDocument") proto.RegisterType((*DIDDocument)(nil), "did.v1.DIDDocument")
proto.RegisterType((*VerificationMethod)(nil), "did.v1.VerificationMethod") 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) } func init() { proto.RegisterFile("did/v1/account.proto", fileDescriptor_f1c7ebf7d0ca3c72) }
var fileDescriptor_f1c7ebf7d0ca3c72 = []byte{ var fileDescriptor_f1c7ebf7d0ca3c72 = []byte{
// 374 bytes of a gzipped FileDescriptorProto // 440 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xb1, 0x8e, 0x9b, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0x8e, 0xd3, 0x40,
0x10, 0x86, 0x0d, 0x4e, 0x9c, 0x78, 0x2d, 0x39, 0xc9, 0x86, 0x48, 0xc4, 0x05, 0x42, 0x2e, 0x22, 0x10, 0x86, 0x63, 0x87, 0x3b, 0xb8, 0x8d, 0xb8, 0x3b, 0x2d, 0x46, 0x32, 0x29, 0xac, 0x28, 0x05,
0xd2, 0x40, 0x6c, 0xb7, 0xa9, 0x22, 0x1a, 0x2b, 0xb2, 0x14, 0x51, 0xa4, 0x48, 0x83, 0x60, 0x77, 0x0a, 0x05, 0x36, 0x77, 0xd7, 0x20, 0x44, 0x81, 0x50, 0x28, 0x0e, 0x14, 0x09, 0x45, 0x82, 0x82,
0x03, 0xab, 0x83, 0x1d, 0xc4, 0x2e, 0xdc, 0xf1, 0x16, 0xf7, 0x1a, 0xf7, 0x26, 0x57, 0xba, 0xbc, 0xc6, 0x5a, 0xaf, 0x07, 0x67, 0x89, 0xbd, 0x63, 0x79, 0xd7, 0x0e, 0x7e, 0x0a, 0x78,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, 0x5e, 0x7a, 0x1b, 0x35, 0xde, 0x9d, 0x77, 0x38, 0xb6, 0xea, 0x9d, 0xd4, 0x59, 0x39, 0x7f, 0x98, 0xb6, 0xd9, 0xf0, 0x0d, 0xa1, 0x5d, 0x13, 0xbd, 0x24,
0x6a, 0x0a, 0x26, 0xe3, 0x51, 0x7b, 0xe8, 0xd5, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x30, 0x7a, 0xfd, 0x25, 0x94, 0x4d, 0x3f, 0xbb, 0x23, 0xb5, 0xc8, 0x49, 0xc1, 0xe2, 0x1c, 0x9a, 0x5e, 0xea,
0x87, 0xb1, 0x4f, 0x02, 0x00, 0x00, 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) { func (m *DIDDocument) Marshal() (dAtA []byte, err error) {
@ -305,15 +333,29 @@ func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.PublicKey != nil { if len(m.PublicKeyJwks) > 0 {
{ for k := range m.PublicKeyJwks {
size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) v := m.PublicKeyJwks[k]
if err != nil { baseI := i
return 0, err 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
} }
i -= size
i = encodeVarintAccount(dAtA, i, uint64(size))
} }
if len(m.PublicKeyMultibase) > 0 {
i -= len(m.PublicKeyMultibase)
copy(dAtA[i:], m.PublicKeyMultibase)
i = encodeVarintAccount(dAtA, i, uint64(len(m.PublicKeyMultibase)))
i-- i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
} }
@ -345,6 +387,7 @@ func encodeVarintAccount(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return base return base
} }
func (m *DIDDocument) Size() (n int) { func (m *DIDDocument) Size() (n int) {
if m == nil { if m == nil {
return 0 return 0
@ -402,19 +445,29 @@ func (m *VerificationMethod) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovAccount(uint64(l)) n += 1 + l + sovAccount(uint64(l))
} }
if m.PublicKey != nil { l = len(m.PublicKeyMultibase)
l = m.PublicKey.Size() if l > 0 {
n += 1 + l + sovAccount(uint64(l)) 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 return n
} }
func sovAccount(x uint64) (n int) { func sovAccount(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7 return (math_bits.Len64(x|1) + 6) / 7
} }
func sozAccount(x uint64) (n int) { func sozAccount(x uint64) (n int) {
return sovAccount(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovAccount(uint64((x << 1) ^ uint64((int64(x) >> 63))))
} }
func (m *DIDDocument) Unmarshal(dAtA []byte) error { func (m *DIDDocument) Unmarshal(dAtA []byte) error {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
@ -659,6 +712,7 @@ func (m *DIDDocument) Unmarshal(dAtA []byte) error {
} }
return nil return nil
} }
func (m *VerificationMethod) Unmarshal(dAtA []byte) error { func (m *VerificationMethod) Unmarshal(dAtA []byte) error {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
@ -754,7 +808,39 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error {
iNdEx = postIndex iNdEx = postIndex
case 3: case 3:
if wireType != 2 { 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 var msglen int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -781,12 +867,103 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error {
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
if m.PublicKey == nil { if m.PublicKeyJwks == nil {
m.PublicKey = &PublicKey{} m.PublicKeyJwks = make(map[string]string)
} }
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 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 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 iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
@ -809,6 +986,7 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error {
} }
return nil return nil
} }
func skipAccount(dAtA []byte) (n int, err error) { func skipAccount(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0

View File

@ -143,106 +143,37 @@ func (m *Params) GetEncryptionRewardRate() float64 {
return 0 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() { func init() {
proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState")
proto.RegisterType((*Params)(nil), "did.v1.Params") proto.RegisterType((*Params)(nil), "did.v1.Params")
proto.RegisterType((*PublicKey)(nil), "did.v1.PublicKey")
} }
func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) }
var fileDescriptor_fda181cae44f7c00 = []byte{ var fileDescriptor_fda181cae44f7c00 = []byte{
// 420 bytes of a gzipped FileDescriptorProto // 338 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xb1, 0x6e, 0x14, 0x31, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x31, 0x4f, 0x02, 0x31,
0x10, 0x86, 0xd7, 0xb9, 0x70, 0x70, 0x26, 0x20, 0xe2, 0x1c, 0xb0, 0xa4, 0xd8, 0x3b, 0x9d, 0x28, 0x14, 0xc7, 0xaf, 0x82, 0x97, 0x58, 0x8d, 0x09, 0x05, 0xf5, 0xc2, 0x70, 0x10, 0x26, 0x62, 0xf4,
0x56, 0x11, 0xac, 0x95, 0x40, 0x15, 0xa5, 0x21, 0x0d, 0x05, 0x05, 0xd1, 0x42, 0x45, 0xb3, 0xf2, 0x1a, 0xd0, 0xc9, 0xb0, 0xc8, 0xe2, 0xa8, 0x39, 0x37, 0x97, 0x4b, 0xe1, 0x9a, 0xa3, 0x09, 0xb4,
0x9d, 0x87, 0x3d, 0x6b, 0xf7, 0xd6, 0x96, 0xed, 0x64, 0xf1, 0x2b, 0x50, 0x21, 0x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0x00, 0xff, 0xff, 0xb5, 0xc5, 0x76, 0x33, 0xb9, 0x01,
0x37, 0xb8, 0x17, 0x1a, 0x04, 0xdb, 0x0a, 0xdc, 0xd7, 0xcb, 0xb3, 0x9d, 0x81, 0x77, 0xf9, 0x28, 0x00, 0x00,
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,
} }
func (this *Params) Equal(that interface{}) bool { func (this *Params) Equal(that interface{}) bool {
@ -374,50 +305,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil 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 { func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
offset -= sovGenesis(v) offset -= sovGenesis(v)
base := offset base := offset
@ -467,27 +354,6 @@ func (m *Params) Size() (n int) {
return n 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) { func sovGenesis(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7 return (math_bits.Len64(x|1) + 6) / 7
} }
@ -713,154 +579,6 @@ func (m *Params) Unmarshal(dAtA []byte) error {
} }
return nil 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) { func skipGenesis(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0

View File

@ -23,6 +23,88 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 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) // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
type Attestation struct { type Attestation struct {
// The unique identifier of the attestation // 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 (m *Attestation) String() string { return proto.CompactTextString(m) }
func (*Attestation) ProtoMessage() {} func (*Attestation) ProtoMessage() {}
func (*Attestation) Descriptor() ([]byte, []int) { func (*Attestation) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{0} return fileDescriptor_f44bb702879c34b4, []int{1}
} }
func (m *Attestation) XXX_Unmarshal(b []byte) error { func (m *Attestation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -112,7 +194,7 @@ type Controller struct {
// The DID of the controller // The DID of the controller
Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"`
// The public key of the controller // 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 // The vault address or identifier
VaultCid string `protobuf:"bytes,4,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` VaultCid string `protobuf:"bytes,4,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"`
// Fingerprint is the Accumulator of discrete credential identifiers // 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 (m *Controller) String() string { return proto.CompactTextString(m) }
func (*Controller) ProtoMessage() {} func (*Controller) ProtoMessage() {}
func (*Controller) Descriptor() ([]byte, []int) { func (*Controller) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{1} return fileDescriptor_f44bb702879c34b4, []int{2}
} }
func (m *Controller) XXX_Unmarshal(b []byte) error { func (m *Controller) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -166,11 +248,11 @@ func (m *Controller) GetDid() string {
return "" return ""
} }
func (m *Controller) GetPublicKey() []byte { func (m *Controller) GetPublicKeyMultibase() string {
if m != nil { if m != nil {
return m.PublicKey return m.PublicKeyMultibase
} }
return nil return ""
} }
func (m *Controller) GetVaultCid() string { func (m *Controller) GetVaultCid() string {
@ -200,16 +282,18 @@ type Delegation struct {
// The controller DID // The controller DID
ControllerDid string `protobuf:"bytes,5,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` ControllerDid string `protobuf:"bytes,5,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"`
// The delegation proof or verification method // 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 // 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) Reset() { *m = Delegation{} }
func (m *Delegation) String() string { return proto.CompactTextString(m) } func (m *Delegation) String() string { return proto.CompactTextString(m) }
func (*Delegation) ProtoMessage() {} func (*Delegation) ProtoMessage() {}
func (*Delegation) Descriptor() ([]byte, []int) { func (*Delegation) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{2} return fileDescriptor_f44bb702879c34b4, []int{3}
} }
func (m *Delegation) XXX_Unmarshal(b []byte) error { func (m *Delegation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -273,9 +357,16 @@ func (m *Delegation) GetControllerDid() string {
return "" return ""
} }
func (m *Delegation) GetPublicKey() []byte { func (m *Delegation) GetPublicKeyMultibase() string {
if m != nil { 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 return nil
} }
@ -303,7 +394,7 @@ func (m *Service) Reset() { *m = Service{} }
func (m *Service) String() string { return proto.CompactTextString(m) } func (m *Service) String() string { return proto.CompactTextString(m) }
func (*Service) ProtoMessage() {} func (*Service) ProtoMessage() {}
func (*Service) Descriptor() ([]byte, []int) { func (*Service) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{3} return fileDescriptor_f44bb702879c34b4, []int{4}
} }
func (m *Service) XXX_Unmarshal(b []byte) error { func (m *Service) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -361,46 +452,128 @@ func (m *Service) GetControllerDid() string {
} }
func init() { 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((*Attestation)(nil), "did.v1.Attestation")
proto.RegisterType((*Controller)(nil), "did.v1.Controller") proto.RegisterType((*Controller)(nil), "did.v1.Controller")
proto.RegisterType((*Delegation)(nil), "did.v1.Delegation") proto.RegisterType((*Delegation)(nil), "did.v1.Delegation")
proto.RegisterMapType((map[string]string)(nil), "did.v1.Delegation.PublicKeyJwksEntry")
proto.RegisterType((*Service)(nil), "did.v1.Service") proto.RegisterType((*Service)(nil), "did.v1.Service")
} }
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
var fileDescriptor_f44bb702879c34b4 = []byte{ var fileDescriptor_f44bb702879c34b4 = []byte{
// 475 bytes of a gzipped FileDescriptorProto // 618 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x3f, 0x6f, 0xd3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x6e, 0xd3, 0x40,
0x18, 0xc6, 0x7b, 0x89, 0x9b, 0x3f, 0x6f, 0xd2, 0x50, 0x9d, 0x2a, 0x61, 0x8a, 0xb0, 0x82, 0x11, 0x10, 0x86, 0xeb, 0x38, 0x6d, 0x93, 0x49, 0xd2, 0x56, 0xab, 0x4a, 0x98, 0x20, 0x4c, 0x08, 0xaa,
0x52,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d0, 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) { func (m *Attestation) Marshal() (dAtA []byte, err error) {
@ -495,10 +668,10 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x22 dAtA[i] = 0x22
} }
if len(m.PublicKey) > 0 { if len(m.PublicKeyMultibase) > 0 {
i -= len(m.PublicKey) i -= len(m.PublicKeyMultibase)
copy(dAtA[i:], m.PublicKey) copy(dAtA[i:], m.PublicKeyMultibase)
i = encodeVarintState(dAtA, i, uint64(len(m.PublicKey))) i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyMultibase)))
i-- i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
} }
@ -542,12 +715,31 @@ func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) {
if m.ChannelId != 0 { if m.ChannelId != 0 {
i = encodeVarintState(dAtA, i, uint64(m.ChannelId)) i = encodeVarintState(dAtA, i, uint64(m.ChannelId))
i-- i--
dAtA[i] = 0x38 dAtA[i] = 0x40
} }
if len(m.PublicKey) > 0 { if len(m.PublicKeyJwks) > 0 {
i -= len(m.PublicKey) for k := range m.PublicKeyJwks {
copy(dAtA[i:], m.PublicKey) v := m.PublicKeyJwks[k]
i = encodeVarintState(dAtA, i, uint64(len(m.PublicKey))) 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-- i--
dAtA[i] = 0x32 dAtA[i] = 0x32
} }
@ -651,6 +843,39 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return base 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) { func (m *Attestation) Size() (n int) {
if m == nil { if m == nil {
return 0 return 0
@ -694,7 +919,7 @@ func (m *Controller) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
l = len(m.PublicKey) l = len(m.PublicKeyMultibase)
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
@ -735,10 +960,18 @@ func (m *Delegation) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
l = len(m.PublicKey) l = len(m.PublicKeyMultibase)
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) 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 { if m.ChannelId != 0 {
n += 1 + sovState(uint64(m.ChannelId)) n += 1 + sovState(uint64(m.ChannelId))
} }
@ -776,6 +1009,313 @@ func sovState(x uint64) (n int) {
func sozState(x uint64) (n int) { func sozState(x uint64) (n int) {
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 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 { func (m *Attestation) Unmarshal(dAtA []byte) error {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
@ -1081,9 +1621,9 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
iNdEx = postIndex iNdEx = postIndex
case 3: case 3:
if wireType != 2 { 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 { for shift := uint(0); ; shift += 7 {
if shift >= 64 { if shift >= 64 {
return ErrIntOverflowState return ErrIntOverflowState
@ -1093,25 +1633,23 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
byteLen |= int(b&0x7F) << shift stringLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
} }
if byteLen < 0 { intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthState return ErrInvalidLengthState
} }
postIndex := iNdEx + byteLen postIndex := iNdEx + intStringLen
if postIndex < 0 { if postIndex < 0 {
return ErrInvalidLengthState return ErrInvalidLengthState
} }
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex])
if m.PublicKey == nil {
m.PublicKey = []byte{}
}
iNdEx = postIndex iNdEx = postIndex
case 4: case 4:
if wireType != 2 { if wireType != 2 {
@ -1391,9 +1929,9 @@ func (m *Delegation) Unmarshal(dAtA []byte) error {
iNdEx = postIndex iNdEx = postIndex
case 6: case 6:
if wireType != 2 { 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 { for shift := uint(0); ; shift += 7 {
if shift >= 64 { if shift >= 64 {
return ErrIntOverflowState return ErrIntOverflowState
@ -1403,27 +1941,152 @@ func (m *Delegation) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
byteLen |= int(b&0x7F) << shift stringLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
} }
if byteLen < 0 { intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthState return ErrInvalidLengthState
} }
postIndex := iNdEx + byteLen postIndex := iNdEx + intStringLen
if postIndex < 0 { if postIndex < 0 {
return ErrInvalidLengthState return ErrInvalidLengthState
} }
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex])
if m.PublicKey == nil {
m.PublicKey = []byte{}
}
iNdEx = postIndex iNdEx = postIndex
case 7: 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 { if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType)
} }