diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index 5a7d36468..2b828873f 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -9,156 +9,6 @@ import ( ormerrors "cosmossdk.io/orm/types/ormerrors" ) -type AliasesTable interface { - Insert(ctx context.Context, aliases *Aliases) error - Update(ctx context.Context, aliases *Aliases) error - Save(ctx context.Context, aliases *Aliases) error - Delete(ctx context.Context, aliases *Aliases) 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) (*Aliases, error) - HasBySubject(ctx context.Context, subject string) (found bool, err error) - // GetBySubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetBySubject(ctx context.Context, subject string) (*Aliases, error) - List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) - ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) - DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error - DeleteRange(ctx context.Context, from, to AliasesIndexKey) error - - doNotImplement() -} - -type AliasesIterator struct { - ormtable.Iterator -} - -func (i AliasesIterator) Value() (*Aliases, error) { - var aliases Aliases - err := i.UnmarshalMessage(&aliases) - return &aliases, err -} - -type AliasesIndexKey interface { - id() uint32 - values() []interface{} - aliasesIndexKey() -} - -// primary key starting index.. -type AliasesPrimaryKey = AliasesIdIndexKey - -type AliasesIdIndexKey struct { - vs []interface{} -} - -func (x AliasesIdIndexKey) id() uint32 { return 0 } -func (x AliasesIdIndexKey) values() []interface{} { return x.vs } -func (x AliasesIdIndexKey) aliasesIndexKey() {} - -func (this AliasesIdIndexKey) WithId(id string) AliasesIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type AliasesSubjectIndexKey struct { - vs []interface{} -} - -func (x AliasesSubjectIndexKey) id() uint32 { return 1 } -func (x AliasesSubjectIndexKey) values() []interface{} { return x.vs } -func (x AliasesSubjectIndexKey) aliasesIndexKey() {} - -func (this AliasesSubjectIndexKey) WithSubject(subject string) AliasesSubjectIndexKey { - this.vs = []interface{}{subject} - return this -} - -type aliasesTable struct { - table ormtable.Table -} - -func (this aliasesTable) Insert(ctx context.Context, aliases *Aliases) error { - return this.table.Insert(ctx, aliases) -} - -func (this aliasesTable) Update(ctx context.Context, aliases *Aliases) error { - return this.table.Update(ctx, aliases) -} - -func (this aliasesTable) Save(ctx context.Context, aliases *Aliases) error { - return this.table.Save(ctx, aliases) -} - -func (this aliasesTable) Delete(ctx context.Context, aliases *Aliases) error { - return this.table.Delete(ctx, aliases) -} - -func (this aliasesTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this aliasesTable) Get(ctx context.Context, id string) (*Aliases, error) { - var aliases Aliases - found, err := this.table.PrimaryKey().Get(ctx, &aliases, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &aliases, nil -} - -func (this aliasesTable) HasBySubject(ctx context.Context, subject string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - subject, - ) -} - -func (this aliasesTable) GetBySubject(ctx context.Context, subject string) (*Aliases, error) { - var aliases Aliases - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &aliases, - subject, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &aliases, nil -} - -func (this aliasesTable) List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return AliasesIterator{it}, err -} - -func (this aliasesTable) ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return AliasesIterator{it}, err -} - -func (this aliasesTable) DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this aliasesTable) DeleteRange(ctx context.Context, from, to AliasesIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this aliasesTable) doNotImplement() {} - -var _ AliasesTable = aliasesTable{} - -func NewAliasesTable(db ormtable.Schema) (AliasesTable, error) { - table := db.GetTable(&Aliases{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Aliases{}).ProtoReflect().Descriptor().FullName())) - } - return aliasesTable{table}, nil -} - type AssertionTable interface { Insert(ctx context.Context, assertion *Assertion) error Update(ctx context.Context, assertion *Assertion) error @@ -281,6 +131,9 @@ type AttestationTable interface { Has(ctx context.Context, id string) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. Get(ctx context.Context, id string) (*Attestation, error) + HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) + // GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error @@ -321,6 +174,24 @@ func (this AttestationIdIndexKey) WithId(id string) AttestationIdIndexKey { return this } +type AttestationSubjectOriginIndexKey struct { + vs []interface{} +} + +func (x AttestationSubjectOriginIndexKey) id() uint32 { return 1 } +func (x AttestationSubjectOriginIndexKey) values() []interface{} { return x.vs } +func (x AttestationSubjectOriginIndexKey) attestationIndexKey() {} + +func (this AttestationSubjectOriginIndexKey) WithSubject(subject string) AttestationSubjectOriginIndexKey { + this.vs = []interface{}{subject} + return this +} + +func (this AttestationSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AttestationSubjectOriginIndexKey { + this.vs = []interface{}{subject, origin} + return this +} + type attestationTable struct { table ormtable.Table } @@ -357,6 +228,28 @@ func (this attestationTable) Get(ctx context.Context, id string) (*Attestation, return &attestation, nil } +func (this attestationTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + subject, + origin, + ) +} + +func (this attestationTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error) { + var attestation Attestation + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &attestation, + subject, + origin, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &attestation, nil +} + func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) return AttestationIterator{it}, err @@ -730,7 +623,6 @@ func NewServiceTable(db ormtable.Schema) (ServiceTable, error) { } type StateStore interface { - AliasesTable() AliasesTable AssertionTable() AssertionTable AttestationTable() AttestationTable ControllerTable() ControllerTable @@ -741,7 +633,6 @@ type StateStore interface { } type stateStore struct { - aliases AliasesTable assertion AssertionTable attestation AttestationTable controller ControllerTable @@ -749,10 +640,6 @@ type stateStore struct { service ServiceTable } -func (x stateStore) AliasesTable() AliasesTable { - return x.aliases -} - func (x stateStore) AssertionTable() AssertionTable { return x.assertion } @@ -778,11 +665,6 @@ func (stateStore) doNotImplement() {} var _ StateStore = stateStore{} func NewStateStore(db ormtable.Schema) (StateStore, error) { - aliasesTable, err := NewAliasesTable(db) - if err != nil { - return nil, err - } - assertionTable, err := NewAssertionTable(db) if err != nil { return nil, err @@ -809,7 +691,6 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { } return stateStore{ - aliasesTable, assertionTable, attestationTable, controllerTable, diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index b35c4df2a..54f783844 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -14,666 +14,6 @@ import ( sync "sync" ) -var ( - md_Aliases protoreflect.MessageDescriptor - fd_Aliases_id protoreflect.FieldDescriptor - fd_Aliases_origin protoreflect.FieldDescriptor - fd_Aliases_subject protoreflect.FieldDescriptor - fd_Aliases_controller protoreflect.FieldDescriptor - fd_Aliases_expiration protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_Aliases = File_did_v1_state_proto.Messages().ByName("Aliases") - fd_Aliases_id = md_Aliases.Fields().ByName("id") - fd_Aliases_origin = md_Aliases.Fields().ByName("origin") - fd_Aliases_subject = md_Aliases.Fields().ByName("subject") - fd_Aliases_controller = md_Aliases.Fields().ByName("controller") - fd_Aliases_expiration = md_Aliases.Fields().ByName("expiration") -} - -var _ protoreflect.Message = (*fastReflection_Aliases)(nil) - -type fastReflection_Aliases Aliases - -func (x *Aliases) ProtoReflect() protoreflect.Message { - return (*fastReflection_Aliases)(x) -} - -func (x *Aliases) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Aliases_messageType fastReflection_Aliases_messageType -var _ protoreflect.MessageType = fastReflection_Aliases_messageType{} - -type fastReflection_Aliases_messageType struct{} - -func (x fastReflection_Aliases_messageType) Zero() protoreflect.Message { - return (*fastReflection_Aliases)(nil) -} -func (x fastReflection_Aliases_messageType) New() protoreflect.Message { - return new(fastReflection_Aliases) -} -func (x fastReflection_Aliases_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Aliases -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Aliases) Descriptor() protoreflect.MessageDescriptor { - return md_Aliases -} - -// 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_Aliases) Type() protoreflect.MessageType { - return _fastReflection_Aliases_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Aliases) New() protoreflect.Message { - return new(fastReflection_Aliases) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Aliases) Interface() protoreflect.ProtoMessage { - return (*Aliases)(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_Aliases) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Aliases_id, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Aliases_origin, value) { - return - } - } - if x.Subject != "" { - value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Aliases_subject, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Aliases_controller, value) { - return - } - } - if x.Expiration != uint64(0) { - value := protoreflect.ValueOfUint64(x.Expiration) - if !f(fd_Aliases_expiration, 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_Aliases) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Aliases.id": - return x.Id != "" - case "did.v1.Aliases.origin": - return x.Origin != "" - case "did.v1.Aliases.subject": - return x.Subject != "" - case "did.v1.Aliases.controller": - return x.Controller != "" - case "did.v1.Aliases.expiration": - return x.Expiration != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) - } - panic(fmt.Errorf("message did.v1.Aliases 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_Aliases) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Aliases.id": - x.Id = "" - case "did.v1.Aliases.origin": - x.Origin = "" - case "did.v1.Aliases.subject": - x.Subject = "" - case "did.v1.Aliases.controller": - x.Controller = "" - case "did.v1.Aliases.expiration": - x.Expiration = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) - } - panic(fmt.Errorf("message did.v1.Aliases 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_Aliases) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Aliases.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Aliases.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.Aliases.subject": - value := x.Subject - return protoreflect.ValueOfString(value) - case "did.v1.Aliases.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - case "did.v1.Aliases.expiration": - value := x.Expiration - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) - } - panic(fmt.Errorf("message did.v1.Aliases 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_Aliases) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Aliases.id": - x.Id = value.Interface().(string) - case "did.v1.Aliases.origin": - x.Origin = value.Interface().(string) - case "did.v1.Aliases.subject": - x.Subject = value.Interface().(string) - case "did.v1.Aliases.controller": - x.Controller = value.Interface().(string) - case "did.v1.Aliases.expiration": - x.Expiration = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) - } - panic(fmt.Errorf("message did.v1.Aliases 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_Aliases) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Aliases.id": - panic(fmt.Errorf("field id of message did.v1.Aliases is not mutable")) - case "did.v1.Aliases.origin": - panic(fmt.Errorf("field origin of message did.v1.Aliases is not mutable")) - case "did.v1.Aliases.subject": - panic(fmt.Errorf("field subject of message did.v1.Aliases is not mutable")) - case "did.v1.Aliases.controller": - panic(fmt.Errorf("field controller of message did.v1.Aliases is not mutable")) - case "did.v1.Aliases.expiration": - panic(fmt.Errorf("field expiration of message did.v1.Aliases is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) - } - panic(fmt.Errorf("message did.v1.Aliases 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_Aliases) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Aliases.id": - return protoreflect.ValueOfString("") - case "did.v1.Aliases.origin": - return protoreflect.ValueOfString("") - case "did.v1.Aliases.subject": - return protoreflect.ValueOfString("") - case "did.v1.Aliases.controller": - return protoreflect.ValueOfString("") - case "did.v1.Aliases.expiration": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) - } - panic(fmt.Errorf("message did.v1.Aliases 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_Aliases) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Aliases", 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_Aliases) 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_Aliases) 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_Aliases) 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_Aliases) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Aliases) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Subject) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Expiration != 0 { - n += 1 + runtime.Sov(uint64(x.Expiration)) - } - 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().(*Aliases) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Expiration != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Expiration)) - i-- - dAtA[i] = 0x28 - } - if len(x.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) - i-- - dAtA[i] = 0x22 - } - if len(x.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) - i-- - dAtA[i] = 0x1a - } - if len(x.Origin) > 0 { - i -= len(x.Origin) - copy(dAtA[i:], x.Origin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) - i-- - dAtA[i] = 0x12 - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Aliases) - 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: Aliases: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Aliases: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - x.Expiration = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Expiration |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_Assertion protoreflect.MessageDescriptor fd_Assertion_id protoreflect.FieldDescriptor @@ -702,7 +42,7 @@ func (x *Assertion) ProtoReflect() protoreflect.Message { } func (x *Assertion) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[1] + mi := &file_did_v1_state_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1387,6 +727,8 @@ var ( fd_Attestation_id protoreflect.FieldDescriptor fd_Attestation_controller protoreflect.FieldDescriptor fd_Attestation_public_key protoreflect.FieldDescriptor + fd_Attestation_origin protoreflect.FieldDescriptor + fd_Attestation_subject protoreflect.FieldDescriptor fd_Attestation_metadata protoreflect.FieldDescriptor ) @@ -1396,6 +738,8 @@ func init() { fd_Attestation_id = md_Attestation.Fields().ByName("id") fd_Attestation_controller = md_Attestation.Fields().ByName("controller") fd_Attestation_public_key = md_Attestation.Fields().ByName("public_key") + fd_Attestation_origin = md_Attestation.Fields().ByName("origin") + fd_Attestation_subject = md_Attestation.Fields().ByName("subject") fd_Attestation_metadata = md_Attestation.Fields().ByName("metadata") } @@ -1408,7 +752,7 @@ func (x *Attestation) ProtoReflect() protoreflect.Message { } func (x *Attestation) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[2] + mi := &file_did_v1_state_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1482,6 +826,18 @@ func (x *fastReflection_Attestation) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Attestation_origin, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Attestation_subject, value) { + return + } + } if x.Metadata != nil { value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) if !f(fd_Attestation_metadata, value) { @@ -1509,6 +865,10 @@ func (x *fastReflection_Attestation) Has(fd protoreflect.FieldDescriptor) bool { return x.Controller != "" case "did.v1.Attestation.public_key": return x.PublicKey != nil + case "did.v1.Attestation.origin": + return x.Origin != "" + case "did.v1.Attestation.subject": + return x.Subject != "" case "did.v1.Attestation.metadata": return x.Metadata != nil default: @@ -1533,6 +893,10 @@ func (x *fastReflection_Attestation) Clear(fd protoreflect.FieldDescriptor) { x.Controller = "" case "did.v1.Attestation.public_key": x.PublicKey = nil + case "did.v1.Attestation.origin": + x.Origin = "" + case "did.v1.Attestation.subject": + x.Subject = "" case "did.v1.Attestation.metadata": x.Metadata = nil default: @@ -1560,6 +924,12 @@ func (x *fastReflection_Attestation) Get(descriptor protoreflect.FieldDescriptor case "did.v1.Attestation.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Attestation.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.Attestation.subject": + value := x.Subject + return protoreflect.ValueOfString(value) case "did.v1.Attestation.metadata": value := x.Metadata return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -1589,6 +959,10 @@ func (x *fastReflection_Attestation) Set(fd protoreflect.FieldDescriptor, value x.Controller = value.Interface().(string) case "did.v1.Attestation.public_key": x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Attestation.origin": + x.Origin = value.Interface().(string) + case "did.v1.Attestation.subject": + x.Subject = value.Interface().(string) case "did.v1.Attestation.metadata": x.Metadata = value.Message().Interface().(*Metadata) default: @@ -1625,6 +999,10 @@ func (x *fastReflection_Attestation) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field id of message did.v1.Attestation is not mutable")) case "did.v1.Attestation.controller": panic(fmt.Errorf("field controller of message did.v1.Attestation is not mutable")) + case "did.v1.Attestation.origin": + panic(fmt.Errorf("field origin of message did.v1.Attestation is not mutable")) + case "did.v1.Attestation.subject": + panic(fmt.Errorf("field subject of message did.v1.Attestation is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) @@ -1645,6 +1023,10 @@ func (x *fastReflection_Attestation) NewField(fd protoreflect.FieldDescriptor) p case "did.v1.Attestation.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Attestation.origin": + return protoreflect.ValueOfString("") + case "did.v1.Attestation.subject": + return protoreflect.ValueOfString("") case "did.v1.Attestation.metadata": m := new(Metadata) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -1729,6 +1111,14 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { l = options.Size(x.PublicKey) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.Metadata != nil { l = options.Size(x.Metadata) n += 1 + l + runtime.Sov(uint64(l)) @@ -1774,6 +1164,20 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- + dAtA[i] = 0x32 + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x2a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- dAtA[i] = 0x22 } if x.PublicKey != nil { @@ -1954,6 +1358,70 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { } iNdEx = postIndex case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -2050,7 +1518,7 @@ func (x *Controller) ProtoReflect() protoreflect.Message { } func (x *Controller) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2677,7 +2145,7 @@ func (x *Delegation) ProtoReflect() protoreflect.Message { } func (x *Delegation) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[4] + mi := &file_did_v1_state_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3390,7 +2858,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { } func (x *Service) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4286,79 +3754,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Aliases represents the `alsoKnownAs` property associated with a DID Controller -type Aliases struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The unique identifier of the alias - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Origin is the Alias provider - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - // Subject is the user defined alias - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - // Controller of the alias - Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` - // Expiration of the alias - Expiration uint64 `protobuf:"varint,5,opt,name=expiration,proto3" json:"expiration,omitempty"` -} - -func (x *Aliases) Reset() { - *x = Aliases{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Aliases) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Aliases) ProtoMessage() {} - -// Deprecated: Use Aliases.ProtoReflect.Descriptor instead. -func (*Aliases) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{0} -} - -func (x *Aliases) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Aliases) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *Aliases) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -func (x *Aliases) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *Aliases) GetExpiration() uint64 { - if x != nil { - return x.Expiration - } - return 0 -} - // Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) type Assertion struct { state protoimpl.MessageState @@ -4380,7 +3775,7 @@ type Assertion struct { func (x *Assertion) Reset() { *x = Assertion{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[1] + mi := &file_did_v1_state_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4394,7 +3789,7 @@ func (*Assertion) ProtoMessage() {} // Deprecated: Use Assertion.ProtoReflect.Descriptor instead. func (*Assertion) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{1} + return file_did_v1_state_proto_rawDescGZIP(), []int{0} } func (x *Assertion) GetId() string { @@ -4444,14 +3839,18 @@ type Attestation struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The value of the linked identifier PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The origin of the attestation + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // The subject of the attestation + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The controller of the attestation - Metadata *Metadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *Attestation) Reset() { *x = Attestation{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[2] + mi := &file_did_v1_state_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4465,7 +3864,7 @@ func (*Attestation) ProtoMessage() {} // Deprecated: Use Attestation.ProtoReflect.Descriptor instead. func (*Attestation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{2} + return file_did_v1_state_proto_rawDescGZIP(), []int{1} } func (x *Attestation) GetId() string { @@ -4489,6 +3888,20 @@ func (x *Attestation) GetPublicKey() *PubKey { return nil } +func (x *Attestation) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Attestation) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + func (x *Attestation) GetMetadata() *Metadata { if x != nil { return x.Metadata @@ -4515,7 +3928,7 @@ type Controller struct { func (x *Controller) Reset() { *x = Controller{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4529,7 +3942,7 @@ func (*Controller) ProtoMessage() {} // Deprecated: Use Controller.ProtoReflect.Descriptor instead. func (*Controller) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{3} + return file_did_v1_state_proto_rawDescGZIP(), []int{2} } func (x *Controller) GetId() string { @@ -4579,7 +3992,7 @@ type Delegation struct { func (x *Delegation) Reset() { *x = Delegation{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[4] + mi := &file_did_v1_state_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4593,7 +4006,7 @@ func (*Delegation) ProtoMessage() {} // Deprecated: Use Delegation.ProtoReflect.Descriptor instead. func (*Delegation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{4} + return file_did_v1_state_proto_rawDescGZIP(), []int{3} } func (x *Delegation) GetId() string { @@ -4647,7 +4060,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4661,7 +4074,7 @@ func (*Service) ProtoMessage() {} // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{5} + return file_did_v1_state_proto_rawDescGZIP(), []int{4} } func (x *Service) GetId() string { @@ -4715,91 +4128,85 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xaa, 0x01, 0x0a, 0x07, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, - 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1e, - 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x1d, - 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x17, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0xcd, 0x01, - 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, - 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0e, 0xf2, - 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x22, 0xaa, 0x01, - 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, - 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x22, 0x92, 0x01, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x3a, - 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x22, - 0x9f, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, + 0x22, 0xcd, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x22, - 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, - 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x05, 0x22, 0xe2, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, - 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x44, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x06, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, - 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2d, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x22, 0xf2, 0x01, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, + 0x24, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x1e, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, + 0x01, 0x18, 0x01, 0x18, 0x02, 0x22, 0x92, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, + 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, + 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x22, 0x9f, 0x01, 0x0a, 0x0a, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x2d, 0x0a, + 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x3a, 0x0e, 0xf2, 0x9e, + 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x22, 0xe2, 0x02, 0x0a, + 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x44, + 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x69, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, 0x72, + 0x69, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x15, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x3a, 0x0e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x08, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x05, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, + 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, + 0x2f, 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 ( @@ -4814,28 +4221,27 @@ func file_did_v1_state_proto_rawDescGZIP() []byte { return file_did_v1_state_proto_rawDescData } -var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_did_v1_state_proto_goTypes = []interface{}{ - (*Aliases)(nil), // 0: did.v1.Aliases - (*Assertion)(nil), // 1: did.v1.Assertion - (*Attestation)(nil), // 2: did.v1.Attestation - (*Controller)(nil), // 3: did.v1.Controller - (*Delegation)(nil), // 4: did.v1.Delegation - (*Service)(nil), // 5: did.v1.Service - nil, // 6: did.v1.Service.ServiceEndpointsEntry - (*PubKey)(nil), // 7: did.v1.PubKey - (*Metadata)(nil), // 8: did.v1.Metadata - (*Permissions)(nil), // 9: did.v1.Permissions + (*Assertion)(nil), // 0: did.v1.Assertion + (*Attestation)(nil), // 1: did.v1.Attestation + (*Controller)(nil), // 2: did.v1.Controller + (*Delegation)(nil), // 3: did.v1.Delegation + (*Service)(nil), // 4: did.v1.Service + nil, // 5: did.v1.Service.ServiceEndpointsEntry + (*PubKey)(nil), // 6: did.v1.PubKey + (*Metadata)(nil), // 7: did.v1.Metadata + (*Permissions)(nil), // 8: did.v1.Permissions } var file_did_v1_state_proto_depIdxs = []int32{ - 7, // 0: did.v1.Assertion.public_key:type_name -> did.v1.PubKey - 8, // 1: did.v1.Assertion.metadata:type_name -> did.v1.Metadata - 7, // 2: did.v1.Attestation.public_key:type_name -> did.v1.PubKey - 8, // 3: did.v1.Attestation.metadata:type_name -> did.v1.Metadata - 7, // 4: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 7, // 5: did.v1.Delegation.public_key:type_name -> did.v1.PubKey - 6, // 6: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry - 9, // 7: did.v1.Service.permissions:type_name -> did.v1.Permissions + 6, // 0: did.v1.Assertion.public_key:type_name -> did.v1.PubKey + 7, // 1: did.v1.Assertion.metadata:type_name -> did.v1.Metadata + 6, // 2: did.v1.Attestation.public_key:type_name -> did.v1.PubKey + 7, // 3: did.v1.Attestation.metadata:type_name -> did.v1.Metadata + 6, // 4: did.v1.Controller.public_key:type_name -> did.v1.PubKey + 6, // 5: did.v1.Delegation.public_key:type_name -> did.v1.PubKey + 5, // 6: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry + 8, // 7: did.v1.Service.permissions:type_name -> did.v1.Permissions 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name @@ -4852,18 +4258,6 @@ func file_did_v1_state_proto_init() { file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Aliases); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Assertion); i { case 0: return &v.state @@ -4875,7 +4269,7 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Attestation); i { case 0: return &v.state @@ -4887,7 +4281,7 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Controller); i { case 0: return &v.state @@ -4899,7 +4293,7 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Delegation); i { case 0: return &v.state @@ -4911,7 +4305,7 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service); i { case 0: return &v.state @@ -4930,7 +4324,7 @@ func file_did_v1_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_state_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index bf68371b1..2ab347b73 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -1,40 +1,17 @@ syntax = "proto3"; package did.v1; + option go_package = "github.com/onsonr/hway/x/did/types"; import "cosmos/orm/v1/orm.proto"; import "did/v1/genesis.proto"; import "did/v1/models.proto"; -// Aliases represents the `alsoKnownAs` property associated with a DID Controller -message Aliases { - option (cosmos.orm.v1.table) = { - id: 1 - primary_key: {fields: "id"} - index: { id: 1, fields: "subject", unique: true } - }; - - // The unique identifier of the alias - string id = 1; - - // Origin is the Alias provider - string origin = 2; - - // Subject is the user defined alias - string subject = 3; - - // Controller of the alias - string controller = 4; - - // Expiration of the alias - uint64 expiration = 5; -} - // Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) message Assertion { option (cosmos.orm.v1.table) = { - id: 2 + id: 1 primary_key: {fields: "id"} }; @@ -57,8 +34,9 @@ message Assertion { // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) message Attestation { option (cosmos.orm.v1.table) = { - id: 3 + id: 2 primary_key: {fields: "id"} + index: { id: 1, fields: "subject,origin", unique: true } }; // The unique identifier of the attestation @@ -70,15 +48,21 @@ message Attestation { // The value of the linked identifier PubKey public_key = 3; + // The origin of the attestation + string origin = 4; + + // The subject of the attestation + string subject = 5; + // The controller of the attestation - Metadata metadata = 4; + Metadata metadata = 6; } // Controller represents a Sonr DWN Vault message Controller { option (cosmos.orm.v1.table) = { - id: 4 + id: 3 primary_key: {fields: "id"} }; @@ -98,7 +82,7 @@ message Controller { // Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC) message Delegation { option (cosmos.orm.v1.table) = { - id: 5 + id: 4 primary_key: {fields: "id"} }; @@ -118,7 +102,7 @@ message Delegation { // Service represents a service in a DID Document message Service { option (cosmos.orm.v1.table) = { - id: 6 + id: 5 primary_key: {fields: "id"} }; diff --git a/x/did/keeper/accounts.go b/x/did/keeper/accounts.go index b55569d4a..4a13e387d 100644 --- a/x/did/keeper/accounts.go +++ b/x/did/keeper/accounts.go @@ -1 +1,9 @@ package keeper + +// deriveAccount is used to derive a wallet account using bip32 +func (k Keeper) deriveAccount() { +} + +// insertAccount places an Account into the did module orm as a Delegation +func (k Keeper) insertAccount() { +} diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index 985683f43..abddda968 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -23,88 +23,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Aliases represents the `alsoKnownAs` property associated with a DID Controller -type Aliases struct { - // The unique identifier of the alias - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Origin is the Alias provider - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - // Subject is the user defined alias - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - // Controller of the alias - Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` - // Expiration of the alias - Expiration uint64 `protobuf:"varint,5,opt,name=expiration,proto3" json:"expiration,omitempty"` -} - -func (m *Aliases) Reset() { *m = Aliases{} } -func (m *Aliases) String() string { return proto.CompactTextString(m) } -func (*Aliases) ProtoMessage() {} -func (*Aliases) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{0} -} -func (m *Aliases) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Aliases) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Aliases.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 *Aliases) XXX_Merge(src proto.Message) { - xxx_messageInfo_Aliases.Merge(m, src) -} -func (m *Aliases) XXX_Size() int { - return m.Size() -} -func (m *Aliases) XXX_DiscardUnknown() { - xxx_messageInfo_Aliases.DiscardUnknown(m) -} - -var xxx_messageInfo_Aliases proto.InternalMessageInfo - -func (m *Aliases) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Aliases) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *Aliases) GetSubject() string { - if m != nil { - return m.Subject - } - return "" -} - -func (m *Aliases) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Aliases) GetExpiration() uint64 { - if m != nil { - return m.Expiration - } - return 0 -} - // Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) type Assertion struct { // The unique identifier of the attestation @@ -123,7 +41,7 @@ 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{1} + return fileDescriptor_f44bb702879c34b4, []int{0} } func (m *Assertion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -195,15 +113,19 @@ type Attestation struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The value of the linked identifier PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The origin of the attestation + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // The subject of the attestation + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The controller of the attestation - Metadata *Metadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *Attestation) Reset() { *m = Attestation{} } func (m *Attestation) String() string { return proto.CompactTextString(m) } func (*Attestation) ProtoMessage() {} func (*Attestation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{2} + return fileDescriptor_f44bb702879c34b4, []int{1} } func (m *Attestation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,6 +175,20 @@ func (m *Attestation) GetPublicKey() *PubKey { return nil } +func (m *Attestation) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *Attestation) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + func (m *Attestation) GetMetadata() *Metadata { if m != nil { return m.Metadata @@ -276,7 +212,7 @@ func (m *Controller) Reset() { *m = Controller{} } func (m *Controller) String() string { return proto.CompactTextString(m) } func (*Controller) ProtoMessage() {} func (*Controller) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{3} + return fileDescriptor_f44bb702879c34b4, []int{2} } func (m *Controller) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +285,7 @@ func (m *Delegation) Reset() { *m = Delegation{} } func (m *Delegation) String() string { return proto.CompactTextString(m) } func (*Delegation) ProtoMessage() {} func (*Delegation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{4} + return fileDescriptor_f44bb702879c34b4, []int{3} } func (m *Delegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -426,7 +362,7 @@ func (m *Service) Reset() { *m = Service{} } func (m *Service) String() string { return proto.CompactTextString(m) } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{5} + return fileDescriptor_f44bb702879c34b4, []int{4} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +434,6 @@ func (m *Service) GetPermissions() *Permissions { } func init() { - proto.RegisterType((*Aliases)(nil), "did.v1.Aliases") proto.RegisterType((*Assertion)(nil), "did.v1.Assertion") proto.RegisterType((*Attestation)(nil), "did.v1.Attestation") proto.RegisterType((*Controller)(nil), "did.v1.Controller") @@ -510,104 +445,46 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0xcf, 0x6e, 0xd3, 0x4a, - 0x14, 0xc6, 0x3b, 0xf9, 0xdb, 0x1c, 0x37, 0x51, 0xee, 0xb4, 0xf7, 0xd6, 0xea, 0x55, 0xad, 0x62, - 0x54, 0xa9, 0x0b, 0x88, 0xd5, 0x22, 0x24, 0x54, 0xb1, 0x29, 0x6d, 0x17, 0x55, 0x85, 0x84, 0x0c, - 0x6c, 0xd8, 0x58, 0x8e, 0x67, 0x9a, 0x0e, 0xd8, 0x33, 0xd6, 0xcc, 0x38, 0xd4, 0x2f, 0x81, 0x10, - 0x0f, 0x00, 0x7b, 0x9e, 0x84, 0x0d, 0x52, 0x25, 0x36, 0x2c, 0x51, 0xfa, 0x06, 0x3c, 0x01, 0xf2, - 0xbf, 0x24, 0xa4, 0x48, 0xa8, 0x2c, 0x58, 0x25, 0xe7, 0x3b, 0x5f, 0x72, 0x7e, 0xe7, 0xb3, 0x67, - 0x00, 0x13, 0x46, 0x9c, 0xf1, 0xae, 0xa3, 0xb4, 0xaf, 0xe9, 0x20, 0x96, 0x42, 0x0b, 0xdc, 0x22, - 0x8c, 0x0c, 0xc6, 0xbb, 0x1b, 0xeb, 0x81, 0x50, 0x91, 0x50, 0x8e, 0x90, 0x51, 0x66, 0x11, 0x32, - 0x2a, 0x0c, 0x1b, 0x6b, 0xe5, 0x8f, 0x46, 0x94, 0x53, 0xc5, 0x54, 0xa9, 0xae, 0x96, 0x6a, 0x24, - 0x08, 0x0d, 0x4b, 0xd1, 0xfe, 0x88, 0xa0, 0x7d, 0x10, 0x32, 0x5f, 0x51, 0x85, 0x7b, 0x50, 0x63, - 0xc4, 0x44, 0x5b, 0x68, 0xa7, 0xe3, 0xd6, 0x18, 0xc1, 0xff, 0x41, 0x4b, 0x48, 0x36, 0x62, 0xdc, - 0xac, 0xe5, 0x5a, 0x59, 0x61, 0x13, 0xda, 0x2a, 0x19, 0xbe, 0xa4, 0x81, 0x36, 0xeb, 0x79, 0xa3, - 0x2a, 0xb1, 0x05, 0x10, 0x08, 0xae, 0xa5, 0x08, 0x43, 0x2a, 0xcd, 0x46, 0xde, 0x9c, 0x53, 0xb2, - 0x3e, 0xbd, 0x88, 0x99, 0xf4, 0x35, 0x13, 0xdc, 0x6c, 0x6e, 0xa1, 0x9d, 0x86, 0x3b, 0xa7, 0xec, - 0x6f, 0x7e, 0x7f, 0xff, 0xe5, 0x4d, 0x7d, 0x1d, 0x1a, 0x19, 0x09, 0xee, 0x4e, 0xe7, 0xf4, 0x91, - 0x89, 0x4c, 0x64, 0x7f, 0x46, 0xd0, 0x39, 0x50, 0x8a, 0xca, 0xcc, 0x7c, 0x0d, 0xf7, 0xe7, 0xe1, - 0xb5, 0x6b, 0xc3, 0xef, 0x02, 0xc4, 0xc9, 0x30, 0x64, 0x81, 0xf7, 0x8a, 0xa6, 0x39, 0xb9, 0xb1, - 0xd7, 0x1b, 0x14, 0x59, 0x0e, 0x9e, 0x24, 0xc3, 0x53, 0x9a, 0xba, 0x9d, 0xc2, 0x71, 0x4a, 0x53, - 0x7c, 0x1b, 0xba, 0x81, 0xa4, 0x84, 0x72, 0xcd, 0xfc, 0xd0, 0x63, 0x24, 0x5f, 0x67, 0xc5, 0x5d, - 0x99, 0x89, 0x27, 0x04, 0xdf, 0x81, 0xe5, 0x88, 0x6a, 0x9f, 0xf8, 0xda, 0xcf, 0xd7, 0x31, 0xf6, - 0xfa, 0xd5, 0x3f, 0x3e, 0x2e, 0x75, 0x77, 0xea, 0xd8, 0xef, 0xe5, 0xeb, 0x2d, 0x17, 0xeb, 0x99, - 0xb5, 0x2c, 0x7c, 0xe3, 0x40, 0x6b, 0x9a, 0x3d, 0xdc, 0xbf, 0xb0, 0xd1, 0x3c, 0x6c, 0xe3, 0x86, - 0xb0, 0x75, 0xfb, 0x1d, 0x02, 0x38, 0x9c, 0xcd, 0x5e, 0x64, 0x35, 0xa1, 0xed, 0x13, 0x22, 0xa9, - 0x52, 0x25, 0x68, 0x55, 0x2e, 0x50, 0x36, 0x7e, 0x47, 0xf9, 0x3f, 0x74, 0xc6, 0x7e, 0x12, 0x6a, - 0x2f, 0x60, 0x24, 0xcf, 0xb4, 0xe3, 0x2e, 0xe7, 0xc2, 0x21, 0x23, 0x0b, 0x50, 0x0d, 0xfb, 0x03, - 0x02, 0x38, 0xa2, 0x21, 0x1d, 0xfd, 0x59, 0x80, 0x36, 0x74, 0x83, 0x73, 0x9f, 0x71, 0x8f, 0xf1, - 0x33, 0x91, 0x3d, 0xe3, 0xe2, 0x7d, 0x36, 0x72, 0xf1, 0x84, 0x9f, 0x89, 0x13, 0x72, 0x43, 0xfc, - 0x05, 0xc2, 0xa6, 0x3d, 0xa9, 0x41, 0xfb, 0x29, 0x95, 0x63, 0x16, 0xd0, 0x6b, 0x78, 0xb7, 0x60, - 0x45, 0x15, 0x2d, 0x4f, 0xa7, 0x31, 0x2d, 0x01, 0x8d, 0x52, 0x7b, 0x96, 0xc6, 0x14, 0x6f, 0x43, - 0x6f, 0xc6, 0xeb, 0x91, 0x29, 0x62, 0x77, 0xa6, 0x1e, 0x31, 0x82, 0x37, 0x01, 0x8a, 0xc3, 0xe9, - 0x25, 0x92, 0x95, 0x07, 0xaf, 0x53, 0x28, 0xcf, 0x25, 0xc3, 0x2e, 0xfc, 0x53, 0x0d, 0xa2, 0x9c, - 0xc4, 0x82, 0x71, 0xad, 0xcc, 0xe6, 0x56, 0x7d, 0xc7, 0xd8, 0xdb, 0xae, 0x56, 0x29, 0x21, 0xab, - 0xcf, 0xe3, 0xca, 0x77, 0xcc, 0xb5, 0x4c, 0xdd, 0xbe, 0x5a, 0x90, 0xf1, 0x7d, 0x30, 0x62, 0x2a, - 0x23, 0xa6, 0x14, 0x13, 0x5c, 0x99, 0xad, 0x3c, 0x98, 0xd5, 0x69, 0x30, 0xb3, 0x96, 0x3b, 0xef, - 0xdb, 0x38, 0x84, 0x7f, 0x7f, 0x39, 0x01, 0xf7, 0xa1, 0x9e, 0x05, 0x5c, 0xa4, 0x93, 0x7d, 0xc5, - 0x6b, 0xd0, 0x1c, 0xfb, 0x61, 0x52, 0xe5, 0x52, 0x14, 0xfb, 0xb5, 0x07, 0x68, 0x21, 0xe4, 0xd6, - 0xa3, 0x87, 0x9f, 0x26, 0x16, 0xba, 0x9c, 0x58, 0xe8, 0xdb, 0xc4, 0x42, 0x6f, 0xaf, 0xac, 0xa5, - 0xcb, 0x2b, 0x6b, 0xe9, 0xeb, 0x95, 0xb5, 0xf4, 0xc2, 0x1e, 0x31, 0x7d, 0x9e, 0x0c, 0x07, 0x81, - 0x88, 0x1c, 0xc1, 0x95, 0xe0, 0xd2, 0x39, 0x7f, 0xed, 0xa7, 0xce, 0x85, 0x93, 0xdd, 0x86, 0x59, - 0xea, 0x6a, 0xd8, 0xca, 0xaf, 0xc2, 0x7b, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x4a, 0x67, - 0x3c, 0x6c, 0x05, 0x00, 0x00, -} - -func (m *Aliases) 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 *Aliases) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Aliases) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expiration != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Expiration)) - i-- - dAtA[i] = 0x28 - } - 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] = 0x22 - } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) - i-- - dAtA[i] = 0x1a - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 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 + // 613 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x3b, 0xfb, 0xaf, 0xcd, 0xbb, 0xed, 0xb2, 0x4e, 0xab, 0x86, 0x8a, 0x61, 0x8d, 0x16, + 0xf6, 0x50, 0x37, 0xb4, 0x22, 0x48, 0xf1, 0x52, 0xdb, 0x1e, 0x4a, 0x11, 0x24, 0xea, 0xc5, 0x4b, + 0xc8, 0x66, 0xa6, 0xdb, 0xd1, 0x64, 0x66, 0x99, 0x99, 0xac, 0xe6, 0x4b, 0x88, 0xf8, 0x01, 0xf4, + 0xeb, 0x78, 0x11, 0x0a, 0x5e, 0x3c, 0xca, 0xf6, 0x1b, 0xf4, 0x13, 0x48, 0x92, 0x49, 0xb7, 0xae, + 0x42, 0xd1, 0x83, 0xa7, 0xdd, 0xf7, 0xc9, 0x93, 0x99, 0xe7, 0xf7, 0xcc, 0x10, 0xc0, 0x84, 0x11, + 0x6f, 0xb2, 0xe5, 0x29, 0x1d, 0x6a, 0x3a, 0x18, 0x4b, 0xa1, 0x05, 0x6e, 0x11, 0x46, 0x06, 0x93, + 0xad, 0xf5, 0x9b, 0x91, 0x50, 0x89, 0x50, 0x9e, 0x90, 0x49, 0x6e, 0x11, 0x32, 0x29, 0x0d, 0xeb, + 0x6b, 0xe6, 0xa5, 0x11, 0xe5, 0x54, 0x31, 0x65, 0xd4, 0x55, 0xa3, 0x26, 0x82, 0xd0, 0xd8, 0x88, + 0xee, 0x57, 0x04, 0xd6, 0xae, 0x52, 0x54, 0x6a, 0x26, 0x38, 0xee, 0x40, 0x8d, 0x11, 0x1b, 0xf5, + 0x50, 0xdf, 0xf2, 0x6b, 0x8c, 0x60, 0x07, 0x20, 0x12, 0x5c, 0x4b, 0x11, 0xc7, 0x54, 0xda, 0xb5, + 0x42, 0xbf, 0xa4, 0xe0, 0xfb, 0x00, 0xe3, 0x74, 0x18, 0xb3, 0x28, 0x78, 0x43, 0x33, 0xbb, 0xde, + 0x43, 0xfd, 0xf6, 0x76, 0x67, 0x50, 0xc6, 0x1b, 0x3c, 0x4b, 0x87, 0x47, 0x34, 0xf3, 0xad, 0xd2, + 0x71, 0x44, 0x33, 0x7c, 0x17, 0x56, 0x22, 0x49, 0x09, 0xe5, 0x9a, 0x85, 0x71, 0xc0, 0x88, 0xdd, + 0xe8, 0xa1, 0xfe, 0xb2, 0xbf, 0x3c, 0x13, 0x0f, 0x09, 0xde, 0x84, 0xa5, 0x84, 0xea, 0x90, 0x84, + 0x3a, 0xb4, 0x9b, 0xc5, 0x8a, 0xdd, 0x6a, 0xc5, 0xa7, 0x46, 0xf7, 0x2f, 0x1c, 0x3b, 0x9d, 0xf3, + 0x4f, 0xdf, 0xde, 0xd7, 0x97, 0xa0, 0x51, 0x26, 0x77, 0xcf, 0x11, 0xb4, 0x77, 0xb5, 0xa6, 0x79, + 0x5f, 0xff, 0x81, 0xe8, 0x06, 0xb4, 0x84, 0x64, 0x23, 0xc6, 0x0b, 0x14, 0xcb, 0x37, 0x13, 0xb6, + 0x61, 0x51, 0xa5, 0xc3, 0xd7, 0x34, 0xd2, 0x05, 0x83, 0xe5, 0x57, 0xe3, 0x2f, 0x78, 0xad, 0x2b, + 0xf1, 0xee, 0x15, 0x78, 0x4e, 0x89, 0x87, 0xd7, 0xa0, 0x63, 0x96, 0xd9, 0x2c, 0xf7, 0xe9, 0x22, + 0x1b, 0xd9, 0x35, 0xf7, 0x23, 0x02, 0xd8, 0x9b, 0x31, 0xcc, 0x33, 0xdb, 0xb0, 0x18, 0x12, 0x22, + 0xa9, 0x52, 0x06, 0xb8, 0x1a, 0xe7, 0x68, 0x1b, 0x57, 0xd1, 0xde, 0x02, 0x6b, 0x12, 0xa6, 0xb1, + 0x0e, 0x22, 0x46, 0x0c, 0xd7, 0x52, 0x21, 0xec, 0x31, 0x32, 0x77, 0x12, 0x75, 0xf7, 0x33, 0x02, + 0xd8, 0xa7, 0x31, 0x1d, 0xfd, 0xdb, 0x41, 0xb8, 0xb0, 0x12, 0x9d, 0x84, 0x8c, 0x07, 0x8c, 0x1f, + 0x8b, 0xfc, 0xae, 0xd4, 0x0b, 0x4b, 0xbb, 0x10, 0x0f, 0xf9, 0xb1, 0x38, 0x24, 0x7f, 0x19, 0x7f, + 0x2e, 0x61, 0xc3, 0x9d, 0xd6, 0x60, 0xf1, 0x39, 0x95, 0x13, 0x16, 0xd1, 0xdf, 0xe2, 0xdd, 0x81, + 0x65, 0x55, 0x3e, 0x0a, 0x74, 0x36, 0xa6, 0x26, 0x60, 0xdb, 0x68, 0x2f, 0xb2, 0x31, 0xc5, 0x1b, + 0xd0, 0x99, 0xe5, 0x0d, 0xc8, 0x45, 0xc4, 0x95, 0x99, 0xba, 0xcf, 0x08, 0xbe, 0x0d, 0x50, 0x1e, + 0x56, 0x90, 0x4a, 0x66, 0xae, 0x89, 0x55, 0x2a, 0x2f, 0x25, 0xc3, 0x3e, 0x5c, 0xab, 0x36, 0xa2, + 0x9c, 0x8c, 0x05, 0xe3, 0x5a, 0xd9, 0xcd, 0x5e, 0xbd, 0xdf, 0xde, 0xde, 0xa8, 0x50, 0x4c, 0xc8, + 0xea, 0xf7, 0xa0, 0xf2, 0x1d, 0x70, 0x2d, 0x33, 0xbf, 0xab, 0xe6, 0x64, 0xfc, 0x10, 0xda, 0x63, + 0x2a, 0x13, 0xa6, 0x14, 0x13, 0x5c, 0x99, 0x6b, 0xb6, 0x7a, 0x51, 0xcc, 0xec, 0x91, 0x7f, 0xd9, + 0xb7, 0xbe, 0x07, 0xd7, 0xff, 0xb8, 0x03, 0xee, 0x42, 0x3d, 0x2f, 0xb8, 0x6c, 0x27, 0xff, 0x8b, + 0xd7, 0xa0, 0x39, 0x09, 0xe3, 0xb4, 0xea, 0xa5, 0x1c, 0x76, 0x6a, 0x8f, 0xd0, 0x5c, 0xc9, 0xcd, + 0x27, 0x8f, 0xbf, 0x4c, 0x1d, 0x74, 0x3a, 0x75, 0xd0, 0x8f, 0xa9, 0x83, 0x3e, 0x9c, 0x39, 0x0b, + 0xa7, 0x67, 0xce, 0xc2, 0xf7, 0x33, 0x67, 0xe1, 0x95, 0x3b, 0x62, 0xfa, 0x24, 0x1d, 0x0e, 0x22, + 0x91, 0x78, 0x82, 0x2b, 0xc1, 0xa5, 0x77, 0xf2, 0x36, 0xcc, 0xbc, 0x77, 0x5e, 0xfe, 0xa1, 0xca, + 0x5b, 0x57, 0xc3, 0x56, 0xf1, 0x95, 0x7a, 0xf0, 0x33, 0x00, 0x00, 0xff, 0xff, 0x13, 0xa6, 0x96, + 0x2c, 0x07, 0x05, 0x00, 0x00, } func (m *Assertion) Marshal() (dAtA []byte, err error) { @@ -708,6 +585,20 @@ func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintState(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x32 + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x2a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) + i-- dAtA[i] = 0x22 } if m.PublicKey != nil { @@ -944,34 +835,6 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Aliases) 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.Origin) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Subject) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - if m.Expiration != 0 { - n += 1 + sovState(uint64(m.Expiration)) - } - return n -} - func (m *Assertion) Size() (n int) { if m == nil { return 0 @@ -1019,6 +882,14 @@ func (m *Attestation) Size() (n int) { l = m.PublicKey.Size() n += 1 + l + sovState(uint64(l)) } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovState(uint64(l)) @@ -1119,203 +990,6 @@ func sovState(x uint64) (n int) { func sozState(x uint64) (n int) { return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Aliases) 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: Aliases: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Aliases: 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 Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - m.Expiration = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Expiration |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *Assertion) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1666,6 +1340,70 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", 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.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) }