From 96e6486c4368b76db8659be0b3ec92a1d0fd0af2 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Thu, 19 Sep 2024 02:04:22 -0400 Subject: [PATCH] feature/migrate models (#16) * feat: add new supported attestation formats to genesis * feat: refactor keyType to keytype enum * refactor: remove unused imports and code * refactor: update main.go to use src package * refactor: move web-related structs from to * refactor: move client middleware package to root * refactor: remove unused IndexedDB dependency * feat: update worker implementation to use * feat: add Caddyfile and Caddy configuration for vault service * refactor(config): move keyshare and address to Motr config * fix: validate service origin in AllocateVault * chore: remove IndexedDB configuration * feat: add support for IPNS-based vault access --- .air.toml | 1 - Makefile | 23 +- api/did/v1/genesis.pulsar.go | 6384 ++++++++--- api/did/v1/models.pulsar.go | 9648 ----------------- api/did/v1/query.pulsar.go | 803 +- api/did/v1/query_grpc.pb.go | 43 - api/did/v1/state.cosmos_orm.go | 304 +- api/did/v1/state.pulsar.go | 1021 +- api/did/v1/tx.pulsar.go | 651 +- caddyfile | 33 + config/caddy/caddy.json | 141 + config/dwn/Config.pkl.go | 6 +- config/dwn/IPFS.pkl.go | 4 +- config/dwn/IndexedDB.pkl.go | 8 - config/dwn/Motr.pkl.go | 10 + config/dwn/Sonr.pkl.go | 10 +- config/dwn/init.pkl.go | 2 +- config/pkl/dwn.pkl | 37 +- config/pkl/orm.pkl | 64 +- config/pkl/txns.pkl | 13 +- config/pkl/web.pkl | 72 + devbox.json | 10 +- go.mod | 11 +- go.sum | 33 +- internal/dwn/dwn.go | 17 - internal/dwn/handlers/{state => }/auth.go | 8 +- internal/dwn/handlers/manifest.go | 1 + internal/dwn/handlers/{state => }/openid.go | 8 +- internal/dwn/handlers/routes.go | 13 +- internal/dwn/handlers/sync/manifest.go | 1 - internal/dwn/handlers/sync/wellknown.go | 1 - internal/dwn/handlers/wellknown.go | 1 + internal/dwn/{wasm => }/main.go | 0 .../dwn/middleware/{browser.go => client.go} | 8 +- .../dwn/middleware/{client => }/headers.go | 2 +- internal/dwn/middleware/jsexc/credentials.go | 3 +- internal/dwn/middleware/jsexc/notifier.go | 6 - internal/dwn/middleware/jsexc/request.go | 37 - internal/dwn/middleware/jsexc/response.go | 50 - internal/dwn/middleware/jsexc/serve.go | 59 - internal/dwn/middleware/jsexc/server.go | 128 + .../middleware/{server.go => middleware.go} | 11 +- .../dwn/middleware/{client => }/session.go | 4 +- internal/dwn/middleware/{client => }/token.go | 2 +- internal/{vfs/models => orm}/Account.pkl.go | 4 +- internal/{vfs/models => orm}/Asset.pkl.go | 4 +- internal/{vfs/models => orm}/Chain.pkl.go | 4 +- .../{vfs/models => orm}/Credential.pkl.go | 8 +- internal/{vfs/models => orm}/Grant.pkl.go | 4 +- internal/orm/JWK.pkl.go | 16 + internal/{vfs/models => orm}/Keyshare.pkl.go | 4 +- .../models/Models.pkl.go => orm/Orm.pkl.go} | 19 +- internal/{vfs/models => orm}/Profile.pkl.go | 4 +- internal/orm/PublicKey.pkl.go | 26 + internal/orm/assettype/AssetType.pkl.go | 46 + .../chains.go => internal/orm/bip44.go | 66 +- .../AuthenticatorSelectionCriteria.pkl.go | 10 + .../browser/Browser.pkl.go} | 16 +- .../PublicKeyCredentialCreationOptions.pkl.go | 22 + .../PublicKeyCredentialDescriptor.pkl.go | 10 + .../PublicKeyCredentialParameters.pkl.go | 8 + .../PublicKeyCredentialRequestOptions.pkl.go | 16 + internal/orm/browser/RpEntity.pkl.go | 10 + internal/{vfs/txns => orm/browser}/SWT.pkl.go | 4 +- internal/orm/browser/UserEntity.pkl.go | 10 + internal/orm/browser/init.pkl.go | 16 + {x/did/builder => internal/orm}/constants.go | 2 +- internal/orm/credential.go | 56 + internal/orm/didmethod/DIDMethod.pkl.go | 52 + internal/orm/init.pkl.go | 17 + internal/orm/jwk.go | 111 + internal/orm/keyalg.go | 22 + internal/orm/keyalgorithm/KeyAlgorithm.pkl.go | 46 + internal/orm/keycurve/KeyCurve.pkl.go | 58 + internal/orm/keyencoding/KeyEncoding.pkl.go | 37 + internal/orm/keyrole/KeyRole.pkl.go | 40 + internal/orm/keysharerole/KeyShareRole.pkl.go | 34 + internal/orm/keytype/KeyType.pkl.go | 55 + .../permissiongrant/PermissionGrant.pkl.go | 46 + .../permissionscope/PermissionScope.pkl.go | 49 + internal/orm/publickey.go | 26 + internal/orm/transactions/Msg.pkl.go | 6 + .../transactions}/MsgDidAllocateVault.pkl.go | 4 +- .../transactions}/MsgDidAuthorize.pkl.go | 4 +- .../transactions}/MsgDidProveWitness.pkl.go | 4 +- .../MsgDidRegisterController.pkl.go | 4 +- .../MsgDidRegisterService.pkl.go | 4 +- .../transactions}/MsgDidSyncVault.pkl.go | 4 +- .../transactions}/MsgDidUpdateParams.pkl.go | 4 +- .../transactions}/MsgGovDeposit.pkl.go | 4 +- .../transactions}/MsgGovSubmitProposal.pkl.go | 4 +- .../transactions}/MsgGovVote.pkl.go | 4 +- .../transactions}/MsgGroupCreateGroup.pkl.go | 4 +- .../MsgGroupSubmitProposal.pkl.go | 4 +- .../transactions}/MsgGroupVote.pkl.go | 4 +- .../MsgStakingBeginRedelegate.pkl.go | 4 +- .../MsgStakingCreateValidator.pkl.go | 4 +- .../transactions}/MsgStakingDelegate.pkl.go | 4 +- .../transactions}/MsgStakingUndelegate.pkl.go | 4 +- .../txns => orm/transactions}/Proposal.pkl.go | 4 +- internal/orm/transactions/Transactions.pkl.go | 36 + .../txns => orm/transactions}/TxBody.pkl.go | 4 +- internal/orm/transactions/init.pkl.go | 27 + internal/vfs/embed.go | 20 +- internal/vfs/models/PublicKey.pkl.go | 6 - internal/vfs/models/init.pkl.go | 16 - internal/vfs/txns/Msg.pkl.go | 6 - internal/vfs/txns/init.pkl.go | 28 - process-compose.yaml | 17 +- proto/did/v1/genesis.proto | 163 +- proto/did/v1/models.proto | 107 - proto/did/v1/query.proto | 7 +- proto/did/v1/state.proto | 66 +- proto/did/v1/tx.proto | 5 +- web/main.go | 16 - web/src/main.go | 25 + web/src/pages/allocate.templ | 20 + web/src/pages/allocate_templ.go | 90 + web/src/pages/home.templ | 30 + web/src/pages/home_templ.go | 154 + web/src/pages/pages.go | 27 + x/did/builder/api.go | 226 - x/did/builder/macroon.go | 48 - x/did/builder/openid.go | 22 - x/did/builder/options.go | 82 - x/did/builder/pubkey.go | 81 - x/did/builder/scopes.go | 56 - x/did/builder/service.go | 103 - x/did/builder/vault.go | 1 - x/did/builder/webauthn.go | 169 - x/did/keeper/context.go | 69 +- x/did/keeper/genesis.go | 34 +- x/did/keeper/ipfs.go | 117 - x/did/keeper/keeper.go | 20 - x/did/keeper/querier.go | 16 +- x/did/keeper/server.go | 60 +- x/did/keeper/vault.go | 86 + x/did/module.go | 10 +- x/did/types/address.go | 1 + x/did/types/codec.go | 163 +- x/did/types/coins.go | 31 - x/did/types/genesis.go | 118 +- x/did/types/genesis.pb.go | 3274 ++++-- x/did/types/models.pb.go | 4717 -------- x/did/types/namespace.go | 102 - x/did/types/perms.go | 36 - x/did/types/pubkey.go | 153 - x/did/types/query.pb.go | 383 +- x/did/types/query.pb.gw.go | 119 - x/did/types/state.pb.go | 517 +- x/did/types/tx.pb.go | 270 +- 151 files changed, 10997 insertions(+), 21705 deletions(-) delete mode 100644 api/did/v1/models.pulsar.go create mode 100644 caddyfile create mode 100644 config/caddy/caddy.json delete mode 100644 config/dwn/IndexedDB.pkl.go create mode 100644 config/dwn/Motr.pkl.go create mode 100644 config/pkl/web.pkl delete mode 100644 internal/dwn/dwn.go rename internal/dwn/handlers/{state => }/auth.go (84%) create mode 100644 internal/dwn/handlers/manifest.go rename internal/dwn/handlers/{state => }/openid.go (70%) delete mode 100644 internal/dwn/handlers/sync/manifest.go delete mode 100644 internal/dwn/handlers/sync/wellknown.go create mode 100644 internal/dwn/handlers/wellknown.go rename internal/dwn/{wasm => }/main.go (100%) rename internal/dwn/middleware/{browser.go => client.go} (74%) rename internal/dwn/middleware/{client => }/headers.go (99%) delete mode 100644 internal/dwn/middleware/jsexc/notifier.go delete mode 100644 internal/dwn/middleware/jsexc/request.go delete mode 100644 internal/dwn/middleware/jsexc/response.go delete mode 100644 internal/dwn/middleware/jsexc/serve.go create mode 100644 internal/dwn/middleware/jsexc/server.go rename internal/dwn/middleware/{server.go => middleware.go} (86%) rename internal/dwn/middleware/{client => }/session.go (92%) rename internal/dwn/middleware/{client => }/token.go (98%) rename internal/{vfs/models => orm}/Account.pkl.go (87%) rename internal/{vfs/models => orm}/Asset.pkl.go (83%) rename internal/{vfs/models => orm}/Chain.pkl.go (81%) rename internal/{vfs/models => orm}/Credential.pkl.go (85%) rename internal/{vfs/models => orm}/Grant.pkl.go (87%) create mode 100644 internal/orm/JWK.pkl.go rename internal/{vfs/models => orm}/Keyshare.pkl.go (81%) rename internal/{vfs/models/Models.pkl.go => orm/Orm.pkl.go} (65%) rename internal/{vfs/models => orm}/Profile.pkl.go (88%) create mode 100644 internal/orm/PublicKey.pkl.go create mode 100644 internal/orm/assettype/AssetType.pkl.go rename x/did/builder/chains.go => internal/orm/bip44.go (54%) create mode 100644 internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go rename internal/{vfs/txns/Txns.pkl.go => orm/browser/Browser.pkl.go} (67%) create mode 100644 internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go create mode 100644 internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go create mode 100644 internal/orm/browser/PublicKeyCredentialParameters.pkl.go create mode 100644 internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go create mode 100644 internal/orm/browser/RpEntity.pkl.go rename internal/{vfs/txns => orm/browser}/SWT.pkl.go (76%) create mode 100644 internal/orm/browser/UserEntity.pkl.go create mode 100644 internal/orm/browser/init.pkl.go rename {x/did/builder => internal/orm}/constants.go (99%) create mode 100644 internal/orm/credential.go create mode 100644 internal/orm/didmethod/DIDMethod.pkl.go create mode 100644 internal/orm/init.pkl.go create mode 100644 internal/orm/jwk.go create mode 100644 internal/orm/keyalg.go create mode 100644 internal/orm/keyalgorithm/KeyAlgorithm.pkl.go create mode 100644 internal/orm/keycurve/KeyCurve.pkl.go create mode 100644 internal/orm/keyencoding/KeyEncoding.pkl.go create mode 100644 internal/orm/keyrole/KeyRole.pkl.go create mode 100644 internal/orm/keysharerole/KeyShareRole.pkl.go create mode 100644 internal/orm/keytype/KeyType.pkl.go create mode 100644 internal/orm/permissiongrant/PermissionGrant.pkl.go create mode 100644 internal/orm/permissionscope/PermissionScope.pkl.go create mode 100644 internal/orm/publickey.go create mode 100644 internal/orm/transactions/Msg.pkl.go rename internal/{vfs/txns => orm/transactions}/MsgDidAllocateVault.pkl.go (90%) rename internal/{vfs/txns => orm/transactions}/MsgDidAuthorize.pkl.go (92%) rename internal/{vfs/txns => orm/transactions}/MsgDidProveWitness.pkl.go (91%) rename internal/{vfs/txns => orm/transactions}/MsgDidRegisterController.pkl.go (93%) rename internal/{vfs/txns => orm/transactions}/MsgDidRegisterService.pkl.go (94%) rename internal/{vfs/txns => orm/transactions}/MsgDidSyncVault.pkl.go (88%) rename internal/{vfs/txns => orm/transactions}/MsgDidUpdateParams.pkl.go (90%) rename internal/{vfs/txns => orm/transactions}/MsgGovDeposit.pkl.go (89%) rename internal/{vfs/txns => orm/transactions}/MsgGovSubmitProposal.pkl.go (91%) rename internal/{vfs/txns => orm/transactions}/MsgGovVote.pkl.go (88%) rename internal/{vfs/txns => orm/transactions}/MsgGroupCreateGroup.pkl.go (90%) rename internal/{vfs/txns => orm/transactions}/MsgGroupSubmitProposal.pkl.go (93%) rename internal/{vfs/txns => orm/transactions}/MsgGroupVote.pkl.go (91%) rename internal/{vfs/txns => orm/transactions}/MsgStakingBeginRedelegate.pkl.go (93%) rename internal/{vfs/txns => orm/transactions}/MsgStakingCreateValidator.pkl.go (95%) rename internal/{vfs/txns => orm/transactions}/MsgStakingDelegate.pkl.go (91%) rename internal/{vfs/txns => orm/transactions}/MsgStakingUndelegate.pkl.go (91%) rename internal/{vfs/txns => orm/transactions}/Proposal.pkl.go (69%) create mode 100644 internal/orm/transactions/Transactions.pkl.go rename internal/{vfs/txns => orm/transactions}/TxBody.pkl.go (80%) create mode 100644 internal/orm/transactions/init.pkl.go delete mode 100644 internal/vfs/models/PublicKey.pkl.go delete mode 100644 internal/vfs/models/init.pkl.go delete mode 100644 internal/vfs/txns/Msg.pkl.go delete mode 100644 internal/vfs/txns/init.pkl.go delete mode 100644 proto/did/v1/models.proto delete mode 100644 web/main.go create mode 100644 web/src/main.go create mode 100644 web/src/pages/allocate.templ create mode 100644 web/src/pages/allocate_templ.go create mode 100644 web/src/pages/home.templ create mode 100644 web/src/pages/home_templ.go create mode 100644 web/src/pages/pages.go delete mode 100644 x/did/builder/api.go delete mode 100644 x/did/builder/macroon.go delete mode 100644 x/did/builder/openid.go delete mode 100644 x/did/builder/options.go delete mode 100644 x/did/builder/pubkey.go delete mode 100644 x/did/builder/scopes.go delete mode 100644 x/did/builder/service.go delete mode 100644 x/did/builder/vault.go delete mode 100644 x/did/builder/webauthn.go delete mode 100644 x/did/keeper/ipfs.go create mode 100644 x/did/keeper/vault.go create mode 100644 x/did/types/address.go delete mode 100644 x/did/types/coins.go delete mode 100644 x/did/types/models.pb.go delete mode 100644 x/did/types/namespace.go delete mode 100644 x/did/types/perms.go delete mode 100644 x/did/types/pubkey.go diff --git a/.air.toml b/.air.toml index ac07e232c..1fc4c2ec2 100644 --- a/.air.toml +++ b/.air.toml @@ -16,7 +16,6 @@ include_ext = ["go", "templ", "html", "pkl", "js", "mjs"] include_file = [ "wrangler.toml", "Dockerfile", - "Makefile", ".goreleaser.yaml", "go.mod", "devbox.json", diff --git a/Makefile b/Makefile index a2a79a24e..f50571638 100644 --- a/Makefile +++ b/Makefile @@ -299,15 +299,32 @@ sh-testnet: mod-tidy ### templ & vault ### ############################################################################### -.PHONY: dwn motr +.PHONY: dwn motr xcaddy ipfs-cluster-start dwn: @echo "(dwn) Building dwn.wasm -> IPFS Vault" - GOOS=js GOARCH=wasm go build -o ./internal/vfs/app.wasm ./internal/dwn/wasm/main.go + GOOS=js GOARCH=wasm go build -o ./internal/vfs/app.wasm ./internal/dwn/main.go motr: @echo "(web) Building app.wasm -> Deploy to Cloudflare Workers" - GOOS=js GOARCH=wasm go build -o ./web/build/app.wasm ./web/main.go + GOOS=js GOARCH=wasm go build -o ./web/build/app.wasm ./web/src/main.go + +xcaddy: + @echo "(proxy) Building Cloudflare/Caddy proxy" + go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest + mkdir -p ./bin + xcaddy build --with github.com/caddy-dns/cloudflare + mv ./caddy ./bin/caddy + ./bin/caddy adapt > ./config/caddy/caddy.json + +ipfs-cluster-start: + @echo "(ipfs) Starting ipfs-cluster" + ipfs-cluster-service init --consensus crdt + ipfs-cluster-service daemon + +caddy-start: + @echo "(proxy) Starting caddy" + ./bin/caddy run --config ./config/caddy/caddy.json ############################################################################### ### help ### diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 38b5ff685..2185cd597 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -16,16 +16,14 @@ import ( ) var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor - fd_GenesisState_global_integrity protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor ) func init() { file_did_v1_genesis_proto_init() md_GenesisState = File_did_v1_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") - fd_GenesisState_global_integrity = md_GenesisState.Fields().ByName("global_integrity") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -99,12 +97,6 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } - if x.GlobalIntegrity != nil { - value := protoreflect.ValueOfMessage(x.GlobalIntegrity.ProtoReflect()) - if !f(fd_GenesisState_global_integrity, value) { - return - } - } } // Has reports whether a field is populated. @@ -122,8 +114,6 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "did.v1.GenesisState.params": return x.Params != nil - case "did.v1.GenesisState.global_integrity": - return x.GlobalIntegrity != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -142,8 +132,6 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.GenesisState.params": x.Params = nil - case "did.v1.GenesisState.global_integrity": - x.GlobalIntegrity = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -163,9 +151,6 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "did.v1.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.GenesisState.global_integrity": - value := x.GlobalIntegrity - return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -188,8 +173,6 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "did.v1.GenesisState.params": x.Params = value.Message().Interface().(*Params) - case "did.v1.GenesisState.global_integrity": - x.GlobalIntegrity = value.Message().Interface().(*GlobalIntegrity) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -215,11 +198,6 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "did.v1.GenesisState.global_integrity": - if x.GlobalIntegrity == nil { - x.GlobalIntegrity = new(GlobalIntegrity) - } - return protoreflect.ValueOfMessage(x.GlobalIntegrity.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -236,9 +214,6 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "did.v1.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.GenesisState.global_integrity": - m := new(GlobalIntegrity) - return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -312,10 +287,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } - if x.GlobalIntegrity != nil { - l = options.Size(x.GlobalIntegrity) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -345,20 +316,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.GlobalIntegrity != nil { - encoded, err := options.Marshal(x.GlobalIntegrity) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -458,640 +415,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GlobalIntegrity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.GlobalIntegrity == nil { - x.GlobalIntegrity = &GlobalIntegrity{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GlobalIntegrity); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_GlobalIntegrity protoreflect.MessageDescriptor - fd_GlobalIntegrity_controller protoreflect.FieldDescriptor - fd_GlobalIntegrity_seed protoreflect.FieldDescriptor - fd_GlobalIntegrity_accumulator protoreflect.FieldDescriptor - fd_GlobalIntegrity_count protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_GlobalIntegrity = File_did_v1_genesis_proto.Messages().ByName("GlobalIntegrity") - fd_GlobalIntegrity_controller = md_GlobalIntegrity.Fields().ByName("controller") - fd_GlobalIntegrity_seed = md_GlobalIntegrity.Fields().ByName("seed") - fd_GlobalIntegrity_accumulator = md_GlobalIntegrity.Fields().ByName("accumulator") - fd_GlobalIntegrity_count = md_GlobalIntegrity.Fields().ByName("count") -} - -var _ protoreflect.Message = (*fastReflection_GlobalIntegrity)(nil) - -type fastReflection_GlobalIntegrity GlobalIntegrity - -func (x *GlobalIntegrity) ProtoReflect() protoreflect.Message { - return (*fastReflection_GlobalIntegrity)(x) -} - -func (x *GlobalIntegrity) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_GlobalIntegrity_messageType fastReflection_GlobalIntegrity_messageType -var _ protoreflect.MessageType = fastReflection_GlobalIntegrity_messageType{} - -type fastReflection_GlobalIntegrity_messageType struct{} - -func (x fastReflection_GlobalIntegrity_messageType) Zero() protoreflect.Message { - return (*fastReflection_GlobalIntegrity)(nil) -} -func (x fastReflection_GlobalIntegrity_messageType) New() protoreflect.Message { - return new(fastReflection_GlobalIntegrity) -} -func (x fastReflection_GlobalIntegrity_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GlobalIntegrity -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_GlobalIntegrity) Descriptor() protoreflect.MessageDescriptor { - return md_GlobalIntegrity -} - -// 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_GlobalIntegrity) Type() protoreflect.MessageType { - return _fastReflection_GlobalIntegrity_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_GlobalIntegrity) New() protoreflect.Message { - return new(fastReflection_GlobalIntegrity) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_GlobalIntegrity) Interface() protoreflect.ProtoMessage { - return (*GlobalIntegrity)(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_GlobalIntegrity) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_GlobalIntegrity_controller, value) { - return - } - } - if x.Seed != "" { - value := protoreflect.ValueOfString(x.Seed) - if !f(fd_GlobalIntegrity_seed, value) { - return - } - } - if len(x.Accumulator) != 0 { - value := protoreflect.ValueOfBytes(x.Accumulator) - if !f(fd_GlobalIntegrity_accumulator, value) { - return - } - } - if x.Count != uint64(0) { - value := protoreflect.ValueOfUint64(x.Count) - if !f(fd_GlobalIntegrity_count, 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_GlobalIntegrity) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.GlobalIntegrity.controller": - return x.Controller != "" - case "did.v1.GlobalIntegrity.seed": - return x.Seed != "" - case "did.v1.GlobalIntegrity.accumulator": - return len(x.Accumulator) != 0 - case "did.v1.GlobalIntegrity.count": - return x.Count != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) - } - panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.GlobalIntegrity.controller": - x.Controller = "" - case "did.v1.GlobalIntegrity.seed": - x.Seed = "" - case "did.v1.GlobalIntegrity.accumulator": - x.Accumulator = nil - case "did.v1.GlobalIntegrity.count": - x.Count = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) - } - panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.GlobalIntegrity.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - case "did.v1.GlobalIntegrity.seed": - value := x.Seed - return protoreflect.ValueOfString(value) - case "did.v1.GlobalIntegrity.accumulator": - value := x.Accumulator - return protoreflect.ValueOfBytes(value) - case "did.v1.GlobalIntegrity.count": - value := x.Count - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) - } - panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.GlobalIntegrity.controller": - x.Controller = value.Interface().(string) - case "did.v1.GlobalIntegrity.seed": - x.Seed = value.Interface().(string) - case "did.v1.GlobalIntegrity.accumulator": - x.Accumulator = value.Bytes() - case "did.v1.GlobalIntegrity.count": - x.Count = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) - } - panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.GlobalIntegrity.controller": - panic(fmt.Errorf("field controller of message did.v1.GlobalIntegrity is not mutable")) - case "did.v1.GlobalIntegrity.seed": - panic(fmt.Errorf("field seed of message did.v1.GlobalIntegrity is not mutable")) - case "did.v1.GlobalIntegrity.accumulator": - panic(fmt.Errorf("field accumulator of message did.v1.GlobalIntegrity is not mutable")) - case "did.v1.GlobalIntegrity.count": - panic(fmt.Errorf("field count of message did.v1.GlobalIntegrity is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) - } - panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.GlobalIntegrity.controller": - return protoreflect.ValueOfString("") - case "did.v1.GlobalIntegrity.seed": - return protoreflect.ValueOfString("") - case "did.v1.GlobalIntegrity.accumulator": - return protoreflect.ValueOfBytes(nil) - case "did.v1.GlobalIntegrity.count": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) - } - panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.GlobalIntegrity", 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_GlobalIntegrity) 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_GlobalIntegrity) 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_GlobalIntegrity) 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_GlobalIntegrity) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GlobalIntegrity) - 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.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Seed) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Accumulator) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Count != 0 { - n += 1 + runtime.Sov(uint64(x.Count)) - } - 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().(*GlobalIntegrity) - 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.Count != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Count)) - i-- - dAtA[i] = 0x20 - } - if len(x.Accumulator) > 0 { - i -= len(x.Accumulator) - copy(dAtA[i:], x.Accumulator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Accumulator))) - i-- - dAtA[i] = 0x1a - } - if len(x.Seed) > 0 { - i -= len(x.Seed) - copy(dAtA[i:], x.Seed) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Seed))) - i-- - dAtA[i] = 0x12 - } - 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] = 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().(*GlobalIntegrity) - 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: GlobalIntegrity: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GlobalIntegrity: 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 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 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Seed", 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.Seed = 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 Accumulator", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Accumulator = append(x.Accumulator[:0], dAtA[iNdEx:postIndex]...) - if x.Accumulator == nil { - x.Accumulator = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - x.Count = 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.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1344,7 +667,7 @@ func (x *Params) ProtoReflect() protoreflect.Message { } func (x *Params) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[2] + mi := &file_did_v1_genesis_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2273,7 +1596,7 @@ func (x *AssetInfo) ProtoReflect() protoreflect.Message { } func (x *AssetInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[3] + mi := &file_did_v1_genesis_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2347,8 +1670,8 @@ func (x *fastReflection_AssetInfo) Range(f func(protoreflect.FieldDescriptor, pr return } } - if x.AssetType != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.AssetType)) + if x.AssetType != "" { + value := protoreflect.ValueOfString(x.AssetType) if !f(fd_AssetInfo_asset_type, value) { return } @@ -2387,7 +1710,7 @@ func (x *fastReflection_AssetInfo) Has(fd protoreflect.FieldDescriptor) bool { case "did.v1.AssetInfo.symbol": return x.Symbol != "" case "did.v1.AssetInfo.asset_type": - return x.AssetType != 0 + return x.AssetType != "" case "did.v1.AssetInfo.name": return x.Name != "" case "did.v1.AssetInfo.icon_url": @@ -2415,7 +1738,7 @@ func (x *fastReflection_AssetInfo) Clear(fd protoreflect.FieldDescriptor) { case "did.v1.AssetInfo.symbol": x.Symbol = "" case "did.v1.AssetInfo.asset_type": - x.AssetType = 0 + x.AssetType = "" case "did.v1.AssetInfo.name": x.Name = "" case "did.v1.AssetInfo.icon_url": @@ -2447,7 +1770,7 @@ func (x *fastReflection_AssetInfo) Get(descriptor protoreflect.FieldDescriptor) return protoreflect.ValueOfString(value) case "did.v1.AssetInfo.asset_type": value := x.AssetType - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "did.v1.AssetInfo.name": value := x.Name return protoreflect.ValueOfString(value) @@ -2481,7 +1804,7 @@ func (x *fastReflection_AssetInfo) Set(fd protoreflect.FieldDescriptor, value pr case "did.v1.AssetInfo.symbol": x.Symbol = value.Interface().(string) case "did.v1.AssetInfo.asset_type": - x.AssetType = (AssetType)(value.Enum()) + x.AssetType = value.Interface().(string) case "did.v1.AssetInfo.name": x.Name = value.Interface().(string) case "did.v1.AssetInfo.icon_url": @@ -2538,7 +1861,7 @@ func (x *fastReflection_AssetInfo) NewField(fd protoreflect.FieldDescriptor) pro case "did.v1.AssetInfo.symbol": return protoreflect.ValueOfString("") case "did.v1.AssetInfo.asset_type": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "did.v1.AssetInfo.name": return protoreflect.ValueOfString("") case "did.v1.AssetInfo.icon_url": @@ -2623,8 +1946,9 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.AssetType != 0 { - n += 1 + runtime.Sov(uint64(x.AssetType)) + l = len(x.AssetType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.Name) if l > 0 { @@ -2677,10 +2001,12 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x2a } - if x.AssetType != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.AssetType)) + if len(x.AssetType) > 0 { + i -= len(x.AssetType) + copy(dAtA[i:], x.AssetType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssetType))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } if len(x.Symbol) > 0 { i -= len(x.Symbol) @@ -2834,10 +2160,10 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { x.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AssetType", wireType) } - x.AssetType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2847,11 +2173,24 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.AssetType |= AssetType(b&0x7F) << shift + 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.AssetType = 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 Name", wireType) @@ -2951,6 +2290,1110 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_Document_3_list)(nil) + +type _Document_3_list struct { + list *[]string +} + +func (x *_Document_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Authentication as it is not of Message kind")) +} + +func (x *_Document_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_4_list)(nil) + +type _Document_4_list struct { + list *[]string +} + +func (x *_Document_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_Document_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_5_list)(nil) + +type _Document_5_list struct { + list *[]string +} + +func (x *_Document_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_Document_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_6_list)(nil) + +type _Document_6_list struct { + list *[]string +} + +func (x *_Document_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityInvocation as it is not of Message kind")) +} + +func (x *_Document_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_6_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_7_list)(nil) + +type _Document_7_list struct { + list *[]string +} + +func (x *_Document_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Service as it is not of Message kind")) +} + +func (x *_Document_7_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_7_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_7_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Document protoreflect.MessageDescriptor + fd_Document_id protoreflect.FieldDescriptor + fd_Document_controller protoreflect.FieldDescriptor + fd_Document_authentication protoreflect.FieldDescriptor + fd_Document_assertion_method protoreflect.FieldDescriptor + fd_Document_capability_delegation protoreflect.FieldDescriptor + fd_Document_capability_invocation protoreflect.FieldDescriptor + fd_Document_service protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_Document = File_did_v1_genesis_proto.Messages().ByName("Document") + fd_Document_id = md_Document.Fields().ByName("id") + fd_Document_controller = md_Document.Fields().ByName("controller") + fd_Document_authentication = md_Document.Fields().ByName("authentication") + fd_Document_assertion_method = md_Document.Fields().ByName("assertion_method") + fd_Document_capability_delegation = md_Document.Fields().ByName("capability_delegation") + fd_Document_capability_invocation = md_Document.Fields().ByName("capability_invocation") + fd_Document_service = md_Document.Fields().ByName("service") +} + +var _ protoreflect.Message = (*fastReflection_Document)(nil) + +type fastReflection_Document Document + +func (x *Document) ProtoReflect() protoreflect.Message { + return (*fastReflection_Document)(x) +} + +func (x *Document) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Document_messageType fastReflection_Document_messageType +var _ protoreflect.MessageType = fastReflection_Document_messageType{} + +type fastReflection_Document_messageType struct{} + +func (x fastReflection_Document_messageType) Zero() protoreflect.Message { + return (*fastReflection_Document)(nil) +} +func (x fastReflection_Document_messageType) New() protoreflect.Message { + return new(fastReflection_Document) +} +func (x fastReflection_Document_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Document +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Document) Descriptor() protoreflect.MessageDescriptor { + return md_Document +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Document) Type() protoreflect.MessageType { + return _fastReflection_Document_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Document) New() protoreflect.Message { + return new(fastReflection_Document) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Document) Interface() protoreflect.ProtoMessage { + return (*Document)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Document) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Document_id, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Document_controller, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_Document_3_list{list: &x.Authentication}) + if !f(fd_Document_authentication, value) { + return + } + } + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_Document_4_list{list: &x.AssertionMethod}) + if !f(fd_Document_assertion_method, value) { + return + } + } + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_Document_5_list{list: &x.CapabilityDelegation}) + if !f(fd_Document_capability_delegation, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_Document_6_list{list: &x.CapabilityInvocation}) + if !f(fd_Document_capability_invocation, value) { + return + } + } + if len(x.Service) != 0 { + value := protoreflect.ValueOfList(&_Document_7_list{list: &x.Service}) + if !f(fd_Document_service, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Document) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Document.id": + return x.Id != "" + case "did.v1.Document.controller": + return x.Controller != "" + case "did.v1.Document.authentication": + return len(x.Authentication) != 0 + case "did.v1.Document.assertion_method": + return len(x.AssertionMethod) != 0 + case "did.v1.Document.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "did.v1.Document.capability_invocation": + return len(x.CapabilityInvocation) != 0 + case "did.v1.Document.service": + return len(x.Service) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Document.id": + x.Id = "" + case "did.v1.Document.controller": + x.Controller = "" + case "did.v1.Document.authentication": + x.Authentication = nil + case "did.v1.Document.assertion_method": + x.AssertionMethod = nil + case "did.v1.Document.capability_delegation": + x.CapabilityDelegation = nil + case "did.v1.Document.capability_invocation": + x.CapabilityInvocation = nil + case "did.v1.Document.service": + x.Service = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Document) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Document.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Document.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.Document.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_Document_3_list{}) + } + listValue := &_Document_3_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_Document_4_list{}) + } + listValue := &_Document_4_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_Document_5_list{}) + } + listValue := &_Document_5_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_Document_6_list{}) + } + listValue := &_Document_6_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.service": + if len(x.Service) == 0 { + return protoreflect.ValueOfList(&_Document_7_list{}) + } + listValue := &_Document_7_list{list: &x.Service} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Document.id": + x.Id = value.Interface().(string) + case "did.v1.Document.controller": + x.Controller = value.Interface().(string) + case "did.v1.Document.authentication": + lv := value.List() + clv := lv.(*_Document_3_list) + x.Authentication = *clv.list + case "did.v1.Document.assertion_method": + lv := value.List() + clv := lv.(*_Document_4_list) + x.AssertionMethod = *clv.list + case "did.v1.Document.capability_delegation": + lv := value.List() + clv := lv.(*_Document_5_list) + x.CapabilityDelegation = *clv.list + case "did.v1.Document.capability_invocation": + lv := value.List() + clv := lv.(*_Document_6_list) + x.CapabilityInvocation = *clv.list + case "did.v1.Document.service": + lv := value.List() + clv := lv.(*_Document_7_list) + x.Service = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Document.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_Document_3_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "did.v1.Document.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_Document_4_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} + } + value := &_Document_5_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_Document_6_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.service": + if x.Service == nil { + x.Service = []string{} + } + value := &_Document_7_list{list: &x.Service} + return protoreflect.ValueOfList(value) + case "did.v1.Document.id": + panic(fmt.Errorf("field id of message did.v1.Document is not mutable")) + case "did.v1.Document.controller": + panic(fmt.Errorf("field controller of message did.v1.Document is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Document) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Document.id": + return protoreflect.ValueOfString("") + case "did.v1.Document.controller": + return protoreflect.ValueOfString("") + case "did.v1.Document.authentication": + list := []string{} + return protoreflect.ValueOfList(&_Document_3_list{list: &list}) + case "did.v1.Document.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_Document_4_list{list: &list}) + case "did.v1.Document.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_Document_5_list{list: &list}) + case "did.v1.Document.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_Document_6_list{list: &list}) + case "did.v1.Document.service": + list := []string{} + return protoreflect.ValueOfList(&_Document_7_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Document) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Document", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Document) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Document) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Document) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Document) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Authentication) > 0 { + for _, s := range x.Authentication { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.AssertionMethod) > 0 { + for _, s := range x.AssertionMethod { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityDelegation) > 0 { + for _, s := range x.CapabilityDelegation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityInvocation) > 0 { + for _, s := range x.CapabilityInvocation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Service) > 0 { + for _, s := range x.Service { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Document) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Service) > 0 { + for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Service[iNdEx]) + copy(dAtA[i:], x.Service[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Service[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(x.CapabilityInvocation) > 0 { + for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(x.CapabilityDelegation) > 0 { + for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(x.AssertionMethod) > 0 { + for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AssertionMethod[iNdEx]) + copy(dAtA[i:], x.AssertionMethod[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.Authentication) > 0 { + for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Authentication[iNdEx]) + copy(dAtA[i:], x.Authentication[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Document) + 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: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", 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.Authentication = append(x.Authentication, 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 AssertionMethod", 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.AssertionMethod = append(x.AssertionMethod, 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 CapabilityDelegation", 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.CapabilityDelegation = append(x.CapabilityDelegation, 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 CapabilityInvocation", 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.CapabilityInvocation = append(x.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service = append(x.Service, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_KeyInfo protoreflect.MessageDescriptor fd_KeyInfo_role protoreflect.FieldDescriptor @@ -3035,32 +3478,32 @@ func (x *fastReflection_KeyInfo) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_KeyInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Role != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if x.Role != "" { + value := protoreflect.ValueOfString(x.Role) if !f(fd_KeyInfo_role, value) { return } } - if x.Algorithm != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Algorithm)) + if x.Algorithm != "" { + value := protoreflect.ValueOfString(x.Algorithm) if !f(fd_KeyInfo_algorithm, value) { return } } - if x.Encoding != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Encoding)) + if x.Encoding != "" { + value := protoreflect.ValueOfString(x.Encoding) if !f(fd_KeyInfo_encoding, value) { return } } - if x.Curve != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Curve)) + if x.Curve != "" { + value := protoreflect.ValueOfString(x.Curve) if !f(fd_KeyInfo_curve, value) { return } } - if x.Type_ != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Type_)) + if x.Type_ != "" { + value := protoreflect.ValueOfString(x.Type_) if !f(fd_KeyInfo_type, value) { return } @@ -3081,15 +3524,15 @@ func (x *fastReflection_KeyInfo) Range(f func(protoreflect.FieldDescriptor, prot func (x *fastReflection_KeyInfo) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.KeyInfo.role": - return x.Role != 0 + return x.Role != "" case "did.v1.KeyInfo.algorithm": - return x.Algorithm != 0 + return x.Algorithm != "" case "did.v1.KeyInfo.encoding": - return x.Encoding != 0 + return x.Encoding != "" case "did.v1.KeyInfo.curve": - return x.Curve != 0 + return x.Curve != "" case "did.v1.KeyInfo.type": - return x.Type_ != 0 + return x.Type_ != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) @@ -3107,15 +3550,15 @@ func (x *fastReflection_KeyInfo) Has(fd protoreflect.FieldDescriptor) bool { func (x *fastReflection_KeyInfo) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.KeyInfo.role": - x.Role = 0 + x.Role = "" case "did.v1.KeyInfo.algorithm": - x.Algorithm = 0 + x.Algorithm = "" case "did.v1.KeyInfo.encoding": - x.Encoding = 0 + x.Encoding = "" case "did.v1.KeyInfo.curve": - x.Curve = 0 + x.Curve = "" case "did.v1.KeyInfo.type": - x.Type_ = 0 + x.Type_ = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) @@ -3134,19 +3577,19 @@ func (x *fastReflection_KeyInfo) Get(descriptor protoreflect.FieldDescriptor) pr switch descriptor.FullName() { case "did.v1.KeyInfo.role": value := x.Role - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "did.v1.KeyInfo.algorithm": value := x.Algorithm - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "did.v1.KeyInfo.encoding": value := x.Encoding - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "did.v1.KeyInfo.curve": value := x.Curve - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "did.v1.KeyInfo.type": value := x.Type_ - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) @@ -3168,15 +3611,15 @@ func (x *fastReflection_KeyInfo) Get(descriptor protoreflect.FieldDescriptor) pr func (x *fastReflection_KeyInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "did.v1.KeyInfo.role": - x.Role = (KeyRole)(value.Enum()) + x.Role = value.Interface().(string) case "did.v1.KeyInfo.algorithm": - x.Algorithm = (KeyAlgorithm)(value.Enum()) + x.Algorithm = value.Interface().(string) case "did.v1.KeyInfo.encoding": - x.Encoding = (KeyEncoding)(value.Enum()) + x.Encoding = value.Interface().(string) case "did.v1.KeyInfo.curve": - x.Curve = (KeyCurve)(value.Enum()) + x.Curve = value.Interface().(string) case "did.v1.KeyInfo.type": - x.Type_ = (KeyType)(value.Enum()) + x.Type_ = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) @@ -3221,15 +3664,15 @@ func (x *fastReflection_KeyInfo) Mutable(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_KeyInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.KeyInfo.role": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "did.v1.KeyInfo.algorithm": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "did.v1.KeyInfo.encoding": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "did.v1.KeyInfo.curve": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "did.v1.KeyInfo.type": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) @@ -3299,20 +3742,25 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Role != 0 { - n += 1 + runtime.Sov(uint64(x.Role)) + l = len(x.Role) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - if x.Algorithm != 0 { - n += 1 + runtime.Sov(uint64(x.Algorithm)) + l = len(x.Algorithm) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - if x.Encoding != 0 { - n += 1 + runtime.Sov(uint64(x.Encoding)) + l = len(x.Encoding) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - if x.Curve != 0 { - n += 1 + runtime.Sov(uint64(x.Curve)) + l = len(x.Curve) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - if x.Type_ != 0 { - n += 1 + runtime.Sov(uint64(x.Type_)) + l = len(x.Type_) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -3343,30 +3791,40 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Type_ != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Type_)) + if len(x.Type_) > 0 { + i -= len(x.Type_) + copy(dAtA[i:], x.Type_) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Type_))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } - if x.Curve != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Curve)) + if len(x.Curve) > 0 { + i -= len(x.Curve) + copy(dAtA[i:], x.Curve) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Curve))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } - if x.Encoding != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Encoding)) + if len(x.Encoding) > 0 { + i -= len(x.Encoding) + copy(dAtA[i:], x.Encoding) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Encoding))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if x.Algorithm != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Algorithm)) + if len(x.Algorithm) > 0 { + i -= len(x.Algorithm) + copy(dAtA[i:], x.Algorithm) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Algorithm))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if x.Role != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + if len(x.Role) > 0 { + i -= len(x.Role) + copy(dAtA[i:], x.Role) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -3418,10 +3876,10 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } - x.Role = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3431,16 +3889,29 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Role |= KeyRole(b&0x7F) << shift + 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.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) } - x.Algorithm = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3450,16 +3921,29 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Algorithm |= KeyAlgorithm(b&0x7F) << shift + 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.Algorithm = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) } - x.Encoding = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3469,16 +3953,29 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Encoding |= KeyEncoding(b&0x7F) << shift + 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.Encoding = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) } - x.Curve = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3488,16 +3985,29 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Curve |= KeyCurve(b&0x7F) << shift + 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.Curve = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", wireType) } - x.Type_ = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3507,11 +4017,2869 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Type_ |= KeyType(b&0x7F) << shift + 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.Type_ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_PubKey protoreflect.MessageDescriptor + fd_PubKey_role protoreflect.FieldDescriptor + fd_PubKey_algorithm protoreflect.FieldDescriptor + fd_PubKey_encoding protoreflect.FieldDescriptor + fd_PubKey_curve protoreflect.FieldDescriptor + fd_PubKey_key_type protoreflect.FieldDescriptor + fd_PubKey_raw protoreflect.FieldDescriptor + fd_PubKey_jwk protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_PubKey = File_did_v1_genesis_proto.Messages().ByName("PubKey") + fd_PubKey_role = md_PubKey.Fields().ByName("role") + fd_PubKey_algorithm = md_PubKey.Fields().ByName("algorithm") + fd_PubKey_encoding = md_PubKey.Fields().ByName("encoding") + fd_PubKey_curve = md_PubKey.Fields().ByName("curve") + fd_PubKey_key_type = md_PubKey.Fields().ByName("key_type") + fd_PubKey_raw = md_PubKey.Fields().ByName("raw") + fd_PubKey_jwk = md_PubKey.Fields().ByName("jwk") +} + +var _ protoreflect.Message = (*fastReflection_PubKey)(nil) + +type fastReflection_PubKey PubKey + +func (x *PubKey) ProtoReflect() protoreflect.Message { + return (*fastReflection_PubKey)(x) +} + +func (x *PubKey) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_PubKey_messageType fastReflection_PubKey_messageType +var _ protoreflect.MessageType = fastReflection_PubKey_messageType{} + +type fastReflection_PubKey_messageType struct{} + +func (x fastReflection_PubKey_messageType) Zero() protoreflect.Message { + return (*fastReflection_PubKey)(nil) +} +func (x fastReflection_PubKey_messageType) New() protoreflect.Message { + return new(fastReflection_PubKey) +} +func (x fastReflection_PubKey_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PubKey) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_PubKey) Type() protoreflect.MessageType { + return _fastReflection_PubKey_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PubKey) New() protoreflect.Message { + return new(fastReflection_PubKey) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PubKey) Interface() protoreflect.ProtoMessage { + return (*PubKey)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_PubKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Role != "" { + value := protoreflect.ValueOfString(x.Role) + if !f(fd_PubKey_role, value) { + return + } + } + if x.Algorithm != "" { + value := protoreflect.ValueOfString(x.Algorithm) + if !f(fd_PubKey_algorithm, value) { + return + } + } + if x.Encoding != "" { + value := protoreflect.ValueOfString(x.Encoding) + if !f(fd_PubKey_encoding, value) { + return + } + } + if x.Curve != "" { + value := protoreflect.ValueOfString(x.Curve) + if !f(fd_PubKey_curve, value) { + return + } + } + if x.KeyType != "" { + value := protoreflect.ValueOfString(x.KeyType) + if !f(fd_PubKey_key_type, value) { + return + } + } + if len(x.Raw) != 0 { + value := protoreflect.ValueOfBytes(x.Raw) + if !f(fd_PubKey_raw, value) { + return + } + } + if x.Jwk != nil { + value := protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) + if !f(fd_PubKey_jwk, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_PubKey) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.PubKey.role": + return x.Role != "" + case "did.v1.PubKey.algorithm": + return x.Algorithm != "" + case "did.v1.PubKey.encoding": + return x.Encoding != "" + case "did.v1.PubKey.curve": + return x.Curve != "" + case "did.v1.PubKey.key_type": + return x.KeyType != "" + case "did.v1.PubKey.raw": + return len(x.Raw) != 0 + case "did.v1.PubKey.jwk": + return x.Jwk != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.PubKey.role": + x.Role = "" + case "did.v1.PubKey.algorithm": + x.Algorithm = "" + case "did.v1.PubKey.encoding": + x.Encoding = "" + case "did.v1.PubKey.curve": + x.Curve = "" + case "did.v1.PubKey.key_type": + x.KeyType = "" + case "did.v1.PubKey.raw": + x.Raw = nil + case "did.v1.PubKey.jwk": + x.Jwk = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_PubKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.PubKey.role": + value := x.Role + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.algorithm": + value := x.Algorithm + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.encoding": + value := x.Encoding + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.curve": + value := x.Curve + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.key_type": + value := x.KeyType + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.raw": + value := x.Raw + return protoreflect.ValueOfBytes(value) + case "did.v1.PubKey.jwk": + value := x.Jwk + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.PubKey.role": + x.Role = value.Interface().(string) + case "did.v1.PubKey.algorithm": + x.Algorithm = value.Interface().(string) + case "did.v1.PubKey.encoding": + x.Encoding = value.Interface().(string) + case "did.v1.PubKey.curve": + x.Curve = value.Interface().(string) + case "did.v1.PubKey.key_type": + x.KeyType = value.Interface().(string) + case "did.v1.PubKey.raw": + x.Raw = value.Bytes() + case "did.v1.PubKey.jwk": + x.Jwk = value.Message().Interface().(*PubKey_JWK) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.jwk": + if x.Jwk == nil { + x.Jwk = new(PubKey_JWK) + } + return protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) + case "did.v1.PubKey.role": + panic(fmt.Errorf("field role of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.algorithm": + panic(fmt.Errorf("field algorithm of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.encoding": + panic(fmt.Errorf("field encoding of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.curve": + panic(fmt.Errorf("field curve of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.key_type": + panic(fmt.Errorf("field key_type of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.raw": + panic(fmt.Errorf("field raw of message did.v1.PubKey is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_PubKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.role": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.algorithm": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.encoding": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.curve": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.key_type": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.raw": + return protoreflect.ValueOfBytes(nil) + case "did.v1.PubKey.jwk": + m := new(PubKey_JWK) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) + } + panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_PubKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_PubKey) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_PubKey) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Role) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Algorithm) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Encoding) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Curve) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.KeyType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Raw) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Jwk != nil { + l = options.Size(x.Jwk) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Jwk != nil { + encoded, err := options.Marshal(x.Jwk) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if len(x.Raw) > 0 { + i -= len(x.Raw) + copy(dAtA[i:], x.Raw) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Raw))) + i-- + dAtA[i] = 0x32 + } + if len(x.KeyType) > 0 { + i -= len(x.KeyType) + copy(dAtA[i:], x.KeyType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyType))) + i-- + dAtA[i] = 0x2a + } + if len(x.Curve) > 0 { + i -= len(x.Curve) + copy(dAtA[i:], x.Curve) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Curve))) + i-- + dAtA[i] = 0x22 + } + if len(x.Encoding) > 0 { + i -= len(x.Encoding) + copy(dAtA[i:], x.Encoding) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Encoding))) + i-- + dAtA[i] = 0x1a + } + if len(x.Algorithm) > 0 { + i -= len(x.Algorithm) + copy(dAtA[i:], x.Algorithm) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Algorithm))) + i-- + dAtA[i] = 0x12 + } + if len(x.Role) > 0 { + i -= len(x.Role) + copy(dAtA[i:], x.Role) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", 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.Role = 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 Algorithm", 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.Algorithm = 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 Encoding", 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.Encoding = 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 Curve", 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.Curve = 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 KeyType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.KeyType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Raw = append(x.Raw[:0], dAtA[iNdEx:postIndex]...) + if x.Raw == nil { + x.Raw = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Jwk == nil { + x.Jwk = &PubKey_JWK{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Jwk); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_PubKey_JWK protoreflect.MessageDescriptor + fd_PubKey_JWK_kty protoreflect.FieldDescriptor + fd_PubKey_JWK_crv protoreflect.FieldDescriptor + fd_PubKey_JWK_x protoreflect.FieldDescriptor + fd_PubKey_JWK_y protoreflect.FieldDescriptor + fd_PubKey_JWK_n protoreflect.FieldDescriptor + fd_PubKey_JWK_e protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_PubKey_JWK = File_did_v1_genesis_proto.Messages().ByName("PubKey").Messages().ByName("JWK") + fd_PubKey_JWK_kty = md_PubKey_JWK.Fields().ByName("kty") + fd_PubKey_JWK_crv = md_PubKey_JWK.Fields().ByName("crv") + fd_PubKey_JWK_x = md_PubKey_JWK.Fields().ByName("x") + fd_PubKey_JWK_y = md_PubKey_JWK.Fields().ByName("y") + fd_PubKey_JWK_n = md_PubKey_JWK.Fields().ByName("n") + fd_PubKey_JWK_e = md_PubKey_JWK.Fields().ByName("e") +} + +var _ protoreflect.Message = (*fastReflection_PubKey_JWK)(nil) + +type fastReflection_PubKey_JWK PubKey_JWK + +func (x *PubKey_JWK) ProtoReflect() protoreflect.Message { + return (*fastReflection_PubKey_JWK)(x) +} + +func (x *PubKey_JWK) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_PubKey_JWK_messageType fastReflection_PubKey_JWK_messageType +var _ protoreflect.MessageType = fastReflection_PubKey_JWK_messageType{} + +type fastReflection_PubKey_JWK_messageType struct{} + +func (x fastReflection_PubKey_JWK_messageType) Zero() protoreflect.Message { + return (*fastReflection_PubKey_JWK)(nil) +} +func (x fastReflection_PubKey_JWK_messageType) New() protoreflect.Message { + return new(fastReflection_PubKey_JWK) +} +func (x fastReflection_PubKey_JWK_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey_JWK +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PubKey_JWK) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey_JWK +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_PubKey_JWK) Type() protoreflect.MessageType { + return _fastReflection_PubKey_JWK_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PubKey_JWK) New() protoreflect.Message { + return new(fastReflection_PubKey_JWK) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PubKey_JWK) Interface() protoreflect.ProtoMessage { + return (*PubKey_JWK)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_PubKey_JWK) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Kty != "" { + value := protoreflect.ValueOfString(x.Kty) + if !f(fd_PubKey_JWK_kty, value) { + return + } + } + if x.Crv != "" { + value := protoreflect.ValueOfString(x.Crv) + if !f(fd_PubKey_JWK_crv, value) { + return + } + } + if x.X != "" { + value := protoreflect.ValueOfString(x.X) + if !f(fd_PubKey_JWK_x, value) { + return + } + } + if x.Y != "" { + value := protoreflect.ValueOfString(x.Y) + if !f(fd_PubKey_JWK_y, value) { + return + } + } + if x.N != "" { + value := protoreflect.ValueOfString(x.N) + if !f(fd_PubKey_JWK_n, value) { + return + } + } + if x.E != "" { + value := protoreflect.ValueOfString(x.E) + if !f(fd_PubKey_JWK_e, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_PubKey_JWK) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + return x.Kty != "" + case "did.v1.PubKey.JWK.crv": + return x.Crv != "" + case "did.v1.PubKey.JWK.x": + return x.X != "" + case "did.v1.PubKey.JWK.y": + return x.Y != "" + case "did.v1.PubKey.JWK.n": + return x.N != "" + case "did.v1.PubKey.JWK.e": + return x.E != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey_JWK) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + x.Kty = "" + case "did.v1.PubKey.JWK.crv": + x.Crv = "" + case "did.v1.PubKey.JWK.x": + x.X = "" + case "did.v1.PubKey.JWK.y": + x.Y = "" + case "did.v1.PubKey.JWK.n": + x.N = "" + case "did.v1.PubKey.JWK.e": + x.E = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_PubKey_JWK) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.PubKey.JWK.kty": + value := x.Kty + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.crv": + value := x.Crv + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.x": + value := x.X + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.y": + value := x.Y + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.n": + value := x.N + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.e": + value := x.E + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey_JWK) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + x.Kty = value.Interface().(string) + case "did.v1.PubKey.JWK.crv": + x.Crv = value.Interface().(string) + case "did.v1.PubKey.JWK.x": + x.X = value.Interface().(string) + case "did.v1.PubKey.JWK.y": + x.Y = value.Interface().(string) + case "did.v1.PubKey.JWK.n": + x.N = value.Interface().(string) + case "did.v1.PubKey.JWK.e": + x.E = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey_JWK) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + panic(fmt.Errorf("field kty of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.crv": + panic(fmt.Errorf("field crv of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.x": + panic(fmt.Errorf("field x of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.y": + panic(fmt.Errorf("field y of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.n": + panic(fmt.Errorf("field n of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.e": + panic(fmt.Errorf("field e of message did.v1.PubKey.JWK is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_PubKey_JWK) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.crv": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.x": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.y": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.n": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.e": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_PubKey_JWK) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey.JWK", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_PubKey_JWK) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey_JWK) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_PubKey_JWK) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_PubKey_JWK) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PubKey_JWK) + 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.Kty) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Crv) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.X) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Y) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.N) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.E) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*PubKey_JWK) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.E) > 0 { + i -= len(x.E) + copy(dAtA[i:], x.E) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.E))) + i-- + dAtA[i] = 0x32 + } + if len(x.N) > 0 { + i -= len(x.N) + copy(dAtA[i:], x.N) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.N))) + i-- + dAtA[i] = 0x2a + } + if len(x.Y) > 0 { + i -= len(x.Y) + copy(dAtA[i:], x.Y) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Y))) + i-- + dAtA[i] = 0x22 + } + if len(x.X) > 0 { + i -= len(x.X) + copy(dAtA[i:], x.X) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.X))) + i-- + dAtA[i] = 0x1a + } + if len(x.Crv) > 0 { + i -= len(x.Crv) + copy(dAtA[i:], x.Crv) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Crv))) + i-- + dAtA[i] = 0x12 + } + if len(x.Kty) > 0 { + i -= len(x.Kty) + copy(dAtA[i:], x.Kty) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kty))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*PubKey_JWK) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey_JWK: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey_JWK: 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 Kty", 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.Kty = 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 Crv", 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.Crv = 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 X", 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.X = 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 Y", 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.Y = 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 N", 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.N = 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 E", 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.E = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.Map = (*_Service_6_map)(nil) + +type _Service_6_map struct { + m *map[string]string +} + +func (x *_Service_6_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Service_6_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Service_6_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Service_6_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Service_6_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_Service_6_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Service_6_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_Service_6_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Service_6_map) IsValid() bool { + return x.m != nil +} + +var _ protoreflect.Map = (*_Service_7_map)(nil) + +type _Service_7_map struct { + m *map[string]string +} + +func (x *_Service_7_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Service_7_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Service_7_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Service_7_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Service_7_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_Service_7_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Service_7_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_Service_7_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Service_7_map) IsValid() bool { + return x.m != nil +} + +var ( + md_Service protoreflect.MessageDescriptor + fd_Service_id protoreflect.FieldDescriptor + fd_Service_service_type protoreflect.FieldDescriptor + fd_Service_authority protoreflect.FieldDescriptor + fd_Service_origin protoreflect.FieldDescriptor + fd_Service_description protoreflect.FieldDescriptor + fd_Service_service_endpoints protoreflect.FieldDescriptor + fd_Service_permissions protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_Service = File_did_v1_genesis_proto.Messages().ByName("Service") + fd_Service_id = md_Service.Fields().ByName("id") + fd_Service_service_type = md_Service.Fields().ByName("service_type") + fd_Service_authority = md_Service.Fields().ByName("authority") + fd_Service_origin = md_Service.Fields().ByName("origin") + fd_Service_description = md_Service.Fields().ByName("description") + fd_Service_service_endpoints = md_Service.Fields().ByName("service_endpoints") + fd_Service_permissions = md_Service.Fields().ByName("permissions") +} + +var _ protoreflect.Message = (*fastReflection_Service)(nil) + +type fastReflection_Service Service + +func (x *Service) ProtoReflect() protoreflect.Message { + return (*fastReflection_Service)(x) +} + +func (x *Service) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Service_messageType fastReflection_Service_messageType +var _ protoreflect.MessageType = fastReflection_Service_messageType{} + +type fastReflection_Service_messageType struct{} + +func (x fastReflection_Service_messageType) Zero() protoreflect.Message { + return (*fastReflection_Service)(nil) +} +func (x fastReflection_Service_messageType) New() protoreflect.Message { + return new(fastReflection_Service) +} +func (x fastReflection_Service_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Service +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Service) Descriptor() protoreflect.MessageDescriptor { + return md_Service +} + +// 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_Service) Type() protoreflect.MessageType { + return _fastReflection_Service_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Service) New() protoreflect.Message { + return new(fastReflection_Service) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Service) Interface() protoreflect.ProtoMessage { + return (*Service)(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_Service) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Service_id, value) { + return + } + } + if x.ServiceType != "" { + value := protoreflect.ValueOfString(x.ServiceType) + if !f(fd_Service_service_type, value) { + return + } + } + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Service_authority, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Service_origin, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_Service_description, value) { + return + } + } + if len(x.ServiceEndpoints) != 0 { + value := protoreflect.ValueOfMap(&_Service_6_map{m: &x.ServiceEndpoints}) + if !f(fd_Service_service_endpoints, value) { + return + } + } + if len(x.Permissions) != 0 { + value := protoreflect.ValueOfMap(&_Service_7_map{m: &x.Permissions}) + if !f(fd_Service_permissions, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Service) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Service.id": + return x.Id != "" + case "did.v1.Service.service_type": + return x.ServiceType != "" + case "did.v1.Service.authority": + return x.Authority != "" + case "did.v1.Service.origin": + return x.Origin != "" + case "did.v1.Service.description": + return x.Description != "" + case "did.v1.Service.service_endpoints": + return len(x.ServiceEndpoints) != 0 + case "did.v1.Service.permissions": + return len(x.Permissions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Service.id": + x.Id = "" + case "did.v1.Service.service_type": + x.ServiceType = "" + case "did.v1.Service.authority": + x.Authority = "" + case "did.v1.Service.origin": + x.Origin = "" + case "did.v1.Service.description": + x.Description = "" + case "did.v1.Service.service_endpoints": + x.ServiceEndpoints = nil + case "did.v1.Service.permissions": + x.Permissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Service.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Service.service_type": + value := x.ServiceType + return protoreflect.ValueOfString(value) + case "did.v1.Service.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.Service.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.Service.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "did.v1.Service.service_endpoints": + if len(x.ServiceEndpoints) == 0 { + return protoreflect.ValueOfMap(&_Service_6_map{}) + } + mapValue := &_Service_6_map{m: &x.ServiceEndpoints} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Service.permissions": + if len(x.Permissions) == 0 { + return protoreflect.ValueOfMap(&_Service_7_map{}) + } + mapValue := &_Service_7_map{m: &x.Permissions} + return protoreflect.ValueOfMap(mapValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Service.id": + x.Id = value.Interface().(string) + case "did.v1.Service.service_type": + x.ServiceType = value.Interface().(string) + case "did.v1.Service.authority": + x.Authority = value.Interface().(string) + case "did.v1.Service.origin": + x.Origin = value.Interface().(string) + case "did.v1.Service.description": + x.Description = value.Interface().(string) + case "did.v1.Service.service_endpoints": + mv := value.Map() + cmv := mv.(*_Service_6_map) + x.ServiceEndpoints = *cmv.m + case "did.v1.Service.permissions": + mv := value.Map() + cmv := mv.(*_Service_7_map) + x.Permissions = *cmv.m + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Service.service_endpoints": + if x.ServiceEndpoints == nil { + x.ServiceEndpoints = make(map[string]string) + } + value := &_Service_6_map{m: &x.ServiceEndpoints} + return protoreflect.ValueOfMap(value) + case "did.v1.Service.permissions": + if x.Permissions == nil { + x.Permissions = make(map[string]string) + } + value := &_Service_7_map{m: &x.Permissions} + return protoreflect.ValueOfMap(value) + case "did.v1.Service.id": + panic(fmt.Errorf("field id of message did.v1.Service is not mutable")) + case "did.v1.Service.service_type": + panic(fmt.Errorf("field service_type of message did.v1.Service is not mutable")) + case "did.v1.Service.authority": + panic(fmt.Errorf("field authority of message did.v1.Service is not mutable")) + case "did.v1.Service.origin": + panic(fmt.Errorf("field origin of message did.v1.Service is not mutable")) + case "did.v1.Service.description": + panic(fmt.Errorf("field description of message did.v1.Service is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Service.id": + return protoreflect.ValueOfString("") + case "did.v1.Service.service_type": + return protoreflect.ValueOfString("") + case "did.v1.Service.authority": + return protoreflect.ValueOfString("") + case "did.v1.Service.origin": + return protoreflect.ValueOfString("") + case "did.v1.Service.description": + return protoreflect.ValueOfString("") + case "did.v1.Service.service_endpoints": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Service_6_map{m: &m}) + case "did.v1.Service.permissions": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Service_7_map{m: &m}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Service", 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_Service) 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_Service) 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_Service) 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_Service) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Service) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ServiceEndpoints) > 0 { + SiZeMaP := func(k string, v string) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.ServiceEndpoints)) + for k := range x.ServiceEndpoints { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.ServiceEndpoints[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.ServiceEndpoints { + SiZeMaP(k, v) + } + } + } + if len(x.Permissions) > 0 { + SiZeMaP := func(k string, v string) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Permissions)) + for k := range x.Permissions { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Permissions[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Permissions { + SiZeMaP(k, v) + } + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Service) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Permissions) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForPermissions := make([]string, 0, len(x.Permissions)) + for k := range x.Permissions { + keysForPermissions = append(keysForPermissions, string(k)) + } + sort.Slice(keysForPermissions, func(i, j int) bool { + return keysForPermissions[i] < keysForPermissions[j] + }) + for iNdEx := len(keysForPermissions) - 1; iNdEx >= 0; iNdEx-- { + v := x.Permissions[string(keysForPermissions[iNdEx])] + out, err := MaRsHaLmAp(keysForPermissions[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Permissions { + v := x.Permissions[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.ServiceEndpoints) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForServiceEndpoints := make([]string, 0, len(x.ServiceEndpoints)) + for k := range x.ServiceEndpoints { + keysForServiceEndpoints = append(keysForServiceEndpoints, string(k)) + } + sort.Slice(keysForServiceEndpoints, func(i, j int) bool { + return keysForServiceEndpoints[i] < keysForServiceEndpoints[j] + }) + for iNdEx := len(keysForServiceEndpoints) - 1; iNdEx >= 0; iNdEx-- { + v := x.ServiceEndpoints[string(keysForServiceEndpoints[iNdEx])] + out, err := MaRsHaLmAp(keysForServiceEndpoints[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.ServiceEndpoints { + v := x.ServiceEndpoints[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x2a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x22 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0x1a + } + if len(x.ServiceType) > 0 { + i -= len(x.ServiceType) + copy(dAtA[i:], x.ServiceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Service) + 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: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ServiceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ServiceEndpoints == nil { + x.ServiceEndpoints = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.ServiceEndpoints[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Permissions == nil { + x.Permissions = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.Permissions[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3560,584 +6928,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified -type AssetType int32 - -const ( - AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0 - AssetType_ASSET_TYPE_NATIVE AssetType = 1 - AssetType_ASSET_TYPE_WRAPPED AssetType = 2 - AssetType_ASSET_TYPE_STAKING AssetType = 3 - AssetType_ASSET_TYPE_POOL AssetType = 4 - AssetType_ASSET_TYPE_IBC AssetType = 5 - AssetType_ASSET_TYPE_CW20 AssetType = 6 -) - -// Enum value maps for AssetType. -var ( - AssetType_name = map[int32]string{ - 0: "ASSET_TYPE_UNSPECIFIED", - 1: "ASSET_TYPE_NATIVE", - 2: "ASSET_TYPE_WRAPPED", - 3: "ASSET_TYPE_STAKING", - 4: "ASSET_TYPE_POOL", - 5: "ASSET_TYPE_IBC", - 6: "ASSET_TYPE_CW20", - } - AssetType_value = map[string]int32{ - "ASSET_TYPE_UNSPECIFIED": 0, - "ASSET_TYPE_NATIVE": 1, - "ASSET_TYPE_WRAPPED": 2, - "ASSET_TYPE_STAKING": 3, - "ASSET_TYPE_POOL": 4, - "ASSET_TYPE_IBC": 5, - "ASSET_TYPE_CW20": 6, - } -) - -func (x AssetType) Enum() *AssetType { - p := new(AssetType) - *p = x - return p -} - -func (x AssetType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AssetType) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[0].Descriptor() -} - -func (AssetType) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[0] -} - -func (x AssetType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AssetType.Descriptor instead. -func (AssetType) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{0} -} - -// DIDNamespace define the different namespaces of DID -type DIDNamespace int32 - -const ( - DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0 - DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1 - DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2 - DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3 - DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4 - DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5 - DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6 - DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7 - DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8 -) - -// Enum value maps for DIDNamespace. -var ( - DIDNamespace_name = map[int32]string{ - 0: "DID_NAMESPACE_UNSPECIFIED", - 1: "DID_NAMESPACE_IPFS", - 2: "DID_NAMESPACE_SONR", - 3: "DID_NAMESPACE_BITCOIN", - 4: "DID_NAMESPACE_ETHEREUM", - 5: "DID_NAMESPACE_IBC", - 6: "DID_NAMESPACE_WEBAUTHN", - 7: "DID_NAMESPACE_DWN", - 8: "DID_NAMESPACE_SERVICE", - } - DIDNamespace_value = map[string]int32{ - "DID_NAMESPACE_UNSPECIFIED": 0, - "DID_NAMESPACE_IPFS": 1, - "DID_NAMESPACE_SONR": 2, - "DID_NAMESPACE_BITCOIN": 3, - "DID_NAMESPACE_ETHEREUM": 4, - "DID_NAMESPACE_IBC": 5, - "DID_NAMESPACE_WEBAUTHN": 6, - "DID_NAMESPACE_DWN": 7, - "DID_NAMESPACE_SERVICE": 8, - } -) - -func (x DIDNamespace) Enum() *DIDNamespace { - p := new(DIDNamespace) - *p = x - return p -} - -func (x DIDNamespace) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DIDNamespace) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[1].Descriptor() -} - -func (DIDNamespace) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[1] -} - -func (x DIDNamespace) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DIDNamespace.Descriptor instead. -func (DIDNamespace) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} -} - -// KeyAlgorithm defines the key algorithm -type KeyAlgorithm int32 - -const ( - KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0 - KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1 - KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2 - KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3 - KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4 - KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5 - KeyAlgorithm_KEY_ALGORITHM_ECDSA KeyAlgorithm = 6 // Fixed typo from EDCSA to ECDSA -) - -// Enum value maps for KeyAlgorithm. -var ( - KeyAlgorithm_name = map[int32]string{ - 0: "KEY_ALGORITHM_UNSPECIFIED", - 1: "KEY_ALGORITHM_ES256", - 2: "KEY_ALGORITHM_ES384", - 3: "KEY_ALGORITHM_ES512", - 4: "KEY_ALGORITHM_EDDSA", - 5: "KEY_ALGORITHM_ES256K", - 6: "KEY_ALGORITHM_ECDSA", - } - KeyAlgorithm_value = map[string]int32{ - "KEY_ALGORITHM_UNSPECIFIED": 0, - "KEY_ALGORITHM_ES256": 1, - "KEY_ALGORITHM_ES384": 2, - "KEY_ALGORITHM_ES512": 3, - "KEY_ALGORITHM_EDDSA": 4, - "KEY_ALGORITHM_ES256K": 5, - "KEY_ALGORITHM_ECDSA": 6, - } -) - -func (x KeyAlgorithm) Enum() *KeyAlgorithm { - p := new(KeyAlgorithm) - *p = x - return p -} - -func (x KeyAlgorithm) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KeyAlgorithm) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[2].Descriptor() -} - -func (KeyAlgorithm) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[2] -} - -func (x KeyAlgorithm) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KeyAlgorithm.Descriptor instead. -func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} -} - -// KeyCurve defines the key curve -type KeyCurve int32 - -const ( - KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0 - KeyCurve_KEY_CURVE_P256 KeyCurve = 1 // NIST P-256 - KeyCurve_KEY_CURVE_P384 KeyCurve = 2 - KeyCurve_KEY_CURVE_P521 KeyCurve = 3 - KeyCurve_KEY_CURVE_X25519 KeyCurve = 4 - KeyCurve_KEY_CURVE_X448 KeyCurve = 5 - KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6 - KeyCurve_KEY_CURVE_ED448 KeyCurve = 7 - KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8 - KeyCurve_KEY_CURVE_BLS12381 KeyCurve = 9 - KeyCurve_KEY_CURVE_KECCAK256 KeyCurve = 10 -) - -// Enum value maps for KeyCurve. -var ( - KeyCurve_name = map[int32]string{ - 0: "KEY_CURVE_UNSPECIFIED", - 1: "KEY_CURVE_P256", - 2: "KEY_CURVE_P384", - 3: "KEY_CURVE_P521", - 4: "KEY_CURVE_X25519", - 5: "KEY_CURVE_X448", - 6: "KEY_CURVE_ED25519", - 7: "KEY_CURVE_ED448", - 8: "KEY_CURVE_SECP256K1", - 9: "KEY_CURVE_BLS12381", - 10: "KEY_CURVE_KECCAK256", - } - KeyCurve_value = map[string]int32{ - "KEY_CURVE_UNSPECIFIED": 0, - "KEY_CURVE_P256": 1, - "KEY_CURVE_P384": 2, - "KEY_CURVE_P521": 3, - "KEY_CURVE_X25519": 4, - "KEY_CURVE_X448": 5, - "KEY_CURVE_ED25519": 6, - "KEY_CURVE_ED448": 7, - "KEY_CURVE_SECP256K1": 8, - "KEY_CURVE_BLS12381": 9, - "KEY_CURVE_KECCAK256": 10, - } -) - -func (x KeyCurve) Enum() *KeyCurve { - p := new(KeyCurve) - *p = x - return p -} - -func (x KeyCurve) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KeyCurve) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[3].Descriptor() -} - -func (KeyCurve) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[3] -} - -func (x KeyCurve) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KeyCurve.Descriptor instead. -func (KeyCurve) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} -} - -// KeyEncoding defines the key encoding -type KeyEncoding int32 - -const ( - KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0 - KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1 - KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2 - KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3 -) - -// Enum value maps for KeyEncoding. -var ( - KeyEncoding_name = map[int32]string{ - 0: "KEY_ENCODING_UNSPECIFIED", - 1: "KEY_ENCODING_RAW", - 2: "KEY_ENCODING_HEX", - 3: "KEY_ENCODING_MULTIBASE", - } - KeyEncoding_value = map[string]int32{ - "KEY_ENCODING_UNSPECIFIED": 0, - "KEY_ENCODING_RAW": 1, - "KEY_ENCODING_HEX": 2, - "KEY_ENCODING_MULTIBASE": 3, - } -) - -func (x KeyEncoding) Enum() *KeyEncoding { - p := new(KeyEncoding) - *p = x - return p -} - -func (x KeyEncoding) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KeyEncoding) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[4].Descriptor() -} - -func (KeyEncoding) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[4] -} - -func (x KeyEncoding) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KeyEncoding.Descriptor instead. -func (KeyEncoding) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{4} -} - -// KeyRole defines the kind of key -type KeyRole int32 - -const ( - KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0 - KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1 // Passkeys and FIDO - KeyRole_KEY_ROLE_ASSERTION KeyRole = 2 // Zk Identifiers - KeyRole_KEY_ROLE_DELEGATION KeyRole = 3 // ETH,BTC,IBC addresses - KeyRole_KEY_ROLE_INVOCATION KeyRole = 4 // DWN Controllers -) - -// Enum value maps for KeyRole. -var ( - KeyRole_name = map[int32]string{ - 0: "KEY_ROLE_UNSPECIFIED", - 1: "KEY_ROLE_AUTHENTICATION", - 2: "KEY_ROLE_ASSERTION", - 3: "KEY_ROLE_DELEGATION", - 4: "KEY_ROLE_INVOCATION", - } - KeyRole_value = map[string]int32{ - "KEY_ROLE_UNSPECIFIED": 0, - "KEY_ROLE_AUTHENTICATION": 1, - "KEY_ROLE_ASSERTION": 2, - "KEY_ROLE_DELEGATION": 3, - "KEY_ROLE_INVOCATION": 4, - } -) - -func (x KeyRole) Enum() *KeyRole { - p := new(KeyRole) - *p = x - return p -} - -func (x KeyRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KeyRole) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[5].Descriptor() -} - -func (KeyRole) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[5] -} - -func (x KeyRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KeyRole.Descriptor instead. -func (KeyRole) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{5} -} - -// KeyType defines the key type -type KeyType int32 - -const ( - KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0 - KeyType_KEY_TYPE_OCTET KeyType = 1 - KeyType_KEY_TYPE_ELLIPTIC KeyType = 2 - KeyType_KEY_TYPE_RSA KeyType = 3 - KeyType_KEY_TYPE_SYMMETRIC KeyType = 4 - KeyType_KEY_TYPE_HMAC KeyType = 5 - KeyType_KEY_TYPE_MPC KeyType = 6 - KeyType_KEY_TYPE_ZK KeyType = 7 - KeyType_KEY_TYPE_WEBAUTHN KeyType = 8 - KeyType_KEY_TYPE_BIP32 KeyType = 9 -) - -// Enum value maps for KeyType. -var ( - KeyType_name = map[int32]string{ - 0: "KEY_TYPE_UNSPECIFIED", - 1: "KEY_TYPE_OCTET", - 2: "KEY_TYPE_ELLIPTIC", - 3: "KEY_TYPE_RSA", - 4: "KEY_TYPE_SYMMETRIC", - 5: "KEY_TYPE_HMAC", - 6: "KEY_TYPE_MPC", - 7: "KEY_TYPE_ZK", - 8: "KEY_TYPE_WEBAUTHN", - 9: "KEY_TYPE_BIP32", - } - KeyType_value = map[string]int32{ - "KEY_TYPE_UNSPECIFIED": 0, - "KEY_TYPE_OCTET": 1, - "KEY_TYPE_ELLIPTIC": 2, - "KEY_TYPE_RSA": 3, - "KEY_TYPE_SYMMETRIC": 4, - "KEY_TYPE_HMAC": 5, - "KEY_TYPE_MPC": 6, - "KEY_TYPE_ZK": 7, - "KEY_TYPE_WEBAUTHN": 8, - "KEY_TYPE_BIP32": 9, - } -) - -func (x KeyType) Enum() *KeyType { - p := new(KeyType) - *p = x - return p -} - -func (x KeyType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KeyType) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[6].Descriptor() -} - -func (KeyType) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[6] -} - -func (x KeyType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KeyType.Descriptor instead. -func (KeyType) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{6} -} - -type KeyshareRole int32 - -const ( - KeyshareRole_KEYSHARE_ROLE_UNSPECIFIED KeyshareRole = 0 - KeyshareRole_KEYSHARE_ROLE_USER KeyshareRole = 1 - KeyshareRole_KEYSHARE_ROLE_VALIDATOR KeyshareRole = 2 -) - -// Enum value maps for KeyshareRole. -var ( - KeyshareRole_name = map[int32]string{ - 0: "KEYSHARE_ROLE_UNSPECIFIED", - 1: "KEYSHARE_ROLE_USER", - 2: "KEYSHARE_ROLE_VALIDATOR", - } - KeyshareRole_value = map[string]int32{ - "KEYSHARE_ROLE_UNSPECIFIED": 0, - "KEYSHARE_ROLE_USER": 1, - "KEYSHARE_ROLE_VALIDATOR": 2, - } -) - -func (x KeyshareRole) Enum() *KeyshareRole { - p := new(KeyshareRole) - *p = x - return p -} - -func (x KeyshareRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KeyshareRole) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[7].Descriptor() -} - -func (KeyshareRole) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[7] -} - -func (x KeyshareRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KeyshareRole.Descriptor instead. -func (KeyshareRole) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{7} -} - -// PermissionScope define the Capabilities Controllers can grant for Services -type PermissionScope int32 - -const ( - PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0 - PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1 - PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ PermissionScope = 2 - PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE PermissionScope = 3 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5 - PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6 - PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7 - PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8 - PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11 - PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12 - PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13 -) - -// Enum value maps for PermissionScope. -var ( - PermissionScope_name = map[int32]string{ - 0: "PERMISSION_SCOPE_UNSPECIFIED", - 1: "PERMISSION_SCOPE_BASIC_INFO", - 2: "PERMISSION_SCOPE_PERMISSIONS_READ", - 3: "PERMISSION_SCOPE_PERMISSIONS_WRITE", - 4: "PERMISSION_SCOPE_TRANSACTIONS_READ", - 5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE", - 6: "PERMISSION_SCOPE_WALLETS_READ", - 7: "PERMISSION_SCOPE_WALLETS_CREATE", - 8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE", - 9: "PERMISSION_SCOPE_WALLETS_UPDATE", - 10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY", - 11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST", - 12: "PERMISSION_SCOPE_ADMIN_USER", - 13: "PERMISSION_SCOPE_ADMIN_VALIDATOR", - } - PermissionScope_value = map[string]int32{ - "PERMISSION_SCOPE_UNSPECIFIED": 0, - "PERMISSION_SCOPE_BASIC_INFO": 1, - "PERMISSION_SCOPE_PERMISSIONS_READ": 2, - "PERMISSION_SCOPE_PERMISSIONS_WRITE": 3, - "PERMISSION_SCOPE_TRANSACTIONS_READ": 4, - "PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5, - "PERMISSION_SCOPE_WALLETS_READ": 6, - "PERMISSION_SCOPE_WALLETS_CREATE": 7, - "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8, - "PERMISSION_SCOPE_WALLETS_UPDATE": 9, - "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10, - "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11, - "PERMISSION_SCOPE_ADMIN_USER": 12, - "PERMISSION_SCOPE_ADMIN_VALIDATOR": 13, - } -) - -func (x PermissionScope) Enum() *PermissionScope { - p := new(PermissionScope) - *p = x - return p -} - -func (x PermissionScope) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PermissionScope) Descriptor() protoreflect.EnumDescriptor { - return file_did_v1_genesis_proto_enumTypes[8].Descriptor() -} - -func (PermissionScope) Type() protoreflect.EnumType { - return &file_did_v1_genesis_proto_enumTypes[8] -} - -func (x PermissionScope) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PermissionScope.Descriptor instead. -func (PermissionScope) EnumDescriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{8} -} - // GenesisState defines the module genesis state type GenesisState struct { state protoimpl.MessageState @@ -4146,8 +6936,6 @@ type GenesisState struct { // Params defines all the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace - GlobalIntegrity *GlobalIntegrity `protobuf:"bytes,2,opt,name=global_integrity,json=globalIntegrity,proto3" json:"global_integrity,omitempty"` } func (x *GenesisState) Reset() { @@ -4177,73 +6965,6 @@ func (x *GenesisState) GetParams() *Params { return nil } -func (x *GenesisState) GetGlobalIntegrity() *GlobalIntegrity { - if x != nil { - return x.GlobalIntegrity - } - return nil -} - -// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace -type GlobalIntegrity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` - Seed string `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` - Accumulator []byte `protobuf:"bytes,3,opt,name=accumulator,proto3" json:"accumulator,omitempty"` - Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *GlobalIntegrity) Reset() { - *x = GlobalIntegrity{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GlobalIntegrity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GlobalIntegrity) ProtoMessage() {} - -// Deprecated: Use GlobalIntegrity.ProtoReflect.Descriptor instead. -func (*GlobalIntegrity) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} -} - -func (x *GlobalIntegrity) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *GlobalIntegrity) GetSeed() string { - if x != nil { - return x.Seed - } - return "" -} - -func (x *GlobalIntegrity) GetAccumulator() []byte { - if x != nil { - return x.Accumulator - } - return nil -} - -func (x *GlobalIntegrity) GetCount() uint64 { - if x != nil { - return x.Count - } - return 0 -} - // Params defines the set of module parameters. type Params struct { state protoimpl.MessageState @@ -4267,7 +6988,7 @@ type Params struct { func (x *Params) Reset() { *x = Params{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[2] + mi := &file_did_v1_genesis_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4281,7 +7002,7 @@ func (*Params) ProtoMessage() {} // Deprecated: Use Params.ProtoReflect.Descriptor instead. func (*Params) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} + return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} } func (x *Params) GetWhitelistedAssets() []*AssetInfo { @@ -4339,7 +7060,7 @@ type AssetInfo struct { // The coin symbol Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` // The coin name - AssetType AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=did.v1.AssetType" json:"asset_type,omitempty"` + AssetType string `protobuf:"bytes,4,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"` // The name of the asset Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` // The icon url @@ -4349,7 +7070,7 @@ type AssetInfo struct { func (x *AssetInfo) Reset() { *x = AssetInfo{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[3] + mi := &file_did_v1_genesis_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4363,7 +7084,7 @@ func (*AssetInfo) ProtoMessage() {} // Deprecated: Use AssetInfo.ProtoReflect.Descriptor instead. func (*AssetInfo) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} + return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} } func (x *AssetInfo) GetIndex() int64 { @@ -4387,11 +7108,11 @@ func (x *AssetInfo) GetSymbol() string { return "" } -func (x *AssetInfo) GetAssetType() AssetType { +func (x *AssetInfo) GetAssetType() string { if x != nil { return x.AssetType } - return AssetType_ASSET_TYPE_UNSPECIFIED + return "" } func (x *AssetInfo) GetName() string { @@ -4408,17 +7129,101 @@ func (x *AssetInfo) GetIconUrl() string { return "" } +// Document defines a DID document +type Document struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DID of the controller + Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` +} + +func (x *Document) Reset() { + *x = Document{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Document) ProtoMessage() {} + +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} +} + +func (x *Document) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Document) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *Document) GetAuthentication() []string { + if x != nil { + return x.Authentication + } + return nil +} + +func (x *Document) GetAssertionMethod() []string { + if x != nil { + return x.AssertionMethod + } + return nil +} + +func (x *Document) GetCapabilityDelegation() []string { + if x != nil { + return x.CapabilityDelegation + } + return nil +} + +func (x *Document) GetCapabilityInvocation() []string { + if x != nil { + return x.CapabilityInvocation + } + return nil +} + +func (x *Document) GetService() []string { + if x != nil { + return x.Service + } + return nil +} + // KeyInfo defines information for accepted PubKey types type KeyInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` - Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" - Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" - Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" - Type_ KeyType `protobuf:"varint,5,opt,name=type,proto3,enum=did.v1.KeyType" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" + Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" + Type_ string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" } func (x *KeyInfo) Reset() { @@ -4441,39 +7246,283 @@ func (*KeyInfo) Descriptor() ([]byte, []int) { return file_did_v1_genesis_proto_rawDescGZIP(), []int{4} } -func (x *KeyInfo) GetRole() KeyRole { +func (x *KeyInfo) GetRole() string { if x != nil { return x.Role } - return KeyRole_KEY_ROLE_UNSPECIFIED + return "" } -func (x *KeyInfo) GetAlgorithm() KeyAlgorithm { +func (x *KeyInfo) GetAlgorithm() string { if x != nil { return x.Algorithm } - return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED + return "" } -func (x *KeyInfo) GetEncoding() KeyEncoding { +func (x *KeyInfo) GetEncoding() string { if x != nil { return x.Encoding } - return KeyEncoding_KEY_ENCODING_UNSPECIFIED + return "" } -func (x *KeyInfo) GetCurve() KeyCurve { +func (x *KeyInfo) GetCurve() string { if x != nil { return x.Curve } - return KeyCurve_KEY_CURVE_UNSPECIFIED + return "" } -func (x *KeyInfo) GetType_() KeyType { +func (x *KeyInfo) GetType_() string { if x != nil { return x.Type_ } - return KeyType_KEY_TYPE_UNSPECIFIED + return "" +} + +// PubKey defines a public key for a did +type PubKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` + KeyType string `protobuf:"bytes,5,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` + Jwk *PubKey_JWK `protobuf:"bytes,7,opt,name=jwk,proto3" json:"jwk,omitempty"` +} + +func (x *PubKey) Reset() { + *x = PubKey{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubKey) ProtoMessage() {} + +// Deprecated: Use PubKey.ProtoReflect.Descriptor instead. +func (*PubKey) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5} +} + +func (x *PubKey) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *PubKey) GetAlgorithm() string { + if x != nil { + return x.Algorithm + } + return "" +} + +func (x *PubKey) GetEncoding() string { + if x != nil { + return x.Encoding + } + return "" +} + +func (x *PubKey) GetCurve() string { + if x != nil { + return x.Curve + } + return "" +} + +func (x *PubKey) GetKeyType() string { + if x != nil { + return x.KeyType + } + return "" +} + +func (x *PubKey) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} + +func (x *PubKey) GetJwk() *PubKey_JWK { + if x != nil { + return x.Jwk + } + return nil +} + +// Service defines a Decentralized Service on the Sonr Blockchain +type Service struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Permissions map[string]string `protobuf:"bytes,7,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Service) Reset() { + *x = Service{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Service) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Service) ProtoMessage() {} + +// Deprecated: Use Service.ProtoReflect.Descriptor instead. +func (*Service) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{6} +} + +func (x *Service) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Service) GetServiceType() string { + if x != nil { + return x.ServiceType + } + return "" +} + +func (x *Service) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *Service) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Service) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Service) GetServiceEndpoints() map[string]string { + if x != nil { + return x.ServiceEndpoints + } + return nil +} + +func (x *Service) GetPermissions() map[string]string { + if x != nil { + return x.Permissions + } + return nil +} + +// JWK represents a JSON Web Key +type PubKey_JWK struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` // Key Type + Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` // Curve (for EC and OKP keys) + X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` // X coordinate (for EC and OKP keys) + Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` // Y coordinate (for EC keys) + N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` // Modulus (for RSA keys) + E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` // Exponent (for RSA keys) +} + +func (x *PubKey_JWK) Reset() { + *x = PubKey_JWK{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubKey_JWK) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubKey_JWK) ProtoMessage() {} + +// Deprecated: Use PubKey_JWK.ProtoReflect.Descriptor instead. +func (*PubKey_JWK) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *PubKey_JWK) GetKty() string { + if x != nil { + return x.Kty + } + return "" +} + +func (x *PubKey_JWK) GetCrv() string { + if x != nil { + return x.Crv + } + return "" +} + +func (x *PubKey_JWK) GetX() string { + if x != nil { + return x.X + } + return "" +} + +func (x *PubKey_JWK) GetY() string { + if x != nil { + return x.Y + } + return "" +} + +func (x *PubKey_JWK) GetN() string { + if x != nil { + return x.N + } + return "" +} + +func (x *PubKey_JWK) GetE() string { + if x != nil { + return x.E + } + return "" } var File_did_v1_genesis_proto protoreflect.FileDescriptor @@ -4483,213 +7532,130 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x67, 0x6c, 0x6f, 0x62, 0x61, - 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x22, 0x7d, 0x0a, 0x0f, 0x47, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x65, - 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xde, 0x03, 0x0a, 0x06, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x55, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, - 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, - 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, - 0x0a, 0x1e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, - 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, - 0x63, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x16, 0x41, 0x6c, - 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 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, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, - 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, - 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x09, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, - 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x30, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0xe0, 0x01, 0x0a, 0x07, 0x4b, 0x65, - 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, - 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, - 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, - 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, - 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, - 0x26, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, - 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, - 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, 0xac, 0x01, 0x0a, - 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x53, - 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, - 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x52, 0x41, 0x50, - 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x13, 0x0a, - 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4f, 0x4f, 0x4c, - 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x30, 0x10, 0x06, 0x2a, 0xf9, 0x01, 0x0a, 0x0c, - 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x19, - 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x44, - 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x46, - 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, - 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x4e, 0x52, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x44, - 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x42, 0x49, 0x54, - 0x43, 0x4f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, - 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x45, 0x54, 0x48, 0x45, 0x52, 0x45, 0x55, 0x4d, - 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, - 0x41, 0x43, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x44, - 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, - 0x54, 0x48, 0x4e, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, - 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x57, 0x4e, 0x10, 0x07, 0x12, 0x19, 0x0a, 0x15, - 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, - 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x2a, 0xc4, 0x01, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x41, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x5f, - 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, - 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32, 0x35, 0x36, 0x10, 0x01, - 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, - 0x4d, 0x5f, 0x45, 0x53, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, - 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x35, 0x31, 0x32, - 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, - 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x44, 0x44, 0x53, 0x41, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x4b, - 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32, - 0x35, 0x36, 0x4b, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, - 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x10, 0x06, 0x2a, 0x81, - 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4b, - 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, - 0x52, 0x56, 0x45, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, - 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x12, - 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x35, 0x32, 0x31, - 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, - 0x58, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, - 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x34, 0x34, 0x38, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, - 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, - 0x39, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, - 0x5f, 0x45, 0x44, 0x34, 0x34, 0x38, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, - 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x4b, 0x31, 0x10, - 0x08, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x42, - 0x4c, 0x53, 0x31, 0x32, 0x33, 0x38, 0x31, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, - 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x32, 0x35, 0x36, - 0x10, 0x0a, 0x2a, 0x73, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, - 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, - 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, - 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, - 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x58, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4b, - 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4d, 0x55, 0x4c, 0x54, - 0x49, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03, 0x2a, 0x8a, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, - 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, - 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, - 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, - 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x53, 0x53, 0x45, 0x52, 0x54, 0x49, 0x4f, 0x4e, - 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, - 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, - 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x43, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0xd9, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, - 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x10, 0x01, 0x12, 0x15, - 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4c, 0x49, 0x50, - 0x54, 0x49, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x52, 0x53, 0x41, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x04, 0x12, - 0x11, 0x0a, 0x0d, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4d, 0x41, 0x43, - 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, - 0x50, 0x43, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x5a, 0x4b, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, - 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x49, 0x50, 0x33, 0x32, 0x10, 0x09, - 0x2a, 0x62, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x52, 0x6f, 0x6c, 0x65, - 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, - 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x53, 0x48, - 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, - 0x4f, 0x52, 0x10, 0x02, 0x2a, 0xa7, 0x04, 0x0a, 0x0f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52, 0x4d, - 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, - 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x42, - 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x50, - 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, - 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, - 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, - 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, - 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, - 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, - 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, - 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, - 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, - 0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x50, - 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, - 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x06, 0x12, 0x23, - 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, - 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x45, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, - 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x08, 0x12, 0x23, 0x0a, 0x1f, 0x50, - 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, - 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x09, - 0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, - 0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x0a, 0x12, 0x2b, 0x0a, 0x27, 0x50, 0x45, - 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, - 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x42, 0x52, 0x4f, 0x41, - 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, - 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, - 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x0c, 0x12, 0x24, 0x0a, 0x20, 0x50, 0x45, 0x52, 0x4d, - 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, - 0x49, 0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x0d, 0x42, 0x7c, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, - 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, - 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, - 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, - 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3c, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xde, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x12, 0x55, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, + 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, + 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x1e, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x16, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 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, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x17, 0x98, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x72, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, + 0x72, 0x6c, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, + 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x06, 0x50, + 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, + 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, + 0x4a, 0x57, 0x4b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, + 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, + 0xb1, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x70, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 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, 0x1a, 0x3e, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4704,42 +7670,33 @@ func file_did_v1_genesis_proto_rawDescGZIP() []byte { return file_did_v1_genesis_proto_rawDescData } -var file_did_v1_genesis_proto_enumTypes = make([]protoimpl.EnumInfo, 9) -var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_did_v1_genesis_proto_goTypes = []interface{}{ - (AssetType)(0), // 0: did.v1.AssetType - (DIDNamespace)(0), // 1: did.v1.DIDNamespace - (KeyAlgorithm)(0), // 2: did.v1.KeyAlgorithm - (KeyCurve)(0), // 3: did.v1.KeyCurve - (KeyEncoding)(0), // 4: did.v1.KeyEncoding - (KeyRole)(0), // 5: did.v1.KeyRole - (KeyType)(0), // 6: did.v1.KeyType - (KeyshareRole)(0), // 7: did.v1.KeyshareRole - (PermissionScope)(0), // 8: did.v1.PermissionScope - (*GenesisState)(nil), // 9: did.v1.GenesisState - (*GlobalIntegrity)(nil), // 10: did.v1.GlobalIntegrity - (*Params)(nil), // 11: did.v1.Params - (*AssetInfo)(nil), // 12: did.v1.AssetInfo - (*KeyInfo)(nil), // 13: did.v1.KeyInfo - nil, // 14: did.v1.Params.AllowedPublicKeysEntry + (*GenesisState)(nil), // 0: did.v1.GenesisState + (*Params)(nil), // 1: did.v1.Params + (*AssetInfo)(nil), // 2: did.v1.AssetInfo + (*Document)(nil), // 3: did.v1.Document + (*KeyInfo)(nil), // 4: did.v1.KeyInfo + (*PubKey)(nil), // 5: did.v1.PubKey + (*Service)(nil), // 6: did.v1.Service + nil, // 7: did.v1.Params.AllowedPublicKeysEntry + (*PubKey_JWK)(nil), // 8: did.v1.PubKey.JWK + nil, // 9: did.v1.Service.ServiceEndpointsEntry + nil, // 10: did.v1.Service.PermissionsEntry } var file_did_v1_genesis_proto_depIdxs = []int32{ - 11, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params - 10, // 1: did.v1.GenesisState.global_integrity:type_name -> did.v1.GlobalIntegrity - 12, // 2: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo - 14, // 3: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry - 0, // 4: did.v1.AssetInfo.asset_type:type_name -> did.v1.AssetType - 5, // 5: did.v1.KeyInfo.role:type_name -> did.v1.KeyRole - 2, // 6: did.v1.KeyInfo.algorithm:type_name -> did.v1.KeyAlgorithm - 4, // 7: did.v1.KeyInfo.encoding:type_name -> did.v1.KeyEncoding - 3, // 8: did.v1.KeyInfo.curve:type_name -> did.v1.KeyCurve - 6, // 9: did.v1.KeyInfo.type:type_name -> did.v1.KeyType - 13, // 10: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params + 2, // 1: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo + 7, // 2: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry + 8, // 3: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK + 9, // 4: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry + 10, // 5: did.v1.Service.permissions:type_name -> did.v1.Service.PermissionsEntry + 4, // 6: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_did_v1_genesis_proto_init() } @@ -4761,18 +7718,6 @@ func file_did_v1_genesis_proto_init() { } } file_did_v1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalIntegrity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Params); i { case 0: return &v.state @@ -4784,7 +7729,7 @@ func file_did_v1_genesis_proto_init() { return nil } } - file_did_v1_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AssetInfo); i { case 0: return &v.state @@ -4796,6 +7741,18 @@ func file_did_v1_genesis_proto_init() { return nil } } + file_did_v1_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } file_did_v1_genesis_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyInfo); i { case 0: @@ -4808,20 +7765,55 @@ func file_did_v1_genesis_proto_init() { return nil } } + file_did_v1_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_genesis_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Service); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_genesis_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKey_JWK); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, - NumEnums: 9, - NumMessages: 6, + NumEnums: 0, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, GoTypes: file_did_v1_genesis_proto_goTypes, DependencyIndexes: file_did_v1_genesis_proto_depIdxs, - EnumInfos: file_did_v1_genesis_proto_enumTypes, MessageInfos: file_did_v1_genesis_proto_msgTypes, }.Build() File_did_v1_genesis_proto = out.File diff --git a/api/did/v1/models.pulsar.go b/api/did/v1/models.pulsar.go deleted file mode 100644 index 50bacc469..000000000 --- a/api/did/v1/models.pulsar.go +++ /dev/null @@ -1,9648 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package didv1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sort "sort" - sync "sync" -) - -var _ protoreflect.List = (*_Credential_6_list)(nil) - -type _Credential_6_list struct { - list *[]string -} - -func (x *_Credential_6_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Credential_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Credential_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Credential_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Credential_6_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Credential at list field Transport as it is not of Message kind")) -} - -func (x *_Credential_6_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Credential_6_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Credential_6_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Credential protoreflect.MessageDescriptor - fd_Credential_subject protoreflect.FieldDescriptor - fd_Credential_attestation_type protoreflect.FieldDescriptor - fd_Credential_origin protoreflect.FieldDescriptor - fd_Credential_credential_id protoreflect.FieldDescriptor - fd_Credential_public_key protoreflect.FieldDescriptor - fd_Credential_transport protoreflect.FieldDescriptor - fd_Credential_sign_count protoreflect.FieldDescriptor - fd_Credential_user_present protoreflect.FieldDescriptor - fd_Credential_user_verified protoreflect.FieldDescriptor - fd_Credential_backup_eligible protoreflect.FieldDescriptor - fd_Credential_backup_state protoreflect.FieldDescriptor - fd_Credential_clone_warning protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_Credential = File_did_v1_models_proto.Messages().ByName("Credential") - fd_Credential_subject = md_Credential.Fields().ByName("subject") - fd_Credential_attestation_type = md_Credential.Fields().ByName("attestation_type") - fd_Credential_origin = md_Credential.Fields().ByName("origin") - fd_Credential_credential_id = md_Credential.Fields().ByName("credential_id") - fd_Credential_public_key = md_Credential.Fields().ByName("public_key") - fd_Credential_transport = md_Credential.Fields().ByName("transport") - fd_Credential_sign_count = md_Credential.Fields().ByName("sign_count") - fd_Credential_user_present = md_Credential.Fields().ByName("user_present") - fd_Credential_user_verified = md_Credential.Fields().ByName("user_verified") - fd_Credential_backup_eligible = md_Credential.Fields().ByName("backup_eligible") - fd_Credential_backup_state = md_Credential.Fields().ByName("backup_state") - fd_Credential_clone_warning = md_Credential.Fields().ByName("clone_warning") -} - -var _ protoreflect.Message = (*fastReflection_Credential)(nil) - -type fastReflection_Credential Credential - -func (x *Credential) ProtoReflect() protoreflect.Message { - return (*fastReflection_Credential)(x) -} - -func (x *Credential) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Credential_messageType fastReflection_Credential_messageType -var _ protoreflect.MessageType = fastReflection_Credential_messageType{} - -type fastReflection_Credential_messageType struct{} - -func (x fastReflection_Credential_messageType) Zero() protoreflect.Message { - return (*fastReflection_Credential)(nil) -} -func (x fastReflection_Credential_messageType) New() protoreflect.Message { - return new(fastReflection_Credential) -} -func (x fastReflection_Credential_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Credential -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Credential) Descriptor() protoreflect.MessageDescriptor { - return md_Credential -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Credential) Type() protoreflect.MessageType { - return _fastReflection_Credential_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Credential) New() protoreflect.Message { - return new(fastReflection_Credential) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Credential) Interface() protoreflect.ProtoMessage { - return (*Credential)(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_Credential) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Subject != "" { - value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Credential_subject, value) { - return - } - } - if x.AttestationType != "" { - value := protoreflect.ValueOfString(x.AttestationType) - if !f(fd_Credential_attestation_type, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Credential_origin, value) { - return - } - } - if len(x.CredentialId) != 0 { - value := protoreflect.ValueOfBytes(x.CredentialId) - if !f(fd_Credential_credential_id, value) { - return - } - } - if len(x.PublicKey) != 0 { - value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_Credential_public_key, value) { - return - } - } - if len(x.Transport) != 0 { - value := protoreflect.ValueOfList(&_Credential_6_list{list: &x.Transport}) - if !f(fd_Credential_transport, value) { - return - } - } - if x.SignCount != uint32(0) { - value := protoreflect.ValueOfUint32(x.SignCount) - if !f(fd_Credential_sign_count, value) { - return - } - } - if x.UserPresent != false { - value := protoreflect.ValueOfBool(x.UserPresent) - if !f(fd_Credential_user_present, value) { - return - } - } - if x.UserVerified != false { - value := protoreflect.ValueOfBool(x.UserVerified) - if !f(fd_Credential_user_verified, value) { - return - } - } - if x.BackupEligible != false { - value := protoreflect.ValueOfBool(x.BackupEligible) - if !f(fd_Credential_backup_eligible, value) { - return - } - } - if x.BackupState != false { - value := protoreflect.ValueOfBool(x.BackupState) - if !f(fd_Credential_backup_state, value) { - return - } - } - if x.CloneWarning != false { - value := protoreflect.ValueOfBool(x.CloneWarning) - if !f(fd_Credential_clone_warning, 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_Credential) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Credential.subject": - return x.Subject != "" - case "did.v1.Credential.attestation_type": - return x.AttestationType != "" - case "did.v1.Credential.origin": - return x.Origin != "" - case "did.v1.Credential.credential_id": - return len(x.CredentialId) != 0 - case "did.v1.Credential.public_key": - return len(x.PublicKey) != 0 - case "did.v1.Credential.transport": - return len(x.Transport) != 0 - case "did.v1.Credential.sign_count": - return x.SignCount != uint32(0) - case "did.v1.Credential.user_present": - return x.UserPresent != false - case "did.v1.Credential.user_verified": - return x.UserVerified != false - case "did.v1.Credential.backup_eligible": - return x.BackupEligible != false - case "did.v1.Credential.backup_state": - return x.BackupState != false - case "did.v1.Credential.clone_warning": - return x.CloneWarning != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) - } - panic(fmt.Errorf("message did.v1.Credential 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_Credential) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Credential.subject": - x.Subject = "" - case "did.v1.Credential.attestation_type": - x.AttestationType = "" - case "did.v1.Credential.origin": - x.Origin = "" - case "did.v1.Credential.credential_id": - x.CredentialId = nil - case "did.v1.Credential.public_key": - x.PublicKey = nil - case "did.v1.Credential.transport": - x.Transport = nil - case "did.v1.Credential.sign_count": - x.SignCount = uint32(0) - case "did.v1.Credential.user_present": - x.UserPresent = false - case "did.v1.Credential.user_verified": - x.UserVerified = false - case "did.v1.Credential.backup_eligible": - x.BackupEligible = false - case "did.v1.Credential.backup_state": - x.BackupState = false - case "did.v1.Credential.clone_warning": - x.CloneWarning = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) - } - panic(fmt.Errorf("message did.v1.Credential 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_Credential) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Credential.subject": - value := x.Subject - return protoreflect.ValueOfString(value) - case "did.v1.Credential.attestation_type": - value := x.AttestationType - return protoreflect.ValueOfString(value) - case "did.v1.Credential.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.Credential.credential_id": - value := x.CredentialId - return protoreflect.ValueOfBytes(value) - case "did.v1.Credential.public_key": - value := x.PublicKey - return protoreflect.ValueOfBytes(value) - case "did.v1.Credential.transport": - if len(x.Transport) == 0 { - return protoreflect.ValueOfList(&_Credential_6_list{}) - } - listValue := &_Credential_6_list{list: &x.Transport} - return protoreflect.ValueOfList(listValue) - case "did.v1.Credential.sign_count": - value := x.SignCount - return protoreflect.ValueOfUint32(value) - case "did.v1.Credential.user_present": - value := x.UserPresent - return protoreflect.ValueOfBool(value) - case "did.v1.Credential.user_verified": - value := x.UserVerified - return protoreflect.ValueOfBool(value) - case "did.v1.Credential.backup_eligible": - value := x.BackupEligible - return protoreflect.ValueOfBool(value) - case "did.v1.Credential.backup_state": - value := x.BackupState - return protoreflect.ValueOfBool(value) - case "did.v1.Credential.clone_warning": - value := x.CloneWarning - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) - } - panic(fmt.Errorf("message did.v1.Credential 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_Credential) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Credential.subject": - x.Subject = value.Interface().(string) - case "did.v1.Credential.attestation_type": - x.AttestationType = value.Interface().(string) - case "did.v1.Credential.origin": - x.Origin = value.Interface().(string) - case "did.v1.Credential.credential_id": - x.CredentialId = value.Bytes() - case "did.v1.Credential.public_key": - x.PublicKey = value.Bytes() - case "did.v1.Credential.transport": - lv := value.List() - clv := lv.(*_Credential_6_list) - x.Transport = *clv.list - case "did.v1.Credential.sign_count": - x.SignCount = uint32(value.Uint()) - case "did.v1.Credential.user_present": - x.UserPresent = value.Bool() - case "did.v1.Credential.user_verified": - x.UserVerified = value.Bool() - case "did.v1.Credential.backup_eligible": - x.BackupEligible = value.Bool() - case "did.v1.Credential.backup_state": - x.BackupState = value.Bool() - case "did.v1.Credential.clone_warning": - x.CloneWarning = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) - } - panic(fmt.Errorf("message did.v1.Credential 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_Credential) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Credential.transport": - if x.Transport == nil { - x.Transport = []string{} - } - value := &_Credential_6_list{list: &x.Transport} - return protoreflect.ValueOfList(value) - case "did.v1.Credential.subject": - panic(fmt.Errorf("field subject of message did.v1.Credential is not mutable")) - case "did.v1.Credential.attestation_type": - panic(fmt.Errorf("field attestation_type of message did.v1.Credential is not mutable")) - case "did.v1.Credential.origin": - panic(fmt.Errorf("field origin of message did.v1.Credential is not mutable")) - case "did.v1.Credential.credential_id": - panic(fmt.Errorf("field credential_id of message did.v1.Credential is not mutable")) - case "did.v1.Credential.public_key": - panic(fmt.Errorf("field public_key of message did.v1.Credential is not mutable")) - case "did.v1.Credential.sign_count": - panic(fmt.Errorf("field sign_count of message did.v1.Credential is not mutable")) - case "did.v1.Credential.user_present": - panic(fmt.Errorf("field user_present of message did.v1.Credential is not mutable")) - case "did.v1.Credential.user_verified": - panic(fmt.Errorf("field user_verified of message did.v1.Credential is not mutable")) - case "did.v1.Credential.backup_eligible": - panic(fmt.Errorf("field backup_eligible of message did.v1.Credential is not mutable")) - case "did.v1.Credential.backup_state": - panic(fmt.Errorf("field backup_state of message did.v1.Credential is not mutable")) - case "did.v1.Credential.clone_warning": - panic(fmt.Errorf("field clone_warning of message did.v1.Credential is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) - } - panic(fmt.Errorf("message did.v1.Credential does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Credential) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Credential.subject": - return protoreflect.ValueOfString("") - case "did.v1.Credential.attestation_type": - return protoreflect.ValueOfString("") - case "did.v1.Credential.origin": - return protoreflect.ValueOfString("") - case "did.v1.Credential.credential_id": - return protoreflect.ValueOfBytes(nil) - case "did.v1.Credential.public_key": - return protoreflect.ValueOfBytes(nil) - case "did.v1.Credential.transport": - list := []string{} - return protoreflect.ValueOfList(&_Credential_6_list{list: &list}) - case "did.v1.Credential.sign_count": - return protoreflect.ValueOfUint32(uint32(0)) - case "did.v1.Credential.user_present": - return protoreflect.ValueOfBool(false) - case "did.v1.Credential.user_verified": - return protoreflect.ValueOfBool(false) - case "did.v1.Credential.backup_eligible": - return protoreflect.ValueOfBool(false) - case "did.v1.Credential.backup_state": - return protoreflect.ValueOfBool(false) - case "did.v1.Credential.clone_warning": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) - } - panic(fmt.Errorf("message did.v1.Credential does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Credential) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Credential", 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_Credential) 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_Credential) 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_Credential) 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_Credential) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Credential) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Subject) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.AttestationType) - 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.CredentialId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PublicKey) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Transport) > 0 { - for _, s := range x.Transport { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.SignCount != 0 { - n += 1 + runtime.Sov(uint64(x.SignCount)) - } - if x.UserPresent { - n += 2 - } - if x.UserVerified { - n += 2 - } - if x.BackupEligible { - n += 2 - } - if x.BackupState { - n += 2 - } - if x.CloneWarning { - n += 2 - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Credential) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.CloneWarning { - i-- - if x.CloneWarning { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x60 - } - if x.BackupState { - i-- - if x.BackupState { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - if x.BackupEligible { - i-- - if x.BackupEligible { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if x.UserVerified { - i-- - if x.UserVerified { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if x.UserPresent { - i-- - if x.UserPresent { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if x.SignCount != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.SignCount)) - i-- - dAtA[i] = 0x38 - } - if len(x.Transport) > 0 { - for iNdEx := len(x.Transport) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Transport[iNdEx]) - copy(dAtA[i:], x.Transport[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Transport[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(x.PublicKey) > 0 { - i -= len(x.PublicKey) - copy(dAtA[i:], x.PublicKey) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) - i-- - dAtA[i] = 0x2a - } - if len(x.CredentialId) > 0 { - i -= len(x.CredentialId) - copy(dAtA[i:], x.CredentialId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialId))) - i-- - dAtA[i] = 0x22 - } - 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] = 0x1a - } - if len(x.AttestationType) > 0 { - i -= len(x.AttestationType) - copy(dAtA[i:], x.AttestationType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationType))) - i-- - dAtA[i] = 0x12 - } - if len(x.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Credential) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Credential: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Credential: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.AttestationType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.CredentialId = append(x.CredentialId[:0], dAtA[iNdEx:postIndex]...) - if x.CredentialId == nil { - x.CredentialId = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if x.PublicKey == nil { - x.PublicKey = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Transport", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Transport = append(x.Transport, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SignCount", wireType) - } - x.SignCount = 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.SignCount |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UserPresent", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.UserPresent = bool(v != 0) - case 9: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UserVerified", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.UserVerified = bool(v != 0) - case 10: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BackupEligible", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.BackupEligible = bool(v != 0) - case 11: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BackupState", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.BackupState = bool(v != 0) - case 12: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CloneWarning", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.CloneWarning = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_Document_3_list)(nil) - -type _Document_3_list struct { - list *[]string -} - -func (x *_Document_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_3_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Authentication as it is not of Message kind")) -} - -func (x *_Document_3_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_3_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_3_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_4_list)(nil) - -type _Document_4_list struct { - list *[]string -} - -func (x *_Document_4_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_4_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_4_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_4_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_4_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field AssertionMethod as it is not of Message kind")) -} - -func (x *_Document_4_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_4_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_4_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_5_list)(nil) - -type _Document_5_list struct { - list *[]string -} - -func (x *_Document_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_5_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityDelegation as it is not of Message kind")) -} - -func (x *_Document_5_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_5_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_5_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_6_list)(nil) - -type _Document_6_list struct { - list *[]string -} - -func (x *_Document_6_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_6_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityInvocation as it is not of Message kind")) -} - -func (x *_Document_6_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_6_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_6_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_7_list)(nil) - -type _Document_7_list struct { - list *[]string -} - -func (x *_Document_7_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_7_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_7_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_7_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_7_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Service as it is not of Message kind")) -} - -func (x *_Document_7_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_7_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_7_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Document protoreflect.MessageDescriptor - fd_Document_id protoreflect.FieldDescriptor - fd_Document_controller protoreflect.FieldDescriptor - fd_Document_authentication protoreflect.FieldDescriptor - fd_Document_assertion_method protoreflect.FieldDescriptor - fd_Document_capability_delegation protoreflect.FieldDescriptor - fd_Document_capability_invocation protoreflect.FieldDescriptor - fd_Document_service protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_Document = File_did_v1_models_proto.Messages().ByName("Document") - fd_Document_id = md_Document.Fields().ByName("id") - fd_Document_controller = md_Document.Fields().ByName("controller") - fd_Document_authentication = md_Document.Fields().ByName("authentication") - fd_Document_assertion_method = md_Document.Fields().ByName("assertion_method") - fd_Document_capability_delegation = md_Document.Fields().ByName("capability_delegation") - fd_Document_capability_invocation = md_Document.Fields().ByName("capability_invocation") - fd_Document_service = md_Document.Fields().ByName("service") -} - -var _ protoreflect.Message = (*fastReflection_Document)(nil) - -type fastReflection_Document Document - -func (x *Document) ProtoReflect() protoreflect.Message { - return (*fastReflection_Document)(x) -} - -func (x *Document) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Document_messageType fastReflection_Document_messageType -var _ protoreflect.MessageType = fastReflection_Document_messageType{} - -type fastReflection_Document_messageType struct{} - -func (x fastReflection_Document_messageType) Zero() protoreflect.Message { - return (*fastReflection_Document)(nil) -} -func (x fastReflection_Document_messageType) New() protoreflect.Message { - return new(fastReflection_Document) -} -func (x fastReflection_Document_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Document -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Document) Descriptor() protoreflect.MessageDescriptor { - return md_Document -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Document) Type() protoreflect.MessageType { - return _fastReflection_Document_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Document) New() protoreflect.Message { - return new(fastReflection_Document) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Document) Interface() protoreflect.ProtoMessage { - return (*Document)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Document) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Document_id, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Document_controller, value) { - return - } - } - if len(x.Authentication) != 0 { - value := protoreflect.ValueOfList(&_Document_3_list{list: &x.Authentication}) - if !f(fd_Document_authentication, value) { - return - } - } - if len(x.AssertionMethod) != 0 { - value := protoreflect.ValueOfList(&_Document_4_list{list: &x.AssertionMethod}) - if !f(fd_Document_assertion_method, value) { - return - } - } - if len(x.CapabilityDelegation) != 0 { - value := protoreflect.ValueOfList(&_Document_5_list{list: &x.CapabilityDelegation}) - if !f(fd_Document_capability_delegation, value) { - return - } - } - if len(x.CapabilityInvocation) != 0 { - value := protoreflect.ValueOfList(&_Document_6_list{list: &x.CapabilityInvocation}) - if !f(fd_Document_capability_invocation, value) { - return - } - } - if len(x.Service) != 0 { - value := protoreflect.ValueOfList(&_Document_7_list{list: &x.Service}) - if !f(fd_Document_service, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Document) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Document.id": - return x.Id != "" - case "did.v1.Document.controller": - return x.Controller != "" - case "did.v1.Document.authentication": - return len(x.Authentication) != 0 - case "did.v1.Document.assertion_method": - return len(x.AssertionMethod) != 0 - case "did.v1.Document.capability_delegation": - return len(x.CapabilityDelegation) != 0 - case "did.v1.Document.capability_invocation": - return len(x.CapabilityInvocation) != 0 - case "did.v1.Document.service": - return len(x.Service) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Document) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Document.id": - x.Id = "" - case "did.v1.Document.controller": - x.Controller = "" - case "did.v1.Document.authentication": - x.Authentication = nil - case "did.v1.Document.assertion_method": - x.AssertionMethod = nil - case "did.v1.Document.capability_delegation": - x.CapabilityDelegation = nil - case "did.v1.Document.capability_invocation": - x.CapabilityInvocation = nil - case "did.v1.Document.service": - x.Service = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Document) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Document.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Document.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - case "did.v1.Document.authentication": - if len(x.Authentication) == 0 { - return protoreflect.ValueOfList(&_Document_3_list{}) - } - listValue := &_Document_3_list{list: &x.Authentication} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.assertion_method": - if len(x.AssertionMethod) == 0 { - return protoreflect.ValueOfList(&_Document_4_list{}) - } - listValue := &_Document_4_list{list: &x.AssertionMethod} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.capability_delegation": - if len(x.CapabilityDelegation) == 0 { - return protoreflect.ValueOfList(&_Document_5_list{}) - } - listValue := &_Document_5_list{list: &x.CapabilityDelegation} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.capability_invocation": - if len(x.CapabilityInvocation) == 0 { - return protoreflect.ValueOfList(&_Document_6_list{}) - } - listValue := &_Document_6_list{list: &x.CapabilityInvocation} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.service": - if len(x.Service) == 0 { - return protoreflect.ValueOfList(&_Document_7_list{}) - } - listValue := &_Document_7_list{list: &x.Service} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Document) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Document.id": - x.Id = value.Interface().(string) - case "did.v1.Document.controller": - x.Controller = value.Interface().(string) - case "did.v1.Document.authentication": - lv := value.List() - clv := lv.(*_Document_3_list) - x.Authentication = *clv.list - case "did.v1.Document.assertion_method": - lv := value.List() - clv := lv.(*_Document_4_list) - x.AssertionMethod = *clv.list - case "did.v1.Document.capability_delegation": - lv := value.List() - clv := lv.(*_Document_5_list) - x.CapabilityDelegation = *clv.list - case "did.v1.Document.capability_invocation": - lv := value.List() - clv := lv.(*_Document_6_list) - x.CapabilityInvocation = *clv.list - case "did.v1.Document.service": - lv := value.List() - clv := lv.(*_Document_7_list) - x.Service = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Document) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Document.authentication": - if x.Authentication == nil { - x.Authentication = []string{} - } - value := &_Document_3_list{list: &x.Authentication} - return protoreflect.ValueOfList(value) - case "did.v1.Document.assertion_method": - if x.AssertionMethod == nil { - x.AssertionMethod = []string{} - } - value := &_Document_4_list{list: &x.AssertionMethod} - return protoreflect.ValueOfList(value) - case "did.v1.Document.capability_delegation": - if x.CapabilityDelegation == nil { - x.CapabilityDelegation = []string{} - } - value := &_Document_5_list{list: &x.CapabilityDelegation} - return protoreflect.ValueOfList(value) - case "did.v1.Document.capability_invocation": - if x.CapabilityInvocation == nil { - x.CapabilityInvocation = []string{} - } - value := &_Document_6_list{list: &x.CapabilityInvocation} - return protoreflect.ValueOfList(value) - case "did.v1.Document.service": - if x.Service == nil { - x.Service = []string{} - } - value := &_Document_7_list{list: &x.Service} - return protoreflect.ValueOfList(value) - case "did.v1.Document.id": - panic(fmt.Errorf("field id of message did.v1.Document is not mutable")) - case "did.v1.Document.controller": - panic(fmt.Errorf("field controller of message did.v1.Document is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Document) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Document.id": - return protoreflect.ValueOfString("") - case "did.v1.Document.controller": - return protoreflect.ValueOfString("") - case "did.v1.Document.authentication": - list := []string{} - return protoreflect.ValueOfList(&_Document_3_list{list: &list}) - case "did.v1.Document.assertion_method": - list := []string{} - return protoreflect.ValueOfList(&_Document_4_list{list: &list}) - case "did.v1.Document.capability_delegation": - list := []string{} - return protoreflect.ValueOfList(&_Document_5_list{list: &list}) - case "did.v1.Document.capability_invocation": - list := []string{} - return protoreflect.ValueOfList(&_Document_6_list{list: &list}) - case "did.v1.Document.service": - list := []string{} - return protoreflect.ValueOfList(&_Document_7_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Document) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Document", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Document) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Document) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Document) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Document) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Document) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Authentication) > 0 { - for _, s := range x.Authentication { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.AssertionMethod) > 0 { - for _, s := range x.AssertionMethod { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.CapabilityDelegation) > 0 { - for _, s := range x.CapabilityDelegation { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.CapabilityInvocation) > 0 { - for _, s := range x.CapabilityInvocation { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.Service) > 0 { - for _, s := range x.Service { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Document) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Service) > 0 { - for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Service[iNdEx]) - copy(dAtA[i:], x.Service[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Service[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(x.CapabilityInvocation) > 0 { - for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.CapabilityInvocation[iNdEx]) - copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(x.CapabilityDelegation) > 0 { - for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.CapabilityDelegation[iNdEx]) - copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(x.AssertionMethod) > 0 { - for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.AssertionMethod[iNdEx]) - copy(dAtA[i:], x.AssertionMethod[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(x.Authentication) > 0 { - for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Authentication[iNdEx]) - copy(dAtA[i:], x.Authentication[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) - i-- - dAtA[i] = 0x12 - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Document) - 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: Document: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", 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.Authentication = append(x.Authentication, 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 AssertionMethod", 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.AssertionMethod = append(x.AssertionMethod, 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 CapabilityDelegation", 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.CapabilityDelegation = append(x.CapabilityDelegation, 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 CapabilityInvocation", 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.CapabilityInvocation = append(x.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service = append(x.Service, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.Map = (*_Keyshare_1_map)(nil) - -type _Keyshare_1_map struct { - m *map[string]string -} - -func (x *_Keyshare_1_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_Keyshare_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfString(v) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_Keyshare_1_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_Keyshare_1_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_Keyshare_1_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfString(v) -} - -func (x *_Keyshare_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.m)[concreteKey] = concreteValue -} - -func (x *_Keyshare_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") -} - -func (x *_Keyshare_1_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Keyshare_1_map) IsValid() bool { - return x.m != nil -} - -var _ protoreflect.Map = (*_Keyshare_2_map)(nil) - -type _Keyshare_2_map struct { - m *map[string][]byte -} - -func (x *_Keyshare_2_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_Keyshare_2_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfBytes(v) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_Keyshare_2_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_Keyshare_2_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_Keyshare_2_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfBytes(v) -} - -func (x *_Keyshare_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - (*x.m)[concreteKey] = concreteValue -} - -func (x *_Keyshare_2_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") -} - -func (x *_Keyshare_2_map) NewValue() protoreflect.Value { - var v []byte - return protoreflect.ValueOfBytes(v) -} - -func (x *_Keyshare_2_map) IsValid() bool { - return x.m != nil -} - -var ( - md_Keyshare protoreflect.MessageDescriptor - fd_Keyshare_metadata protoreflect.FieldDescriptor - fd_Keyshare_payloads protoreflect.FieldDescriptor - fd_Keyshare_protocol protoreflect.FieldDescriptor - fd_Keyshare_public_key protoreflect.FieldDescriptor - fd_Keyshare_version protoreflect.FieldDescriptor - fd_Keyshare_role protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_Keyshare = File_did_v1_models_proto.Messages().ByName("Keyshare") - fd_Keyshare_metadata = md_Keyshare.Fields().ByName("metadata") - fd_Keyshare_payloads = md_Keyshare.Fields().ByName("payloads") - fd_Keyshare_protocol = md_Keyshare.Fields().ByName("protocol") - fd_Keyshare_public_key = md_Keyshare.Fields().ByName("public_key") - fd_Keyshare_version = md_Keyshare.Fields().ByName("version") - fd_Keyshare_role = md_Keyshare.Fields().ByName("role") -} - -var _ protoreflect.Message = (*fastReflection_Keyshare)(nil) - -type fastReflection_Keyshare Keyshare - -func (x *Keyshare) ProtoReflect() protoreflect.Message { - return (*fastReflection_Keyshare)(x) -} - -func (x *Keyshare) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Keyshare_messageType fastReflection_Keyshare_messageType -var _ protoreflect.MessageType = fastReflection_Keyshare_messageType{} - -type fastReflection_Keyshare_messageType struct{} - -func (x fastReflection_Keyshare_messageType) Zero() protoreflect.Message { - return (*fastReflection_Keyshare)(nil) -} -func (x fastReflection_Keyshare_messageType) New() protoreflect.Message { - return new(fastReflection_Keyshare) -} -func (x fastReflection_Keyshare_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Keyshare -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Keyshare) Descriptor() protoreflect.MessageDescriptor { - return md_Keyshare -} - -// 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_Keyshare) Type() protoreflect.MessageType { - return _fastReflection_Keyshare_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Keyshare) New() protoreflect.Message { - return new(fastReflection_Keyshare) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Keyshare) Interface() protoreflect.ProtoMessage { - return (*Keyshare)(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_Keyshare) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfMap(&_Keyshare_1_map{m: &x.Metadata}) - if !f(fd_Keyshare_metadata, value) { - return - } - } - if len(x.Payloads) != 0 { - value := protoreflect.ValueOfMap(&_Keyshare_2_map{m: &x.Payloads}) - if !f(fd_Keyshare_payloads, value) { - return - } - } - if x.Protocol != "" { - value := protoreflect.ValueOfString(x.Protocol) - if !f(fd_Keyshare_protocol, value) { - return - } - } - if len(x.PublicKey) != 0 { - value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_Keyshare_public_key, value) { - return - } - } - if x.Version != uint32(0) { - value := protoreflect.ValueOfUint32(x.Version) - if !f(fd_Keyshare_version, value) { - return - } - } - if x.Role != int32(0) { - value := protoreflect.ValueOfInt32(x.Role) - if !f(fd_Keyshare_role, 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_Keyshare) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Keyshare.metadata": - return len(x.Metadata) != 0 - case "did.v1.Keyshare.payloads": - return len(x.Payloads) != 0 - case "did.v1.Keyshare.protocol": - return x.Protocol != "" - case "did.v1.Keyshare.public_key": - return len(x.PublicKey) != 0 - case "did.v1.Keyshare.version": - return x.Version != uint32(0) - case "did.v1.Keyshare.role": - return x.Role != int32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) - } - panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Keyshare.metadata": - x.Metadata = nil - case "did.v1.Keyshare.payloads": - x.Payloads = nil - case "did.v1.Keyshare.protocol": - x.Protocol = "" - case "did.v1.Keyshare.public_key": - x.PublicKey = nil - case "did.v1.Keyshare.version": - x.Version = uint32(0) - case "did.v1.Keyshare.role": - x.Role = int32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) - } - panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Keyshare.metadata": - if len(x.Metadata) == 0 { - return protoreflect.ValueOfMap(&_Keyshare_1_map{}) - } - mapValue := &_Keyshare_1_map{m: &x.Metadata} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.Keyshare.payloads": - if len(x.Payloads) == 0 { - return protoreflect.ValueOfMap(&_Keyshare_2_map{}) - } - mapValue := &_Keyshare_2_map{m: &x.Payloads} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.Keyshare.protocol": - value := x.Protocol - return protoreflect.ValueOfString(value) - case "did.v1.Keyshare.public_key": - value := x.PublicKey - return protoreflect.ValueOfBytes(value) - case "did.v1.Keyshare.version": - value := x.Version - return protoreflect.ValueOfUint32(value) - case "did.v1.Keyshare.role": - value := x.Role - return protoreflect.ValueOfInt32(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) - } - panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Keyshare.metadata": - mv := value.Map() - cmv := mv.(*_Keyshare_1_map) - x.Metadata = *cmv.m - case "did.v1.Keyshare.payloads": - mv := value.Map() - cmv := mv.(*_Keyshare_2_map) - x.Payloads = *cmv.m - case "did.v1.Keyshare.protocol": - x.Protocol = value.Interface().(string) - case "did.v1.Keyshare.public_key": - x.PublicKey = value.Bytes() - case "did.v1.Keyshare.version": - x.Version = uint32(value.Uint()) - case "did.v1.Keyshare.role": - x.Role = int32(value.Int()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) - } - panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Keyshare.metadata": - if x.Metadata == nil { - x.Metadata = make(map[string]string) - } - value := &_Keyshare_1_map{m: &x.Metadata} - return protoreflect.ValueOfMap(value) - case "did.v1.Keyshare.payloads": - if x.Payloads == nil { - x.Payloads = make(map[string][]byte) - } - value := &_Keyshare_2_map{m: &x.Payloads} - return protoreflect.ValueOfMap(value) - case "did.v1.Keyshare.protocol": - panic(fmt.Errorf("field protocol of message did.v1.Keyshare is not mutable")) - case "did.v1.Keyshare.public_key": - panic(fmt.Errorf("field public_key of message did.v1.Keyshare is not mutable")) - case "did.v1.Keyshare.version": - panic(fmt.Errorf("field version of message did.v1.Keyshare is not mutable")) - case "did.v1.Keyshare.role": - panic(fmt.Errorf("field role of message did.v1.Keyshare is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) - } - panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Keyshare.metadata": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_Keyshare_1_map{m: &m}) - case "did.v1.Keyshare.payloads": - m := make(map[string][]byte) - return protoreflect.ValueOfMap(&_Keyshare_2_map{m: &m}) - case "did.v1.Keyshare.protocol": - return protoreflect.ValueOfString("") - case "did.v1.Keyshare.public_key": - return protoreflect.ValueOfBytes(nil) - case "did.v1.Keyshare.version": - return protoreflect.ValueOfUint32(uint32(0)) - case "did.v1.Keyshare.role": - return protoreflect.ValueOfInt32(int32(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) - } - panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Keyshare", 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_Keyshare) 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_Keyshare) 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_Keyshare) 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_Keyshare) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Keyshare) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Metadata) > 0 { - SiZeMaP := func(k string, v string) { - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Metadata)) - for k := range x.Metadata { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Metadata[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Metadata { - SiZeMaP(k, v) - } - } - } - if len(x.Payloads) > 0 { - SiZeMaP := func(k string, v []byte) { - l = 1 + len(v) + runtime.Sov(uint64(len(v))) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Payloads)) - for k := range x.Payloads { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Payloads[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Payloads { - SiZeMaP(k, v) - } - } - } - l = len(x.Protocol) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PublicKey) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Version != 0 { - n += 1 + runtime.Sov(uint64(x.Version)) - } - if x.Role != 0 { - n += 1 + runtime.Sov(uint64(x.Role)) - } - 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().(*Keyshare) - 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.Role != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) - i-- - dAtA[i] = 0x30 - } - if x.Version != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) - i-- - dAtA[i] = 0x28 - } - if len(x.PublicKey) > 0 { - i -= len(x.PublicKey) - copy(dAtA[i:], x.PublicKey) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) - i-- - dAtA[i] = 0x22 - } - if len(x.Protocol) > 0 { - i -= len(x.Protocol) - copy(dAtA[i:], x.Protocol) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Protocol))) - i-- - dAtA[i] = 0x1a - } - if len(x.Payloads) > 0 { - MaRsHaLmAp := func(k string, v []byte) (protoiface.MarshalOutput, error) { - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForPayloads := make([]string, 0, len(x.Payloads)) - for k := range x.Payloads { - keysForPayloads = append(keysForPayloads, string(k)) - } - sort.Slice(keysForPayloads, func(i, j int) bool { - return keysForPayloads[i] < keysForPayloads[j] - }) - for iNdEx := len(keysForPayloads) - 1; iNdEx >= 0; iNdEx-- { - v := x.Payloads[string(keysForPayloads[iNdEx])] - out, err := MaRsHaLmAp(keysForPayloads[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Payloads { - v := x.Payloads[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Metadata) > 0 { - MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForMetadata := make([]string, 0, len(x.Metadata)) - for k := range x.Metadata { - keysForMetadata = append(keysForMetadata, string(k)) - } - sort.Slice(keysForMetadata, func(i, j int) bool { - return keysForMetadata[i] < keysForMetadata[j] - }) - for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { - v := x.Metadata[string(keysForMetadata[iNdEx])] - out, err := MaRsHaLmAp(keysForMetadata[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Metadata { - v := x.Metadata[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if 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().(*Keyshare) - 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: Keyshare: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshare: 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 Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Metadata == nil { - x.Metadata = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapvalue > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.Metadata[mapkey] = mapvalue - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Payloads", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Payloads == nil { - x.Payloads = make(map[string][]byte) - } - var mapkey string - var mapvalue []byte - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postbytesIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.Payloads[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Protocol", 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.Protocol = 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 PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if x.PublicKey == nil { - x.PublicKey = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - x.Version = 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.Version |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - x.Role = 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.Role |= int32(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 _ protoreflect.List = (*_Permissions_1_list)(nil) - -type _Permissions_1_list struct { - list *[]DIDNamespace -} - -func (x *_Permissions_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Permissions_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)((*x.list)[i])) -} - -func (x *_Permissions_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Enum() - concreteValue := (DIDNamespace)(valueUnwrapped) - (*x.list)[i] = concreteValue -} - -func (x *_Permissions_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Enum() - concreteValue := (DIDNamespace)(valueUnwrapped) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Permissions_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Permissions at list field Grants as it is not of Message kind")) -} - -func (x *_Permissions_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Permissions_1_list) NewElement() protoreflect.Value { - v := 0 - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(v)) -} - -func (x *_Permissions_1_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Permissions_2_list)(nil) - -type _Permissions_2_list struct { - list *[]PermissionScope -} - -func (x *_Permissions_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Permissions_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)((*x.list)[i])) -} - -func (x *_Permissions_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Enum() - concreteValue := (PermissionScope)(valueUnwrapped) - (*x.list)[i] = concreteValue -} - -func (x *_Permissions_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Enum() - concreteValue := (PermissionScope)(valueUnwrapped) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Permissions_2_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Permissions at list field Scopes as it is not of Message kind")) -} - -func (x *_Permissions_2_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Permissions_2_list) NewElement() protoreflect.Value { - v := 0 - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(v)) -} - -func (x *_Permissions_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Permissions protoreflect.MessageDescriptor - fd_Permissions_grants protoreflect.FieldDescriptor - fd_Permissions_scopes protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_Permissions = File_did_v1_models_proto.Messages().ByName("Permissions") - fd_Permissions_grants = md_Permissions.Fields().ByName("grants") - fd_Permissions_scopes = md_Permissions.Fields().ByName("scopes") -} - -var _ protoreflect.Message = (*fastReflection_Permissions)(nil) - -type fastReflection_Permissions Permissions - -func (x *Permissions) ProtoReflect() protoreflect.Message { - return (*fastReflection_Permissions)(x) -} - -func (x *Permissions) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Permissions_messageType fastReflection_Permissions_messageType -var _ protoreflect.MessageType = fastReflection_Permissions_messageType{} - -type fastReflection_Permissions_messageType struct{} - -func (x fastReflection_Permissions_messageType) Zero() protoreflect.Message { - return (*fastReflection_Permissions)(nil) -} -func (x fastReflection_Permissions_messageType) New() protoreflect.Message { - return new(fastReflection_Permissions) -} -func (x fastReflection_Permissions_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Permissions -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Permissions) Descriptor() protoreflect.MessageDescriptor { - return md_Permissions -} - -// 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_Permissions) Type() protoreflect.MessageType { - return _fastReflection_Permissions_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Permissions) New() protoreflect.Message { - return new(fastReflection_Permissions) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Permissions) Interface() protoreflect.ProtoMessage { - return (*Permissions)(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_Permissions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Grants) != 0 { - value := protoreflect.ValueOfList(&_Permissions_1_list{list: &x.Grants}) - if !f(fd_Permissions_grants, value) { - return - } - } - if len(x.Scopes) != 0 { - value := protoreflect.ValueOfList(&_Permissions_2_list{list: &x.Scopes}) - if !f(fd_Permissions_scopes, 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_Permissions) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Permissions.grants": - return len(x.Grants) != 0 - case "did.v1.Permissions.scopes": - return len(x.Scopes) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) - } - panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Permissions.grants": - x.Grants = nil - case "did.v1.Permissions.scopes": - x.Scopes = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) - } - panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Permissions.grants": - if len(x.Grants) == 0 { - return protoreflect.ValueOfList(&_Permissions_1_list{}) - } - listValue := &_Permissions_1_list{list: &x.Grants} - return protoreflect.ValueOfList(listValue) - case "did.v1.Permissions.scopes": - if len(x.Scopes) == 0 { - return protoreflect.ValueOfList(&_Permissions_2_list{}) - } - listValue := &_Permissions_2_list{list: &x.Scopes} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) - } - panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Permissions.grants": - lv := value.List() - clv := lv.(*_Permissions_1_list) - x.Grants = *clv.list - case "did.v1.Permissions.scopes": - lv := value.List() - clv := lv.(*_Permissions_2_list) - x.Scopes = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) - } - panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Permissions.grants": - if x.Grants == nil { - x.Grants = []DIDNamespace{} - } - value := &_Permissions_1_list{list: &x.Grants} - return protoreflect.ValueOfList(value) - case "did.v1.Permissions.scopes": - if x.Scopes == nil { - x.Scopes = []PermissionScope{} - } - value := &_Permissions_2_list{list: &x.Scopes} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) - } - panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Permissions.grants": - list := []DIDNamespace{} - return protoreflect.ValueOfList(&_Permissions_1_list{list: &list}) - case "did.v1.Permissions.scopes": - list := []PermissionScope{} - return protoreflect.ValueOfList(&_Permissions_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) - } - panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Permissions", 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_Permissions) 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_Permissions) 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_Permissions) 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_Permissions) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Permissions) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Grants) > 0 { - l = 0 - for _, e := range x.Grants { - l += runtime.Sov(uint64(e)) - } - n += 1 + runtime.Sov(uint64(l)) + l - } - if len(x.Scopes) > 0 { - l = 0 - for _, e := range x.Scopes { - l += runtime.Sov(uint64(e)) - } - n += 1 + runtime.Sov(uint64(l)) + l - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Permissions) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Scopes) > 0 { - var pksize2 int - for _, num := range x.Scopes { - pksize2 += runtime.Sov(uint64(num)) - } - i -= pksize2 - j1 := i - for _, num1 := range x.Scopes { - num := uint64(num1) - for num >= 1<<7 { - dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA[j1] = uint8(num) - j1++ - } - i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) - i-- - dAtA[i] = 0x12 - } - if len(x.Grants) > 0 { - var pksize4 int - for _, num := range x.Grants { - pksize4 += runtime.Sov(uint64(num)) - } - i -= pksize4 - j3 := i - for _, num1 := range x.Grants { - num := uint64(num1) - for num >= 1<<7 { - dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j3++ - } - dAtA[j3] = uint8(num) - j3++ - } - i = runtime.EncodeVarint(dAtA, i, uint64(pksize4)) - 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().(*Permissions) - 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: Permissions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Permissions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v DIDNamespace - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= DIDNamespace(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Grants = append(x.Grants, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + packedLen - 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 - } - var elementCount int - if elementCount != 0 && len(x.Grants) == 0 { - x.Grants = make([]DIDNamespace, 0, elementCount) - } - for iNdEx < postIndex { - var v DIDNamespace - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= DIDNamespace(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Grants = append(x.Grants, v) - } - } else { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Grants", wireType) - } - case 2: - if wireType == 0 { - var v PermissionScope - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= PermissionScope(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Scopes = append(x.Scopes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + packedLen - 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 - } - var elementCount int - if elementCount != 0 && len(x.Scopes) == 0 { - x.Scopes = make([]PermissionScope, 0, elementCount) - } - for iNdEx < postIndex { - var v PermissionScope - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= PermissionScope(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Scopes = append(x.Scopes, v) - } - } else { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_PubKey protoreflect.MessageDescriptor - fd_PubKey_role protoreflect.FieldDescriptor - fd_PubKey_algorithm protoreflect.FieldDescriptor - fd_PubKey_encoding protoreflect.FieldDescriptor - fd_PubKey_curve protoreflect.FieldDescriptor - fd_PubKey_key_type protoreflect.FieldDescriptor - fd_PubKey_raw protoreflect.FieldDescriptor - fd_PubKey_jwk protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_PubKey = File_did_v1_models_proto.Messages().ByName("PubKey") - fd_PubKey_role = md_PubKey.Fields().ByName("role") - fd_PubKey_algorithm = md_PubKey.Fields().ByName("algorithm") - fd_PubKey_encoding = md_PubKey.Fields().ByName("encoding") - fd_PubKey_curve = md_PubKey.Fields().ByName("curve") - fd_PubKey_key_type = md_PubKey.Fields().ByName("key_type") - fd_PubKey_raw = md_PubKey.Fields().ByName("raw") - fd_PubKey_jwk = md_PubKey.Fields().ByName("jwk") -} - -var _ protoreflect.Message = (*fastReflection_PubKey)(nil) - -type fastReflection_PubKey PubKey - -func (x *PubKey) ProtoReflect() protoreflect.Message { - return (*fastReflection_PubKey)(x) -} - -func (x *PubKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_PubKey_messageType fastReflection_PubKey_messageType -var _ protoreflect.MessageType = fastReflection_PubKey_messageType{} - -type fastReflection_PubKey_messageType struct{} - -func (x fastReflection_PubKey_messageType) Zero() protoreflect.Message { - return (*fastReflection_PubKey)(nil) -} -func (x fastReflection_PubKey_messageType) New() protoreflect.Message { - return new(fastReflection_PubKey) -} -func (x fastReflection_PubKey_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_PubKey -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_PubKey) Descriptor() protoreflect.MessageDescriptor { - return md_PubKey -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_PubKey) Type() protoreflect.MessageType { - return _fastReflection_PubKey_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_PubKey) New() protoreflect.Message { - return new(fastReflection_PubKey) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_PubKey) Interface() protoreflect.ProtoMessage { - return (*PubKey)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_PubKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Role != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) - if !f(fd_PubKey_role, value) { - return - } - } - if x.Algorithm != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Algorithm)) - if !f(fd_PubKey_algorithm, value) { - return - } - } - if x.Encoding != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Encoding)) - if !f(fd_PubKey_encoding, value) { - return - } - } - if x.Curve != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Curve)) - if !f(fd_PubKey_curve, value) { - return - } - } - if x.KeyType != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.KeyType)) - if !f(fd_PubKey_key_type, value) { - return - } - } - if len(x.Raw) != 0 { - value := protoreflect.ValueOfBytes(x.Raw) - if !f(fd_PubKey_raw, value) { - return - } - } - if x.Jwk != nil { - value := protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) - if !f(fd_PubKey_jwk, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_PubKey) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.PubKey.role": - return x.Role != 0 - case "did.v1.PubKey.algorithm": - return x.Algorithm != 0 - case "did.v1.PubKey.encoding": - return x.Encoding != 0 - case "did.v1.PubKey.curve": - return x.Curve != 0 - case "did.v1.PubKey.key_type": - return x.KeyType != 0 - case "did.v1.PubKey.raw": - return len(x.Raw) != 0 - case "did.v1.PubKey.jwk": - return x.Jwk != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.PubKey.role": - x.Role = 0 - case "did.v1.PubKey.algorithm": - x.Algorithm = 0 - case "did.v1.PubKey.encoding": - x.Encoding = 0 - case "did.v1.PubKey.curve": - x.Curve = 0 - case "did.v1.PubKey.key_type": - x.KeyType = 0 - case "did.v1.PubKey.raw": - x.Raw = nil - case "did.v1.PubKey.jwk": - x.Jwk = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_PubKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.PubKey.role": - value := x.Role - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "did.v1.PubKey.algorithm": - value := x.Algorithm - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "did.v1.PubKey.encoding": - value := x.Encoding - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "did.v1.PubKey.curve": - value := x.Curve - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "did.v1.PubKey.key_type": - value := x.KeyType - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "did.v1.PubKey.raw": - value := x.Raw - return protoreflect.ValueOfBytes(value) - case "did.v1.PubKey.jwk": - value := x.Jwk - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.PubKey.role": - x.Role = (KeyRole)(value.Enum()) - case "did.v1.PubKey.algorithm": - x.Algorithm = (KeyAlgorithm)(value.Enum()) - case "did.v1.PubKey.encoding": - x.Encoding = (KeyEncoding)(value.Enum()) - case "did.v1.PubKey.curve": - x.Curve = (KeyCurve)(value.Enum()) - case "did.v1.PubKey.key_type": - x.KeyType = (KeyType)(value.Enum()) - case "did.v1.PubKey.raw": - x.Raw = value.Bytes() - case "did.v1.PubKey.jwk": - x.Jwk = value.Message().Interface().(*PubKey_JWK) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PubKey.jwk": - if x.Jwk == nil { - x.Jwk = new(PubKey_JWK) - } - return protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) - case "did.v1.PubKey.role": - panic(fmt.Errorf("field role of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.algorithm": - panic(fmt.Errorf("field algorithm of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.encoding": - panic(fmt.Errorf("field encoding of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.curve": - panic(fmt.Errorf("field curve of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.key_type": - panic(fmt.Errorf("field key_type of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.raw": - panic(fmt.Errorf("field raw of message did.v1.PubKey is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_PubKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PubKey.role": - return protoreflect.ValueOfEnum(0) - case "did.v1.PubKey.algorithm": - return protoreflect.ValueOfEnum(0) - case "did.v1.PubKey.encoding": - return protoreflect.ValueOfEnum(0) - case "did.v1.PubKey.curve": - return protoreflect.ValueOfEnum(0) - case "did.v1.PubKey.key_type": - return protoreflect.ValueOfEnum(0) - case "did.v1.PubKey.raw": - return protoreflect.ValueOfBytes(nil) - case "did.v1.PubKey.jwk": - m := new(PubKey_JWK) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_PubKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_PubKey) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_PubKey) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*PubKey) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Role != 0 { - n += 1 + runtime.Sov(uint64(x.Role)) - } - if x.Algorithm != 0 { - n += 1 + runtime.Sov(uint64(x.Algorithm)) - } - if x.Encoding != 0 { - n += 1 + runtime.Sov(uint64(x.Encoding)) - } - if x.Curve != 0 { - n += 1 + runtime.Sov(uint64(x.Curve)) - } - if x.KeyType != 0 { - n += 1 + runtime.Sov(uint64(x.KeyType)) - } - l = len(x.Raw) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Jwk != nil { - l = options.Size(x.Jwk) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*PubKey) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Jwk != nil { - encoded, err := options.Marshal(x.Jwk) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x3a - } - if len(x.Raw) > 0 { - i -= len(x.Raw) - copy(dAtA[i:], x.Raw) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Raw))) - i-- - dAtA[i] = 0x32 - } - if x.KeyType != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.KeyType)) - i-- - dAtA[i] = 0x28 - } - if x.Curve != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Curve)) - i-- - dAtA[i] = 0x20 - } - if x.Encoding != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Encoding)) - i-- - dAtA[i] = 0x18 - } - if x.Algorithm != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Algorithm)) - i-- - dAtA[i] = 0x10 - } - if x.Role != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*PubKey) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - x.Role = 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.Role |= KeyRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) - } - x.Algorithm = 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.Algorithm |= KeyAlgorithm(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) - } - x.Encoding = 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.Encoding |= KeyEncoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) - } - x.Curve = 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.Curve |= KeyCurve(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) - } - x.KeyType = 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.KeyType |= KeyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Raw = append(x.Raw[:0], dAtA[iNdEx:postIndex]...) - if x.Raw == nil { - x.Raw = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Jwk == nil { - x.Jwk = &PubKey_JWK{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Jwk); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_PubKey_JWK protoreflect.MessageDescriptor - fd_PubKey_JWK_kty protoreflect.FieldDescriptor - fd_PubKey_JWK_crv protoreflect.FieldDescriptor - fd_PubKey_JWK_x protoreflect.FieldDescriptor - fd_PubKey_JWK_y protoreflect.FieldDescriptor - fd_PubKey_JWK_n protoreflect.FieldDescriptor - fd_PubKey_JWK_e protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_PubKey_JWK = File_did_v1_models_proto.Messages().ByName("PubKey").Messages().ByName("JWK") - fd_PubKey_JWK_kty = md_PubKey_JWK.Fields().ByName("kty") - fd_PubKey_JWK_crv = md_PubKey_JWK.Fields().ByName("crv") - fd_PubKey_JWK_x = md_PubKey_JWK.Fields().ByName("x") - fd_PubKey_JWK_y = md_PubKey_JWK.Fields().ByName("y") - fd_PubKey_JWK_n = md_PubKey_JWK.Fields().ByName("n") - fd_PubKey_JWK_e = md_PubKey_JWK.Fields().ByName("e") -} - -var _ protoreflect.Message = (*fastReflection_PubKey_JWK)(nil) - -type fastReflection_PubKey_JWK PubKey_JWK - -func (x *PubKey_JWK) ProtoReflect() protoreflect.Message { - return (*fastReflection_PubKey_JWK)(x) -} - -func (x *PubKey_JWK) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_PubKey_JWK_messageType fastReflection_PubKey_JWK_messageType -var _ protoreflect.MessageType = fastReflection_PubKey_JWK_messageType{} - -type fastReflection_PubKey_JWK_messageType struct{} - -func (x fastReflection_PubKey_JWK_messageType) Zero() protoreflect.Message { - return (*fastReflection_PubKey_JWK)(nil) -} -func (x fastReflection_PubKey_JWK_messageType) New() protoreflect.Message { - return new(fastReflection_PubKey_JWK) -} -func (x fastReflection_PubKey_JWK_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_PubKey_JWK -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_PubKey_JWK) Descriptor() protoreflect.MessageDescriptor { - return md_PubKey_JWK -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_PubKey_JWK) Type() protoreflect.MessageType { - return _fastReflection_PubKey_JWK_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_PubKey_JWK) New() protoreflect.Message { - return new(fastReflection_PubKey_JWK) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_PubKey_JWK) Interface() protoreflect.ProtoMessage { - return (*PubKey_JWK)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_PubKey_JWK) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Kty != "" { - value := protoreflect.ValueOfString(x.Kty) - if !f(fd_PubKey_JWK_kty, value) { - return - } - } - if x.Crv != "" { - value := protoreflect.ValueOfString(x.Crv) - if !f(fd_PubKey_JWK_crv, value) { - return - } - } - if x.X != "" { - value := protoreflect.ValueOfString(x.X) - if !f(fd_PubKey_JWK_x, value) { - return - } - } - if x.Y != "" { - value := protoreflect.ValueOfString(x.Y) - if !f(fd_PubKey_JWK_y, value) { - return - } - } - if x.N != "" { - value := protoreflect.ValueOfString(x.N) - if !f(fd_PubKey_JWK_n, value) { - return - } - } - if x.E != "" { - value := protoreflect.ValueOfString(x.E) - if !f(fd_PubKey_JWK_e, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_PubKey_JWK) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.PubKey.JWK.kty": - return x.Kty != "" - case "did.v1.PubKey.JWK.crv": - return x.Crv != "" - case "did.v1.PubKey.JWK.x": - return x.X != "" - case "did.v1.PubKey.JWK.y": - return x.Y != "" - case "did.v1.PubKey.JWK.n": - return x.N != "" - case "did.v1.PubKey.JWK.e": - return x.E != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) - } - panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey_JWK) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.PubKey.JWK.kty": - x.Kty = "" - case "did.v1.PubKey.JWK.crv": - x.Crv = "" - case "did.v1.PubKey.JWK.x": - x.X = "" - case "did.v1.PubKey.JWK.y": - x.Y = "" - case "did.v1.PubKey.JWK.n": - x.N = "" - case "did.v1.PubKey.JWK.e": - x.E = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) - } - panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_PubKey_JWK) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.PubKey.JWK.kty": - value := x.Kty - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.JWK.crv": - value := x.Crv - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.JWK.x": - value := x.X - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.JWK.y": - value := x.Y - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.JWK.n": - value := x.N - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.JWK.e": - value := x.E - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) - } - panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey_JWK) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.PubKey.JWK.kty": - x.Kty = value.Interface().(string) - case "did.v1.PubKey.JWK.crv": - x.Crv = value.Interface().(string) - case "did.v1.PubKey.JWK.x": - x.X = value.Interface().(string) - case "did.v1.PubKey.JWK.y": - x.Y = value.Interface().(string) - case "did.v1.PubKey.JWK.n": - x.N = value.Interface().(string) - case "did.v1.PubKey.JWK.e": - x.E = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) - } - panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey_JWK) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PubKey.JWK.kty": - panic(fmt.Errorf("field kty of message did.v1.PubKey.JWK is not mutable")) - case "did.v1.PubKey.JWK.crv": - panic(fmt.Errorf("field crv of message did.v1.PubKey.JWK is not mutable")) - case "did.v1.PubKey.JWK.x": - panic(fmt.Errorf("field x of message did.v1.PubKey.JWK is not mutable")) - case "did.v1.PubKey.JWK.y": - panic(fmt.Errorf("field y of message did.v1.PubKey.JWK is not mutable")) - case "did.v1.PubKey.JWK.n": - panic(fmt.Errorf("field n of message did.v1.PubKey.JWK is not mutable")) - case "did.v1.PubKey.JWK.e": - panic(fmt.Errorf("field e of message did.v1.PubKey.JWK is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) - } - panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_PubKey_JWK) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PubKey.JWK.kty": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.JWK.crv": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.JWK.x": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.JWK.y": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.JWK.n": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.JWK.e": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) - } - panic(fmt.Errorf("message did.v1.PubKey.JWK does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_PubKey_JWK) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey.JWK", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_PubKey_JWK) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_PubKey_JWK) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_PubKey_JWK) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_PubKey_JWK) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*PubKey_JWK) - 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.Kty) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Crv) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.X) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Y) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.N) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.E) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*PubKey_JWK) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.E) > 0 { - i -= len(x.E) - copy(dAtA[i:], x.E) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.E))) - i-- - dAtA[i] = 0x32 - } - if len(x.N) > 0 { - i -= len(x.N) - copy(dAtA[i:], x.N) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.N))) - i-- - dAtA[i] = 0x2a - } - if len(x.Y) > 0 { - i -= len(x.Y) - copy(dAtA[i:], x.Y) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Y))) - i-- - dAtA[i] = 0x22 - } - if len(x.X) > 0 { - i -= len(x.X) - copy(dAtA[i:], x.X) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.X))) - i-- - dAtA[i] = 0x1a - } - if len(x.Crv) > 0 { - i -= len(x.Crv) - copy(dAtA[i:], x.Crv) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Crv))) - i-- - dAtA[i] = 0x12 - } - if len(x.Kty) > 0 { - i -= len(x.Kty) - copy(dAtA[i:], x.Kty) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kty))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*PubKey_JWK) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey_JWK: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey_JWK: 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 Kty", 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.Kty = 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 Crv", 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.Crv = 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 X", 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.X = 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 Y", 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.Y = 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 N", 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.N = 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 E", 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.E = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.Map = (*_Service_6_map)(nil) - -type _Service_6_map struct { - m *map[string]string -} - -func (x *_Service_6_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_Service_6_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfString(v) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_Service_6_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_Service_6_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_Service_6_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfString(v) -} - -func (x *_Service_6_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.m)[concreteKey] = concreteValue -} - -func (x *_Service_6_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") -} - -func (x *_Service_6_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Service_6_map) IsValid() bool { - return x.m != nil -} - -var ( - md_Service protoreflect.MessageDescriptor - fd_Service_id protoreflect.FieldDescriptor - fd_Service_service_type protoreflect.FieldDescriptor - fd_Service_authority protoreflect.FieldDescriptor - fd_Service_origin protoreflect.FieldDescriptor - fd_Service_description protoreflect.FieldDescriptor - fd_Service_service_endpoints protoreflect.FieldDescriptor - fd_Service_permissions protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_Service = File_did_v1_models_proto.Messages().ByName("Service") - fd_Service_id = md_Service.Fields().ByName("id") - fd_Service_service_type = md_Service.Fields().ByName("service_type") - fd_Service_authority = md_Service.Fields().ByName("authority") - fd_Service_origin = md_Service.Fields().ByName("origin") - fd_Service_description = md_Service.Fields().ByName("description") - fd_Service_service_endpoints = md_Service.Fields().ByName("service_endpoints") - fd_Service_permissions = md_Service.Fields().ByName("permissions") -} - -var _ protoreflect.Message = (*fastReflection_Service)(nil) - -type fastReflection_Service Service - -func (x *Service) ProtoReflect() protoreflect.Message { - return (*fastReflection_Service)(x) -} - -func (x *Service) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Service_messageType fastReflection_Service_messageType -var _ protoreflect.MessageType = fastReflection_Service_messageType{} - -type fastReflection_Service_messageType struct{} - -func (x fastReflection_Service_messageType) Zero() protoreflect.Message { - return (*fastReflection_Service)(nil) -} -func (x fastReflection_Service_messageType) New() protoreflect.Message { - return new(fastReflection_Service) -} -func (x fastReflection_Service_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Service -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Service) Descriptor() protoreflect.MessageDescriptor { - return md_Service -} - -// 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_Service) Type() protoreflect.MessageType { - return _fastReflection_Service_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Service) New() protoreflect.Message { - return new(fastReflection_Service) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Service) Interface() protoreflect.ProtoMessage { - return (*Service)(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_Service) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Service_id, value) { - return - } - } - if x.ServiceType != "" { - value := protoreflect.ValueOfString(x.ServiceType) - if !f(fd_Service_service_type, value) { - return - } - } - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_Service_authority, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Service_origin, value) { - return - } - } - if x.Description != "" { - value := protoreflect.ValueOfString(x.Description) - if !f(fd_Service_description, value) { - return - } - } - if len(x.ServiceEndpoints) != 0 { - value := protoreflect.ValueOfMap(&_Service_6_map{m: &x.ServiceEndpoints}) - if !f(fd_Service_service_endpoints, value) { - return - } - } - if x.Permissions != nil { - value := protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) - if !f(fd_Service_permissions, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Service) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Service.id": - return x.Id != "" - case "did.v1.Service.service_type": - return x.ServiceType != "" - case "did.v1.Service.authority": - return x.Authority != "" - case "did.v1.Service.origin": - return x.Origin != "" - case "did.v1.Service.description": - return x.Description != "" - case "did.v1.Service.service_endpoints": - return len(x.ServiceEndpoints) != 0 - case "did.v1.Service.permissions": - return x.Permissions != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) - } - panic(fmt.Errorf("message did.v1.Service 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_Service) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Service.id": - x.Id = "" - case "did.v1.Service.service_type": - x.ServiceType = "" - case "did.v1.Service.authority": - x.Authority = "" - case "did.v1.Service.origin": - x.Origin = "" - case "did.v1.Service.description": - x.Description = "" - case "did.v1.Service.service_endpoints": - x.ServiceEndpoints = nil - case "did.v1.Service.permissions": - x.Permissions = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) - } - panic(fmt.Errorf("message did.v1.Service 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_Service) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Service.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Service.service_type": - value := x.ServiceType - return protoreflect.ValueOfString(value) - case "did.v1.Service.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "did.v1.Service.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.Service.description": - value := x.Description - return protoreflect.ValueOfString(value) - case "did.v1.Service.service_endpoints": - if len(x.ServiceEndpoints) == 0 { - return protoreflect.ValueOfMap(&_Service_6_map{}) - } - mapValue := &_Service_6_map{m: &x.ServiceEndpoints} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.Service.permissions": - value := x.Permissions - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) - } - panic(fmt.Errorf("message did.v1.Service 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_Service) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Service.id": - x.Id = value.Interface().(string) - case "did.v1.Service.service_type": - x.ServiceType = value.Interface().(string) - case "did.v1.Service.authority": - x.Authority = value.Interface().(string) - case "did.v1.Service.origin": - x.Origin = value.Interface().(string) - case "did.v1.Service.description": - x.Description = value.Interface().(string) - case "did.v1.Service.service_endpoints": - mv := value.Map() - cmv := mv.(*_Service_6_map) - x.ServiceEndpoints = *cmv.m - case "did.v1.Service.permissions": - x.Permissions = value.Message().Interface().(*Permissions) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) - } - panic(fmt.Errorf("message did.v1.Service 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_Service) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Service.service_endpoints": - if x.ServiceEndpoints == nil { - x.ServiceEndpoints = make(map[string]string) - } - value := &_Service_6_map{m: &x.ServiceEndpoints} - return protoreflect.ValueOfMap(value) - case "did.v1.Service.permissions": - if x.Permissions == nil { - x.Permissions = new(Permissions) - } - return protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) - case "did.v1.Service.id": - panic(fmt.Errorf("field id of message did.v1.Service is not mutable")) - case "did.v1.Service.service_type": - panic(fmt.Errorf("field service_type of message did.v1.Service is not mutable")) - case "did.v1.Service.authority": - panic(fmt.Errorf("field authority of message did.v1.Service is not mutable")) - case "did.v1.Service.origin": - panic(fmt.Errorf("field origin of message did.v1.Service is not mutable")) - case "did.v1.Service.description": - panic(fmt.Errorf("field description of message did.v1.Service is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) - } - panic(fmt.Errorf("message did.v1.Service 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_Service) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Service.id": - return protoreflect.ValueOfString("") - case "did.v1.Service.service_type": - return protoreflect.ValueOfString("") - case "did.v1.Service.authority": - return protoreflect.ValueOfString("") - case "did.v1.Service.origin": - return protoreflect.ValueOfString("") - case "did.v1.Service.description": - return protoreflect.ValueOfString("") - case "did.v1.Service.service_endpoints": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_Service_6_map{m: &m}) - case "did.v1.Service.permissions": - m := new(Permissions) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) - } - panic(fmt.Errorf("message did.v1.Service 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_Service) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Service", 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_Service) 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_Service) 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_Service) 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_Service) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Service) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ServiceType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Description) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.ServiceEndpoints) > 0 { - SiZeMaP := func(k string, v string) { - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.ServiceEndpoints)) - for k := range x.ServiceEndpoints { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.ServiceEndpoints[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.ServiceEndpoints { - SiZeMaP(k, v) - } - } - } - if x.Permissions != nil { - l = options.Size(x.Permissions) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Service) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Permissions != nil { - encoded, err := options.Marshal(x.Permissions) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x3a - } - if len(x.ServiceEndpoints) > 0 { - MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForServiceEndpoints := make([]string, 0, len(x.ServiceEndpoints)) - for k := range x.ServiceEndpoints { - keysForServiceEndpoints = append(keysForServiceEndpoints, string(k)) - } - sort.Slice(keysForServiceEndpoints, func(i, j int) bool { - return keysForServiceEndpoints[i] < keysForServiceEndpoints[j] - }) - for iNdEx := len(keysForServiceEndpoints) - 1; iNdEx >= 0; iNdEx-- { - v := x.ServiceEndpoints[string(keysForServiceEndpoints[iNdEx])] - out, err := MaRsHaLmAp(keysForServiceEndpoints[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.ServiceEndpoints { - v := x.ServiceEndpoints[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Description) > 0 { - i -= len(x.Description) - copy(dAtA[i:], x.Description) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) - i-- - dAtA[i] = 0x2a - } - if len(x.Origin) > 0 { - i -= len(x.Origin) - copy(dAtA[i:], x.Origin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) - i-- - dAtA[i] = 0x22 - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0x1a - } - if len(x.ServiceType) > 0 { - i -= len(x.ServiceType) - copy(dAtA[i:], x.ServiceType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) - i-- - dAtA[i] = 0x12 - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Service) - 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: Service: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ServiceType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.ServiceEndpoints == nil { - x.ServiceEndpoints = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapvalue > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.ServiceEndpoints[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Permissions == nil { - x.Permissions = &Permissions{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Permissions); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_ServiceInfo protoreflect.MessageDescriptor - fd_ServiceInfo_exists protoreflect.FieldDescriptor - fd_ServiceInfo_origin protoreflect.FieldDescriptor - fd_ServiceInfo_fingerprint protoreflect.FieldDescriptor - fd_ServiceInfo_service protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_ServiceInfo = File_did_v1_models_proto.Messages().ByName("ServiceInfo") - fd_ServiceInfo_exists = md_ServiceInfo.Fields().ByName("exists") - fd_ServiceInfo_origin = md_ServiceInfo.Fields().ByName("origin") - fd_ServiceInfo_fingerprint = md_ServiceInfo.Fields().ByName("fingerprint") - fd_ServiceInfo_service = md_ServiceInfo.Fields().ByName("service") -} - -var _ protoreflect.Message = (*fastReflection_ServiceInfo)(nil) - -type fastReflection_ServiceInfo ServiceInfo - -func (x *ServiceInfo) ProtoReflect() protoreflect.Message { - return (*fastReflection_ServiceInfo)(x) -} - -func (x *ServiceInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ServiceInfo_messageType fastReflection_ServiceInfo_messageType -var _ protoreflect.MessageType = fastReflection_ServiceInfo_messageType{} - -type fastReflection_ServiceInfo_messageType struct{} - -func (x fastReflection_ServiceInfo_messageType) Zero() protoreflect.Message { - return (*fastReflection_ServiceInfo)(nil) -} -func (x fastReflection_ServiceInfo_messageType) New() protoreflect.Message { - return new(fastReflection_ServiceInfo) -} -func (x fastReflection_ServiceInfo_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ServiceInfo -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ServiceInfo) Descriptor() protoreflect.MessageDescriptor { - return md_ServiceInfo -} - -// 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_ServiceInfo) Type() protoreflect.MessageType { - return _fastReflection_ServiceInfo_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ServiceInfo) New() protoreflect.Message { - return new(fastReflection_ServiceInfo) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ServiceInfo) Interface() protoreflect.ProtoMessage { - return (*ServiceInfo)(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_ServiceInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Exists != false { - value := protoreflect.ValueOfBool(x.Exists) - if !f(fd_ServiceInfo_exists, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_ServiceInfo_origin, value) { - return - } - } - if x.Fingerprint != "" { - value := protoreflect.ValueOfString(x.Fingerprint) - if !f(fd_ServiceInfo_fingerprint, value) { - return - } - } - if x.Service != nil { - value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) - if !f(fd_ServiceInfo_service, 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_ServiceInfo) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.ServiceInfo.exists": - return x.Exists != false - case "did.v1.ServiceInfo.origin": - return x.Origin != "" - case "did.v1.ServiceInfo.fingerprint": - return x.Fingerprint != "" - case "did.v1.ServiceInfo.service": - return x.Service != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) - } - panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.ServiceInfo.exists": - x.Exists = false - case "did.v1.ServiceInfo.origin": - x.Origin = "" - case "did.v1.ServiceInfo.fingerprint": - x.Fingerprint = "" - case "did.v1.ServiceInfo.service": - x.Service = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) - } - panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.ServiceInfo.exists": - value := x.Exists - return protoreflect.ValueOfBool(value) - case "did.v1.ServiceInfo.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.ServiceInfo.fingerprint": - value := x.Fingerprint - return protoreflect.ValueOfString(value) - case "did.v1.ServiceInfo.service": - value := x.Service - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) - } - panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.ServiceInfo.exists": - x.Exists = value.Bool() - case "did.v1.ServiceInfo.origin": - x.Origin = value.Interface().(string) - case "did.v1.ServiceInfo.fingerprint": - x.Fingerprint = value.Interface().(string) - case "did.v1.ServiceInfo.service": - x.Service = value.Message().Interface().(*Service) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) - } - panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ServiceInfo.service": - if x.Service == nil { - x.Service = new(Service) - } - return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) - case "did.v1.ServiceInfo.exists": - panic(fmt.Errorf("field exists of message did.v1.ServiceInfo is not mutable")) - case "did.v1.ServiceInfo.origin": - panic(fmt.Errorf("field origin of message did.v1.ServiceInfo is not mutable")) - case "did.v1.ServiceInfo.fingerprint": - panic(fmt.Errorf("field fingerprint of message did.v1.ServiceInfo is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) - } - panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ServiceInfo.exists": - return protoreflect.ValueOfBool(false) - case "did.v1.ServiceInfo.origin": - return protoreflect.ValueOfString("") - case "did.v1.ServiceInfo.fingerprint": - return protoreflect.ValueOfString("") - case "did.v1.ServiceInfo.service": - m := new(Service) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) - } - panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.ServiceInfo", 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_ServiceInfo) 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_ServiceInfo) 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_ServiceInfo) 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_ServiceInfo) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ServiceInfo) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Exists { - n += 2 - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Fingerprint) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Service != nil { - l = options.Size(x.Service) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ServiceInfo) - 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.Service != nil { - encoded, err := options.Marshal(x.Service) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x22 - } - if len(x.Fingerprint) > 0 { - i -= len(x.Fingerprint) - copy(dAtA[i:], x.Fingerprint) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Fingerprint))) - 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 x.Exists { - i-- - if x.Exists { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ServiceInfo) - 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: ServiceInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ServiceInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Exists = bool(v != 0) - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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 Fingerprint", 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.Fingerprint = 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 Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Service == nil { - x.Service = &Service{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_FirstPartyCaveat protoreflect.MessageDescriptor - fd_FirstPartyCaveat_scope protoreflect.FieldDescriptor - fd_FirstPartyCaveat_exp protoreflect.FieldDescriptor - fd_FirstPartyCaveat_cnf protoreflect.FieldDescriptor - fd_FirstPartyCaveat_aud protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_FirstPartyCaveat = File_did_v1_models_proto.Messages().ByName("FirstPartyCaveat") - fd_FirstPartyCaveat_scope = md_FirstPartyCaveat.Fields().ByName("scope") - fd_FirstPartyCaveat_exp = md_FirstPartyCaveat.Fields().ByName("exp") - fd_FirstPartyCaveat_cnf = md_FirstPartyCaveat.Fields().ByName("cnf") - fd_FirstPartyCaveat_aud = md_FirstPartyCaveat.Fields().ByName("aud") -} - -var _ protoreflect.Message = (*fastReflection_FirstPartyCaveat)(nil) - -type fastReflection_FirstPartyCaveat FirstPartyCaveat - -func (x *FirstPartyCaveat) ProtoReflect() protoreflect.Message { - return (*fastReflection_FirstPartyCaveat)(x) -} - -func (x *FirstPartyCaveat) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_FirstPartyCaveat_messageType fastReflection_FirstPartyCaveat_messageType -var _ protoreflect.MessageType = fastReflection_FirstPartyCaveat_messageType{} - -type fastReflection_FirstPartyCaveat_messageType struct{} - -func (x fastReflection_FirstPartyCaveat_messageType) Zero() protoreflect.Message { - return (*fastReflection_FirstPartyCaveat)(nil) -} -func (x fastReflection_FirstPartyCaveat_messageType) New() protoreflect.Message { - return new(fastReflection_FirstPartyCaveat) -} -func (x fastReflection_FirstPartyCaveat_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_FirstPartyCaveat -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_FirstPartyCaveat) Descriptor() protoreflect.MessageDescriptor { - return md_FirstPartyCaveat -} - -// 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_FirstPartyCaveat) Type() protoreflect.MessageType { - return _fastReflection_FirstPartyCaveat_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_FirstPartyCaveat) New() protoreflect.Message { - return new(fastReflection_FirstPartyCaveat) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_FirstPartyCaveat) Interface() protoreflect.ProtoMessage { - return (*FirstPartyCaveat)(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_FirstPartyCaveat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Scope != nil { - value := protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) - if !f(fd_FirstPartyCaveat_scope, value) { - return - } - } - if x.Exp != int64(0) { - value := protoreflect.ValueOfInt64(x.Exp) - if !f(fd_FirstPartyCaveat_exp, value) { - return - } - } - if x.Cnf != "" { - value := protoreflect.ValueOfString(x.Cnf) - if !f(fd_FirstPartyCaveat_cnf, value) { - return - } - } - if x.Aud != "" { - value := protoreflect.ValueOfString(x.Aud) - if !f(fd_FirstPartyCaveat_aud, 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_FirstPartyCaveat) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.FirstPartyCaveat.scope": - return x.Scope != nil - case "did.v1.FirstPartyCaveat.exp": - return x.Exp != int64(0) - case "did.v1.FirstPartyCaveat.cnf": - return x.Cnf != "" - case "did.v1.FirstPartyCaveat.aud": - return x.Aud != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.FirstPartyCaveat.scope": - x.Scope = nil - case "did.v1.FirstPartyCaveat.exp": - x.Exp = int64(0) - case "did.v1.FirstPartyCaveat.cnf": - x.Cnf = "" - case "did.v1.FirstPartyCaveat.aud": - x.Aud = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.FirstPartyCaveat.scope": - value := x.Scope - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.FirstPartyCaveat.exp": - value := x.Exp - return protoreflect.ValueOfInt64(value) - case "did.v1.FirstPartyCaveat.cnf": - value := x.Cnf - return protoreflect.ValueOfString(value) - case "did.v1.FirstPartyCaveat.aud": - value := x.Aud - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.FirstPartyCaveat.scope": - x.Scope = value.Message().Interface().(*Permissions) - case "did.v1.FirstPartyCaveat.exp": - x.Exp = value.Int() - case "did.v1.FirstPartyCaveat.cnf": - x.Cnf = value.Interface().(string) - case "did.v1.FirstPartyCaveat.aud": - x.Aud = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.FirstPartyCaveat.scope": - if x.Scope == nil { - x.Scope = new(Permissions) - } - return protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) - case "did.v1.FirstPartyCaveat.exp": - panic(fmt.Errorf("field exp of message did.v1.FirstPartyCaveat is not mutable")) - case "did.v1.FirstPartyCaveat.cnf": - panic(fmt.Errorf("field cnf of message did.v1.FirstPartyCaveat is not mutable")) - case "did.v1.FirstPartyCaveat.aud": - panic(fmt.Errorf("field aud of message did.v1.FirstPartyCaveat is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.FirstPartyCaveat.scope": - m := new(Permissions) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.FirstPartyCaveat.exp": - return protoreflect.ValueOfInt64(int64(0)) - case "did.v1.FirstPartyCaveat.cnf": - return protoreflect.ValueOfString("") - case "did.v1.FirstPartyCaveat.aud": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.FirstPartyCaveat", 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_FirstPartyCaveat) 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_FirstPartyCaveat) 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_FirstPartyCaveat) 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_FirstPartyCaveat) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*FirstPartyCaveat) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Scope != nil { - l = options.Size(x.Scope) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Exp != 0 { - n += 1 + runtime.Sov(uint64(x.Exp)) - } - l = len(x.Cnf) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Aud) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*FirstPartyCaveat) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Aud) > 0 { - i -= len(x.Aud) - copy(dAtA[i:], x.Aud) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aud))) - i-- - dAtA[i] = 0x22 - } - if len(x.Cnf) > 0 { - i -= len(x.Cnf) - copy(dAtA[i:], x.Cnf) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cnf))) - i-- - dAtA[i] = 0x1a - } - if x.Exp != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Exp)) - i-- - dAtA[i] = 0x10 - } - if x.Scope != nil { - encoded, err := options.Marshal(x.Scope) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - 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().(*FirstPartyCaveat) - 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: FirstPartyCaveat: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FirstPartyCaveat: 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 Scope", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Scope == nil { - x.Scope = &Permissions{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scope); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) - } - x.Exp = 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.Exp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cnf", 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.Cnf = 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 Aud", 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.Aud = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_ThirdPartyCaveat protoreflect.MessageDescriptor - fd_ThirdPartyCaveat_scope protoreflect.FieldDescriptor - fd_ThirdPartyCaveat_exp protoreflect.FieldDescriptor - fd_ThirdPartyCaveat_cnf protoreflect.FieldDescriptor - fd_ThirdPartyCaveat_aud protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_models_proto_init() - md_ThirdPartyCaveat = File_did_v1_models_proto.Messages().ByName("ThirdPartyCaveat") - fd_ThirdPartyCaveat_scope = md_ThirdPartyCaveat.Fields().ByName("scope") - fd_ThirdPartyCaveat_exp = md_ThirdPartyCaveat.Fields().ByName("exp") - fd_ThirdPartyCaveat_cnf = md_ThirdPartyCaveat.Fields().ByName("cnf") - fd_ThirdPartyCaveat_aud = md_ThirdPartyCaveat.Fields().ByName("aud") -} - -var _ protoreflect.Message = (*fastReflection_ThirdPartyCaveat)(nil) - -type fastReflection_ThirdPartyCaveat ThirdPartyCaveat - -func (x *ThirdPartyCaveat) ProtoReflect() protoreflect.Message { - return (*fastReflection_ThirdPartyCaveat)(x) -} - -func (x *ThirdPartyCaveat) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[8] - 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_ThirdPartyCaveat_messageType fastReflection_ThirdPartyCaveat_messageType -var _ protoreflect.MessageType = fastReflection_ThirdPartyCaveat_messageType{} - -type fastReflection_ThirdPartyCaveat_messageType struct{} - -func (x fastReflection_ThirdPartyCaveat_messageType) Zero() protoreflect.Message { - return (*fastReflection_ThirdPartyCaveat)(nil) -} -func (x fastReflection_ThirdPartyCaveat_messageType) New() protoreflect.Message { - return new(fastReflection_ThirdPartyCaveat) -} -func (x fastReflection_ThirdPartyCaveat_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ThirdPartyCaveat -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ThirdPartyCaveat) Descriptor() protoreflect.MessageDescriptor { - return md_ThirdPartyCaveat -} - -// 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_ThirdPartyCaveat) Type() protoreflect.MessageType { - return _fastReflection_ThirdPartyCaveat_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ThirdPartyCaveat) New() protoreflect.Message { - return new(fastReflection_ThirdPartyCaveat) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ThirdPartyCaveat) Interface() protoreflect.ProtoMessage { - return (*ThirdPartyCaveat)(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_ThirdPartyCaveat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Scope != nil { - value := protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) - if !f(fd_ThirdPartyCaveat_scope, value) { - return - } - } - if x.Exp != int64(0) { - value := protoreflect.ValueOfInt64(x.Exp) - if !f(fd_ThirdPartyCaveat_exp, value) { - return - } - } - if x.Cnf != "" { - value := protoreflect.ValueOfString(x.Cnf) - if !f(fd_ThirdPartyCaveat_cnf, value) { - return - } - } - if x.Aud != "" { - value := protoreflect.ValueOfString(x.Aud) - if !f(fd_ThirdPartyCaveat_aud, 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_ThirdPartyCaveat) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.ThirdPartyCaveat.scope": - return x.Scope != nil - case "did.v1.ThirdPartyCaveat.exp": - return x.Exp != int64(0) - case "did.v1.ThirdPartyCaveat.cnf": - return x.Cnf != "" - case "did.v1.ThirdPartyCaveat.aud": - return x.Aud != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.ThirdPartyCaveat.scope": - x.Scope = nil - case "did.v1.ThirdPartyCaveat.exp": - x.Exp = int64(0) - case "did.v1.ThirdPartyCaveat.cnf": - x.Cnf = "" - case "did.v1.ThirdPartyCaveat.aud": - x.Aud = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.ThirdPartyCaveat.scope": - value := x.Scope - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.ThirdPartyCaveat.exp": - value := x.Exp - return protoreflect.ValueOfInt64(value) - case "did.v1.ThirdPartyCaveat.cnf": - value := x.Cnf - return protoreflect.ValueOfString(value) - case "did.v1.ThirdPartyCaveat.aud": - value := x.Aud - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.ThirdPartyCaveat.scope": - x.Scope = value.Message().Interface().(*Permissions) - case "did.v1.ThirdPartyCaveat.exp": - x.Exp = value.Int() - case "did.v1.ThirdPartyCaveat.cnf": - x.Cnf = value.Interface().(string) - case "did.v1.ThirdPartyCaveat.aud": - x.Aud = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ThirdPartyCaveat.scope": - if x.Scope == nil { - x.Scope = new(Permissions) - } - return protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) - case "did.v1.ThirdPartyCaveat.exp": - panic(fmt.Errorf("field exp of message did.v1.ThirdPartyCaveat is not mutable")) - case "did.v1.ThirdPartyCaveat.cnf": - panic(fmt.Errorf("field cnf of message did.v1.ThirdPartyCaveat is not mutable")) - case "did.v1.ThirdPartyCaveat.aud": - panic(fmt.Errorf("field aud of message did.v1.ThirdPartyCaveat is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ThirdPartyCaveat.scope": - m := new(Permissions) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.ThirdPartyCaveat.exp": - return protoreflect.ValueOfInt64(int64(0)) - case "did.v1.ThirdPartyCaveat.cnf": - return protoreflect.ValueOfString("") - case "did.v1.ThirdPartyCaveat.aud": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) - } - panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.ThirdPartyCaveat", 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_ThirdPartyCaveat) 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_ThirdPartyCaveat) 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_ThirdPartyCaveat) 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_ThirdPartyCaveat) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ThirdPartyCaveat) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Scope != nil { - l = options.Size(x.Scope) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Exp != 0 { - n += 1 + runtime.Sov(uint64(x.Exp)) - } - l = len(x.Cnf) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Aud) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ThirdPartyCaveat) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Aud) > 0 { - i -= len(x.Aud) - copy(dAtA[i:], x.Aud) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aud))) - i-- - dAtA[i] = 0x22 - } - if len(x.Cnf) > 0 { - i -= len(x.Cnf) - copy(dAtA[i:], x.Cnf) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cnf))) - i-- - dAtA[i] = 0x1a - } - if x.Exp != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Exp)) - i-- - dAtA[i] = 0x10 - } - if x.Scope != nil { - encoded, err := options.Marshal(x.Scope) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - 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().(*ThirdPartyCaveat) - 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: ThirdPartyCaveat: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ThirdPartyCaveat: 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 Scope", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Scope == nil { - x.Scope = &Permissions{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scope); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) - } - x.Exp = 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.Exp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cnf", 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.Cnf = 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 Aud", 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.Aud = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: did/v1/models.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Credential struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` - AttestationType string `protobuf:"bytes,2,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` - Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` - CredentialId []byte `protobuf:"bytes,4,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` - PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Transport []string `protobuf:"bytes,6,rep,name=transport,proto3" json:"transport,omitempty"` - SignCount uint32 `protobuf:"varint,7,opt,name=sign_count,json=signCount,proto3" json:"sign_count,omitempty"` - UserPresent bool `protobuf:"varint,8,opt,name=user_present,json=userPresent,proto3" json:"user_present,omitempty"` - UserVerified bool `protobuf:"varint,9,opt,name=user_verified,json=userVerified,proto3" json:"user_verified,omitempty"` - BackupEligible bool `protobuf:"varint,10,opt,name=backup_eligible,json=backupEligible,proto3" json:"backup_eligible,omitempty"` - BackupState bool `protobuf:"varint,11,opt,name=backup_state,json=backupState,proto3" json:"backup_state,omitempty"` - CloneWarning bool `protobuf:"varint,12,opt,name=clone_warning,json=cloneWarning,proto3" json:"clone_warning,omitempty"` -} - -func (x *Credential) Reset() { - *x = Credential{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Credential) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Credential) ProtoMessage() {} - -// Deprecated: Use Credential.ProtoReflect.Descriptor instead. -func (*Credential) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{0} -} - -func (x *Credential) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -func (x *Credential) GetAttestationType() string { - if x != nil { - return x.AttestationType - } - return "" -} - -func (x *Credential) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *Credential) GetCredentialId() []byte { - if x != nil { - return x.CredentialId - } - return nil -} - -func (x *Credential) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Credential) GetTransport() []string { - if x != nil { - return x.Transport - } - return nil -} - -func (x *Credential) GetSignCount() uint32 { - if x != nil { - return x.SignCount - } - return 0 -} - -func (x *Credential) GetUserPresent() bool { - if x != nil { - return x.UserPresent - } - return false -} - -func (x *Credential) GetUserVerified() bool { - if x != nil { - return x.UserVerified - } - return false -} - -func (x *Credential) GetBackupEligible() bool { - if x != nil { - return x.BackupEligible - } - return false -} - -func (x *Credential) GetBackupState() bool { - if x != nil { - return x.BackupState - } - return false -} - -func (x *Credential) GetCloneWarning() bool { - if x != nil { - return x.CloneWarning - } - return false -} - -// Document defines a DID document -type Document struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DID of the controller - Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` -} - -func (x *Document) Reset() { - *x = Document{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Document) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Document) ProtoMessage() {} - -// Deprecated: Use Document.ProtoReflect.Descriptor instead. -func (*Document) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{1} -} - -func (x *Document) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Document) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *Document) GetAuthentication() []string { - if x != nil { - return x.Authentication - } - return nil -} - -func (x *Document) GetAssertionMethod() []string { - if x != nil { - return x.AssertionMethod - } - return nil -} - -func (x *Document) GetCapabilityDelegation() []string { - if x != nil { - return x.CapabilityDelegation - } - return nil -} - -func (x *Document) GetCapabilityInvocation() []string { - if x != nil { - return x.CapabilityInvocation - } - return nil -} - -func (x *Document) GetService() []string { - if x != nil { - return x.Service - } - return nil -} - -// Keyshare defines a keyshare from the MPC protocol -type Keyshare struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metadata map[string]string `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Payloads map[string][]byte `protobuf:"bytes,2,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` - PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` - Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` // 0 =none, 1 = validator, 2 = user -} - -func (x *Keyshare) Reset() { - *x = Keyshare{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Keyshare) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Keyshare) ProtoMessage() {} - -// Deprecated: Use Keyshare.ProtoReflect.Descriptor instead. -func (*Keyshare) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{2} -} - -func (x *Keyshare) GetMetadata() map[string]string { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Keyshare) GetPayloads() map[string][]byte { - if x != nil { - return x.Payloads - } - return nil -} - -func (x *Keyshare) GetProtocol() string { - if x != nil { - return x.Protocol - } - return "" -} - -func (x *Keyshare) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Keyshare) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *Keyshare) GetRole() int32 { - if x != nil { - return x.Role - } - return 0 -} - -// Permissions contains a list of grants and access control rules for -// a Service. -type Permissions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Grants []DIDNamespace `protobuf:"varint,1,rep,packed,name=grants,proto3,enum=did.v1.DIDNamespace" json:"grants,omitempty"` - Scopes []PermissionScope `protobuf:"varint,2,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"` -} - -func (x *Permissions) Reset() { - *x = Permissions{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Permissions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Permissions) ProtoMessage() {} - -// Deprecated: Use Permissions.ProtoReflect.Descriptor instead. -func (*Permissions) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{3} -} - -func (x *Permissions) GetGrants() []DIDNamespace { - if x != nil { - return x.Grants - } - return nil -} - -func (x *Permissions) GetScopes() []PermissionScope { - if x != nil { - return x.Scopes - } - return nil -} - -// PubKey defines a public key for a did -type PubKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` - Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` - Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` - Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` - KeyType KeyType `protobuf:"varint,5,opt,name=key_type,json=keyType,proto3,enum=did.v1.KeyType" json:"key_type,omitempty"` - Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` - Jwk *PubKey_JWK `protobuf:"bytes,7,opt,name=jwk,proto3" json:"jwk,omitempty"` -} - -func (x *PubKey) Reset() { - *x = PubKey{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PubKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PubKey) ProtoMessage() {} - -// Deprecated: Use PubKey.ProtoReflect.Descriptor instead. -func (*PubKey) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{4} -} - -func (x *PubKey) GetRole() KeyRole { - if x != nil { - return x.Role - } - return KeyRole_KEY_ROLE_UNSPECIFIED -} - -func (x *PubKey) GetAlgorithm() KeyAlgorithm { - if x != nil { - return x.Algorithm - } - return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED -} - -func (x *PubKey) GetEncoding() KeyEncoding { - if x != nil { - return x.Encoding - } - return KeyEncoding_KEY_ENCODING_UNSPECIFIED -} - -func (x *PubKey) GetCurve() KeyCurve { - if x != nil { - return x.Curve - } - return KeyCurve_KEY_CURVE_UNSPECIFIED -} - -func (x *PubKey) GetKeyType() KeyType { - if x != nil { - return x.KeyType - } - return KeyType_KEY_TYPE_UNSPECIFIED -} - -func (x *PubKey) GetRaw() []byte { - if x != nil { - return x.Raw - } - return nil -} - -func (x *PubKey) GetJwk() *PubKey_JWK { - if x != nil { - return x.Jwk - } - return nil -} - -// Service defines a Decentralized Service on the Sonr Blockchain -type Service struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (x *Service) Reset() { - *x = Service{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Service) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Service) ProtoMessage() {} - -// Deprecated: Use Service.ProtoReflect.Descriptor instead. -func (*Service) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{5} -} - -func (x *Service) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Service) GetServiceType() string { - if x != nil { - return x.ServiceType - } - return "" -} - -func (x *Service) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *Service) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *Service) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Service) GetServiceEndpoints() map[string]string { - if x != nil { - return x.ServiceEndpoints - } - return nil -} - -func (x *Service) GetPermissions() *Permissions { - if x != nil { - return x.Permissions - } - return nil -} - -// ServicceInfo defines a Decentralized Service on the Sonr Blockchain -type ServiceInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - Fingerprint string `protobuf:"bytes,3,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` -} - -func (x *ServiceInfo) Reset() { - *x = ServiceInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceInfo) ProtoMessage() {} - -// Deprecated: Use ServiceInfo.ProtoReflect.Descriptor instead. -func (*ServiceInfo) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{6} -} - -func (x *ServiceInfo) GetExists() bool { - if x != nil { - return x.Exists - } - return false -} - -func (x *ServiceInfo) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *ServiceInfo) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *ServiceInfo) GetService() *Service { - if x != nil { - return x.Service - } - return nil -} - -// FirstPartyCaveat defines a first party caveat -type FirstPartyCaveat struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` - Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` - Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` - Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` -} - -func (x *FirstPartyCaveat) Reset() { - *x = FirstPartyCaveat{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FirstPartyCaveat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FirstPartyCaveat) ProtoMessage() {} - -// Deprecated: Use FirstPartyCaveat.ProtoReflect.Descriptor instead. -func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{7} -} - -func (x *FirstPartyCaveat) GetScope() *Permissions { - if x != nil { - return x.Scope - } - return nil -} - -func (x *FirstPartyCaveat) GetExp() int64 { - if x != nil { - return x.Exp - } - return 0 -} - -func (x *FirstPartyCaveat) GetCnf() string { - if x != nil { - return x.Cnf - } - return "" -} - -func (x *FirstPartyCaveat) GetAud() string { - if x != nil { - return x.Aud - } - return "" -} - -// ThirdPartyCaveat defines a third party caveat -type ThirdPartyCaveat struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` - Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` - Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` - Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` -} - -func (x *ThirdPartyCaveat) Reset() { - *x = ThirdPartyCaveat{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ThirdPartyCaveat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ThirdPartyCaveat) ProtoMessage() {} - -// Deprecated: Use ThirdPartyCaveat.ProtoReflect.Descriptor instead. -func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{8} -} - -func (x *ThirdPartyCaveat) GetScope() *Permissions { - if x != nil { - return x.Scope - } - return nil -} - -func (x *ThirdPartyCaveat) GetExp() int64 { - if x != nil { - return x.Exp - } - return 0 -} - -func (x *ThirdPartyCaveat) GetCnf() string { - if x != nil { - return x.Cnf - } - return "" -} - -func (x *ThirdPartyCaveat) GetAud() string { - if x != nil { - return x.Aud - } - return "" -} - -// JWK represents a JSON Web Key -type PubKey_JWK struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` // Key Type - Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` // Curve (for EC and OKP keys) - X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` // X coordinate (for EC and OKP keys) - Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` // Y coordinate (for EC keys) - N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` // Modulus (for RSA keys) - E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` // Exponent (for RSA keys) -} - -func (x *PubKey_JWK) Reset() { - *x = PubKey_JWK{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PubKey_JWK) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PubKey_JWK) ProtoMessage() {} - -// Deprecated: Use PubKey_JWK.ProtoReflect.Descriptor instead. -func (*PubKey_JWK) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *PubKey_JWK) GetKty() string { - if x != nil { - return x.Kty - } - return "" -} - -func (x *PubKey_JWK) GetCrv() string { - if x != nil { - return x.Crv - } - return "" -} - -func (x *PubKey_JWK) GetX() string { - if x != nil { - return x.X - } - return "" -} - -func (x *PubKey_JWK) GetY() string { - if x != nil { - return x.Y - } - return "" -} - -func (x *PubKey_JWK) GetN() string { - if x != nil { - return x.N - } - return "" -} - -func (x *PubKey_JWK) GetE() string { - if x != nil { - return x.E - } - return "" -} - -var File_did_v1_models_proto protoreflect.FileDescriptor - -var file_did_v1_models_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x64, - 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x03, 0x0a, 0x0a, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, - 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x73, - 0x65, 0x72, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x27, - 0x0a, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, - 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x45, - 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x75, - 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, - 0x6f, 0x6e, 0x65, 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x22, - 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, - 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, - 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, - 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x22, 0xe5, 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3a, 0x0a, 0x08, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, - 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6c, 0x0a, 0x0b, 0x50, - 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x81, 0x03, 0x0a, 0x06, 0x50, 0x75, - 0x62, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, 0x0a, - 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x26, - 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x52, - 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x2a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x03, 0x72, 0x61, 0x77, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x2e, 0x4a, 0x57, 0x4b, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, 0x4a, 0x57, - 0x4b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, - 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, - 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0xe4, 0x02, - 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, - 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, - 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, - 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, - 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x22, 0x73, 0x0a, 0x10, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, - 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, - 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x63, 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, - 0x61, 0x72, 0x74, 0x79, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x42, 0x7b, 0x0a, 0x0a, 0x63, - 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_did_v1_models_proto_rawDescOnce sync.Once - file_did_v1_models_proto_rawDescData = file_did_v1_models_proto_rawDesc -) - -func file_did_v1_models_proto_rawDescGZIP() []byte { - file_did_v1_models_proto_rawDescOnce.Do(func() { - file_did_v1_models_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_models_proto_rawDescData) - }) - return file_did_v1_models_proto_rawDescData -} - -var file_did_v1_models_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_did_v1_models_proto_goTypes = []interface{}{ - (*Credential)(nil), // 0: did.v1.Credential - (*Document)(nil), // 1: did.v1.Document - (*Keyshare)(nil), // 2: did.v1.Keyshare - (*Permissions)(nil), // 3: did.v1.Permissions - (*PubKey)(nil), // 4: did.v1.PubKey - (*Service)(nil), // 5: did.v1.Service - (*ServiceInfo)(nil), // 6: did.v1.ServiceInfo - (*FirstPartyCaveat)(nil), // 7: did.v1.FirstPartyCaveat - (*ThirdPartyCaveat)(nil), // 8: did.v1.ThirdPartyCaveat - nil, // 9: did.v1.Keyshare.MetadataEntry - nil, // 10: did.v1.Keyshare.PayloadsEntry - (*PubKey_JWK)(nil), // 11: did.v1.PubKey.JWK - nil, // 12: did.v1.Service.ServiceEndpointsEntry - (DIDNamespace)(0), // 13: did.v1.DIDNamespace - (PermissionScope)(0), // 14: did.v1.PermissionScope - (KeyRole)(0), // 15: did.v1.KeyRole - (KeyAlgorithm)(0), // 16: did.v1.KeyAlgorithm - (KeyEncoding)(0), // 17: did.v1.KeyEncoding - (KeyCurve)(0), // 18: did.v1.KeyCurve - (KeyType)(0), // 19: did.v1.KeyType -} -var file_did_v1_models_proto_depIdxs = []int32{ - 9, // 0: did.v1.Keyshare.metadata:type_name -> did.v1.Keyshare.MetadataEntry - 10, // 1: did.v1.Keyshare.payloads:type_name -> did.v1.Keyshare.PayloadsEntry - 13, // 2: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace - 14, // 3: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope - 15, // 4: did.v1.PubKey.role:type_name -> did.v1.KeyRole - 16, // 5: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm - 17, // 6: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding - 18, // 7: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve - 19, // 8: did.v1.PubKey.key_type:type_name -> did.v1.KeyType - 11, // 9: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK - 12, // 10: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry - 3, // 11: did.v1.Service.permissions:type_name -> did.v1.Permissions - 5, // 12: did.v1.ServiceInfo.service:type_name -> did.v1.Service - 3, // 13: did.v1.FirstPartyCaveat.scope:type_name -> did.v1.Permissions - 3, // 14: did.v1.ThirdPartyCaveat.scope:type_name -> did.v1.Permissions - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name -} - -func init() { file_did_v1_models_proto_init() } -func file_did_v1_models_proto_init() { - if File_did_v1_models_proto != nil { - return - } - file_did_v1_genesis_proto_init() - if !protoimpl.UnsafeEnabled { - file_did_v1_models_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Credential); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Document); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Keyshare); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Permissions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PubKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Service); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FirstPartyCaveat); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ThirdPartyCaveat); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_models_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PubKey_JWK); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_did_v1_models_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_did_v1_models_proto_goTypes, - DependencyIndexes: file_did_v1_models_proto_depIdxs, - MessageInfos: file_did_v1_models_proto_msgTypes, - }.Build() - File_did_v1_models_proto = out.File - file_did_v1_models_proto_rawDesc = nil - file_did_v1_models_proto_goTypes = nil - file_did_v1_models_proto_depIdxs = nil -} diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index 372c5c3e9..1a3a88011 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -2127,559 +2127,6 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } } -var ( - md_QueryServiceResponse protoreflect.MessageDescriptor - fd_QueryServiceResponse_existing protoreflect.FieldDescriptor - fd_QueryServiceResponse_service protoreflect.FieldDescriptor - fd_QueryServiceResponse_txt_record protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryServiceResponse = File_did_v1_query_proto.Messages().ByName("QueryServiceResponse") - fd_QueryServiceResponse_existing = md_QueryServiceResponse.Fields().ByName("existing") - fd_QueryServiceResponse_service = md_QueryServiceResponse.Fields().ByName("service") - fd_QueryServiceResponse_txt_record = md_QueryServiceResponse.Fields().ByName("txt_record") -} - -var _ protoreflect.Message = (*fastReflection_QueryServiceResponse)(nil) - -type fastReflection_QueryServiceResponse QueryServiceResponse - -func (x *QueryServiceResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryServiceResponse)(x) -} - -func (x *QueryServiceResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryServiceResponse_messageType fastReflection_QueryServiceResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryServiceResponse_messageType{} - -type fastReflection_QueryServiceResponse_messageType struct{} - -func (x fastReflection_QueryServiceResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryServiceResponse)(nil) -} -func (x fastReflection_QueryServiceResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryServiceResponse) -} -func (x fastReflection_QueryServiceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryServiceResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryServiceResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryServiceResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryServiceResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryServiceResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryServiceResponse) New() protoreflect.Message { - return new(fastReflection_QueryServiceResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryServiceResponse) Interface() protoreflect.ProtoMessage { - return (*QueryServiceResponse)(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_QueryServiceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Existing != false { - value := protoreflect.ValueOfBool(x.Existing) - if !f(fd_QueryServiceResponse_existing, value) { - return - } - } - if x.Service != nil { - value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) - if !f(fd_QueryServiceResponse_service, value) { - return - } - } - if x.TxtRecord != "" { - value := protoreflect.ValueOfString(x.TxtRecord) - if !f(fd_QueryServiceResponse_txt_record, 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_QueryServiceResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryServiceResponse.existing": - return x.Existing != false - case "did.v1.QueryServiceResponse.service": - return x.Service != nil - case "did.v1.QueryServiceResponse.txt_record": - return x.TxtRecord != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) - } - panic(fmt.Errorf("message did.v1.QueryServiceResponse 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_QueryServiceResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryServiceResponse.existing": - x.Existing = false - case "did.v1.QueryServiceResponse.service": - x.Service = nil - case "did.v1.QueryServiceResponse.txt_record": - x.TxtRecord = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) - } - panic(fmt.Errorf("message did.v1.QueryServiceResponse 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_QueryServiceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryServiceResponse.existing": - value := x.Existing - return protoreflect.ValueOfBool(value) - case "did.v1.QueryServiceResponse.service": - value := x.Service - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.QueryServiceResponse.txt_record": - value := x.TxtRecord - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) - } - panic(fmt.Errorf("message did.v1.QueryServiceResponse 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_QueryServiceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryServiceResponse.existing": - x.Existing = value.Bool() - case "did.v1.QueryServiceResponse.service": - x.Service = value.Message().Interface().(*ServiceInfo) - case "did.v1.QueryServiceResponse.txt_record": - x.TxtRecord = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) - } - panic(fmt.Errorf("message did.v1.QueryServiceResponse 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_QueryServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryServiceResponse.service": - if x.Service == nil { - x.Service = new(ServiceInfo) - } - return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) - case "did.v1.QueryServiceResponse.existing": - panic(fmt.Errorf("field existing of message did.v1.QueryServiceResponse is not mutable")) - case "did.v1.QueryServiceResponse.txt_record": - panic(fmt.Errorf("field txt_record of message did.v1.QueryServiceResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) - } - panic(fmt.Errorf("message did.v1.QueryServiceResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryServiceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryServiceResponse.existing": - return protoreflect.ValueOfBool(false) - case "did.v1.QueryServiceResponse.service": - m := new(ServiceInfo) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.QueryServiceResponse.txt_record": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryServiceResponse")) - } - panic(fmt.Errorf("message did.v1.QueryServiceResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryServiceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryServiceResponse", 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_QueryServiceResponse) 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_QueryServiceResponse) 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_QueryServiceResponse) 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_QueryServiceResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryServiceResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Existing { - n += 2 - } - if x.Service != nil { - l = options.Size(x.Service) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.TxtRecord) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryServiceResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.TxtRecord) > 0 { - i -= len(x.TxtRecord) - copy(dAtA[i:], x.TxtRecord) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TxtRecord))) - i-- - dAtA[i] = 0x1a - } - if x.Service != nil { - encoded, err := options.Marshal(x.Service) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.Existing { - i-- - if x.Existing { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryServiceResponse) - 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: QueryServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Existing", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Existing = bool(v != 0) - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Service == nil { - x.Service = &ServiceInfo{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxtRecord", 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.TxtRecord = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_SyncRequest protoreflect.MessageDescriptor fd_SyncRequest_did protoreflect.FieldDescriptor @@ -2700,7 +2147,7 @@ func (x *SyncRequest) ProtoReflect() protoreflect.Message { } func (x *SyncRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[5] + mi := &file_did_v1_query_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3120,7 +2567,7 @@ func (x *SyncResponse) ProtoReflect() protoreflect.Message { } func (x *SyncResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[6] + mi := &file_did_v1_query_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3717,59 +3164,6 @@ func (x *QueryResolveResponse) GetDocument() *Document { return nil } -// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. -type QueryServiceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // options is the PublicKeyCredentialAttestationOptions - Existing bool `protobuf:"varint,1,opt,name=existing,proto3" json:"existing,omitempty"` - Service *ServiceInfo `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` - TxtRecord string `protobuf:"bytes,3,opt,name=txt_record,json=txtRecord,proto3" json:"txt_record,omitempty"` -} - -func (x *QueryServiceResponse) Reset() { - *x = QueryServiceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryServiceResponse) ProtoMessage() {} - -// Deprecated: Use QueryServiceResponse.ProtoReflect.Descriptor instead. -func (*QueryServiceResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryServiceResponse) GetExisting() bool { - if x != nil { - return x.Existing - } - return false -} - -func (x *QueryServiceResponse) GetService() *ServiceInfo { - if x != nil { - return x.Service - } - return nil -} - -func (x *QueryServiceResponse) GetTxtRecord() string { - if x != nil { - return x.TxtRecord - } - return "" -} - // SyncRequest is the request type for the Sync RPC method. type SyncRequest struct { state protoimpl.MessageState @@ -3782,7 +3176,7 @@ type SyncRequest struct { func (x *SyncRequest) Reset() { *x = SyncRequest{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[5] + mi := &file_did_v1_query_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3796,7 +3190,7 @@ func (*SyncRequest) ProtoMessage() {} // Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead. func (*SyncRequest) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{5} + return file_did_v1_query_proto_rawDescGZIP(), []int{4} } func (x *SyncRequest) GetDid() string { @@ -3818,7 +3212,7 @@ type SyncResponse struct { func (x *SyncResponse) Reset() { *x = SyncResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[6] + mi := &file_did_v1_query_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3832,7 +3226,7 @@ func (*SyncResponse) ProtoMessage() {} // Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead. func (*SyncResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{6} + return file_did_v1_query_proto_rawDescGZIP(), []int{5} } func (x *SyncResponse) GetSuccess() bool { @@ -3848,75 +3242,60 @@ var file_did_v1_query_proto_rawDesc = []byte{ 0x0a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, - 0x3d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x44, - 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x80, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x78, 0x74, 0x5f, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x78, - 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x1f, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x32, 0xc4, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x06, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x07, 0x52, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x58, 0x0a, - 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x7d, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, - 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x07, 0x22, 0x05, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, - 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, - 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x60, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, + 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3d, 0x0a, 0x13, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x44, 0x0a, 0x14, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, + 0x1f, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, + 0x22, 0x28, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xea, 0x01, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, 0x64, 0x2f, + 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x13, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, + 0x22, 0x05, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, + 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, + 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3931,38 +3310,33 @@ func file_did_v1_query_proto_rawDescGZIP() []byte { return file_did_v1_query_proto_rawDescData } -var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_did_v1_query_proto_goTypes = []interface{}{ (*QueryRequest)(nil), // 0: did.v1.QueryRequest (*QueryResponse)(nil), // 1: did.v1.QueryResponse (*QueryParamsResponse)(nil), // 2: did.v1.QueryParamsResponse (*QueryResolveResponse)(nil), // 3: did.v1.QueryResolveResponse - (*QueryServiceResponse)(nil), // 4: did.v1.QueryServiceResponse - (*SyncRequest)(nil), // 5: did.v1.SyncRequest - (*SyncResponse)(nil), // 6: did.v1.SyncResponse - (*Document)(nil), // 7: did.v1.Document - (*Params)(nil), // 8: did.v1.Params - (*ServiceInfo)(nil), // 9: did.v1.ServiceInfo + (*SyncRequest)(nil), // 4: did.v1.SyncRequest + (*SyncResponse)(nil), // 5: did.v1.SyncResponse + (*Document)(nil), // 6: did.v1.Document + (*Params)(nil), // 7: did.v1.Params } var file_did_v1_query_proto_depIdxs = []int32{ - 7, // 0: did.v1.QueryResponse.document:type_name -> did.v1.Document - 8, // 1: did.v1.QueryResponse.params:type_name -> did.v1.Params - 8, // 2: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params - 7, // 3: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document - 9, // 4: did.v1.QueryServiceResponse.service:type_name -> did.v1.ServiceInfo - 0, // 5: did.v1.Query.Params:input_type -> did.v1.QueryRequest - 0, // 6: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest - 0, // 7: did.v1.Query.Service:input_type -> did.v1.QueryRequest - 5, // 8: did.v1.Query.Sync:input_type -> did.v1.SyncRequest - 2, // 9: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse - 3, // 10: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse - 4, // 11: did.v1.Query.Service:output_type -> did.v1.QueryServiceResponse - 6, // 12: did.v1.Query.Sync:output_type -> did.v1.SyncResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 6, // 0: did.v1.QueryResponse.document:type_name -> did.v1.Document + 7, // 1: did.v1.QueryResponse.params:type_name -> did.v1.Params + 7, // 2: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 6, // 3: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document + 0, // 4: did.v1.Query.Params:input_type -> did.v1.QueryRequest + 0, // 5: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest + 4, // 6: did.v1.Query.Sync:input_type -> did.v1.SyncRequest + 2, // 7: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 3, // 8: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse + 5, // 9: did.v1.Query.Sync:output_type -> did.v1.SyncResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_did_v1_query_proto_init() } @@ -3971,7 +3345,6 @@ func file_did_v1_query_proto_init() { return } file_did_v1_genesis_proto_init() - file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryRequest); i { @@ -4022,18 +3395,6 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryServiceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncRequest); i { case 0: return &v.state @@ -4045,7 +3406,7 @@ func file_did_v1_query_proto_init() { return nil } } - file_did_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncResponse); i { case 0: return &v.state @@ -4064,7 +3425,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index c5be5104b..77258f332 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion7 const ( Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" - Query_Service_FullMethodName = "/did.v1.Query/Service" Query_Sync_FullMethodName = "/did.v1.Query/Sync" ) @@ -33,10 +32,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // Service returns associated ServiceInfo for a given Origin - // if the servie is not found, a fingerprint is generated to be used - // as a TXT record in DNS. v=sonr, o=origin, p=protocol - Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) // Sync queries the DID document by its id. And returns the required PKL information Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) } @@ -67,15 +62,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { - out := new(QueryServiceResponse) - err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) { out := new(SyncResponse) err := c.cc.Invoke(ctx, Query_Sync_FullMethodName, in, out, opts...) @@ -93,10 +79,6 @@ type QueryServer interface { Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) - // Service returns associated ServiceInfo for a given Origin - // if the servie is not found, a fingerprint is generated to be used - // as a TXT record in DNS. v=sonr, o=origin, p=protocol - Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) // Sync queries the DID document by its id. And returns the required PKL information Sync(context.Context, *SyncRequest) (*SyncResponse, error) mustEmbedUnimplementedQueryServer() @@ -112,9 +94,6 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryPa func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (UnimplementedQueryServer) Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") -} func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") } @@ -167,24 +146,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Service(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Service_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Service(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SyncRequest) if err := dec(in); err != nil { @@ -218,10 +179,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, - { - MethodName: "Service", - Handler: _Query_Service_Handler, - }, { MethodName: "Sync", Handler: _Query_Sync_Handler, diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index 6b5fd2f70..e7589f1e8 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -17,9 +17,9 @@ type AliasTable 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) (*Alias, error) - HasByDidAlias(ctx context.Context, did string, alias string) (found bool, err error) - // GetByDidAlias returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByDidAlias(ctx context.Context, did string, alias string) (*Alias, error) + 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) (*Alias, error) List(ctx context.Context, prefixKey AliasIndexKey, opts ...ormlist.Option) (AliasIterator, error) ListRange(ctx context.Context, from, to AliasIndexKey, opts ...ormlist.Option) (AliasIterator, error) DeleteBy(ctx context.Context, prefixKey AliasIndexKey) error @@ -60,21 +60,21 @@ func (this AliasIdIndexKey) WithId(id string) AliasIdIndexKey { return this } -type AliasDidAliasIndexKey struct { +type AliasSubjectOriginIndexKey struct { vs []interface{} } -func (x AliasDidAliasIndexKey) id() uint32 { return 1 } -func (x AliasDidAliasIndexKey) values() []interface{} { return x.vs } -func (x AliasDidAliasIndexKey) aliasIndexKey() {} +func (x AliasSubjectOriginIndexKey) id() uint32 { return 1 } +func (x AliasSubjectOriginIndexKey) values() []interface{} { return x.vs } +func (x AliasSubjectOriginIndexKey) aliasIndexKey() {} -func (this AliasDidAliasIndexKey) WithDid(did string) AliasDidAliasIndexKey { - this.vs = []interface{}{did} +func (this AliasSubjectOriginIndexKey) WithSubject(subject string) AliasSubjectOriginIndexKey { + this.vs = []interface{}{subject} return this } -func (this AliasDidAliasIndexKey) WithDidAlias(did string, alias string) AliasDidAliasIndexKey { - this.vs = []interface{}{did, alias} +func (this AliasSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AliasSubjectOriginIndexKey { + this.vs = []interface{}{subject, origin} return this } @@ -114,18 +114,18 @@ func (this aliasTable) Get(ctx context.Context, id string) (*Alias, error) { return &alias, nil } -func (this aliasTable) HasByDidAlias(ctx context.Context, did string, alias string) (found bool, err error) { +func (this aliasTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - did, - alias, + subject, + origin, ) } -func (this aliasTable) GetByDidAlias(ctx context.Context, did string, alias string) (*Alias, error) { +func (this aliasTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Alias, error) { var alias Alias found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &alias, - did, - alias, + subject, + origin, ) if err != nil { return nil, err @@ -174,12 +174,21 @@ type ControllerTable 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) (*Controller, error) - HasByAddress(ctx context.Context, address string) (found bool, err error) - // GetByAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByAddress(ctx context.Context, address string) (*Controller, error) + HasBySonrAddress(ctx context.Context, sonr_address string) (found bool, err error) + // GetBySonrAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetBySonrAddress(ctx context.Context, sonr_address string) (*Controller, error) + HasByEthAddress(ctx context.Context, eth_address string) (found bool, err error) + // GetByEthAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByEthAddress(ctx context.Context, eth_address string) (*Controller, error) + HasByBtcAddress(ctx context.Context, btc_address string) (found bool, err error) + // GetByBtcAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByBtcAddress(ctx context.Context, btc_address string) (*Controller, error) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) // GetByVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) + HasByStatusVaultCid(ctx context.Context, status string, vault_cid string) (found bool, err error) + // GetByStatusVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByStatusVaultCid(ctx context.Context, status string, vault_cid string) (*Controller, error) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error @@ -220,16 +229,42 @@ func (this ControllerIdIndexKey) WithId(id string) ControllerIdIndexKey { return this } -type ControllerAddressIndexKey struct { +type ControllerSonrAddressIndexKey struct { vs []interface{} } -func (x ControllerAddressIndexKey) id() uint32 { return 1 } -func (x ControllerAddressIndexKey) values() []interface{} { return x.vs } -func (x ControllerAddressIndexKey) controllerIndexKey() {} +func (x ControllerSonrAddressIndexKey) id() uint32 { return 1 } +func (x ControllerSonrAddressIndexKey) values() []interface{} { return x.vs } +func (x ControllerSonrAddressIndexKey) controllerIndexKey() {} -func (this ControllerAddressIndexKey) WithAddress(address string) ControllerAddressIndexKey { - this.vs = []interface{}{address} +func (this ControllerSonrAddressIndexKey) WithSonrAddress(sonr_address string) ControllerSonrAddressIndexKey { + this.vs = []interface{}{sonr_address} + return this +} + +type ControllerEthAddressIndexKey struct { + vs []interface{} +} + +func (x ControllerEthAddressIndexKey) id() uint32 { return 2 } +func (x ControllerEthAddressIndexKey) values() []interface{} { return x.vs } +func (x ControllerEthAddressIndexKey) controllerIndexKey() {} + +func (this ControllerEthAddressIndexKey) WithEthAddress(eth_address string) ControllerEthAddressIndexKey { + this.vs = []interface{}{eth_address} + return this +} + +type ControllerBtcAddressIndexKey struct { + vs []interface{} +} + +func (x ControllerBtcAddressIndexKey) id() uint32 { return 3 } +func (x ControllerBtcAddressIndexKey) values() []interface{} { return x.vs } +func (x ControllerBtcAddressIndexKey) controllerIndexKey() {} + +func (this ControllerBtcAddressIndexKey) WithBtcAddress(btc_address string) ControllerBtcAddressIndexKey { + this.vs = []interface{}{btc_address} return this } @@ -237,7 +272,7 @@ type ControllerVaultCidIndexKey struct { vs []interface{} } -func (x ControllerVaultCidIndexKey) id() uint32 { return 2 } +func (x ControllerVaultCidIndexKey) id() uint32 { return 4 } func (x ControllerVaultCidIndexKey) values() []interface{} { return x.vs } func (x ControllerVaultCidIndexKey) controllerIndexKey() {} @@ -246,19 +281,24 @@ func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) Controller return this } -type ControllerStatusIndexKey struct { +type ControllerStatusVaultCidIndexKey struct { vs []interface{} } -func (x ControllerStatusIndexKey) id() uint32 { return 3 } -func (x ControllerStatusIndexKey) values() []interface{} { return x.vs } -func (x ControllerStatusIndexKey) controllerIndexKey() {} +func (x ControllerStatusVaultCidIndexKey) id() uint32 { return 5 } +func (x ControllerStatusVaultCidIndexKey) values() []interface{} { return x.vs } +func (x ControllerStatusVaultCidIndexKey) controllerIndexKey() {} -func (this ControllerStatusIndexKey) WithStatus(status string) ControllerStatusIndexKey { +func (this ControllerStatusVaultCidIndexKey) WithStatus(status string) ControllerStatusVaultCidIndexKey { this.vs = []interface{}{status} return this } +func (this ControllerStatusVaultCidIndexKey) WithStatusVaultCid(status string, vault_cid string) ControllerStatusVaultCidIndexKey { + this.vs = []interface{}{status, vault_cid} + return this +} + type controllerTable struct { table ormtable.Table } @@ -295,16 +335,56 @@ func (this controllerTable) Get(ctx context.Context, id string) (*Controller, er return &controller, nil } -func (this controllerTable) HasByAddress(ctx context.Context, address string) (found bool, err error) { +func (this controllerTable) HasBySonrAddress(ctx context.Context, sonr_address string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - address, + sonr_address, ) } -func (this controllerTable) GetByAddress(ctx context.Context, address string) (*Controller, error) { +func (this controllerTable) GetBySonrAddress(ctx context.Context, sonr_address string) (*Controller, error) { var controller Controller found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &controller, - address, + sonr_address, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &controller, nil +} + +func (this controllerTable) HasByEthAddress(ctx context.Context, eth_address string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + eth_address, + ) +} + +func (this controllerTable) GetByEthAddress(ctx context.Context, eth_address string) (*Controller, error) { + var controller Controller + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &controller, + eth_address, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &controller, nil +} + +func (this controllerTable) HasByBtcAddress(ctx context.Context, btc_address string) (found bool, err error) { + return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx, + btc_address, + ) +} + +func (this controllerTable) GetByBtcAddress(ctx context.Context, btc_address string) (*Controller, error) { + var controller Controller + found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &controller, + btc_address, ) if err != nil { return nil, err @@ -316,14 +396,36 @@ func (this controllerTable) GetByAddress(ctx context.Context, address string) (* } func (this controllerTable) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) { - return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + return this.table.GetIndexByID(4).(ormtable.UniqueIndex).Has(ctx, vault_cid, ) } func (this controllerTable) GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) { var controller Controller - found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &controller, + found, err := this.table.GetIndexByID(4).(ormtable.UniqueIndex).Get(ctx, &controller, + vault_cid, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &controller, nil +} + +func (this controllerTable) HasByStatusVaultCid(ctx context.Context, status string, vault_cid string) (found bool, err error) { + return this.table.GetIndexByID(5).(ormtable.UniqueIndex).Has(ctx, + status, + vault_cid, + ) +} + +func (this controllerTable) GetByStatusVaultCid(ctx context.Context, status string, vault_cid string) (*Controller, error) { + var controller Controller + found, err := this.table.GetIndexByID(5).(ormtable.UniqueIndex).Get(ctx, &controller, + status, vault_cid, ) if err != nil { @@ -373,9 +475,15 @@ type VerificationTable 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) (*Verification, error) - HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) - // GetByControllerMethodIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*Verification, error) + HasByIssuerSubject(ctx context.Context, issuer string, subject string) (found bool, err error) + // GetByIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByIssuerSubject(ctx context.Context, issuer string, subject string) (*Verification, error) + HasByControllerDidMethodIssuer(ctx context.Context, controller string, did_method string, issuer string) (found bool, err error) + // GetByControllerDidMethodIssuer returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerDidMethodIssuer(ctx context.Context, controller string, did_method string, issuer string) (*Verification, error) + HasByVerificationTypeSubjectIssuer(ctx context.Context, verification_type string, subject string, issuer string) (found bool, err error) + // GetByVerificationTypeSubjectIssuer returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByVerificationTypeSubjectIssuer(ctx context.Context, verification_type string, subject string, issuer string) (*Verification, error) List(ctx context.Context, prefixKey VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) ListRange(ctx context.Context, from, to VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) DeleteBy(ctx context.Context, prefixKey VerificationIndexKey) error @@ -416,31 +524,67 @@ func (this VerificationIdIndexKey) WithId(id string) VerificationIdIndexKey { return this } -type VerificationControllerMethodIssuerSubjectIndexKey struct { +type VerificationIssuerSubjectIndexKey struct { vs []interface{} } -func (x VerificationControllerMethodIssuerSubjectIndexKey) id() uint32 { return 1 } -func (x VerificationControllerMethodIssuerSubjectIndexKey) values() []interface{} { return x.vs } -func (x VerificationControllerMethodIssuerSubjectIndexKey) verificationIndexKey() {} +func (x VerificationIssuerSubjectIndexKey) id() uint32 { return 1 } +func (x VerificationIssuerSubjectIndexKey) values() []interface{} { return x.vs } +func (x VerificationIssuerSubjectIndexKey) verificationIndexKey() {} -func (this VerificationControllerMethodIssuerSubjectIndexKey) WithController(controller string) VerificationControllerMethodIssuerSubjectIndexKey { +func (this VerificationIssuerSubjectIndexKey) WithIssuer(issuer string) VerificationIssuerSubjectIndexKey { + this.vs = []interface{}{issuer} + return this +} + +func (this VerificationIssuerSubjectIndexKey) WithIssuerSubject(issuer string, subject string) VerificationIssuerSubjectIndexKey { + this.vs = []interface{}{issuer, subject} + return this +} + +type VerificationControllerDidMethodIssuerIndexKey struct { + vs []interface{} +} + +func (x VerificationControllerDidMethodIssuerIndexKey) id() uint32 { return 2 } +func (x VerificationControllerDidMethodIssuerIndexKey) values() []interface{} { return x.vs } +func (x VerificationControllerDidMethodIssuerIndexKey) verificationIndexKey() {} + +func (this VerificationControllerDidMethodIssuerIndexKey) WithController(controller string) VerificationControllerDidMethodIssuerIndexKey { this.vs = []interface{}{controller} return this } -func (this VerificationControllerMethodIssuerSubjectIndexKey) WithControllerMethod(controller string, method DIDNamespace) VerificationControllerMethodIssuerSubjectIndexKey { - this.vs = []interface{}{controller, method} +func (this VerificationControllerDidMethodIssuerIndexKey) WithControllerDidMethod(controller string, did_method string) VerificationControllerDidMethodIssuerIndexKey { + this.vs = []interface{}{controller, did_method} return this } -func (this VerificationControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuer(controller string, method DIDNamespace, issuer string) VerificationControllerMethodIssuerSubjectIndexKey { - this.vs = []interface{}{controller, method, issuer} +func (this VerificationControllerDidMethodIssuerIndexKey) WithControllerDidMethodIssuer(controller string, did_method string, issuer string) VerificationControllerDidMethodIssuerIndexKey { + this.vs = []interface{}{controller, did_method, issuer} return this } -func (this VerificationControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuerSubject(controller string, method DIDNamespace, issuer string, subject string) VerificationControllerMethodIssuerSubjectIndexKey { - this.vs = []interface{}{controller, method, issuer, subject} +type VerificationVerificationTypeSubjectIssuerIndexKey struct { + vs []interface{} +} + +func (x VerificationVerificationTypeSubjectIssuerIndexKey) id() uint32 { return 3 } +func (x VerificationVerificationTypeSubjectIssuerIndexKey) values() []interface{} { return x.vs } +func (x VerificationVerificationTypeSubjectIssuerIndexKey) verificationIndexKey() {} + +func (this VerificationVerificationTypeSubjectIssuerIndexKey) WithVerificationType(verification_type string) VerificationVerificationTypeSubjectIssuerIndexKey { + this.vs = []interface{}{verification_type} + return this +} + +func (this VerificationVerificationTypeSubjectIssuerIndexKey) WithVerificationTypeSubject(verification_type string, subject string) VerificationVerificationTypeSubjectIssuerIndexKey { + this.vs = []interface{}{verification_type, subject} + return this +} + +func (this VerificationVerificationTypeSubjectIssuerIndexKey) WithVerificationTypeSubjectIssuer(verification_type string, subject string, issuer string) VerificationVerificationTypeSubjectIssuerIndexKey { + this.vs = []interface{}{verification_type, subject, issuer} return this } @@ -480,20 +624,16 @@ func (this verificationTable) Get(ctx context.Context, id string) (*Verification return &verification, nil } -func (this verificationTable) HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) { +func (this verificationTable) HasByIssuerSubject(ctx context.Context, issuer string, subject string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - controller, - method, issuer, subject, ) } -func (this verificationTable) GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*Verification, error) { +func (this verificationTable) GetByIssuerSubject(ctx context.Context, issuer string, subject string) (*Verification, error) { var verification Verification found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &verification, - controller, - method, issuer, subject, ) @@ -506,6 +646,54 @@ func (this verificationTable) GetByControllerMethodIssuerSubject(ctx context.Con return &verification, nil } +func (this verificationTable) HasByControllerDidMethodIssuer(ctx context.Context, controller string, did_method string, issuer string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + controller, + did_method, + issuer, + ) +} + +func (this verificationTable) GetByControllerDidMethodIssuer(ctx context.Context, controller string, did_method string, issuer string) (*Verification, error) { + var verification Verification + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &verification, + controller, + did_method, + issuer, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &verification, nil +} + +func (this verificationTable) HasByVerificationTypeSubjectIssuer(ctx context.Context, verification_type string, subject string, issuer string) (found bool, err error) { + return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx, + verification_type, + subject, + issuer, + ) +} + +func (this verificationTable) GetByVerificationTypeSubjectIssuer(ctx context.Context, verification_type string, subject string, issuer string) (*Verification, error) { + var verification Verification + found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &verification, + verification_type, + subject, + issuer, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &verification, nil +} + func (this verificationTable) List(ctx context.Context, prefixKey VerificationIndexKey, opts ...ormlist.Option) (VerificationIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) return VerificationIterator{it}, err diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index dd314c728..332fd4912 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -13,71 +13,19 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_Alias_5_list)(nil) - -type _Alias_5_list struct { - list *[]string -} - -func (x *_Alias_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Alias_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Alias_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Alias_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Alias_5_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Alias at list field Scopes as it is not of Message kind")) -} - -func (x *_Alias_5_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Alias_5_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Alias_5_list) IsValid() bool { - return x.list != nil -} - var ( - md_Alias protoreflect.MessageDescriptor - fd_Alias_id protoreflect.FieldDescriptor - fd_Alias_did protoreflect.FieldDescriptor - fd_Alias_alias protoreflect.FieldDescriptor - fd_Alias_origin protoreflect.FieldDescriptor - fd_Alias_scopes protoreflect.FieldDescriptor - fd_Alias_expiration protoreflect.FieldDescriptor + md_Alias protoreflect.MessageDescriptor + fd_Alias_id protoreflect.FieldDescriptor + fd_Alias_subject protoreflect.FieldDescriptor + fd_Alias_origin protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() md_Alias = File_did_v1_state_proto.Messages().ByName("Alias") fd_Alias_id = md_Alias.Fields().ByName("id") - fd_Alias_did = md_Alias.Fields().ByName("did") - fd_Alias_alias = md_Alias.Fields().ByName("alias") + fd_Alias_subject = md_Alias.Fields().ByName("subject") fd_Alias_origin = md_Alias.Fields().ByName("origin") - fd_Alias_scopes = md_Alias.Fields().ByName("scopes") - fd_Alias_expiration = md_Alias.Fields().ByName("expiration") } var _ protoreflect.Message = (*fastReflection_Alias)(nil) @@ -151,15 +99,9 @@ func (x *fastReflection_Alias) Range(f func(protoreflect.FieldDescriptor, protor return } } - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_Alias_did, value) { - return - } - } - if x.Alias != "" { - value := protoreflect.ValueOfString(x.Alias) - if !f(fd_Alias_alias, value) { + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Alias_subject, value) { return } } @@ -169,18 +111,6 @@ func (x *fastReflection_Alias) Range(f func(protoreflect.FieldDescriptor, protor return } } - if len(x.Scopes) != 0 { - value := protoreflect.ValueOfList(&_Alias_5_list{list: &x.Scopes}) - if !f(fd_Alias_scopes, value) { - return - } - } - if x.Expiration != int64(0) { - value := protoreflect.ValueOfInt64(x.Expiration) - if !f(fd_Alias_expiration, value) { - return - } - } } // Has reports whether a field is populated. @@ -198,16 +128,10 @@ func (x *fastReflection_Alias) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.Alias.id": return x.Id != "" - case "did.v1.Alias.did": - return x.Did != "" - case "did.v1.Alias.alias": - return x.Alias != "" + case "did.v1.Alias.subject": + return x.Subject != "" case "did.v1.Alias.origin": return x.Origin != "" - case "did.v1.Alias.scopes": - return len(x.Scopes) != 0 - case "did.v1.Alias.expiration": - return x.Expiration != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) @@ -226,16 +150,10 @@ func (x *fastReflection_Alias) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.Alias.id": x.Id = "" - case "did.v1.Alias.did": - x.Did = "" - case "did.v1.Alias.alias": - x.Alias = "" + case "did.v1.Alias.subject": + x.Subject = "" case "did.v1.Alias.origin": x.Origin = "" - case "did.v1.Alias.scopes": - x.Scopes = nil - case "did.v1.Alias.expiration": - x.Expiration = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) @@ -255,24 +173,12 @@ func (x *fastReflection_Alias) Get(descriptor protoreflect.FieldDescriptor) prot case "did.v1.Alias.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Alias.did": - value := x.Did - return protoreflect.ValueOfString(value) - case "did.v1.Alias.alias": - value := x.Alias + case "did.v1.Alias.subject": + value := x.Subject return protoreflect.ValueOfString(value) case "did.v1.Alias.origin": value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.Alias.scopes": - if len(x.Scopes) == 0 { - return protoreflect.ValueOfList(&_Alias_5_list{}) - } - listValue := &_Alias_5_list{list: &x.Scopes} - return protoreflect.ValueOfList(listValue) - case "did.v1.Alias.expiration": - value := x.Expiration - return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) @@ -295,18 +201,10 @@ func (x *fastReflection_Alias) Set(fd protoreflect.FieldDescriptor, value protor switch fd.FullName() { case "did.v1.Alias.id": x.Id = value.Interface().(string) - case "did.v1.Alias.did": - x.Did = value.Interface().(string) - case "did.v1.Alias.alias": - x.Alias = value.Interface().(string) + case "did.v1.Alias.subject": + x.Subject = value.Interface().(string) case "did.v1.Alias.origin": x.Origin = value.Interface().(string) - case "did.v1.Alias.scopes": - lv := value.List() - clv := lv.(*_Alias_5_list) - x.Scopes = *clv.list - case "did.v1.Alias.expiration": - x.Expiration = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) @@ -327,22 +225,12 @@ func (x *fastReflection_Alias) Set(fd protoreflect.FieldDescriptor, value protor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Alias) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Alias.scopes": - if x.Scopes == nil { - x.Scopes = []string{} - } - value := &_Alias_5_list{list: &x.Scopes} - return protoreflect.ValueOfList(value) case "did.v1.Alias.id": panic(fmt.Errorf("field id of message did.v1.Alias is not mutable")) - case "did.v1.Alias.did": - panic(fmt.Errorf("field did of message did.v1.Alias is not mutable")) - case "did.v1.Alias.alias": - panic(fmt.Errorf("field alias of message did.v1.Alias is not mutable")) + case "did.v1.Alias.subject": + panic(fmt.Errorf("field subject of message did.v1.Alias is not mutable")) case "did.v1.Alias.origin": panic(fmt.Errorf("field origin of message did.v1.Alias is not mutable")) - case "did.v1.Alias.expiration": - panic(fmt.Errorf("field expiration of message did.v1.Alias is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) @@ -358,17 +246,10 @@ func (x *fastReflection_Alias) NewField(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { case "did.v1.Alias.id": return protoreflect.ValueOfString("") - case "did.v1.Alias.did": - return protoreflect.ValueOfString("") - case "did.v1.Alias.alias": + case "did.v1.Alias.subject": return protoreflect.ValueOfString("") case "did.v1.Alias.origin": return protoreflect.ValueOfString("") - case "did.v1.Alias.scopes": - list := []string{} - return protoreflect.ValueOfList(&_Alias_5_list{list: &list}) - case "did.v1.Alias.expiration": - return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) @@ -442,11 +323,7 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Did) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Alias) + l = len(x.Subject) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -454,15 +331,6 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Scopes) > 0 { - for _, s := range x.Scopes { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.Expiration != 0 { - n += 1 + runtime.Sov(uint64(x.Expiration)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -492,38 +360,17 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Expiration != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Expiration)) - i-- - dAtA[i] = 0x30 - } - if len(x.Scopes) > 0 { - for iNdEx := len(x.Scopes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Scopes[iNdEx]) - copy(dAtA[i:], x.Scopes[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Scopes[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if len(x.Origin) > 0 { i -= len(x.Origin) copy(dAtA[i:], x.Origin) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) i-- - dAtA[i] = 0x22 - } - if len(x.Alias) > 0 { - i -= len(x.Alias) - copy(dAtA[i:], x.Alias) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Alias))) - i-- dAtA[i] = 0x1a } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) i-- dAtA[i] = 0x12 } @@ -617,7 +464,7 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -645,41 +492,9 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Did = string(dAtA[iNdEx:postIndex]) + x.Subject = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Alias", 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.Alias = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } @@ -711,57 +526,6 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { } 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 Scopes", 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.Scopes = append(x.Scopes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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 |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -797,112 +561,104 @@ func (x *fastReflection_Alias) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_Controller_3_list)(nil) +var _ protoreflect.List = (*_Controller_5_list)(nil) -type _Controller_3_list struct { - list *[]*Alias +type _Controller_5_list struct { + list *[]string } -func (x *_Controller_3_list) Len() int { +func (x *_Controller_5_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Controller_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +func (x *_Controller_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Controller_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Alias) +func (x *_Controller_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Controller_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Alias) +func (x *_Controller_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Controller_3_list) AppendMutable() protoreflect.Value { - v := new(Alias) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Controller_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Controller at list field Aliases as it is not of Message kind")) } -func (x *_Controller_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } +func (x *_Controller_5_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Controller_3_list) NewElement() protoreflect.Value { - v := new(Alias) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Controller_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) } -func (x *_Controller_3_list) IsValid() bool { +func (x *_Controller_5_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Controller_6_list)(nil) +var _ protoreflect.List = (*_Controller_8_list)(nil) -type _Controller_6_list struct { - list *[]*Credential +type _Controller_8_list struct { + list *[]string } -func (x *_Controller_6_list) Len() int { +func (x *_Controller_8_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Controller_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +func (x *_Controller_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Controller_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Credential) +func (x *_Controller_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Controller_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Credential) +func (x *_Controller_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Controller_6_list) AppendMutable() protoreflect.Value { - v := new(Credential) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Controller_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Controller at list field Authentication as it is not of Message kind")) } -func (x *_Controller_6_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } +func (x *_Controller_8_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Controller_6_list) NewElement() protoreflect.Value { - v := new(Credential) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Controller_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) } -func (x *_Controller_6_list) IsValid() bool { +func (x *_Controller_8_list) IsValid() bool { return x.list != nil } var ( md_Controller protoreflect.MessageDescriptor fd_Controller_id protoreflect.FieldDescriptor - fd_Controller_address protoreflect.FieldDescriptor + fd_Controller_sonr_address protoreflect.FieldDescriptor + fd_Controller_eth_address protoreflect.FieldDescriptor + fd_Controller_btc_address protoreflect.FieldDescriptor fd_Controller_aliases protoreflect.FieldDescriptor fd_Controller_public_key protoreflect.FieldDescriptor fd_Controller_vault_cid protoreflect.FieldDescriptor @@ -914,7 +670,9 @@ func init() { file_did_v1_state_proto_init() md_Controller = File_did_v1_state_proto.Messages().ByName("Controller") fd_Controller_id = md_Controller.Fields().ByName("id") - fd_Controller_address = md_Controller.Fields().ByName("address") + fd_Controller_sonr_address = md_Controller.Fields().ByName("sonr_address") + fd_Controller_eth_address = md_Controller.Fields().ByName("eth_address") + fd_Controller_btc_address = md_Controller.Fields().ByName("btc_address") fd_Controller_aliases = md_Controller.Fields().ByName("aliases") fd_Controller_public_key = md_Controller.Fields().ByName("public_key") fd_Controller_vault_cid = md_Controller.Fields().ByName("vault_cid") @@ -993,14 +751,26 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_Controller_address, value) { + if x.SonrAddress != "" { + value := protoreflect.ValueOfString(x.SonrAddress) + if !f(fd_Controller_sonr_address, value) { + return + } + } + if x.EthAddress != "" { + value := protoreflect.ValueOfString(x.EthAddress) + if !f(fd_Controller_eth_address, value) { + return + } + } + if x.BtcAddress != "" { + value := protoreflect.ValueOfString(x.BtcAddress) + if !f(fd_Controller_btc_address, value) { return } } if len(x.Aliases) != 0 { - value := protoreflect.ValueOfList(&_Controller_3_list{list: &x.Aliases}) + value := protoreflect.ValueOfList(&_Controller_5_list{list: &x.Aliases}) if !f(fd_Controller_aliases, value) { return } @@ -1018,7 +788,7 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p } } if len(x.Authentication) != 0 { - value := protoreflect.ValueOfList(&_Controller_6_list{list: &x.Authentication}) + value := protoreflect.ValueOfList(&_Controller_8_list{list: &x.Authentication}) if !f(fd_Controller_authentication, value) { return } @@ -1046,8 +816,12 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.Controller.id": return x.Id != "" - case "did.v1.Controller.address": - return x.Address != "" + case "did.v1.Controller.sonr_address": + return x.SonrAddress != "" + case "did.v1.Controller.eth_address": + return x.EthAddress != "" + case "did.v1.Controller.btc_address": + return x.BtcAddress != "" case "did.v1.Controller.aliases": return len(x.Aliases) != 0 case "did.v1.Controller.public_key": @@ -1076,8 +850,12 @@ func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.Controller.id": x.Id = "" - case "did.v1.Controller.address": - x.Address = "" + case "did.v1.Controller.sonr_address": + x.SonrAddress = "" + case "did.v1.Controller.eth_address": + x.EthAddress = "" + case "did.v1.Controller.btc_address": + x.BtcAddress = "" case "did.v1.Controller.aliases": x.Aliases = nil case "did.v1.Controller.public_key": @@ -1107,14 +885,20 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Controller.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Controller.address": - value := x.Address + case "did.v1.Controller.sonr_address": + value := x.SonrAddress + return protoreflect.ValueOfString(value) + case "did.v1.Controller.eth_address": + value := x.EthAddress + return protoreflect.ValueOfString(value) + case "did.v1.Controller.btc_address": + value := x.BtcAddress return protoreflect.ValueOfString(value) case "did.v1.Controller.aliases": if len(x.Aliases) == 0 { - return protoreflect.ValueOfList(&_Controller_3_list{}) + return protoreflect.ValueOfList(&_Controller_5_list{}) } - listValue := &_Controller_3_list{list: &x.Aliases} + listValue := &_Controller_5_list{list: &x.Aliases} return protoreflect.ValueOfList(listValue) case "did.v1.Controller.public_key": value := x.PublicKey @@ -1124,9 +908,9 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) return protoreflect.ValueOfString(value) case "did.v1.Controller.authentication": if len(x.Authentication) == 0 { - return protoreflect.ValueOfList(&_Controller_6_list{}) + return protoreflect.ValueOfList(&_Controller_8_list{}) } - listValue := &_Controller_6_list{list: &x.Authentication} + listValue := &_Controller_8_list{list: &x.Authentication} return protoreflect.ValueOfList(listValue) case "did.v1.Controller.status": value := x.Status @@ -1153,11 +937,15 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p switch fd.FullName() { case "did.v1.Controller.id": x.Id = value.Interface().(string) - case "did.v1.Controller.address": - x.Address = value.Interface().(string) + case "did.v1.Controller.sonr_address": + x.SonrAddress = value.Interface().(string) + case "did.v1.Controller.eth_address": + x.EthAddress = value.Interface().(string) + case "did.v1.Controller.btc_address": + x.BtcAddress = value.Interface().(string) case "did.v1.Controller.aliases": lv := value.List() - clv := lv.(*_Controller_3_list) + clv := lv.(*_Controller_5_list) x.Aliases = *clv.list case "did.v1.Controller.public_key": x.PublicKey = value.Message().Interface().(*PubKey) @@ -1165,7 +953,7 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p x.VaultCid = value.Interface().(string) case "did.v1.Controller.authentication": lv := value.List() - clv := lv.(*_Controller_6_list) + clv := lv.(*_Controller_8_list) x.Authentication = *clv.list case "did.v1.Controller.status": x.Status = value.Interface().(string) @@ -1191,9 +979,9 @@ func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) pro switch fd.FullName() { case "did.v1.Controller.aliases": if x.Aliases == nil { - x.Aliases = []*Alias{} + x.Aliases = []string{} } - value := &_Controller_3_list{list: &x.Aliases} + value := &_Controller_5_list{list: &x.Aliases} return protoreflect.ValueOfList(value) case "did.v1.Controller.public_key": if x.PublicKey == nil { @@ -1202,14 +990,18 @@ func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) pro return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) case "did.v1.Controller.authentication": if x.Authentication == nil { - x.Authentication = []*Credential{} + x.Authentication = []string{} } - value := &_Controller_6_list{list: &x.Authentication} + value := &_Controller_8_list{list: &x.Authentication} return protoreflect.ValueOfList(value) case "did.v1.Controller.id": panic(fmt.Errorf("field id of message did.v1.Controller is not mutable")) - case "did.v1.Controller.address": - panic(fmt.Errorf("field address of message did.v1.Controller is not mutable")) + case "did.v1.Controller.sonr_address": + panic(fmt.Errorf("field sonr_address of message did.v1.Controller is not mutable")) + case "did.v1.Controller.eth_address": + panic(fmt.Errorf("field eth_address of message did.v1.Controller is not mutable")) + case "did.v1.Controller.btc_address": + panic(fmt.Errorf("field btc_address of message did.v1.Controller is not mutable")) case "did.v1.Controller.vault_cid": panic(fmt.Errorf("field vault_cid of message did.v1.Controller is not mutable")) case "did.v1.Controller.status": @@ -1229,19 +1021,23 @@ func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) pr switch fd.FullName() { case "did.v1.Controller.id": return protoreflect.ValueOfString("") - case "did.v1.Controller.address": + case "did.v1.Controller.sonr_address": + return protoreflect.ValueOfString("") + case "did.v1.Controller.eth_address": + return protoreflect.ValueOfString("") + case "did.v1.Controller.btc_address": return protoreflect.ValueOfString("") case "did.v1.Controller.aliases": - list := []*Alias{} - return protoreflect.ValueOfList(&_Controller_3_list{list: &list}) + list := []string{} + return protoreflect.ValueOfList(&_Controller_5_list{list: &list}) case "did.v1.Controller.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.Controller.vault_cid": return protoreflect.ValueOfString("") case "did.v1.Controller.authentication": - list := []*Credential{} - return protoreflect.ValueOfList(&_Controller_6_list{list: &list}) + list := []string{} + return protoreflect.ValueOfList(&_Controller_8_list{list: &list}) case "did.v1.Controller.status": return protoreflect.ValueOfString("") default: @@ -1317,13 +1113,21 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Address) + l = len(x.SonrAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EthAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BtcAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if len(x.Aliases) > 0 { - for _, e := range x.Aliases { - l = options.Size(e) + for _, s := range x.Aliases { + l = len(s) n += 1 + l + runtime.Sov(uint64(l)) } } @@ -1336,8 +1140,8 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } if len(x.Authentication) > 0 { - for _, e := range x.Authentication { - l = options.Size(e) + for _, s := range x.Authentication { + l = len(s) n += 1 + l + runtime.Sov(uint64(l)) } } @@ -1379,22 +1183,15 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.Status) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Status))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x4a } if len(x.Authentication) > 0 { for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Authentication[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i -= len(x.Authentication[iNdEx]) + copy(dAtA[i:], x.Authentication[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x42 } } if len(x.VaultCid) > 0 { @@ -1402,7 +1199,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.VaultCid) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VaultCid))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } if x.PublicKey != nil { encoded, err := options.Marshal(x.PublicKey) @@ -1416,28 +1213,35 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 } if len(x.Aliases) > 0 { for iNdEx := len(x.Aliases) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Aliases[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i -= len(x.Aliases[iNdEx]) + copy(dAtA[i:], x.Aliases[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aliases[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.BtcAddress) > 0 { + i -= len(x.BtcAddress) + copy(dAtA[i:], x.BtcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BtcAddress))) + i-- + dAtA[i] = 0x22 + } + if len(x.EthAddress) > 0 { + i -= len(x.EthAddress) + copy(dAtA[i:], x.EthAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthAddress))) + i-- + dAtA[i] = 0x1a + } + if len(x.SonrAddress) > 0 { + i -= len(x.SonrAddress) + copy(dAtA[i:], x.SonrAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SonrAddress))) i-- dAtA[i] = 0x12 } @@ -1531,7 +1335,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1559,13 +1363,13 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.SonrAddress = 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 Aliases", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1575,27 +1379,89 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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.Aliases = append(x.Aliases, &Alias{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Aliases[len(x.Aliases)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.EthAddress = 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 BtcAddress", 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.BtcAddress = 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 Aliases", 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.Aliases = append(x.Aliases, 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 PublicKey", wireType) } @@ -1631,7 +1497,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType) } @@ -1663,11 +1529,11 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } x.VaultCid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1677,27 +1543,25 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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.Authentication = append(x.Authentication, &Credential{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Authentication[len(x.Authentication)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Authentication = append(x.Authentication, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 9: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } @@ -1765,14 +1629,14 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } var ( - md_Verification protoreflect.MessageDescriptor - fd_Verification_id protoreflect.FieldDescriptor - fd_Verification_controller protoreflect.FieldDescriptor - fd_Verification_method protoreflect.FieldDescriptor - fd_Verification_issuer protoreflect.FieldDescriptor - fd_Verification_subject protoreflect.FieldDescriptor - fd_Verification_public_key protoreflect.FieldDescriptor - fd_Verification_kind protoreflect.FieldDescriptor + md_Verification protoreflect.MessageDescriptor + fd_Verification_id protoreflect.FieldDescriptor + fd_Verification_controller protoreflect.FieldDescriptor + fd_Verification_did_method protoreflect.FieldDescriptor + fd_Verification_issuer protoreflect.FieldDescriptor + fd_Verification_subject protoreflect.FieldDescriptor + fd_Verification_public_key protoreflect.FieldDescriptor + fd_Verification_verification_type protoreflect.FieldDescriptor ) func init() { @@ -1780,11 +1644,11 @@ func init() { md_Verification = File_did_v1_state_proto.Messages().ByName("Verification") fd_Verification_id = md_Verification.Fields().ByName("id") fd_Verification_controller = md_Verification.Fields().ByName("controller") - fd_Verification_method = md_Verification.Fields().ByName("method") + fd_Verification_did_method = md_Verification.Fields().ByName("did_method") fd_Verification_issuer = md_Verification.Fields().ByName("issuer") fd_Verification_subject = md_Verification.Fields().ByName("subject") fd_Verification_public_key = md_Verification.Fields().ByName("public_key") - fd_Verification_kind = md_Verification.Fields().ByName("kind") + fd_Verification_verification_type = md_Verification.Fields().ByName("verification_type") } var _ protoreflect.Message = (*fastReflection_Verification)(nil) @@ -1864,9 +1728,9 @@ func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Method != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Method)) - if !f(fd_Verification_method, value) { + if x.DidMethod != "" { + value := protoreflect.ValueOfString(x.DidMethod) + if !f(fd_Verification_did_method, value) { return } } @@ -1888,9 +1752,9 @@ func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Kind != "" { - value := protoreflect.ValueOfString(x.Kind) - if !f(fd_Verification_kind, value) { + if x.VerificationType != "" { + value := protoreflect.ValueOfString(x.VerificationType) + if !f(fd_Verification_verification_type, value) { return } } @@ -1913,16 +1777,16 @@ func (x *fastReflection_Verification) Has(fd protoreflect.FieldDescriptor) bool return x.Id != "" case "did.v1.Verification.controller": return x.Controller != "" - case "did.v1.Verification.method": - return x.Method != 0 + case "did.v1.Verification.did_method": + return x.DidMethod != "" case "did.v1.Verification.issuer": return x.Issuer != "" case "did.v1.Verification.subject": return x.Subject != "" case "did.v1.Verification.public_key": return x.PublicKey != nil - case "did.v1.Verification.kind": - return x.Kind != "" + case "did.v1.Verification.verification_type": + return x.VerificationType != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1943,16 +1807,16 @@ func (x *fastReflection_Verification) Clear(fd protoreflect.FieldDescriptor) { x.Id = "" case "did.v1.Verification.controller": x.Controller = "" - case "did.v1.Verification.method": - x.Method = 0 + case "did.v1.Verification.did_method": + x.DidMethod = "" case "did.v1.Verification.issuer": x.Issuer = "" case "did.v1.Verification.subject": x.Subject = "" case "did.v1.Verification.public_key": x.PublicKey = nil - case "did.v1.Verification.kind": - x.Kind = "" + case "did.v1.Verification.verification_type": + x.VerificationType = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1975,9 +1839,9 @@ func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescripto case "did.v1.Verification.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Verification.method": - value := x.Method - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.Verification.did_method": + value := x.DidMethod + return protoreflect.ValueOfString(value) case "did.v1.Verification.issuer": value := x.Issuer return protoreflect.ValueOfString(value) @@ -1987,8 +1851,8 @@ func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescripto case "did.v1.Verification.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.Verification.kind": - value := x.Kind + case "did.v1.Verification.verification_type": + value := x.VerificationType return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -2014,16 +1878,16 @@ func (x *fastReflection_Verification) Set(fd protoreflect.FieldDescriptor, value x.Id = value.Interface().(string) case "did.v1.Verification.controller": x.Controller = value.Interface().(string) - case "did.v1.Verification.method": - x.Method = (DIDNamespace)(value.Enum()) + case "did.v1.Verification.did_method": + x.DidMethod = value.Interface().(string) case "did.v1.Verification.issuer": x.Issuer = value.Interface().(string) case "did.v1.Verification.subject": x.Subject = value.Interface().(string) case "did.v1.Verification.public_key": x.PublicKey = value.Message().Interface().(*PubKey) - case "did.v1.Verification.kind": - x.Kind = value.Interface().(string) + case "did.v1.Verification.verification_type": + x.VerificationType = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -2053,14 +1917,14 @@ func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field id of message did.v1.Verification is not mutable")) case "did.v1.Verification.controller": panic(fmt.Errorf("field controller of message did.v1.Verification is not mutable")) - case "did.v1.Verification.method": - panic(fmt.Errorf("field method of message did.v1.Verification is not mutable")) + case "did.v1.Verification.did_method": + panic(fmt.Errorf("field did_method of message did.v1.Verification is not mutable")) case "did.v1.Verification.issuer": panic(fmt.Errorf("field issuer of message did.v1.Verification is not mutable")) case "did.v1.Verification.subject": panic(fmt.Errorf("field subject of message did.v1.Verification is not mutable")) - case "did.v1.Verification.kind": - panic(fmt.Errorf("field kind of message did.v1.Verification is not mutable")) + case "did.v1.Verification.verification_type": + panic(fmt.Errorf("field verification_type of message did.v1.Verification is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -2078,8 +1942,8 @@ func (x *fastReflection_Verification) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "did.v1.Verification.controller": return protoreflect.ValueOfString("") - case "did.v1.Verification.method": - return protoreflect.ValueOfEnum(0) + case "did.v1.Verification.did_method": + return protoreflect.ValueOfString("") case "did.v1.Verification.issuer": return protoreflect.ValueOfString("") case "did.v1.Verification.subject": @@ -2087,7 +1951,7 @@ func (x *fastReflection_Verification) NewField(fd protoreflect.FieldDescriptor) case "did.v1.Verification.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.Verification.kind": + case "did.v1.Verification.verification_type": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -2166,8 +2030,9 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Method != 0 { - n += 1 + runtime.Sov(uint64(x.Method)) + l = len(x.DidMethod) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.Issuer) if l > 0 { @@ -2181,7 +2046,7 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { l = options.Size(x.PublicKey) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Kind) + l = len(x.VerificationType) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2214,10 +2079,10 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Kind) > 0 { - i -= len(x.Kind) - copy(dAtA[i:], x.Kind) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + if len(x.VerificationType) > 0 { + i -= len(x.VerificationType) + copy(dAtA[i:], x.VerificationType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VerificationType))) i-- dAtA[i] = 0x3a } @@ -2249,10 +2114,12 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x22 } - if x.Method != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Method)) + if len(x.DidMethod) > 0 { + i -= len(x.DidMethod) + copy(dAtA[i:], x.DidMethod) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DidMethod))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if len(x.Controller) > 0 { i -= len(x.Controller) @@ -2382,10 +2249,10 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { x.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DidMethod", wireType) } - x.Method = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2395,11 +2262,24 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Method |= DIDNamespace(b&0x7F) << shift + 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.DidMethod = 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 Issuer", wireType) @@ -2502,7 +2382,7 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 7: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VerificationType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2530,7 +2410,7 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Kind = string(dAtA[iNdEx:postIndex]) + x.VerificationType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2588,16 +2468,10 @@ type Alias struct { // The unique identifier of the alias Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The DID of the alias - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // The alias of the DID - Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // Origin of the alias - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // Permissions of the alias - Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"` - // Expiration of the alias - Expiration int64 `protobuf:"varint,6,opt,name=expiration,proto3" json:"expiration,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` } func (x *Alias) Reset() { @@ -2627,16 +2501,9 @@ func (x *Alias) GetId() string { return "" } -func (x *Alias) GetDid() string { +func (x *Alias) GetSubject() string { if x != nil { - return x.Did - } - return "" -} - -func (x *Alias) GetAlias() string { - if x != nil { - return x.Alias + return x.Subject } return "" } @@ -2648,20 +2515,6 @@ func (x *Alias) GetOrigin() string { return "" } -func (x *Alias) GetScopes() []string { - if x != nil { - return x.Scopes - } - return nil -} - -func (x *Alias) GetExpiration() int64 { - if x != nil { - return x.Expiration - } - return 0 -} - // Controller represents a Sonr DWN Vault type Controller struct { state protoimpl.MessageState @@ -2671,17 +2524,21 @@ type Controller struct { // The unique identifier of the controller Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The DID of the controller - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + SonrAddress string `protobuf:"bytes,2,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` + // The DID of the controller + EthAddress string `protobuf:"bytes,3,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` + // The DID of the controller + BtcAddress string `protobuf:"bytes,4,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` // Aliases of the controller - Aliases []*Alias `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` + Aliases []string `protobuf:"bytes,5,rep,name=aliases,proto3" json:"aliases,omitempty"` // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // The vault address or identifier - VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` + VaultCid string `protobuf:"bytes,7,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` // The Authentications of the controller - Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"` + Authentication []string `protobuf:"bytes,8,rep,name=authentication,proto3" json:"authentication,omitempty"` // The Status of the claims for the controller - Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` + Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` } func (x *Controller) Reset() { @@ -2711,14 +2568,28 @@ func (x *Controller) GetId() string { return "" } -func (x *Controller) GetAddress() string { +func (x *Controller) GetSonrAddress() string { if x != nil { - return x.Address + return x.SonrAddress } return "" } -func (x *Controller) GetAliases() []*Alias { +func (x *Controller) GetEthAddress() string { + if x != nil { + return x.EthAddress + } + return "" +} + +func (x *Controller) GetBtcAddress() string { + if x != nil { + return x.BtcAddress + } + return "" +} + +func (x *Controller) GetAliases() []string { if x != nil { return x.Aliases } @@ -2739,7 +2610,7 @@ func (x *Controller) GetVaultCid() string { return "" } -func (x *Controller) GetAuthentication() []*Credential { +func (x *Controller) GetAuthentication() []string { if x != nil { return x.Authentication } @@ -2764,15 +2635,15 @@ type Verification struct { // The controller of the verification Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DIDNamespace of the verification - Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` + DidMethod string `protobuf:"bytes,3,opt,name=did_method,json=didMethod,proto3" json:"did_method,omitempty"` // The value of the linked identifier Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` // The subject of the verification Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) - Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` + // The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` } func (x *Verification) Reset() { @@ -2809,11 +2680,11 @@ func (x *Verification) GetController() string { return "" } -func (x *Verification) GetMethod() DIDNamespace { +func (x *Verification) GetDidMethod() string { if x != nil { - return x.Method + return x.DidMethod } - return DIDNamespace_DID_NAMESPACE_UNSPECIFIED + return "" } func (x *Verification) GetIssuer() string { @@ -2837,9 +2708,9 @@ func (x *Verification) GetPublicKey() *PubKey { return nil } -func (x *Verification) GetKind() string { +func (x *Verification) GetVerificationType() string { if x != nil { - return x.Kind + return x.VerificationType } return "" } @@ -2851,66 +2722,70 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xb0, 0x01, 0x0a, 0x05, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, - 0x12, 0x0f, 0x0a, 0x09, 0x64, 0x69, 0x64, 0x2c, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x10, 0x01, 0x18, - 0x01, 0x18, 0x01, 0x22, 0xbb, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x07, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x07, 0x61, 0x6c, - 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, - 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x0e, 0x61, - 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3a, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x34, 0x0a, 0x04, 0x0a, - 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, - 0x18, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x10, - 0x02, 0x18, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x10, 0x03, 0x18, - 0x02, 0x22, 0x99, 0x02, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x3a, 0x36, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x30, 0x0a, 0x04, 0x0a, - 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x05, 0x42, 0x7a, 0x0a, - 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, - 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6f, 0x0a, 0x05, 0x41, + 0x6c, 0x69, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 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, 0x01, 0x22, 0x9a, 0x03, 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, 0x21, 0x0a, 0x0c, 0x73, + 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x74, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, 0x0a, 0x04, + 0x0a, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, + 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x0f, + 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x10, 0x04, 0x18, 0x01, 0x12, + 0x16, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x63, 0x69, 0x64, 0x10, 0x05, 0x18, 0x01, 0x18, 0x02, 0x22, 0xdd, 0x02, 0x0a, 0x0c, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, + 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x64, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x70, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6a, 0x0a, + 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, 0x1c, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, 0x01, 0x12, + 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x05, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, + 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, + 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2931,20 +2806,15 @@ var file_did_v1_state_proto_goTypes = []interface{}{ (*Controller)(nil), // 1: did.v1.Controller (*Verification)(nil), // 2: did.v1.Verification (*PubKey)(nil), // 3: did.v1.PubKey - (*Credential)(nil), // 4: did.v1.Credential - (DIDNamespace)(0), // 5: did.v1.DIDNamespace } var file_did_v1_state_proto_depIdxs = []int32{ - 0, // 0: did.v1.Controller.aliases:type_name -> did.v1.Alias - 3, // 1: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 4, // 2: did.v1.Controller.authentication:type_name -> did.v1.Credential - 5, // 3: did.v1.Verification.method:type_name -> did.v1.DIDNamespace - 3, // 4: did.v1.Verification.public_key:type_name -> did.v1.PubKey - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 3, // 0: did.v1.Controller.public_key:type_name -> did.v1.PubKey + 3, // 1: did.v1.Verification.public_key:type_name -> did.v1.PubKey + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_did_v1_state_proto_init() } @@ -2953,7 +2823,6 @@ func file_did_v1_state_proto_init() { return } file_did_v1_genesis_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.(*Alias); i { diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index 2d19f43c1..6ac071d4e 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -1484,11 +1484,11 @@ func (x *fastReflection_MsgAllocateVault) ProtoMethods() *protoiface.Methods { } var ( - md_MsgAllocateVaultResponse protoreflect.MessageDescriptor - fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_registration_options protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_localhost protoreflect.FieldDescriptor + md_MsgAllocateVaultResponse protoreflect.MessageDescriptor + fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_token protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_localhost protoreflect.FieldDescriptor ) func init() { @@ -1496,7 +1496,7 @@ func init() { md_MsgAllocateVaultResponse = File_did_v1_tx_proto.Messages().ByName("MsgAllocateVaultResponse") fd_MsgAllocateVaultResponse_cid = md_MsgAllocateVaultResponse.Fields().ByName("cid") fd_MsgAllocateVaultResponse_expiry_block = md_MsgAllocateVaultResponse.Fields().ByName("expiry_block") - fd_MsgAllocateVaultResponse_registration_options = md_MsgAllocateVaultResponse.Fields().ByName("registration_options") + fd_MsgAllocateVaultResponse_token = md_MsgAllocateVaultResponse.Fields().ByName("token") fd_MsgAllocateVaultResponse_localhost = md_MsgAllocateVaultResponse.Fields().ByName("localhost") } @@ -1577,9 +1577,9 @@ func (x *fastReflection_MsgAllocateVaultResponse) Range(f func(protoreflect.Fiel return } } - if x.RegistrationOptions != "" { - value := protoreflect.ValueOfString(x.RegistrationOptions) - if !f(fd_MsgAllocateVaultResponse_registration_options, value) { + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgAllocateVaultResponse_token, value) { return } } @@ -1608,8 +1608,8 @@ func (x *fastReflection_MsgAllocateVaultResponse) Has(fd protoreflect.FieldDescr return x.Cid != "" case "did.v1.MsgAllocateVaultResponse.expiry_block": return x.ExpiryBlock != int64(0) - case "did.v1.MsgAllocateVaultResponse.registration_options": - return x.RegistrationOptions != "" + case "did.v1.MsgAllocateVaultResponse.token": + return x.Token != "" case "did.v1.MsgAllocateVaultResponse.localhost": return x.Localhost != false default: @@ -1632,8 +1632,8 @@ func (x *fastReflection_MsgAllocateVaultResponse) Clear(fd protoreflect.FieldDes x.Cid = "" case "did.v1.MsgAllocateVaultResponse.expiry_block": x.ExpiryBlock = int64(0) - case "did.v1.MsgAllocateVaultResponse.registration_options": - x.RegistrationOptions = "" + case "did.v1.MsgAllocateVaultResponse.token": + x.Token = "" case "did.v1.MsgAllocateVaultResponse.localhost": x.Localhost = false default: @@ -1658,8 +1658,8 @@ func (x *fastReflection_MsgAllocateVaultResponse) Get(descriptor protoreflect.Fi case "did.v1.MsgAllocateVaultResponse.expiry_block": value := x.ExpiryBlock return protoreflect.ValueOfInt64(value) - case "did.v1.MsgAllocateVaultResponse.registration_options": - value := x.RegistrationOptions + case "did.v1.MsgAllocateVaultResponse.token": + value := x.Token return protoreflect.ValueOfString(value) case "did.v1.MsgAllocateVaultResponse.localhost": value := x.Localhost @@ -1688,8 +1688,8 @@ func (x *fastReflection_MsgAllocateVaultResponse) Set(fd protoreflect.FieldDescr x.Cid = value.Interface().(string) case "did.v1.MsgAllocateVaultResponse.expiry_block": x.ExpiryBlock = value.Int() - case "did.v1.MsgAllocateVaultResponse.registration_options": - x.RegistrationOptions = value.Interface().(string) + case "did.v1.MsgAllocateVaultResponse.token": + x.Token = value.Interface().(string) case "did.v1.MsgAllocateVaultResponse.localhost": x.Localhost = value.Bool() default: @@ -1716,8 +1716,8 @@ func (x *fastReflection_MsgAllocateVaultResponse) Mutable(fd protoreflect.FieldD panic(fmt.Errorf("field cid of message did.v1.MsgAllocateVaultResponse is not mutable")) case "did.v1.MsgAllocateVaultResponse.expiry_block": panic(fmt.Errorf("field expiry_block of message did.v1.MsgAllocateVaultResponse is not mutable")) - case "did.v1.MsgAllocateVaultResponse.registration_options": - panic(fmt.Errorf("field registration_options of message did.v1.MsgAllocateVaultResponse is not mutable")) + case "did.v1.MsgAllocateVaultResponse.token": + panic(fmt.Errorf("field token of message did.v1.MsgAllocateVaultResponse is not mutable")) case "did.v1.MsgAllocateVaultResponse.localhost": panic(fmt.Errorf("field localhost of message did.v1.MsgAllocateVaultResponse is not mutable")) default: @@ -1737,7 +1737,7 @@ func (x *fastReflection_MsgAllocateVaultResponse) NewField(fd protoreflect.Field return protoreflect.ValueOfString("") case "did.v1.MsgAllocateVaultResponse.expiry_block": return protoreflect.ValueOfInt64(int64(0)) - case "did.v1.MsgAllocateVaultResponse.registration_options": + case "did.v1.MsgAllocateVaultResponse.token": return protoreflect.ValueOfString("") case "did.v1.MsgAllocateVaultResponse.localhost": return protoreflect.ValueOfBool(false) @@ -1817,7 +1817,7 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met if x.ExpiryBlock != 0 { n += 1 + runtime.Sov(uint64(x.ExpiryBlock)) } - l = len(x.RegistrationOptions) + l = len(x.Token) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1863,10 +1863,10 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met i-- dAtA[i] = 0x20 } - if len(x.RegistrationOptions) > 0 { - i -= len(x.RegistrationOptions) - copy(dAtA[i:], x.RegistrationOptions) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RegistrationOptions))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x1a } @@ -1984,7 +1984,7 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met } case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2012,7 +2012,7 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.RegistrationOptions = string(dAtA[iNdEx:postIndex]) + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -3639,12 +3639,94 @@ func (x *fastReflection_MsgRegisterControllerResponse) ProtoMethods() *protoifac } } +var _ protoreflect.Map = (*_MsgAuthorizeService_3_map)(nil) + +type _MsgAuthorizeService_3_map struct { + m *map[string]string +} + +func (x *_MsgAuthorizeService_3_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_MsgAuthorizeService_3_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_MsgAuthorizeService_3_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_MsgAuthorizeService_3_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_MsgAuthorizeService_3_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_MsgAuthorizeService_3_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_MsgAuthorizeService_3_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_MsgAuthorizeService_3_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgAuthorizeService_3_map) IsValid() bool { + return x.m != nil +} + var ( - md_MsgAuthorizeService protoreflect.MessageDescriptor - fd_MsgAuthorizeService_controller protoreflect.FieldDescriptor - fd_MsgAuthorizeService_origin protoreflect.FieldDescriptor - fd_MsgAuthorizeService_scopes protoreflect.FieldDescriptor - fd_MsgAuthorizeService_token protoreflect.FieldDescriptor + md_MsgAuthorizeService protoreflect.MessageDescriptor + fd_MsgAuthorizeService_controller protoreflect.FieldDescriptor + fd_MsgAuthorizeService_origin protoreflect.FieldDescriptor + fd_MsgAuthorizeService_permissions protoreflect.FieldDescriptor + fd_MsgAuthorizeService_token protoreflect.FieldDescriptor ) func init() { @@ -3652,7 +3734,7 @@ func init() { md_MsgAuthorizeService = File_did_v1_tx_proto.Messages().ByName("MsgAuthorizeService") fd_MsgAuthorizeService_controller = md_MsgAuthorizeService.Fields().ByName("controller") fd_MsgAuthorizeService_origin = md_MsgAuthorizeService.Fields().ByName("origin") - fd_MsgAuthorizeService_scopes = md_MsgAuthorizeService.Fields().ByName("scopes") + fd_MsgAuthorizeService_permissions = md_MsgAuthorizeService.Fields().ByName("permissions") fd_MsgAuthorizeService_token = md_MsgAuthorizeService.Fields().ByName("token") } @@ -3733,9 +3815,9 @@ func (x *fastReflection_MsgAuthorizeService) Range(f func(protoreflect.FieldDesc return } } - if x.Scopes != nil { - value := protoreflect.ValueOfMessage(x.Scopes.ProtoReflect()) - if !f(fd_MsgAuthorizeService_scopes, value) { + if len(x.Permissions) != 0 { + value := protoreflect.ValueOfMap(&_MsgAuthorizeService_3_map{m: &x.Permissions}) + if !f(fd_MsgAuthorizeService_permissions, value) { return } } @@ -3764,8 +3846,8 @@ func (x *fastReflection_MsgAuthorizeService) Has(fd protoreflect.FieldDescriptor return x.Controller != "" case "did.v1.MsgAuthorizeService.origin": return x.Origin != "" - case "did.v1.MsgAuthorizeService.scopes": - return x.Scopes != nil + case "did.v1.MsgAuthorizeService.permissions": + return len(x.Permissions) != 0 case "did.v1.MsgAuthorizeService.token": return x.Token != "" default: @@ -3788,8 +3870,8 @@ func (x *fastReflection_MsgAuthorizeService) Clear(fd protoreflect.FieldDescript x.Controller = "" case "did.v1.MsgAuthorizeService.origin": x.Origin = "" - case "did.v1.MsgAuthorizeService.scopes": - x.Scopes = nil + case "did.v1.MsgAuthorizeService.permissions": + x.Permissions = nil case "did.v1.MsgAuthorizeService.token": x.Token = "" default: @@ -3814,9 +3896,12 @@ func (x *fastReflection_MsgAuthorizeService) Get(descriptor protoreflect.FieldDe case "did.v1.MsgAuthorizeService.origin": value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.MsgAuthorizeService.scopes": - value := x.Scopes - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.MsgAuthorizeService.permissions": + if len(x.Permissions) == 0 { + return protoreflect.ValueOfMap(&_MsgAuthorizeService_3_map{}) + } + mapValue := &_MsgAuthorizeService_3_map{m: &x.Permissions} + return protoreflect.ValueOfMap(mapValue) case "did.v1.MsgAuthorizeService.token": value := x.Token return protoreflect.ValueOfString(value) @@ -3844,8 +3929,10 @@ func (x *fastReflection_MsgAuthorizeService) Set(fd protoreflect.FieldDescriptor x.Controller = value.Interface().(string) case "did.v1.MsgAuthorizeService.origin": x.Origin = value.Interface().(string) - case "did.v1.MsgAuthorizeService.scopes": - x.Scopes = value.Message().Interface().(*Permissions) + case "did.v1.MsgAuthorizeService.permissions": + mv := value.Map() + cmv := mv.(*_MsgAuthorizeService_3_map) + x.Permissions = *cmv.m case "did.v1.MsgAuthorizeService.token": x.Token = value.Interface().(string) default: @@ -3868,11 +3955,12 @@ func (x *fastReflection_MsgAuthorizeService) Set(fd protoreflect.FieldDescriptor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAuthorizeService) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgAuthorizeService.scopes": - if x.Scopes == nil { - x.Scopes = new(Permissions) + case "did.v1.MsgAuthorizeService.permissions": + if x.Permissions == nil { + x.Permissions = make(map[string]string) } - return protoreflect.ValueOfMessage(x.Scopes.ProtoReflect()) + value := &_MsgAuthorizeService_3_map{m: &x.Permissions} + return protoreflect.ValueOfMap(value) case "did.v1.MsgAuthorizeService.controller": panic(fmt.Errorf("field controller of message did.v1.MsgAuthorizeService is not mutable")) case "did.v1.MsgAuthorizeService.origin": @@ -3896,9 +3984,9 @@ func (x *fastReflection_MsgAuthorizeService) NewField(fd protoreflect.FieldDescr return protoreflect.ValueOfString("") case "did.v1.MsgAuthorizeService.origin": return protoreflect.ValueOfString("") - case "did.v1.MsgAuthorizeService.scopes": - m := new(Permissions) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.MsgAuthorizeService.permissions": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_MsgAuthorizeService_3_map{m: &m}) case "did.v1.MsgAuthorizeService.token": return protoreflect.ValueOfString("") default: @@ -3978,9 +4066,26 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Scopes != nil { - l = options.Size(x.Scopes) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Permissions) > 0 { + SiZeMaP := func(k string, v string) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Permissions)) + for k := range x.Permissions { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Permissions[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Permissions { + SiZeMaP(k, v) + } + } } l = len(x.Token) if l > 0 { @@ -4022,19 +4127,48 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods i-- dAtA[i] = 0x22 } - if x.Scopes != nil { - encoded, err := options.Marshal(x.Scopes) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.Permissions) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForPermissions := make([]string, 0, len(x.Permissions)) + for k := range x.Permissions { + keysForPermissions = append(keysForPermissions, string(k)) + } + sort.Slice(keysForPermissions, func(i, j int) bool { + return keysForPermissions[i] < keysForPermissions[j] + }) + for iNdEx := len(keysForPermissions) - 1; iNdEx >= 0; iNdEx-- { + v := x.Permissions[string(keysForPermissions[iNdEx])] + out, err := MaRsHaLmAp(keysForPermissions[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Permissions { + v := x.Permissions[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a } if len(x.Origin) > 0 { i -= len(x.Origin) @@ -4165,7 +4299,7 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4192,12 +4326,103 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Scopes == nil { - x.Scopes = &Permissions{} + if x.Permissions == nil { + x.Permissions = make(map[string]string) } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scopes); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + x.Permissions[mapkey] = mapvalue iNdEx = postIndex case 4: if wireType != 2 { @@ -5879,7 +6104,7 @@ type MsgAllocateVaultResponse struct { // ExpiryBlock is the block number at which the vault will expire. ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn - RegistrationOptions string `protobuf:"bytes,3,opt,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` // IsLocalhost is a flag to indicate if the vault is localhost Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` } @@ -5918,9 +6143,9 @@ func (x *MsgAllocateVaultResponse) GetExpiryBlock() int64 { return 0 } -func (x *MsgAllocateVaultResponse) GetRegistrationOptions() string { +func (x *MsgAllocateVaultResponse) GetToken() string { if x != nil { - return x.RegistrationOptions + return x.Token } return "" } @@ -6062,7 +6287,7 @@ type MsgAuthorizeService struct { // Origin is the origin of the request in wildcard form. Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` // Permissions is the scope of the service. - Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // token is the macron token to authenticate the operation. Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } @@ -6101,9 +6326,9 @@ func (x *MsgAuthorizeService) GetOrigin() string { return "" } -func (x *MsgAuthorizeService) GetScopes() *Permissions { +func (x *MsgAuthorizeService) GetPermissions() map[string]string { if x != nil { - return x.Scopes + return x.Permissions } return nil } @@ -6258,134 +6483,137 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, - 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, - 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, - 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, - 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, - 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa0, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, - 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x79, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x15, - 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, - 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x22, 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbb, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, - 0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 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, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x0f, - 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, - 0x48, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x32, 0xa8, 0x03, 0x0a, 0x03, 0x4d, 0x73, - 0x67, 0x12, 0x48, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x10, 0x41, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x23, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4b, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, - 0x6c, 0x74, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, - 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x20, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, - 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, + 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, - 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, - 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, - 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, - 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, + 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6b, + 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, + 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x9e, 0x02, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 0x4e, 0x0a, + 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x1a, 0x3e, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 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, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, + 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x22, 0x48, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x32, 0xa8, 0x03, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x48, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x10, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x23, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, + 0x75, 0x6c, 0x74, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x20, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5a, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, + 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, + 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6400,7 +6628,7 @@ func file_did_v1_tx_proto_rawDescGZIP() []byte { return file_did_v1_tx_proto_rawDescData } -var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_did_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: did.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: did.v1.MsgUpdateParamsResponse @@ -6413,14 +6641,14 @@ var file_did_v1_tx_proto_goTypes = []interface{}{ (*MsgRegisterService)(nil), // 8: did.v1.MsgRegisterService (*MsgRegisterServiceResponse)(nil), // 9: did.v1.MsgRegisterServiceResponse nil, // 10: did.v1.MsgRegisterControllerResponse.AccountsEntry - (*Params)(nil), // 11: did.v1.Params - (*Permissions)(nil), // 12: did.v1.Permissions + nil, // 11: did.v1.MsgAuthorizeService.PermissionsEntry + (*Params)(nil), // 12: did.v1.Params (*Service)(nil), // 13: did.v1.Service } var file_did_v1_tx_proto_depIdxs = []int32{ - 11, // 0: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params + 12, // 0: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params 10, // 1: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry - 12, // 2: did.v1.MsgAuthorizeService.scopes:type_name -> did.v1.Permissions + 11, // 2: did.v1.MsgAuthorizeService.permissions:type_name -> did.v1.MsgAuthorizeService.PermissionsEntry 13, // 3: did.v1.MsgRegisterService.service:type_name -> did.v1.Service 0, // 4: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams 6, // 5: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService @@ -6445,7 +6673,6 @@ func file_did_v1_tx_proto_init() { return } file_did_v1_genesis_proto_init() - file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { @@ -6574,7 +6801,7 @@ func file_did_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/caddyfile b/caddyfile new file mode 100644 index 000000000..c97299e26 --- /dev/null +++ b/caddyfile @@ -0,0 +1,33 @@ +{ + email team@sonr.id +} + +# Vaults at vault.sonr.id +vault.sonr.id { + tls { + dns cloudflare {env.CLOUDFLARE_API_TOKEN} + resolvers 1.1.1.1 + } + + # Match paths that are bech32 addresses + @vault path_regexp vaultPath ^/([a-z0-9]{42})(/.*|)$ + + handle @vault { + # Rewrite to IPFS gateway format + uri replace /{re.vaultPath.0} /ipns/{re.vaultPath.1}{re.vaultPath.2} + + # Proxy to IPFS gateway + reverse_proxy http://localhost:8080 + } + + file_server + + header { + Content-Type .wasm application/wasm + Service-Worker-Allowed "/" + # Add any other necessary headers + } + + # Optional: Enable compression + encode zstd gzip +} diff --git a/config/caddy/caddy.json b/config/caddy/caddy.json new file mode 100644 index 000000000..9e4f3eb20 --- /dev/null +++ b/config/caddy/caddy.json @@ -0,0 +1,141 @@ +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":443" + ], + "routes": [ + { + "match": [ + { + "host": [ + "vault.sonr.id" + ] + } + ], + "handle": [ + { + "handler": "subroute", + "routes": [ + { + "handle": [ + { + "handler": "headers", + "response": { + "replace": { + "Content-Type": [ + { + "replace": "application/wasm", + "search_regexp": ".wasm" + } + ] + }, + "set": { + "Service-Worker-Allowed": [ + "/" + ] + } + } + }, + { + "encodings": { + "gzip": {}, + "zstd": {} + }, + "handler": "encode", + "prefer": [ + "zstd", + "gzip" + ] + } + ] + }, + { + "handle": [ + { + "handler": "subroute", + "routes": [ + { + "handle": [ + { + "handler": "rewrite", + "uri_substring": [ + { + "find": "/{http.regexp.vaultPath.0}", + "replace": "/ipns/{http.regexp.vaultPath.1}{http.regexp.vaultPath.2}" + } + ] + }, + { + "handler": "reverse_proxy", + "upstreams": [ + { + "dial": "localhost:8080" + } + ] + } + ] + } + ] + } + ], + "match": [ + { + "path_regexp": { + "name": "vaultPath", + "pattern": "^/([a-z0-9]{42})(/.*|)$" + } + } + ] + }, + { + "handle": [ + { + "handler": "file_server", + "hide": [ + "./Caddyfile" + ] + } + ] + } + ] + } + ], + "terminal": true + } + ] + } + } + }, + "tls": { + "automation": { + "policies": [ + { + "subjects": [ + "vault.sonr.id" + ], + "issuers": [ + { + "challenges": { + "dns": { + "provider": { + "api_token": "{env.CLOUDFLARE_API_TOKEN}", + "name": "cloudflare" + }, + "resolvers": [ + "1.1.1.1" + ] + } + }, + "email": "team@sonr.id", + "module": "acme" + } + ] + } + ] + } + } + } +} diff --git a/config/dwn/Config.pkl.go b/config/dwn/Config.pkl.go index f492485ba..2a9caa0e3 100644 --- a/config/dwn/Config.pkl.go +++ b/config/dwn/Config.pkl.go @@ -6,9 +6,5 @@ type Config struct { Sonr *Sonr `pkl:"sonr" json:"sonr,omitempty"` - Keyshare *string `pkl:"keyshare" json:"keyshare,omitempty"` - - Address *string `pkl:"address" json:"address,omitempty"` - - Vault *IndexedDB `pkl:"vault" json:"vault,omitempty"` + Motr *Motr `pkl:"motr" json:"motr,omitempty"` } diff --git a/config/dwn/IPFS.pkl.go b/config/dwn/IPFS.pkl.go index 7f2add580..78084810b 100644 --- a/config/dwn/IPFS.pkl.go +++ b/config/dwn/IPFS.pkl.go @@ -2,7 +2,7 @@ package dwn type IPFS struct { - ApiUrl string `pkl:"apiUrl"` + ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"` - GatewayUrl string `pkl:"gatewayUrl"` + GatewayUrl string `pkl:"gatewayUrl" json:"gatewayUrl,omitempty"` } diff --git a/config/dwn/IndexedDB.pkl.go b/config/dwn/IndexedDB.pkl.go deleted file mode 100644 index 8ee09f1c9..000000000 --- a/config/dwn/IndexedDB.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -type IndexedDB struct { - Name string `pkl:"name"` - - Version int `pkl:"version"` -} diff --git a/config/dwn/Motr.pkl.go b/config/dwn/Motr.pkl.go new file mode 100644 index 000000000..bc144efd0 --- /dev/null +++ b/config/dwn/Motr.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `dwn`. DO NOT EDIT. +package dwn + +type Motr struct { + Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"` + + Address string `pkl:"address" json:"address,omitempty"` + + Origin string `pkl:"origin" json:"origin,omitempty"` +} diff --git a/config/dwn/Sonr.pkl.go b/config/dwn/Sonr.pkl.go index 4a342bf40..8693af808 100644 --- a/config/dwn/Sonr.pkl.go +++ b/config/dwn/Sonr.pkl.go @@ -2,11 +2,13 @@ package dwn type Sonr struct { - ApiUrl string `pkl:"apiUrl"` + ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"` - GrpcUrl string `pkl:"grpcUrl"` + GrpcUrl string `pkl:"grpcUrl" json:"grpcUrl,omitempty"` - RpcUrl string `pkl:"rpcUrl"` + RpcUrl string `pkl:"rpcUrl" json:"rpcUrl,omitempty"` - WebSocketUrl string `pkl:"webSocketUrl"` + WebSocketUrl string `pkl:"webSocketUrl" json:"webSocketUrl,omitempty"` + + ChainId string `pkl:"chainId" json:"chainId,omitempty"` } diff --git a/config/dwn/init.pkl.go b/config/dwn/init.pkl.go index 074eb42f1..a966d2720 100644 --- a/config/dwn/init.pkl.go +++ b/config/dwn/init.pkl.go @@ -8,5 +8,5 @@ func init() { pkl.RegisterMapping("dwn#Config", Config{}) pkl.RegisterMapping("dwn#IPFS", IPFS{}) pkl.RegisterMapping("dwn#Sonr", Sonr{}) - pkl.RegisterMapping("dwn#IndexedDB", IndexedDB{}) + pkl.RegisterMapping("dwn#Motr", Motr{}) } diff --git a/config/pkl/dwn.pkl b/config/pkl/dwn.pkl index 78dfe6864..9d747b863 100644 --- a/config/pkl/dwn.pkl +++ b/config/pkl/dwn.pkl @@ -20,30 +20,43 @@ class Config { sonr: Sonr @JsonField - keyshare: JSON? - - @JsonField - address: String? - - @JsonField - vault: IndexedDB -} - -class IndexedDB { - name: String = "vault" - version: Int = 1 + motr: Motr } class IPFS { + @JsonField apiUrl: String + + @JsonField gatewayUrl: String } +class Motr { + @JsonField + keyshare: JSON + + @JsonField + address: String + + @JsonField + origin: String +} + class Sonr { + @JsonField apiUrl: String + + @JsonField grpcUrl: String + + @JsonField rpcUrl: String + + @JsonField webSocketUrl: String + + @JsonField + chainId: String } diff --git a/config/pkl/orm.pkl b/config/pkl/orm.pkl index 67eeb7ac1..145d89654 100644 --- a/config/pkl/orm.pkl +++ b/config/pkl/orm.pkl @@ -1,6 +1,6 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/vfs/models" } +@go.Package { name = "github.com/onsonr/sonr/internal/orm" } -module models +module orm import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" @@ -15,7 +15,6 @@ typealias ChainCode = UInt typealias Scope = String typealias Hex = String -typealias UTF8 = String class PrimaryKey extends go.Field { structTags { @@ -30,6 +29,28 @@ class JsonField extends go.Field { } } +// Enums +typealias AssetType = "native"|"wrapped"|"staking"|"pool"|"ibc"|"cw20" + +typealias DIDMethod = "ipfs"|"sonr"|"bitcoin"|"ethereum"|"ibc"|"webauthn"|"dwn"|"service" + +typealias KeyAlgorithm = "es256"|"es384"|"es512"|"eddsa"|"es256k"|"ecdsa" + +typealias KeyCurve = "p256"|"p384"|"p521"|"x25519"|"x448"|"ed25519"|"ed448"|"secp256k1"|"bls12381"|"keccak256" + +typealias KeyEncoding = "raw"|"hex"|"multibase" + +typealias KeyRole = "authentication"|"assertion"|"delegation"|"invocation" + +typealias KeyType = "octet"|"elliptic"|"rsa"|"symmetric"|"hmac"|"mpc"|"zk"|"webauthn"|"bip32" + +typealias KeyShareRole = "user"|"validator" + +typealias PermissionGrant = "none"|"read"|"write"|"verify"|"broadcast"|"admin" + +typealias PermissionScope = "profile"|"metadata"|"permissions"|"wallets"|"transactions"|"user"|"validator" + + class Account { @PrimaryKey id: DID @@ -109,6 +130,12 @@ class Credential { @JsonField origin: String + @JsonField + label: String? + + @JsonField + deviceId: String? + @JsonField credentialId: Base64 @@ -143,6 +170,26 @@ class Credential { updatedAt: String? } +class JWK { + @JsonField + kty: String + + @JsonField + crv: String + + @JsonField + x: String + + @JsonField + y: String + + @JsonField + n: String + + @JsonField + e: String +} + class Grant { @PrimaryKey id: UInt @@ -188,7 +235,13 @@ class Keyshare { class PublicKey { @PrimaryKey - id: DID + role: KeyRole + algorithm: KeyAlgorithm + encoding: KeyEncoding + curve: KeyCurve + key_type: KeyType + raw: Base58 + jwk: JWK } class Profile { @@ -218,3 +271,6 @@ class Profile { } +db_name: String = "vault" +db_version: Int = 1 + diff --git a/config/pkl/txns.pkl b/config/pkl/txns.pkl index be21a759e..e658489b1 100644 --- a/config/pkl/txns.pkl +++ b/config/pkl/txns.pkl @@ -1,6 +1,6 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/vfs/txns" } +@go.Package { name = "github.com/onsonr/sonr/internal/orm/transactions" } -module txns +module transactions import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" @@ -25,15 +25,6 @@ class Proposal { description: String } -class SWT { - origin: String - location: String - identifier: String - scopes: List - properties: Map - expiryBlock: Int -} - /// Gov module messages class MsgGovSubmitProposal extends Msg { typeUrl = "/cosmos.gov.v1beta1.MsgSubmitProposal" diff --git a/config/pkl/web.pkl b/config/pkl/web.pkl new file mode 100644 index 000000000..ed06f3e6b --- /dev/null +++ b/config/pkl/web.pkl @@ -0,0 +1,72 @@ +@go.Package { name = "github.com/onsonr/sonr/internal/orm/browser" } + +module browser + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + } +} + +class PublicKeyCredentialRequestOptions { + challenge: String + timeout: Int + rpId: String + allowCredentials: List + userVerification: String + extensions: List +} + +class PublicKeyCredentialDescriptor { + id: String + transports: List + type: String +} + +class PublicKeyCredentialParameters { + type: String + alg: Int? +} + +class AuthenticatorSelectionCriteria { + authenticatorAttachment: String + requireResidentKey: Boolean + userVerification: String +} + + +class PublicKeyCredentialCreationOptions { + rp: RpEntity + user: UserEntity + challenge: String + pubKeyCredParams: List + timeout: Int + excludeCredentials: List + authenticatorSelection: AuthenticatorSelectionCriteria? + attestation: String + extensions: List +} + +class RpEntity { + id: String + name: String? + icon: String? +} + +class UserEntity { + id: String + displayName: String? + name: String? +} + +class SWT { + origin: String + location: String + identifier: String + scopes: List + properties: Map + expiryBlock: Int +} diff --git a/devbox.json b/devbox.json index 7abcfca3c..2794c3221 100644 --- a/devbox.json +++ b/devbox.json @@ -9,8 +9,11 @@ "commitizen@latest" ], "env": { + "CLOUDFLARE_API_TOKEN": "$CLOUDFLARE_API_TOKEN", + "PROJECT_DIR": "$HOME/ghq/github.com/onsonr/sonr", + "PROJECT_BIN": "$PROJECT_DIR/bin", "GOPATH": "$HOME/go", - "PATH": "$HOME/go/bin:$PATH", + "PATH": "$HOME/go/bin:$PROJECT_BIN:$PATH", "CHAIN_ID": "sonr-testnet-1", "DENOM": "usnr", "KEYRING": "test", @@ -39,6 +42,7 @@ "gen:pkl": [ "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/dwn.pkl", "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/orm.pkl", + "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/web.pkl", "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/txns.pkl" ], "gen:templ": [ @@ -47,7 +51,11 @@ "dev": [ "air" ], + "start-proxy": [ + "./bin/caddy run --config ./config/caddy/caddy.conf" + ], "testnet": [ + "make xcaddy", "devbox services up" ] } diff --git a/go.mod b/go.mod index 47f23303a..b63f95ccc 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,6 @@ require ( github.com/charmbracelet/huh v0.5.3 github.com/charmbracelet/lipgloss v0.13.0 github.com/cometbft/cometbft v0.38.8 - github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.5 @@ -72,9 +71,8 @@ require ( github.com/ipfs/kubo v0.29.0 github.com/joho/godotenv v1.5.1 github.com/labstack/echo/v4 v4.10.2 - github.com/mr-tron/base58 v1.2.0 github.com/nlepage/go-js-promise v1.0.0 - github.com/onsonr/crypto v1.31.0 + github.com/onsonr/crypto v1.32.0 github.com/segmentio/ksuid v1.0.4 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 @@ -89,9 +87,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.2 - gopkg.in/macaroon-bakery.v2 v2.3.0 gopkg.in/macaroon.v2 v2.1.0 - lukechampine.com/blake3 v1.3.0 ) require ( @@ -100,7 +96,6 @@ require ( cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.38.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect - git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect @@ -135,6 +130,7 @@ require ( github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect @@ -267,6 +263,7 @@ require ( github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect + github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect @@ -349,11 +346,11 @@ require ( google.golang.org/api v0.169.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect - gopkg.in/errgo.v1 v1.0.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect + lukechampine.com/blake3 v1.3.0 // indirect nhooyr.io/websocket v1.8.10 // indirect pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index b7f3c9e9a..0618dcae6 100644 --- a/go.sum +++ b/go.sum @@ -803,9 +803,6 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= -git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 h1:Ahny8Ud1LjVMMAlt8utUFKhhxJtwBAualvsbc/Sk7cE= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= @@ -1150,9 +1147,6 @@ github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.0.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k= -github.com/frankban/quicktest v1.1.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k= -github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= @@ -1198,7 +1192,6 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-macaroon-bakery/macaroonpb v1.0.0/go.mod h1:UzrGOcbiwTXISFP2XDLDPjfhMINZa+fX/7A2lMd31zc= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -1285,7 +1278,6 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -1606,12 +1598,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/mgotest v1.0.1/go.mod h1:vTaDufYul+Ps8D7bgseHjq87X8eu0ivlKLp9mVc/Bfc= -github.com/juju/postgrestest v1.1.0/go.mod h1:/n17Y2T6iFozzXwSCO0JYJ5gSiz2caEtSwAjh/uLXDM= -github.com/juju/qthttptest v0.0.1/go.mod h1://LCf/Ls22/rPw2u1yWukUJvYtfPY4nYpWUl2uZhryo= -github.com/juju/schema v1.0.0/go.mod h1:Y+ThzXpUJ0E7NYYocAbuvJ7vTivXfrof/IfRPq/0abI= -github.com/juju/webbrowser v0.0.0-20160309143629-54b8c57083b4/go.mod h1:G6PCelgkM6cuvyD10iYJsjLBsSadVXtJ+nBxFAxE2BU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -1654,8 +1640,6 @@ github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3 github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -1851,8 +1835,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= -github.com/onsonr/crypto v1.31.0 h1:kI5oNIQ84bOfICqJBIxJxPguEPfLPe+kUD6x2QHZTa4= -github.com/onsonr/crypto v1.31.0/go.mod h1:NSfeCO6XoyQeSDEp6Jy42UGG5047GvzG6lW9lRnjrR0= +github.com/onsonr/crypto v1.32.0 h1:3XxItjoYg4vLuTU7uvpbIl/MTk2tb6L43SSO9RFcEXc= +github.com/onsonr/crypto v1.32.0/go.mod h1:NSfeCO6XoyQeSDEp6Jy42UGG5047GvzG6lW9lRnjrR0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= @@ -1969,7 +1953,6 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -2207,7 +2190,6 @@ go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEb golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -2302,7 +2284,6 @@ golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20150829230318-ea47fc708ee3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2444,7 +2425,6 @@ golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2607,7 +2587,6 @@ golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181008205924-a2b3f7f249e9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -3032,20 +3011,12 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v1 v1.0.0/go.mod h1:CxwszS/Xz1C49Ucd2i6Zil5UToP1EmyrFhKaMVbg1mk= -gopkg.in/errgo.v1 v1.0.1 h1:oQFRXzZ7CkBGdm1XZm/EbQYaYNNEElNBOd09M6cqNso= -gopkg.in/errgo.v1 v1.0.1/go.mod h1:3NjfXwocQRYAPTq4/fzX+CwUhPRcR/azYRhj8G+LqMo= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/httprequest.v1 v1.2.0/go.mod h1:T61ZUaJLpMnzvoJDO03ZD8yRXD4nZzBeDoW5e9sffjg= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/juju/environschema.v1 v1.0.0/go.mod h1:WTgU3KXKCVoO9bMmG/4KHzoaRvLeoxfjArpgd1MGWFA= -gopkg.in/macaroon-bakery.v2 v2.3.0 h1:b40knPgPTke1QLTE8BSYeH7+R/hiIozB1A8CTLYN0Ic= -gopkg.in/macaroon-bakery.v2 v2.3.0/go.mod h1:/8YhtPARXeRzbpEPLmRB66+gQE8/pzBBkWwg7Vz/guc= gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI= gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/internal/dwn/dwn.go b/internal/dwn/dwn.go deleted file mode 100644 index 843cc6bf3..000000000 --- a/internal/dwn/dwn.go +++ /dev/null @@ -1,17 +0,0 @@ -package dwn - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/dwn/front" - "github.com/onsonr/sonr/internal/dwn/handlers" - "github.com/onsonr/sonr/internal/dwn/middleware" -) - -// NewServer creates a new dwn server using echo -func NewServer() *echo.Echo { - e := echo.New() - e.Use(middleware.UseSession) - front.RegisterViews(e) - handlers.RegisterState(e) - return e -} diff --git a/internal/dwn/handlers/state/auth.go b/internal/dwn/handlers/auth.go similarity index 84% rename from internal/dwn/handlers/state/auth.go rename to internal/dwn/handlers/auth.go index 8765d4c5a..d725449a3 100644 --- a/internal/dwn/handlers/state/auth.go +++ b/internal/dwn/handlers/auth.go @@ -1,4 +1,4 @@ -package state +package handlers import ( "encoding/json" @@ -8,16 +8,16 @@ import ( "github.com/labstack/echo/v4" ) -func CheckSubjectIsValid(e echo.Context) error { +func checkSubjectIsValid(e echo.Context) error { credentialID := e.FormValue("credentialID") return e.JSON(200, credentialID) } -func HandleCredentialAssertion(e echo.Context) error { +func handleCredentialAssertion(e echo.Context) error { return e.JSON(200, "HandleCredentialAssertion") } -func HandleCredentialCreation(e echo.Context) error { +func handleCredentialCreation(e echo.Context) error { // Get the serialized credential data from the form credentialDataJSON := e.FormValue("credentialData") diff --git a/internal/dwn/handlers/manifest.go b/internal/dwn/handlers/manifest.go new file mode 100644 index 000000000..5ac8282f4 --- /dev/null +++ b/internal/dwn/handlers/manifest.go @@ -0,0 +1 @@ +package handlers diff --git a/internal/dwn/handlers/state/openid.go b/internal/dwn/handlers/openid.go similarity index 70% rename from internal/dwn/handlers/state/openid.go rename to internal/dwn/handlers/openid.go index 1797220f6..0d981247f 100644 --- a/internal/dwn/handlers/state/openid.go +++ b/internal/dwn/handlers/openid.go @@ -1,22 +1,22 @@ -package state +package handlers import ( "github.com/labstack/echo/v4" ) -func GrantAuthorization(e echo.Context) error { +func grantAuthorization(e echo.Context) error { // Implement authorization endpoint using passkey authentication // Store session data in cache return nil } -func GetJWKS(e echo.Context) error { +func getJWKS(e echo.Context) error { // Implement token endpoint // Use cached session data for validation return nil } -func GetToken(e echo.Context) error { +func getToken(e echo.Context) error { // Implement token endpoint // Use cached session data for validation return nil diff --git a/internal/dwn/handlers/routes.go b/internal/dwn/handlers/routes.go index 03781ac26..0b8af5917 100644 --- a/internal/dwn/handlers/routes.go +++ b/internal/dwn/handlers/routes.go @@ -2,19 +2,18 @@ package handlers import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/dwn/handlers/state" middleware "github.com/onsonr/sonr/internal/dwn/middleware" ) func RegisterState(e *echo.Echo) { g := e.Group("state") - g.POST("/login/:identifier", state.HandleCredentialAssertion) + g.POST("/login/:identifier", handleCredentialAssertion) // g.GET("/discovery", state.GetDiscovery) - g.GET("/jwks", state.GetJWKS) - g.GET("/token", state.GetToken) - g.POST("/:origin/grant/:subject", state.GrantAuthorization) - g.POST("/register/:subject", state.HandleCredentialCreation) - g.POST("/register/:subject/check", state.CheckSubjectIsValid) + g.GET("/jwks", getJWKS) + g.GET("/token", getToken) + g.POST("/:origin/grant/:subject", grantAuthorization) + g.POST("/register/:subject", handleCredentialCreation) + g.POST("/register/:subject/check", checkSubjectIsValid) } func RegisterSync(e *echo.Echo) { diff --git a/internal/dwn/handlers/sync/manifest.go b/internal/dwn/handlers/sync/manifest.go deleted file mode 100644 index 1ca2a85ed..000000000 --- a/internal/dwn/handlers/sync/manifest.go +++ /dev/null @@ -1 +0,0 @@ -package sync diff --git a/internal/dwn/handlers/sync/wellknown.go b/internal/dwn/handlers/sync/wellknown.go deleted file mode 100644 index 1ca2a85ed..000000000 --- a/internal/dwn/handlers/sync/wellknown.go +++ /dev/null @@ -1 +0,0 @@ -package sync diff --git a/internal/dwn/handlers/wellknown.go b/internal/dwn/handlers/wellknown.go new file mode 100644 index 000000000..5ac8282f4 --- /dev/null +++ b/internal/dwn/handlers/wellknown.go @@ -0,0 +1 @@ +package handlers diff --git a/internal/dwn/wasm/main.go b/internal/dwn/main.go similarity index 100% rename from internal/dwn/wasm/main.go rename to internal/dwn/main.go diff --git a/internal/dwn/middleware/browser.go b/internal/dwn/middleware/client.go similarity index 74% rename from internal/dwn/middleware/browser.go rename to internal/dwn/middleware/client.go index cfb343350..76b33c8cb 100644 --- a/internal/dwn/middleware/browser.go +++ b/internal/dwn/middleware/client.go @@ -6,10 +6,11 @@ package middleware import ( "github.com/donseba/go-htmx" "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/config/dwn" "github.com/onsonr/sonr/internal/dwn/middleware/jsexc" ) -type Browser struct { +type Client struct { echo.Context isMobile bool userAgent string @@ -23,13 +24,12 @@ type Browser struct { // WebAPIs indexedDB jsexc.IndexedDBAPI localStorage jsexc.LocalStorageAPI - push jsexc.PushAPI sessionStorage jsexc.SessionStorageAPI } -func UseNavigator(next echo.HandlerFunc) echo.HandlerFunc { +func UseNavigator(next echo.HandlerFunc, cnfg *dwn.Config) echo.HandlerFunc { return func(c echo.Context) error { - cc := jsexc.NewNavigator(c) + cc := jsexc.NewNavigator(c, cnfg) return next(cc) } } diff --git a/internal/dwn/middleware/client/headers.go b/internal/dwn/middleware/headers.go similarity index 99% rename from internal/dwn/middleware/client/headers.go rename to internal/dwn/middleware/headers.go index f84b940d8..eecdecffc 100644 --- a/internal/dwn/middleware/client/headers.go +++ b/internal/dwn/middleware/headers.go @@ -1,4 +1,4 @@ -package client +package middleware type RequestHeaders struct { Authorization *string `header:"Authorization"` diff --git a/internal/dwn/middleware/jsexc/credentials.go b/internal/dwn/middleware/jsexc/credentials.go index 8dd870c18..5405c28dd 100644 --- a/internal/dwn/middleware/jsexc/credentials.go +++ b/internal/dwn/middleware/jsexc/credentials.go @@ -8,6 +8,7 @@ import ( "syscall/js" "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/config/dwn" ) type Navigator struct { @@ -16,7 +17,7 @@ type Navigator struct { hasCredentials bool } -func NewNavigator(c echo.Context) *Navigator { +func NewNavigator(c echo.Context, cnfg *dwn.Config) *Navigator { navigator := js.Global().Get("navigator") credentials := navigator.Get("credentials") hasCredentials := !credentials.IsUndefined() diff --git a/internal/dwn/middleware/jsexc/notifier.go b/internal/dwn/middleware/jsexc/notifier.go deleted file mode 100644 index 7be3c85fa..000000000 --- a/internal/dwn/middleware/jsexc/notifier.go +++ /dev/null @@ -1,6 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package jsexc - -type PushAPI interface{} diff --git a/internal/dwn/middleware/jsexc/request.go b/internal/dwn/middleware/jsexc/request.go deleted file mode 100644 index f5fcea011..000000000 --- a/internal/dwn/middleware/jsexc/request.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build js && wasm - -package jsexc - -import ( - "bytes" - "net/http" - "net/http/httptest" - "syscall/js" - - promise "github.com/nlepage/go-js-promise" -) - -// Request builds and returns the equivalent http.Request -func Request(r js.Value) *http.Request { - jsBody := js.Global().Get("Uint8Array").New(promise.Await(r.Call("arrayBuffer"))) - body := make([]byte, jsBody.Get("length").Int()) - js.CopyBytesToGo(body, jsBody) - - req := httptest.NewRequest( - r.Get("method").String(), - r.Get("url").String(), - bytes.NewBuffer(body), - ) - - headersIt := r.Get("headers").Call("entries") - for { - e := headersIt.Call("next") - if e.Get("done").Bool() { - break - } - v := e.Get("value") - req.Header.Set(v.Index(0).String(), v.Index(1).String()) - } - - return req -} diff --git a/internal/dwn/middleware/jsexc/response.go b/internal/dwn/middleware/jsexc/response.go deleted file mode 100644 index 5e0aa2f86..000000000 --- a/internal/dwn/middleware/jsexc/response.go +++ /dev/null @@ -1,50 +0,0 @@ -//go:build js && wasm - -package jsexc - -import ( - "io" - "net/http/httptest" - "syscall/js" -) - -// ResponseRecorder uses httptest.ResponseRecorder to build a JS Response -type ResponseRecorder struct { - *httptest.ResponseRecorder -} - -// NewResponseRecorder returns a new ResponseRecorder -func NewResponseRecorder() ResponseRecorder { - return ResponseRecorder{httptest.NewRecorder()} -} - -// JSResponse builds and returns the equivalent JS Response -func (rr ResponseRecorder) JSResponse() js.Value { - res := rr.Result() - - body := js.Undefined() - if res.ContentLength != 0 { - b, err := io.ReadAll(res.Body) - if err != nil { - panic(err) - } - body = js.Global().Get("Uint8Array").New(len(b)) - js.CopyBytesToJS(body, b) - } - - init := make(map[string]interface{}, 2) - - if res.StatusCode != 0 { - init["status"] = res.StatusCode - } - - if len(res.Header) != 0 { - headers := make(map[string]interface{}, len(res.Header)) - for k := range res.Header { - headers[k] = res.Header.Get(k) - } - init["headers"] = headers - } - - return js.Global().Get("Response").New(body, init) -} diff --git a/internal/dwn/middleware/jsexc/serve.go b/internal/dwn/middleware/jsexc/serve.go deleted file mode 100644 index 9fc379fed..000000000 --- a/internal/dwn/middleware/jsexc/serve.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build js && wasm - -package jsexc - -import ( - "fmt" - "net/http" - "strings" - "syscall/js" - - promise "github.com/nlepage/go-js-promise" -) - -// Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. -func Serve(handler http.Handler) func() { - h := handler - if h == nil { - h = http.DefaultServeMux - } - - prefix := js.Global().Get("wasmhttp").Get("path").String() - for strings.HasSuffix(prefix, "/") { - prefix = strings.TrimSuffix(prefix, "/") - } - - if prefix != "" { - mux := http.NewServeMux() - mux.Handle(prefix+"/", http.StripPrefix(prefix, h)) - h = mux - } - - cb := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { - resPromise, resolve, reject := promise.New() - - go func() { - defer func() { - if r := recover(); r != nil { - if err, ok := r.(error); ok { - reject(fmt.Sprintf("wasmhttp: panic: %+v\n", err)) - } else { - reject(fmt.Sprintf("wasmhttp: panic: %v\n", r)) - } - } - }() - - res := NewResponseRecorder() - - h.ServeHTTP(res, Request(args[0])) - - resolve(res.JSResponse()) - }() - - return resPromise - }) - - js.Global().Get("wasmhttp").Call("setHandler", cb) - - return cb.Release -} diff --git a/internal/dwn/middleware/jsexc/server.go b/internal/dwn/middleware/jsexc/server.go new file mode 100644 index 000000000..5c2f33d1d --- /dev/null +++ b/internal/dwn/middleware/jsexc/server.go @@ -0,0 +1,128 @@ +//go:build js && wasm + +package jsexc + +import ( + "bytes" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strings" + "syscall/js" + + promise "github.com/nlepage/go-js-promise" +) + +// Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. +func Serve(handler http.Handler) func() { + h := handler + if h == nil { + h = http.DefaultServeMux + } + + prefix := js.Global().Get("wasmhttp").Get("path").String() + for strings.HasSuffix(prefix, "/") { + prefix = strings.TrimSuffix(prefix, "/") + } + + if prefix != "" { + mux := http.NewServeMux() + mux.Handle(prefix+"/", http.StripPrefix(prefix, h)) + h = mux + } + + cb := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { + resPromise, resolve, reject := promise.New() + + go func() { + defer func() { + if r := recover(); r != nil { + if err, ok := r.(error); ok { + reject(fmt.Sprintf("wasmhttp: panic: %+v\n", err)) + } else { + reject(fmt.Sprintf("wasmhttp: panic: %v\n", r)) + } + } + }() + + res := NewResponseRecorder() + + h.ServeHTTP(res, Request(args[0])) + + resolve(res.JSResponse()) + }() + + return resPromise + }) + + js.Global().Get("wasmhttp").Call("setHandler", cb) + + return cb.Release +} + +// Request builds and returns the equivalent http.Request +func Request(r js.Value) *http.Request { + jsBody := js.Global().Get("Uint8Array").New(promise.Await(r.Call("arrayBuffer"))) + body := make([]byte, jsBody.Get("length").Int()) + js.CopyBytesToGo(body, jsBody) + + req := httptest.NewRequest( + r.Get("method").String(), + r.Get("url").String(), + bytes.NewBuffer(body), + ) + + headersIt := r.Get("headers").Call("entries") + for { + e := headersIt.Call("next") + if e.Get("done").Bool() { + break + } + v := e.Get("value") + req.Header.Set(v.Index(0).String(), v.Index(1).String()) + } + + return req +} + +// ResponseRecorder uses httptest.ResponseRecorder to build a JS Response +type ResponseRecorder struct { + *httptest.ResponseRecorder +} + +// NewResponseRecorder returns a new ResponseRecorder +func NewResponseRecorder() ResponseRecorder { + return ResponseRecorder{httptest.NewRecorder()} +} + +// JSResponse builds and returns the equivalent JS Response +func (rr ResponseRecorder) JSResponse() js.Value { + res := rr.Result() + + body := js.Undefined() + if res.ContentLength != 0 { + b, err := io.ReadAll(res.Body) + if err != nil { + panic(err) + } + body = js.Global().Get("Uint8Array").New(len(b)) + js.CopyBytesToJS(body, b) + } + + init := make(map[string]interface{}, 2) + + if res.StatusCode != 0 { + init["status"] = res.StatusCode + } + + if len(res.Header) != 0 { + headers := make(map[string]interface{}, len(res.Header)) + for k := range res.Header { + headers[k] = res.Header.Get(k) + } + init["headers"] = headers + } + + return js.Global().Get("Response").New(body, init) +} diff --git a/internal/dwn/middleware/server.go b/internal/dwn/middleware/middleware.go similarity index 86% rename from internal/dwn/middleware/server.go rename to internal/dwn/middleware/middleware.go index 994db3913..32b681a86 100644 --- a/internal/dwn/middleware/server.go +++ b/internal/dwn/middleware/middleware.go @@ -4,20 +4,19 @@ import ( "net/http" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/dwn/middleware/client" "gopkg.in/macaroon.v2" ) // GetSession returns the current Session -func GetSession(c echo.Context) *client.Session { - return c.(*client.Session) +func GetSession(c echo.Context) *Session { + return c.(*Session) } // UseSession establishes a Session Cookie. func UseSession(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { - sc := client.NewSession(c) - headers := new(client.RequestHeaders) + sc := initSession(c) + headers := new(RequestHeaders) sc.Bind(headers) return next(sc) } @@ -46,7 +45,7 @@ func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFun // Verify the macaroon err = token.Verify(secretKey, func(caveat string) error { - for _, c := range client.MacroonCaveats { + for _, c := range MacroonCaveats { if c.String() == caveat { return nil } diff --git a/internal/dwn/middleware/client/session.go b/internal/dwn/middleware/session.go similarity index 92% rename from internal/dwn/middleware/client/session.go rename to internal/dwn/middleware/session.go index 61b98b5d1..a98b1a761 100644 --- a/internal/dwn/middleware/client/session.go +++ b/internal/dwn/middleware/session.go @@ -1,4 +1,4 @@ -package client +package middleware import ( "net/http" @@ -22,7 +22,7 @@ func (c *Session) ID() string { return ReadCookie(c, "session") } -func NewSession(c echo.Context) *Session { +func initSession(c echo.Context) *Session { s := &Session{Context: c} if val := ReadCookie(c, "session"); val == "" { id := ksuid.New().String() diff --git a/internal/dwn/middleware/client/token.go b/internal/dwn/middleware/token.go similarity index 98% rename from internal/dwn/middleware/client/token.go rename to internal/dwn/middleware/token.go index 35facb9e7..5c462003c 100644 --- a/internal/dwn/middleware/client/token.go +++ b/internal/dwn/middleware/token.go @@ -1,4 +1,4 @@ -package client +package middleware import ( "fmt" diff --git a/internal/vfs/models/Account.pkl.go b/internal/orm/Account.pkl.go similarity index 87% rename from internal/vfs/models/Account.pkl.go rename to internal/orm/Account.pkl.go index 1edb9b525..9bf3f02f4 100644 --- a/internal/vfs/models/Account.pkl.go +++ b/internal/orm/Account.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Account struct { Id string `pkl:"id" json:"id,omitempty" query:"id"` diff --git a/internal/vfs/models/Asset.pkl.go b/internal/orm/Asset.pkl.go similarity index 83% rename from internal/vfs/models/Asset.pkl.go rename to internal/orm/Asset.pkl.go index 5e42f533b..7fdfaebc0 100644 --- a/internal/vfs/models/Asset.pkl.go +++ b/internal/orm/Asset.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Asset struct { Id string `pkl:"id" json:"id,omitempty" query:"id"` diff --git a/internal/vfs/models/Chain.pkl.go b/internal/orm/Chain.pkl.go similarity index 81% rename from internal/vfs/models/Chain.pkl.go rename to internal/orm/Chain.pkl.go index 4ccd436ed..6fa443c58 100644 --- a/internal/vfs/models/Chain.pkl.go +++ b/internal/orm/Chain.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Chain struct { Id string `pkl:"id" json:"id,omitempty" query:"id"` diff --git a/internal/vfs/models/Credential.pkl.go b/internal/orm/Credential.pkl.go similarity index 85% rename from internal/vfs/models/Credential.pkl.go rename to internal/orm/Credential.pkl.go index 5ab02aaa5..138ce7f88 100644 --- a/internal/vfs/models/Credential.pkl.go +++ b/internal/orm/Credential.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Credential struct { Id string `pkl:"id" json:"id,omitempty" query:"id"` @@ -12,6 +12,10 @@ type Credential struct { Origin string `pkl:"origin" json:"origin,omitempty"` + Label *string `pkl:"label" json:"label,omitempty"` + + DeviceId *string `pkl:"deviceId" json:"deviceId,omitempty"` + CredentialId string `pkl:"credentialId" json:"credentialId,omitempty"` PublicKey string `pkl:"publicKey" json:"publicKey,omitempty"` diff --git a/internal/vfs/models/Grant.pkl.go b/internal/orm/Grant.pkl.go similarity index 87% rename from internal/vfs/models/Grant.pkl.go rename to internal/orm/Grant.pkl.go index fa260b55e..b5b4d1e3d 100644 --- a/internal/vfs/models/Grant.pkl.go +++ b/internal/orm/Grant.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Grant struct { Id uint `pkl:"id" json:"id,omitempty" query:"id"` diff --git a/internal/orm/JWK.pkl.go b/internal/orm/JWK.pkl.go new file mode 100644 index 000000000..3cd3f044f --- /dev/null +++ b/internal/orm/JWK.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type JWK struct { + Kty string `pkl:"kty" json:"kty,omitempty"` + + Crv string `pkl:"crv" json:"crv,omitempty"` + + X string `pkl:"x" json:"x,omitempty"` + + Y string `pkl:"y" json:"y,omitempty"` + + N string `pkl:"n" json:"n,omitempty"` + + E string `pkl:"e" json:"e,omitempty"` +} diff --git a/internal/vfs/models/Keyshare.pkl.go b/internal/orm/Keyshare.pkl.go similarity index 81% rename from internal/vfs/models/Keyshare.pkl.go rename to internal/orm/Keyshare.pkl.go index f95591fae..cbc8b356f 100644 --- a/internal/vfs/models/Keyshare.pkl.go +++ b/internal/orm/Keyshare.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Keyshare struct { Id string `pkl:"id" json:"id,omitempty" query:"id"` diff --git a/internal/vfs/models/Models.pkl.go b/internal/orm/Orm.pkl.go similarity index 65% rename from internal/vfs/models/Models.pkl.go rename to internal/orm/Orm.pkl.go index a3e880304..0c1f09dbc 100644 --- a/internal/vfs/models/Models.pkl.go +++ b/internal/orm/Orm.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm import ( "context" @@ -7,11 +7,14 @@ import ( "github.com/apple/pkl-go/pkl" ) -type Models struct { +type Orm struct { + DbName string `pkl:"db_name"` + + DbVersion int `pkl:"db_version"` } -// LoadFromPath loads the pkl module at the given path and evaluates it into a Models -func LoadFromPath(ctx context.Context, path string) (ret *Models, err error) { +// LoadFromPath loads the pkl module at the given path and evaluates it into a Orm +func LoadFromPath(ctx context.Context, path string) (ret *Orm, err error) { evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) if err != nil { return nil, err @@ -26,9 +29,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *Models, err error) { return ret, err } -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Models -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Models, error) { - var ret Models +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Orm +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Orm, error) { + var ret Orm if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { return nil, err } diff --git a/internal/vfs/models/Profile.pkl.go b/internal/orm/Profile.pkl.go similarity index 88% rename from internal/vfs/models/Profile.pkl.go rename to internal/orm/Profile.pkl.go index f88b41a65..794e4e352 100644 --- a/internal/vfs/models/Profile.pkl.go +++ b/internal/orm/Profile.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm type Profile struct { Id string `pkl:"id" json:"id,omitempty" query:"id"` diff --git a/internal/orm/PublicKey.pkl.go b/internal/orm/PublicKey.pkl.go new file mode 100644 index 000000000..a81904913 --- /dev/null +++ b/internal/orm/PublicKey.pkl.go @@ -0,0 +1,26 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +import ( + "github.com/onsonr/sonr/internal/orm/keyalgorithm" + "github.com/onsonr/sonr/internal/orm/keycurve" + "github.com/onsonr/sonr/internal/orm/keyencoding" + "github.com/onsonr/sonr/internal/orm/keyrole" + "github.com/onsonr/sonr/internal/orm/keytype" +) + +type PublicKey struct { + Role keyrole.KeyRole `pkl:"role" json:"role,omitempty" query:"role"` + + Algorithm keyalgorithm.KeyAlgorithm `pkl:"algorithm"` + + Encoding keyencoding.KeyEncoding `pkl:"encoding"` + + Curve keycurve.KeyCurve `pkl:"curve"` + + KeyType keytype.KeyType `pkl:"key_type"` + + Raw string `pkl:"raw"` + + Jwk *JWK `pkl:"jwk"` +} diff --git a/internal/orm/assettype/AssetType.pkl.go b/internal/orm/assettype/AssetType.pkl.go new file mode 100644 index 000000000..ba491f869 --- /dev/null +++ b/internal/orm/assettype/AssetType.pkl.go @@ -0,0 +1,46 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package assettype + +import ( + "encoding" + "fmt" +) + +type AssetType string + +const ( + Native AssetType = "native" + Wrapped AssetType = "wrapped" + Staking AssetType = "staking" + Pool AssetType = "pool" + Ibc AssetType = "ibc" + Cw20 AssetType = "cw20" +) + +// String returns the string representation of AssetType +func (rcv AssetType) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(AssetType) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for AssetType. +func (rcv *AssetType) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "native": + *rcv = Native + case "wrapped": + *rcv = Wrapped + case "staking": + *rcv = Staking + case "pool": + *rcv = Pool + case "ibc": + *rcv = Ibc + case "cw20": + *rcv = Cw20 + default: + return fmt.Errorf(`illegal: "%s" is not a valid AssetType`, str) + } + return nil +} diff --git a/x/did/builder/chains.go b/internal/orm/bip44.go similarity index 54% rename from x/did/builder/chains.go rename to internal/orm/bip44.go index eb3cf805a..a48b40b2e 100644 --- a/x/did/builder/chains.go +++ b/internal/orm/bip44.go @@ -1,25 +1,75 @@ -package builder +package orm import ( "crypto/hmac" "crypto/sha512" "encoding/binary" + "encoding/hex" "errors" "math/big" "github.com/btcsuite/btcd/btcec/v2" - "github.com/onsonr/sonr/x/did/types" + "github.com/onsonr/sonr/internal/orm/didmethod" ) +type ChainCode uint32 + +func GetChainCode(m didmethod.DIDMethod) ChainCode { + switch m { + case didmethod.Bitcoin: + return 0 // 0 + case didmethod.Ethereum: + return 64 // 60 + case didmethod.Ibc: + return 118 // 118 + case didmethod.Sonr: + return 703 // 703 + default: + return 0 + } +} + +func FormatAddress(pubKey *PublicKey, m didmethod.DIDMethod) (string, error) { + hexPubKey, err := hex.DecodeString(pubKey.Raw) + if err != nil { + return "", err + } + + // switch m { + // case didmethod.Bitcoin: + // return bech32.Encode("bc", pubKey.Bytes()) + // + // case didmethod.Ethereum: + // epk, err := pubKey.ECDSA() + // if err != nil { + // return "", err + // } + // return ComputeEthAddress(*epk), nil + // + // case didmethod.Sonr: + // return bech32.Encode("idx", hexPubKey) + // + // case didmethod.Ibc: + // return bech32.Encode("cosmos", hexPubKey) + // + // } + return string(hexPubKey), nil +} + // ComputeAccountPublicKey computes the public key of a child key given the extended public key, chain code, and index. -func computeBip32AccountPublicKey(extPubKey PublicKey, chainCode types.ChainCode, index int) (*types.PubKey, error) { +func ComputeBip32AccountPublicKey(extPubKey PublicKey, chainCode ChainCode, index int) (*PublicKey, error) { // Check if the index is a hardened child key if chainCode&0x80000000 != 0 && index < 0 { return nil, errors.New("invalid index") } + hexPubKey, err := hex.DecodeString(extPubKey.Raw) + if err != nil { + return nil, err + } + // Serialize the public key - pubKey, err := btcec.ParsePubKey(extPubKey.GetRaw()) + pubKey, err := btcec.ParsePubKey(hexPubKey) if err != nil { return nil, err } @@ -54,12 +104,8 @@ func computeBip32AccountPublicKey(extPubKey PublicKey, chainCode types.ChainCode ly := newBigIntFieldVal(childY) // Create the child public key - childPubKey := btcec.NewPublicKey(lx, ly) - pk, err := types.NewPublicKey(childPubKey.SerializeCompressed(), types.ChainCodeKeyInfos[chainCode]) - if err != nil { - return nil, err - } - return pk, nil + _ = btcec.NewPublicKey(lx, ly) + return &PublicKey{}, nil } // newBigIntFieldVal creates a new field value from a big integer. diff --git a/internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go b/internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go new file mode 100644 index 000000000..a53b382f2 --- /dev/null +++ b/internal/orm/browser/AuthenticatorSelectionCriteria.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type AuthenticatorSelectionCriteria struct { + AuthenticatorAttachment string `pkl:"authenticatorAttachment"` + + RequireResidentKey bool `pkl:"requireResidentKey"` + + UserVerification string `pkl:"userVerification"` +} diff --git a/internal/vfs/txns/Txns.pkl.go b/internal/orm/browser/Browser.pkl.go similarity index 67% rename from internal/vfs/txns/Txns.pkl.go rename to internal/orm/browser/Browser.pkl.go index 288c5c5bc..3943b79a5 100644 --- a/internal/vfs/txns/Txns.pkl.go +++ b/internal/orm/browser/Browser.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser import ( "context" @@ -7,11 +7,11 @@ import ( "github.com/apple/pkl-go/pkl" ) -type Txns struct { +type Browser struct { } -// LoadFromPath loads the pkl module at the given path and evaluates it into a Txns -func LoadFromPath(ctx context.Context, path string) (ret *Txns, err error) { +// LoadFromPath loads the pkl module at the given path and evaluates it into a Browser +func LoadFromPath(ctx context.Context, path string) (ret *Browser, err error) { evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) if err != nil { return nil, err @@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *Txns, err error) { return ret, err } -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Txns -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Txns, error) { - var ret Txns +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Browser +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Browser, error) { + var ret Browser if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { return nil, err } diff --git a/internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go b/internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go new file mode 100644 index 000000000..db72fb8fe --- /dev/null +++ b/internal/orm/browser/PublicKeyCredentialCreationOptions.pkl.go @@ -0,0 +1,22 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type PublicKeyCredentialCreationOptions struct { + Rp *RpEntity `pkl:"rp"` + + User *UserEntity `pkl:"user"` + + Challenge string `pkl:"challenge"` + + PubKeyCredParams []*PublicKeyCredentialParameters `pkl:"pubKeyCredParams"` + + Timeout int `pkl:"timeout"` + + ExcludeCredentials []*PublicKeyCredentialDescriptor `pkl:"excludeCredentials"` + + AuthenticatorSelection *AuthenticatorSelectionCriteria `pkl:"authenticatorSelection"` + + Attestation string `pkl:"attestation"` + + Extensions []*PublicKeyCredentialParameters `pkl:"extensions"` +} diff --git a/internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go b/internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go new file mode 100644 index 000000000..ac66c213b --- /dev/null +++ b/internal/orm/browser/PublicKeyCredentialDescriptor.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type PublicKeyCredentialDescriptor struct { + Id string `pkl:"id"` + + Transports []string `pkl:"transports"` + + Type string `pkl:"type"` +} diff --git a/internal/orm/browser/PublicKeyCredentialParameters.pkl.go b/internal/orm/browser/PublicKeyCredentialParameters.pkl.go new file mode 100644 index 000000000..7c7492bda --- /dev/null +++ b/internal/orm/browser/PublicKeyCredentialParameters.pkl.go @@ -0,0 +1,8 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type PublicKeyCredentialParameters struct { + Type string `pkl:"type"` + + Alg *int `pkl:"alg"` +} diff --git a/internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go b/internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go new file mode 100644 index 000000000..f494a9fcb --- /dev/null +++ b/internal/orm/browser/PublicKeyCredentialRequestOptions.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type PublicKeyCredentialRequestOptions struct { + Challenge string `pkl:"challenge"` + + Timeout int `pkl:"timeout"` + + RpId string `pkl:"rpId"` + + AllowCredentials []*PublicKeyCredentialDescriptor `pkl:"allowCredentials"` + + UserVerification string `pkl:"userVerification"` + + Extensions []*PublicKeyCredentialParameters `pkl:"extensions"` +} diff --git a/internal/orm/browser/RpEntity.pkl.go b/internal/orm/browser/RpEntity.pkl.go new file mode 100644 index 000000000..facd857a2 --- /dev/null +++ b/internal/orm/browser/RpEntity.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type RpEntity struct { + Id string `pkl:"id"` + + Name *string `pkl:"name"` + + Icon *string `pkl:"icon"` +} diff --git a/internal/vfs/txns/SWT.pkl.go b/internal/orm/browser/SWT.pkl.go similarity index 76% rename from internal/vfs/txns/SWT.pkl.go rename to internal/orm/browser/SWT.pkl.go index d0bf3e94b..32e9ebe54 100644 --- a/internal/vfs/txns/SWT.pkl.go +++ b/internal/orm/browser/SWT.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser type SWT struct { Origin string `pkl:"origin"` diff --git a/internal/orm/browser/UserEntity.pkl.go b/internal/orm/browser/UserEntity.pkl.go new file mode 100644 index 000000000..6b99cb2b8 --- /dev/null +++ b/internal/orm/browser/UserEntity.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +type UserEntity struct { + Id string `pkl:"id"` + + DisplayName *string `pkl:"displayName"` + + Name *string `pkl:"name"` +} diff --git a/internal/orm/browser/init.pkl.go b/internal/orm/browser/init.pkl.go new file mode 100644 index 000000000..df843093c --- /dev/null +++ b/internal/orm/browser/init.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `browser`. DO NOT EDIT. +package browser + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("browser", Browser{}) + pkl.RegisterMapping("browser#PublicKeyCredentialRequestOptions", PublicKeyCredentialRequestOptions{}) + pkl.RegisterMapping("browser#PublicKeyCredentialDescriptor", PublicKeyCredentialDescriptor{}) + pkl.RegisterMapping("browser#PublicKeyCredentialParameters", PublicKeyCredentialParameters{}) + pkl.RegisterMapping("browser#AuthenticatorSelectionCriteria", AuthenticatorSelectionCriteria{}) + pkl.RegisterMapping("browser#PublicKeyCredentialCreationOptions", PublicKeyCredentialCreationOptions{}) + pkl.RegisterMapping("browser#RpEntity", RpEntity{}) + pkl.RegisterMapping("browser#UserEntity", UserEntity{}) + pkl.RegisterMapping("browser#SWT", SWT{}) +} diff --git a/x/did/builder/constants.go b/internal/orm/constants.go similarity index 99% rename from x/did/builder/constants.go rename to internal/orm/constants.go index be06402c8..744733c81 100644 --- a/x/did/builder/constants.go +++ b/internal/orm/constants.go @@ -1,4 +1,4 @@ -package builder +package orm import ( "github.com/onsonr/sonr/x/did/types" diff --git a/internal/orm/credential.go b/internal/orm/credential.go new file mode 100644 index 000000000..5448bba29 --- /dev/null +++ b/internal/orm/credential.go @@ -0,0 +1,56 @@ +package orm + +import ( + "encoding/base64" + + "github.com/go-webauthn/webauthn/protocol" +) + +// NewCredential will return a credential pointer on successful validation of a registration response. +func NewCredential(c *protocol.ParsedCredentialCreationData, origin, handle string) *Credential { + return &Credential{ + Subject: handle, + Origin: origin, + AttestationType: c.Response.AttestationObject.Format, + CredentialId: BytesToBase64(c.Response.AttestationObject.AuthData.AttData.CredentialID), + PublicKey: BytesToBase64(c.Response.AttestationObject.AuthData.AttData.CredentialPublicKey), + Transport: NormalizeTransports(c.Response.Transports), + SignCount: uint(c.Response.AttestationObject.AuthData.Counter), + UserPresent: c.Response.AttestationObject.AuthData.Flags.HasUserPresent(), + UserVerified: c.Response.AttestationObject.AuthData.Flags.HasUserVerified(), + BackupEligible: c.Response.AttestationObject.AuthData.Flags.HasBackupEligible(), + BackupState: c.Response.AttestationObject.AuthData.Flags.HasAttestedCredentialData(), + } +} + +func BytesToBase64(b []byte) string { + return base64.RawURLEncoding.EncodeToString(b) +} + +func Base64ToBytes(b string) ([]byte, error) { + return base64.RawURLEncoding.DecodeString(b) +} + +// Descriptor converts a Credential into a protocol.CredentialDescriptor. +func (c *Credential) Descriptor() protocol.CredentialDescriptor { + id, err := base64.RawURLEncoding.DecodeString(c.CredentialId) + if err != nil { + panic(err) + } + return protocol.CredentialDescriptor{ + Type: protocol.PublicKeyCredentialType, + CredentialID: id, + Transport: ConvertTransports(c.Transport), + AttestationType: c.AttestationType, + } +} + +// This is a signal that the authenticator may be cloned, see CloneWarning above for more information. +func (a *Credential) UpdateCounter(authDataCount uint) { + if authDataCount <= a.SignCount && (authDataCount != 0 || a.SignCount != 0) { + a.CloneWarning = true + return + } + + a.SignCount = authDataCount +} diff --git a/internal/orm/didmethod/DIDMethod.pkl.go b/internal/orm/didmethod/DIDMethod.pkl.go new file mode 100644 index 000000000..4d6c583d6 --- /dev/null +++ b/internal/orm/didmethod/DIDMethod.pkl.go @@ -0,0 +1,52 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package didmethod + +import ( + "encoding" + "fmt" +) + +type DIDMethod string + +const ( + Ipfs DIDMethod = "ipfs" + Sonr DIDMethod = "sonr" + Bitcoin DIDMethod = "bitcoin" + Ethereum DIDMethod = "ethereum" + Ibc DIDMethod = "ibc" + Webauthn DIDMethod = "webauthn" + Dwn DIDMethod = "dwn" + Service DIDMethod = "service" +) + +// String returns the string representation of DIDMethod +func (rcv DIDMethod) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(DIDMethod) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for DIDMethod. +func (rcv *DIDMethod) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "ipfs": + *rcv = Ipfs + case "sonr": + *rcv = Sonr + case "bitcoin": + *rcv = Bitcoin + case "ethereum": + *rcv = Ethereum + case "ibc": + *rcv = Ibc + case "webauthn": + *rcv = Webauthn + case "dwn": + *rcv = Dwn + case "service": + *rcv = Service + default: + return fmt.Errorf(`illegal: "%s" is not a valid DIDMethod`, str) + } + return nil +} diff --git a/internal/orm/init.pkl.go b/internal/orm/init.pkl.go new file mode 100644 index 000000000..390916a45 --- /dev/null +++ b/internal/orm/init.pkl.go @@ -0,0 +1,17 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("orm", Orm{}) + pkl.RegisterMapping("orm#Account", Account{}) + pkl.RegisterMapping("orm#Asset", Asset{}) + pkl.RegisterMapping("orm#Chain", Chain{}) + pkl.RegisterMapping("orm#Credential", Credential{}) + pkl.RegisterMapping("orm#JWK", JWK{}) + pkl.RegisterMapping("orm#Grant", Grant{}) + pkl.RegisterMapping("orm#Keyshare", Keyshare{}) + pkl.RegisterMapping("orm#PublicKey", PublicKey{}) + pkl.RegisterMapping("orm#Profile", Profile{}) +} diff --git a/internal/orm/jwk.go b/internal/orm/jwk.go new file mode 100644 index 000000000..a55d8f226 --- /dev/null +++ b/internal/orm/jwk.go @@ -0,0 +1,111 @@ +package orm + +import ( + "encoding/base64" + "fmt" + + "github.com/go-webauthn/webauthn/protocol" + "github.com/go-webauthn/webauthn/protocol/webauthncose" +) + +func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*JWK, error) { + curve, err := GetCOSECurveName(key.Curve) + if err != nil { + return nil, err + } + + jwkMap := map[string]interface{}{ + "kty": "EC", + "crv": curve, + "x": base64.RawURLEncoding.EncodeToString(key.XCoord), + "y": base64.RawURLEncoding.EncodeToString(key.YCoord), + } + + return MapToJWK(jwkMap) +} + +func FormatRSAPublicKey(key *webauthncose.RSAPublicKeyData) (*JWK, error) { + jwkMap := map[string]interface{}{ + "kty": "RSA", + "n": base64.RawURLEncoding.EncodeToString(key.Modulus), + "e": base64.RawURLEncoding.EncodeToString(key.Exponent), + } + + return MapToJWK(jwkMap) +} + +func FormatOKPPublicKey(key *webauthncose.OKPPublicKeyData) (*JWK, error) { + curve, err := GetOKPCurveName(key.Curve) + if err != nil { + return nil, err + } + + jwkMap := map[string]interface{}{ + "kty": "OKP", + "crv": curve, + "x": base64.RawURLEncoding.EncodeToString(key.XCoord), + } + + return MapToJWK(jwkMap) +} + +func MapToJWK(m map[string]interface{}) (*JWK, error) { + jwk := &JWK{} + for k, v := range m { + switch k { + case "kty": + jwk.Kty = v.(string) + case "crv": + jwk.Crv = v.(string) + case "x": + jwk.X = v.(string) + case "y": + jwk.Y = v.(string) + case "n": + jwk.N = v.(string) + case "e": + jwk.E = v.(string) + } + } + return jwk, nil +} + +func GetCOSECurveName(curveID int64) (string, error) { + switch curveID { + case int64(webauthncose.P256): + return "P-256", nil + case int64(webauthncose.P384): + return "P-384", nil + case int64(webauthncose.P521): + return "P-521", nil + default: + return "", fmt.Errorf("unknown curve ID: %d", curveID) + } +} + +func GetOKPCurveName(curveID int64) (string, error) { + switch curveID { + case int64(webauthncose.Ed25519): + return "Ed25519", nil + default: + return "", fmt.Errorf("unknown OKP curve ID: %d", curveID) + } +} + +// ConvertTransports converts the transports from strings to protocol.AuthenticatorTransport +func ConvertTransports(transports []string) []protocol.AuthenticatorTransport { + tss := make([]protocol.AuthenticatorTransport, len(transports)) + for i, t := range transports { + tss[i] = protocol.AuthenticatorTransport(t) + } + return tss +} + +// NormalizeTransports returns the transports as strings +func NormalizeTransports(transports []protocol.AuthenticatorTransport) []string { + tss := make([]string, len(transports)) + for i, t := range transports { + tss[i] = string(t) + } + return tss +} diff --git a/internal/orm/keyalg.go b/internal/orm/keyalg.go new file mode 100644 index 000000000..387df8d3d --- /dev/null +++ b/internal/orm/keyalg.go @@ -0,0 +1,22 @@ +package orm + +import "github.com/onsonr/sonr/internal/orm/keyalgorithm" + +type COSEAlgorithmIdentifier int + +func GetCoseIdentifier(alg keyalgorithm.KeyAlgorithm) COSEAlgorithmIdentifier { + switch alg { + case keyalgorithm.Es256: + return COSEAlgorithmIdentifier(-7) + case keyalgorithm.Es384: + return COSEAlgorithmIdentifier(-35) + case keyalgorithm.Es512: + return COSEAlgorithmIdentifier(-36) + case keyalgorithm.Eddsa: + return COSEAlgorithmIdentifier(-8) + case keyalgorithm.Es256k: + return COSEAlgorithmIdentifier(-10) + default: + return COSEAlgorithmIdentifier(0) + } +} diff --git a/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go b/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go new file mode 100644 index 000000000..16f47ac66 --- /dev/null +++ b/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go @@ -0,0 +1,46 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package keyalgorithm + +import ( + "encoding" + "fmt" +) + +type KeyAlgorithm string + +const ( + Es256 KeyAlgorithm = "es256" + Es384 KeyAlgorithm = "es384" + Es512 KeyAlgorithm = "es512" + Eddsa KeyAlgorithm = "eddsa" + Es256k KeyAlgorithm = "es256k" + Ecdsa KeyAlgorithm = "ecdsa" +) + +// String returns the string representation of KeyAlgorithm +func (rcv KeyAlgorithm) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(KeyAlgorithm) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyAlgorithm. +func (rcv *KeyAlgorithm) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "es256": + *rcv = Es256 + case "es384": + *rcv = Es384 + case "es512": + *rcv = Es512 + case "eddsa": + *rcv = Eddsa + case "es256k": + *rcv = Es256k + case "ecdsa": + *rcv = Ecdsa + default: + return fmt.Errorf(`illegal: "%s" is not a valid KeyAlgorithm`, str) + } + return nil +} diff --git a/internal/orm/keycurve/KeyCurve.pkl.go b/internal/orm/keycurve/KeyCurve.pkl.go new file mode 100644 index 000000000..773b59ab1 --- /dev/null +++ b/internal/orm/keycurve/KeyCurve.pkl.go @@ -0,0 +1,58 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package keycurve + +import ( + "encoding" + "fmt" +) + +type KeyCurve string + +const ( + P256 KeyCurve = "p256" + P384 KeyCurve = "p384" + P521 KeyCurve = "p521" + X25519 KeyCurve = "x25519" + X448 KeyCurve = "x448" + Ed25519 KeyCurve = "ed25519" + Ed448 KeyCurve = "ed448" + Secp256k1 KeyCurve = "secp256k1" + Bls12381 KeyCurve = "bls12381" + Keccak256 KeyCurve = "keccak256" +) + +// String returns the string representation of KeyCurve +func (rcv KeyCurve) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(KeyCurve) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyCurve. +func (rcv *KeyCurve) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "p256": + *rcv = P256 + case "p384": + *rcv = P384 + case "p521": + *rcv = P521 + case "x25519": + *rcv = X25519 + case "x448": + *rcv = X448 + case "ed25519": + *rcv = Ed25519 + case "ed448": + *rcv = Ed448 + case "secp256k1": + *rcv = Secp256k1 + case "bls12381": + *rcv = Bls12381 + case "keccak256": + *rcv = Keccak256 + default: + return fmt.Errorf(`illegal: "%s" is not a valid KeyCurve`, str) + } + return nil +} diff --git a/internal/orm/keyencoding/KeyEncoding.pkl.go b/internal/orm/keyencoding/KeyEncoding.pkl.go new file mode 100644 index 000000000..dab253554 --- /dev/null +++ b/internal/orm/keyencoding/KeyEncoding.pkl.go @@ -0,0 +1,37 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package keyencoding + +import ( + "encoding" + "fmt" +) + +type KeyEncoding string + +const ( + Raw KeyEncoding = "raw" + Hex KeyEncoding = "hex" + Multibase KeyEncoding = "multibase" +) + +// String returns the string representation of KeyEncoding +func (rcv KeyEncoding) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(KeyEncoding) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyEncoding. +func (rcv *KeyEncoding) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "raw": + *rcv = Raw + case "hex": + *rcv = Hex + case "multibase": + *rcv = Multibase + default: + return fmt.Errorf(`illegal: "%s" is not a valid KeyEncoding`, str) + } + return nil +} diff --git a/internal/orm/keyrole/KeyRole.pkl.go b/internal/orm/keyrole/KeyRole.pkl.go new file mode 100644 index 000000000..ee5437cee --- /dev/null +++ b/internal/orm/keyrole/KeyRole.pkl.go @@ -0,0 +1,40 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package keyrole + +import ( + "encoding" + "fmt" +) + +type KeyRole string + +const ( + Authentication KeyRole = "authentication" + Assertion KeyRole = "assertion" + Delegation KeyRole = "delegation" + Invocation KeyRole = "invocation" +) + +// String returns the string representation of KeyRole +func (rcv KeyRole) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(KeyRole) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyRole. +func (rcv *KeyRole) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "authentication": + *rcv = Authentication + case "assertion": + *rcv = Assertion + case "delegation": + *rcv = Delegation + case "invocation": + *rcv = Invocation + default: + return fmt.Errorf(`illegal: "%s" is not a valid KeyRole`, str) + } + return nil +} diff --git a/internal/orm/keysharerole/KeyShareRole.pkl.go b/internal/orm/keysharerole/KeyShareRole.pkl.go new file mode 100644 index 000000000..84394745e --- /dev/null +++ b/internal/orm/keysharerole/KeyShareRole.pkl.go @@ -0,0 +1,34 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package keysharerole + +import ( + "encoding" + "fmt" +) + +type KeyShareRole string + +const ( + User KeyShareRole = "user" + Validator KeyShareRole = "validator" +) + +// String returns the string representation of KeyShareRole +func (rcv KeyShareRole) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(KeyShareRole) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyShareRole. +func (rcv *KeyShareRole) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "user": + *rcv = User + case "validator": + *rcv = Validator + default: + return fmt.Errorf(`illegal: "%s" is not a valid KeyShareRole`, str) + } + return nil +} diff --git a/internal/orm/keytype/KeyType.pkl.go b/internal/orm/keytype/KeyType.pkl.go new file mode 100644 index 000000000..d3f9808ad --- /dev/null +++ b/internal/orm/keytype/KeyType.pkl.go @@ -0,0 +1,55 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package keytype + +import ( + "encoding" + "fmt" +) + +type KeyType string + +const ( + Octet KeyType = "octet" + Elliptic KeyType = "elliptic" + Rsa KeyType = "rsa" + Symmetric KeyType = "symmetric" + Hmac KeyType = "hmac" + Mpc KeyType = "mpc" + Zk KeyType = "zk" + Webauthn KeyType = "webauthn" + Bip32 KeyType = "bip32" +) + +// String returns the string representation of KeyType +func (rcv KeyType) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(KeyType) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for KeyType. +func (rcv *KeyType) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "octet": + *rcv = Octet + case "elliptic": + *rcv = Elliptic + case "rsa": + *rcv = Rsa + case "symmetric": + *rcv = Symmetric + case "hmac": + *rcv = Hmac + case "mpc": + *rcv = Mpc + case "zk": + *rcv = Zk + case "webauthn": + *rcv = Webauthn + case "bip32": + *rcv = Bip32 + default: + return fmt.Errorf(`illegal: "%s" is not a valid KeyType`, str) + } + return nil +} diff --git a/internal/orm/permissiongrant/PermissionGrant.pkl.go b/internal/orm/permissiongrant/PermissionGrant.pkl.go new file mode 100644 index 000000000..bdeea225f --- /dev/null +++ b/internal/orm/permissiongrant/PermissionGrant.pkl.go @@ -0,0 +1,46 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package permissiongrant + +import ( + "encoding" + "fmt" +) + +type PermissionGrant string + +const ( + None PermissionGrant = "none" + Read PermissionGrant = "read" + Write PermissionGrant = "write" + Verify PermissionGrant = "verify" + Broadcast PermissionGrant = "broadcast" + Admin PermissionGrant = "admin" +) + +// String returns the string representation of PermissionGrant +func (rcv PermissionGrant) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(PermissionGrant) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for PermissionGrant. +func (rcv *PermissionGrant) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "none": + *rcv = None + case "read": + *rcv = Read + case "write": + *rcv = Write + case "verify": + *rcv = Verify + case "broadcast": + *rcv = Broadcast + case "admin": + *rcv = Admin + default: + return fmt.Errorf(`illegal: "%s" is not a valid PermissionGrant`, str) + } + return nil +} diff --git a/internal/orm/permissionscope/PermissionScope.pkl.go b/internal/orm/permissionscope/PermissionScope.pkl.go new file mode 100644 index 000000000..2af42ee43 --- /dev/null +++ b/internal/orm/permissionscope/PermissionScope.pkl.go @@ -0,0 +1,49 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package permissionscope + +import ( + "encoding" + "fmt" +) + +type PermissionScope string + +const ( + Profile PermissionScope = "profile" + Metadata PermissionScope = "metadata" + Permissions PermissionScope = "permissions" + Wallets PermissionScope = "wallets" + Transactions PermissionScope = "transactions" + User PermissionScope = "user" + Validator PermissionScope = "validator" +) + +// String returns the string representation of PermissionScope +func (rcv PermissionScope) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(PermissionScope) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for PermissionScope. +func (rcv *PermissionScope) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "profile": + *rcv = Profile + case "metadata": + *rcv = Metadata + case "permissions": + *rcv = Permissions + case "wallets": + *rcv = Wallets + case "transactions": + *rcv = Transactions + case "user": + *rcv = User + case "validator": + *rcv = Validator + default: + return fmt.Errorf(`illegal: "%s" is not a valid PermissionScope`, str) + } + return nil +} diff --git a/internal/orm/publickey.go b/internal/orm/publickey.go new file mode 100644 index 000000000..8256d0946 --- /dev/null +++ b/internal/orm/publickey.go @@ -0,0 +1,26 @@ +package orm + +import ( + "fmt" + + "github.com/go-webauthn/webauthn/protocol/webauthncose" +) + +// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation +func ExtractWebAuthnPublicKey(keyBytes []byte) (*JWK, error) { + key, err := webauthncose.ParsePublicKey(keyBytes) + if err != nil { + return nil, fmt.Errorf("failed to parse public key: %w", err) + } + + switch k := key.(type) { + case *webauthncose.EC2PublicKeyData: + return FormatEC2PublicKey(k) + case *webauthncose.RSAPublicKeyData: + return FormatRSAPublicKey(k) + case *webauthncose.OKPPublicKeyData: + return FormatOKPPublicKey(k) + default: + return nil, fmt.Errorf("unsupported key type") + } +} diff --git a/internal/orm/transactions/Msg.pkl.go b/internal/orm/transactions/Msg.pkl.go new file mode 100644 index 000000000..fe8ffcc9a --- /dev/null +++ b/internal/orm/transactions/Msg.pkl.go @@ -0,0 +1,6 @@ +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions + +type Msg interface { + GetTypeUrl() string +} diff --git a/internal/vfs/txns/MsgDidAllocateVault.pkl.go b/internal/orm/transactions/MsgDidAllocateVault.pkl.go similarity index 90% rename from internal/vfs/txns/MsgDidAllocateVault.pkl.go rename to internal/orm/transactions/MsgDidAllocateVault.pkl.go index dcb4a04e4..0e691f461 100644 --- a/internal/vfs/txns/MsgDidAllocateVault.pkl.go +++ b/internal/orm/transactions/MsgDidAllocateVault.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgDidAuthorize.pkl.go b/internal/orm/transactions/MsgDidAuthorize.pkl.go similarity index 92% rename from internal/vfs/txns/MsgDidAuthorize.pkl.go rename to internal/orm/transactions/MsgDidAuthorize.pkl.go index 344bbe81a..b12fc046d 100644 --- a/internal/vfs/txns/MsgDidAuthorize.pkl.go +++ b/internal/orm/transactions/MsgDidAuthorize.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgDidProveWitness.pkl.go b/internal/orm/transactions/MsgDidProveWitness.pkl.go similarity index 91% rename from internal/vfs/txns/MsgDidProveWitness.pkl.go rename to internal/orm/transactions/MsgDidProveWitness.pkl.go index 6ea127769..8bb849194 100644 --- a/internal/vfs/txns/MsgDidProveWitness.pkl.go +++ b/internal/orm/transactions/MsgDidProveWitness.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgDidRegisterController.pkl.go b/internal/orm/transactions/MsgDidRegisterController.pkl.go similarity index 93% rename from internal/vfs/txns/MsgDidRegisterController.pkl.go rename to internal/orm/transactions/MsgDidRegisterController.pkl.go index dc6d3651b..99907f455 100644 --- a/internal/vfs/txns/MsgDidRegisterController.pkl.go +++ b/internal/orm/transactions/MsgDidRegisterController.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgDidRegisterService.pkl.go b/internal/orm/transactions/MsgDidRegisterService.pkl.go similarity index 94% rename from internal/vfs/txns/MsgDidRegisterService.pkl.go rename to internal/orm/transactions/MsgDidRegisterService.pkl.go index 3d2f849a5..d234865da 100644 --- a/internal/vfs/txns/MsgDidRegisterService.pkl.go +++ b/internal/orm/transactions/MsgDidRegisterService.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgDidSyncVault.pkl.go b/internal/orm/transactions/MsgDidSyncVault.pkl.go similarity index 88% rename from internal/vfs/txns/MsgDidSyncVault.pkl.go rename to internal/orm/transactions/MsgDidSyncVault.pkl.go index c7f38de0a..c4de4ba64 100644 --- a/internal/vfs/txns/MsgDidSyncVault.pkl.go +++ b/internal/orm/transactions/MsgDidSyncVault.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgDidUpdateParams.pkl.go b/internal/orm/transactions/MsgDidUpdateParams.pkl.go similarity index 90% rename from internal/vfs/txns/MsgDidUpdateParams.pkl.go rename to internal/orm/transactions/MsgDidUpdateParams.pkl.go index 566383b4f..a3e227ab8 100644 --- a/internal/vfs/txns/MsgDidUpdateParams.pkl.go +++ b/internal/orm/transactions/MsgDidUpdateParams.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgGovDeposit.pkl.go b/internal/orm/transactions/MsgGovDeposit.pkl.go similarity index 89% rename from internal/vfs/txns/MsgGovDeposit.pkl.go rename to internal/orm/transactions/MsgGovDeposit.pkl.go index 237e1ff46..556d1df7f 100644 --- a/internal/vfs/txns/MsgGovDeposit.pkl.go +++ b/internal/orm/transactions/MsgGovDeposit.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgGovSubmitProposal.pkl.go b/internal/orm/transactions/MsgGovSubmitProposal.pkl.go similarity index 91% rename from internal/vfs/txns/MsgGovSubmitProposal.pkl.go rename to internal/orm/transactions/MsgGovSubmitProposal.pkl.go index 8c7f744fb..c33b589b6 100644 --- a/internal/vfs/txns/MsgGovSubmitProposal.pkl.go +++ b/internal/orm/transactions/MsgGovSubmitProposal.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgGovVote.pkl.go b/internal/orm/transactions/MsgGovVote.pkl.go similarity index 88% rename from internal/vfs/txns/MsgGovVote.pkl.go rename to internal/orm/transactions/MsgGovVote.pkl.go index 73ff547b2..303cf1eee 100644 --- a/internal/vfs/txns/MsgGovVote.pkl.go +++ b/internal/orm/transactions/MsgGovVote.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions type MsgGovVote interface { Msg diff --git a/internal/vfs/txns/MsgGroupCreateGroup.pkl.go b/internal/orm/transactions/MsgGroupCreateGroup.pkl.go similarity index 90% rename from internal/vfs/txns/MsgGroupCreateGroup.pkl.go rename to internal/orm/transactions/MsgGroupCreateGroup.pkl.go index 19fd7173e..c5dafd6bd 100644 --- a/internal/vfs/txns/MsgGroupCreateGroup.pkl.go +++ b/internal/orm/transactions/MsgGroupCreateGroup.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgGroupSubmitProposal.pkl.go b/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go similarity index 93% rename from internal/vfs/txns/MsgGroupSubmitProposal.pkl.go rename to internal/orm/transactions/MsgGroupSubmitProposal.pkl.go index 2cb9f0729..c23f15391 100644 --- a/internal/vfs/txns/MsgGroupSubmitProposal.pkl.go +++ b/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgGroupVote.pkl.go b/internal/orm/transactions/MsgGroupVote.pkl.go similarity index 91% rename from internal/vfs/txns/MsgGroupVote.pkl.go rename to internal/orm/transactions/MsgGroupVote.pkl.go index 79ae04244..a79ce6899 100644 --- a/internal/vfs/txns/MsgGroupVote.pkl.go +++ b/internal/orm/transactions/MsgGroupVote.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions type MsgGroupVote interface { Msg diff --git a/internal/vfs/txns/MsgStakingBeginRedelegate.pkl.go b/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go similarity index 93% rename from internal/vfs/txns/MsgStakingBeginRedelegate.pkl.go rename to internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go index fe803db38..44a019af4 100644 --- a/internal/vfs/txns/MsgStakingBeginRedelegate.pkl.go +++ b/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgStakingCreateValidator.pkl.go b/internal/orm/transactions/MsgStakingCreateValidator.pkl.go similarity index 95% rename from internal/vfs/txns/MsgStakingCreateValidator.pkl.go rename to internal/orm/transactions/MsgStakingCreateValidator.pkl.go index d3c11015c..d904a71c6 100644 --- a/internal/vfs/txns/MsgStakingCreateValidator.pkl.go +++ b/internal/orm/transactions/MsgStakingCreateValidator.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgStakingDelegate.pkl.go b/internal/orm/transactions/MsgStakingDelegate.pkl.go similarity index 91% rename from internal/vfs/txns/MsgStakingDelegate.pkl.go rename to internal/orm/transactions/MsgStakingDelegate.pkl.go index b6fb170ec..9dd6fa824 100644 --- a/internal/vfs/txns/MsgStakingDelegate.pkl.go +++ b/internal/orm/transactions/MsgStakingDelegate.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/MsgStakingUndelegate.pkl.go b/internal/orm/transactions/MsgStakingUndelegate.pkl.go similarity index 91% rename from internal/vfs/txns/MsgStakingUndelegate.pkl.go rename to internal/orm/transactions/MsgStakingUndelegate.pkl.go index c1732c2c2..ffc2395e6 100644 --- a/internal/vfs/txns/MsgStakingUndelegate.pkl.go +++ b/internal/orm/transactions/MsgStakingUndelegate.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/vfs/txns/Proposal.pkl.go b/internal/orm/transactions/Proposal.pkl.go similarity index 69% rename from internal/vfs/txns/Proposal.pkl.go rename to internal/orm/transactions/Proposal.pkl.go index 70463d42f..4a3e8bd62 100644 --- a/internal/vfs/txns/Proposal.pkl.go +++ b/internal/orm/transactions/Proposal.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions // Base class for all proposals type Proposal struct { diff --git a/internal/orm/transactions/Transactions.pkl.go b/internal/orm/transactions/Transactions.pkl.go new file mode 100644 index 000000000..5a551b8c4 --- /dev/null +++ b/internal/orm/transactions/Transactions.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions + +import ( + "context" + + "github.com/apple/pkl-go/pkl" +) + +type Transactions struct { +} + +// LoadFromPath loads the pkl module at the given path and evaluates it into a Transactions +func LoadFromPath(ctx context.Context, path string) (ret *Transactions, err error) { + evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) + if err != nil { + return nil, err + } + defer func() { + cerr := evaluator.Close() + if err == nil { + err = cerr + } + }() + ret, err = Load(ctx, evaluator, pkl.FileSource(path)) + return ret, err +} + +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Transactions +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Transactions, error) { + var ret Transactions + if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { + return nil, err + } + return &ret, nil +} diff --git a/internal/vfs/txns/TxBody.pkl.go b/internal/orm/transactions/TxBody.pkl.go similarity index 80% rename from internal/vfs/txns/TxBody.pkl.go rename to internal/orm/transactions/TxBody.pkl.go index 407ba4179..8a8c23263 100644 --- a/internal/vfs/txns/TxBody.pkl.go +++ b/internal/orm/transactions/TxBody.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions import "github.com/apple/pkl-go/pkl" diff --git a/internal/orm/transactions/init.pkl.go b/internal/orm/transactions/init.pkl.go new file mode 100644 index 000000000..211bc2e21 --- /dev/null +++ b/internal/orm/transactions/init.pkl.go @@ -0,0 +1,27 @@ +// Code generated from Pkl module `transactions`. DO NOT EDIT. +package transactions + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("transactions", Transactions{}) + pkl.RegisterMapping("transactions#Proposal", Proposal{}) + pkl.RegisterMapping("transactions#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) + pkl.RegisterMapping("transactions#MsgGovVote", MsgGovVoteImpl{}) + pkl.RegisterMapping("transactions#MsgGovDeposit", MsgGovDepositImpl{}) + pkl.RegisterMapping("transactions#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) + pkl.RegisterMapping("transactions#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) + pkl.RegisterMapping("transactions#MsgGroupVote", MsgGroupVoteImpl{}) + pkl.RegisterMapping("transactions#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) + pkl.RegisterMapping("transactions#MsgStakingDelegate", MsgStakingDelegateImpl{}) + pkl.RegisterMapping("transactions#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) + pkl.RegisterMapping("transactions#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) + pkl.RegisterMapping("transactions#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) + pkl.RegisterMapping("transactions#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) + pkl.RegisterMapping("transactions#MsgDidProveWitness", MsgDidProveWitnessImpl{}) + pkl.RegisterMapping("transactions#MsgDidSyncVault", MsgDidSyncVaultImpl{}) + pkl.RegisterMapping("transactions#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) + pkl.RegisterMapping("transactions#MsgDidAuthorize", MsgDidAuthorizeImpl{}) + pkl.RegisterMapping("transactions#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) + pkl.RegisterMapping("transactions#TxBody", TxBody{}) +} diff --git a/internal/vfs/embed.go b/internal/vfs/embed.go index 14a732320..7cd67797e 100644 --- a/internal/vfs/embed.go +++ b/internal/vfs/embed.go @@ -18,12 +18,11 @@ var indexData []byte var swJSData []byte // NewDWNConfigFile uses the config template to generate the dwn config file -func NewDWNConfigFile(keyshareJSON string, adddress string) (files.Node, error) { +func NewDWNConfigFile(keyshareJSON string, adddress string, chainID string) (files.Node, error) { dwnCfg := &dwn.Config{ - Keyshare: &keyshareJSON, - Address: &adddress, - Ipfs: defaultIPFSConfig(), - Sonr: defaultSonrConfig(), + Motr: createMotrConfig(keyshareJSON, adddress, "sonr.id"), + Ipfs: defaultIPFSConfig(), + Sonr: defaultSonrConfig(chainID), } dwnConfigData, err := json.Marshal(dwnCfg) if err != nil { @@ -47,6 +46,14 @@ func SWJSFile() files.Node { return files.NewBytesFile(swJSData) } +func createMotrConfig(keyshareJSON string, adddress string, origin string) *dwn.Motr { + return &dwn.Motr{ + Keyshare: keyshareJSON, + Address: adddress, + Origin: origin, + } +} + func defaultIPFSConfig() *dwn.IPFS { return &dwn.IPFS{ ApiUrl: "https://api.sonr-ipfs.land", @@ -54,11 +61,12 @@ func defaultIPFSConfig() *dwn.IPFS { } } -func defaultSonrConfig() *dwn.Sonr { +func defaultSonrConfig(chainID string) *dwn.Sonr { return &dwn.Sonr{ ApiUrl: "https://api.sonr.land", GrpcUrl: "https://grpc.sonr.land", RpcUrl: "https://rpc.sonr.land", WebSocketUrl: "wss://rpc.sonr.land/ws", + ChainId: chainID, } } diff --git a/internal/vfs/models/PublicKey.pkl.go b/internal/vfs/models/PublicKey.pkl.go deleted file mode 100644 index 4844d2dd4..000000000 --- a/internal/vfs/models/PublicKey.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type PublicKey struct { - Id string `pkl:"id" json:"id,omitempty" query:"id"` -} diff --git a/internal/vfs/models/init.pkl.go b/internal/vfs/models/init.pkl.go deleted file mode 100644 index 3ce3011c6..000000000 --- a/internal/vfs/models/init.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("models", Models{}) - pkl.RegisterMapping("models#Account", Account{}) - pkl.RegisterMapping("models#Asset", Asset{}) - pkl.RegisterMapping("models#Chain", Chain{}) - pkl.RegisterMapping("models#Credential", Credential{}) - pkl.RegisterMapping("models#Grant", Grant{}) - pkl.RegisterMapping("models#Keyshare", Keyshare{}) - pkl.RegisterMapping("models#PublicKey", PublicKey{}) - pkl.RegisterMapping("models#Profile", Profile{}) -} diff --git a/internal/vfs/txns/Msg.pkl.go b/internal/vfs/txns/Msg.pkl.go deleted file mode 100644 index 316adf06d..000000000 --- a/internal/vfs/txns/Msg.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -type Msg interface { - GetTypeUrl() string -} diff --git a/internal/vfs/txns/init.pkl.go b/internal/vfs/txns/init.pkl.go deleted file mode 100644 index 91b290e30..000000000 --- a/internal/vfs/txns/init.pkl.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated from Pkl module `txns`. DO NOT EDIT. -package txns - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("txns", Txns{}) - pkl.RegisterMapping("txns#Proposal", Proposal{}) - pkl.RegisterMapping("txns#SWT", SWT{}) - pkl.RegisterMapping("txns#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) - pkl.RegisterMapping("txns#MsgGovVote", MsgGovVoteImpl{}) - pkl.RegisterMapping("txns#MsgGovDeposit", MsgGovDepositImpl{}) - pkl.RegisterMapping("txns#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) - pkl.RegisterMapping("txns#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) - pkl.RegisterMapping("txns#MsgGroupVote", MsgGroupVoteImpl{}) - pkl.RegisterMapping("txns#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) - pkl.RegisterMapping("txns#MsgStakingDelegate", MsgStakingDelegateImpl{}) - pkl.RegisterMapping("txns#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) - pkl.RegisterMapping("txns#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) - pkl.RegisterMapping("txns#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) - pkl.RegisterMapping("txns#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) - pkl.RegisterMapping("txns#MsgDidProveWitness", MsgDidProveWitnessImpl{}) - pkl.RegisterMapping("txns#MsgDidSyncVault", MsgDidSyncVaultImpl{}) - pkl.RegisterMapping("txns#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) - pkl.RegisterMapping("txns#MsgDidAuthorize", MsgDidAuthorizeImpl{}) - pkl.RegisterMapping("txns#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) - pkl.RegisterMapping("txns#TxBody", TxBody{}) -} diff --git a/process-compose.yaml b/process-compose.yaml index 62f947ffe..a42170e72 100644 --- a/process-compose.yaml +++ b/process-compose.yaml @@ -1,18 +1,17 @@ version: "0.6" processes: - ipfs: - namespace: testnet - command: "ipfs-cluster-service init --consensus crdt && ipfs-cluster-service daemon" - background: true - availability: - restart: on_failure - max_restarts: 3 - sonr: namespace: testnet command: "make sh-testnet" restart: on_failure max_restarts: 3 depends: - - ipfs + + caddy: + namespace: testnet + command: "make caddy-start" + restart: on_failure + max_restarts: 3 + depends: + - sonr diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 37c3ff16d..65e92ed09 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -10,17 +10,6 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; message GenesisState { // Params defines all the parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; - - // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace - GlobalIntegrity global_integrity = 2; -} - -// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace -message GlobalIntegrity { - string controller = 1; - string seed = 2; - bytes accumulator = 3; - uint64 count = 4; } // Params defines the set of module parameters. @@ -60,7 +49,7 @@ message AssetInfo { string symbol = 3; // The coin name - AssetType asset_type = 4; + string asset_type = 4; // The name of the asset string name = 5; @@ -69,116 +58,54 @@ message AssetInfo { string icon_url = 6; } +// Document defines a DID document +message Document { + string id = 1; + string controller = 2; // The DID of the controller + repeated string authentication = 3; + repeated string assertion_method = 4; + repeated string capability_delegation = 5; + repeated string capability_invocation = 6; + repeated string service = 7; +} + // KeyInfo defines information for accepted PubKey types message KeyInfo { - KeyRole role = 1; - KeyAlgorithm algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" - KeyEncoding encoding = 3; // e.g., "hex", "base64", "multibase" - KeyCurve curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" - KeyType type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" + string role = 1; + string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" + string encoding = 3; // e.g., "hex", "base64", "multibase" + string curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" + string type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" } -// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified -enum AssetType { - ASSET_TYPE_UNSPECIFIED = 0; - ASSET_TYPE_NATIVE = 1; - ASSET_TYPE_WRAPPED = 2; - ASSET_TYPE_STAKING = 3; - ASSET_TYPE_POOL = 4; - ASSET_TYPE_IBC = 5; - ASSET_TYPE_CW20 = 6; +// PubKey defines a public key for a did +message PubKey { + string role = 1; + string algorithm = 2; + string encoding = 3; + string curve = 4; + string key_type = 5; + bytes raw = 6; + JWK jwk = 7; + + // JWK represents a JSON Web Key + message JWK { + string kty = 1; // Key Type + string crv = 2; // Curve (for EC and OKP keys) + string x = 3; // X coordinate (for EC and OKP keys) + string y = 4; // Y coordinate (for EC keys) + string n = 5; // Modulus (for RSA keys) + string e = 6; // Exponent (for RSA keys) + } } -// DIDNamespace define the different namespaces of DID -enum DIDNamespace { - DID_NAMESPACE_UNSPECIFIED = 0; - DID_NAMESPACE_IPFS = 1; - DID_NAMESPACE_SONR = 2; - DID_NAMESPACE_BITCOIN = 3; - DID_NAMESPACE_ETHEREUM = 4; - DID_NAMESPACE_IBC = 5; - DID_NAMESPACE_WEBAUTHN = 6; - DID_NAMESPACE_DWN = 7; - DID_NAMESPACE_SERVICE = 8; -} - -// KeyAlgorithm defines the key algorithm -enum KeyAlgorithm { - KEY_ALGORITHM_UNSPECIFIED = 0; - KEY_ALGORITHM_ES256 = 1; - KEY_ALGORITHM_ES384 = 2; - KEY_ALGORITHM_ES512 = 3; - KEY_ALGORITHM_EDDSA = 4; - KEY_ALGORITHM_ES256K = 5; - KEY_ALGORITHM_ECDSA = 6; // Fixed typo from EDCSA to ECDSA -} - -// KeyCurve defines the key curve -enum KeyCurve { - KEY_CURVE_UNSPECIFIED = 0; - KEY_CURVE_P256 = 1; // NIST P-256 - KEY_CURVE_P384 = 2; - KEY_CURVE_P521 = 3; - KEY_CURVE_X25519 = 4; - KEY_CURVE_X448 = 5; - KEY_CURVE_ED25519 = 6; - KEY_CURVE_ED448 = 7; - KEY_CURVE_SECP256K1 = 8; - KEY_CURVE_BLS12381 = 9; - KEY_CURVE_KECCAK256 = 10; -} - -// KeyEncoding defines the key encoding -enum KeyEncoding { - KEY_ENCODING_UNSPECIFIED = 0; - KEY_ENCODING_RAW = 1; - KEY_ENCODING_HEX = 2; - KEY_ENCODING_MULTIBASE = 3; -} - -// KeyRole defines the kind of key -enum KeyRole { - KEY_ROLE_UNSPECIFIED = 0; - KEY_ROLE_AUTHENTICATION = 1; // Passkeys and FIDO - KEY_ROLE_ASSERTION = 2; // Zk Identifiers - KEY_ROLE_DELEGATION = 3; // ETH,BTC,IBC addresses - KEY_ROLE_INVOCATION = 4; // DWN Controllers -} - -// KeyType defines the key type -enum KeyType { - KEY_TYPE_UNSPECIFIED = 0; - KEY_TYPE_OCTET = 1; - KEY_TYPE_ELLIPTIC = 2; - KEY_TYPE_RSA = 3; - KEY_TYPE_SYMMETRIC = 4; - KEY_TYPE_HMAC = 5; - KEY_TYPE_MPC = 6; - KEY_TYPE_ZK = 7; - KEY_TYPE_WEBAUTHN = 8; - KEY_TYPE_BIP32 = 9; -} - -enum KeyshareRole { - KEYSHARE_ROLE_UNSPECIFIED = 0; - KEYSHARE_ROLE_USER = 1; - KEYSHARE_ROLE_VALIDATOR = 2; -} - -// PermissionScope define the Capabilities Controllers can grant for Services -enum PermissionScope { - PERMISSION_SCOPE_UNSPECIFIED = 0; - PERMISSION_SCOPE_BASIC_INFO = 1; - PERMISSION_SCOPE_PERMISSIONS_READ = 2; - PERMISSION_SCOPE_PERMISSIONS_WRITE = 3; - PERMISSION_SCOPE_TRANSACTIONS_READ = 4; - PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5; - PERMISSION_SCOPE_WALLETS_READ = 6; - PERMISSION_SCOPE_WALLETS_CREATE = 7; - PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8; - PERMISSION_SCOPE_WALLETS_UPDATE = 9; - PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10; - PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11; - PERMISSION_SCOPE_ADMIN_USER = 12; - PERMISSION_SCOPE_ADMIN_VALIDATOR = 13; +// Service defines a Decentralized Service on the Sonr Blockchain +message Service { + string id = 1; + string service_type = 2; + string authority = 3; + string origin = 4; + string description = 5; + map service_endpoints = 6; + map permissions = 7; } diff --git a/proto/did/v1/models.proto b/proto/did/v1/models.proto deleted file mode 100644 index 68f899d11..000000000 --- a/proto/did/v1/models.proto +++ /dev/null @@ -1,107 +0,0 @@ -syntax = "proto3"; - -package did.v1; - -import "did/v1/genesis.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/onsonr/sonr/x/did/types"; - -message Credential { - string subject = 1; - string attestation_type = 2; - string origin = 3; - bytes credential_id = 4; - bytes public_key = 5; - repeated string transport = 6; - uint32 sign_count = 7; - bool user_present = 8; - bool user_verified = 9; - bool backup_eligible = 10; - bool backup_state = 11; - bool clone_warning = 12; -} - -// Document defines a DID document -message Document { - string id = 1; - string controller = 2; // The DID of the controller - repeated string authentication = 3; - repeated string assertion_method = 4; - repeated string capability_delegation = 5; - repeated string capability_invocation = 6; - repeated string service = 7; -} - -// Keyshare defines a keyshare from the MPC protocol -message Keyshare { - map metadata = 1; - map payloads = 2; - string protocol = 3; - bytes public_key = 4; - uint32 version = 5; - int32 role = 6; // 0 =none, 1 = validator, 2 = user -} - -// Permissions contains a list of grants and access control rules for -// a Service. -message Permissions { - repeated DIDNamespace grants = 1; - repeated PermissionScope scopes = 2; -} - -// PubKey defines a public key for a did -message PubKey { - KeyRole role = 1; - KeyAlgorithm algorithm = 2; - KeyEncoding encoding = 3; - KeyCurve curve = 4; - KeyType key_type = 5; - bytes raw = 6; - JWK jwk = 7; - - // JWK represents a JSON Web Key - message JWK { - string kty = 1; // Key Type - string crv = 2; // Curve (for EC and OKP keys) - string x = 3; // X coordinate (for EC and OKP keys) - string y = 4; // Y coordinate (for EC keys) - string n = 5; // Modulus (for RSA keys) - string e = 6; // Exponent (for RSA keys) - } -} - -// Service defines a Decentralized Service on the Sonr Blockchain -message Service { - string id = 1; - string service_type = 2; - string authority = 3; - string origin = 4; - string description = 5; - map service_endpoints = 6; - Permissions permissions = 7; -} - -// ServicceInfo defines a Decentralized Service on the Sonr Blockchain -message ServiceInfo { - bool exists = 1; - string origin = 2; - string fingerprint = 3; - Service service = 4; -} - -// FirstPartyCaveat defines a first party caveat -message FirstPartyCaveat { - Permissions scope = 1; - int64 exp = 2; - string cnf = 3; - string aud = 4; -} - -// ThirdPartyCaveat defines a third party caveat -message ThirdPartyCaveat { - Permissions scope = 1; - int64 exp = 2; - string cnf = 3; - string aud = 4; -} diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 08a52fee0..b7a743b3e 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package did.v1; import "did/v1/genesis.proto"; -import "did/v1/models.proto"; import "google/api/annotations.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -47,6 +46,12 @@ message QueryParamsResponse { Params params = 1; } +// QueryResolveResponse is the response type for the Query/Resolve RPC method. +message QueryResolveResponse { + // document is the DID document + Document document = 1; +} + // SyncRequest is the request type for the Sync RPC method. message SyncRequest { string did = 1; diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 917ee35a7..ccfa723d3 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -4,7 +4,6 @@ package did.v1; import "cosmos/orm/v1/orm.proto"; import "did/v1/genesis.proto"; -import "did/v1/models.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -15,7 +14,7 @@ message Alias { primary_key: {fields: "id"} index: { id: 1 - fields: "did,alias" + fields: "subject,origin" unique: true } }; @@ -23,20 +22,11 @@ message Alias { // The unique identifier of the alias string id = 1; - // The DID of the alias - string did = 2; - // The alias of the DID - string alias = 3; + string subject = 2; // Origin of the alias - string origin = 4; - - // Permissions of the alias - repeated string scopes = 5; - - // Expiration of the alias - int64 expiration = 6; + string origin = 3; } // Controller represents a Sonr DWN Vault @@ -46,16 +36,26 @@ message Controller { primary_key: {fields: "id"} index: { id: 1 - fields: "address" + fields: "sonr_address" unique: true } index: { id: 2 - fields: "vault_cid" + fields: "eth_address" unique: true } index: { id: 3 + fields: "btc_address" + unique: true + } + index: { + id: 4 + fields: "vault_cid" + unique: true + } + index: { + id: 5 fields: "status,vault_cid" unique: true } @@ -65,22 +65,28 @@ message Controller { string id = 1; // The DID of the controller - string address = 2; + string sonr_address = 2; + + // The DID of the controller + string eth_address = 3; + + // The DID of the controller + string btc_address = 4; // Aliases of the controller - repeated Alias aliases = 3; + repeated string aliases = 5; // PubKey is the verification method - PubKey public_key = 4; + PubKey public_key = 6; // The vault address or identifier - string vault_cid = 5; + string vault_cid = 7; // The Authentications of the controller - repeated Credential authentication = 6; + repeated string authentication = 8; // The Status of the claims for the controller - string status = 7; + string status = 9; } // Verification reprsents a method of verifying membership in a DID @@ -90,7 +96,17 @@ message Verification { primary_key: {fields: "id"} index: { id: 1 - fields: "controller,method,issuer,subject" + fields: "issuer,subject" + unique: true + } + index: { + id: 2 + fields: "controller,did_method,issuer" + unique: true + } + index: { + id: 3 + fields: "verification_type,subject,issuer" unique: true } }; @@ -102,7 +118,7 @@ message Verification { string controller = 2; // The DIDNamespace of the verification - DIDNamespace method = 3; + string did_method = 3; // The value of the linked identifier string issuer = 4; @@ -113,6 +129,6 @@ message Verification { // The public key of the verification PubKey public_key = 6; - // The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) - string kind = 7; + // The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + string verification_type = 7; } diff --git a/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index a17dd13f7..5b832fb3e 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -5,7 +5,6 @@ package did.v1; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "did/v1/genesis.proto"; -import "did/v1/models.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -77,7 +76,7 @@ message MsgAllocateVaultResponse { int64 expiry_block = 2; // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn - string registration_options = 3; + string token = 3; // IsLocalhost is a flag to indicate if the vault is localhost bool localhost = 4; @@ -123,7 +122,7 @@ message MsgAuthorizeService { string origin = 2; // Permissions is the scope of the service. - Permissions scopes = 3; + map permissions = 3; // token is the macron token to authenticate the operation. string token = 4; diff --git a/web/main.go b/web/main.go deleted file mode 100644 index 54f548981..000000000 --- a/web/main.go +++ /dev/null @@ -1,16 +0,0 @@ -//go:build wasm - -package main - -import ( - "github.com/syumai/workers" -) - -// # Sonr.ID -// -// This App is used as an IPFS gateway proxy for exissting Sonr DWN nodes -func main() { - // TODO: Route from /ipfs/cid and /ipns/did to the gateway - // Configure the server - workers.Serve(nil) -} diff --git a/web/src/main.go b/web/src/main.go new file mode 100644 index 000000000..486f8165a --- /dev/null +++ b/web/src/main.go @@ -0,0 +1,25 @@ +//go:build wasm + +package main + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/web/src/pages" + "github.com/syumai/workers" +) + +// # Sonr.ID +// +// This App is used as an IPFS gateway proxy for exissting Sonr DWN nodes +func main() { + // TODO: Route from /ipfs/cid and /ipns/did to the gateway + // 1. Display Generic Homepage + e := echo.New() + // Configure the server + e.GET("/", pages.HomeView) + e.GET("/allocate", pages.AllocateView) + // 2. Present Terms Agreement and Checkbox to Accept + // 3. Collect UserAgent, Set-Cookie, and Client Headers + // 4. Redirect to DWN Node + workers.Serve(e) +} diff --git a/web/src/pages/allocate.templ b/web/src/pages/allocate.templ new file mode 100644 index 000000000..7408e17fc --- /dev/null +++ b/web/src/pages/allocate.templ @@ -0,0 +1,20 @@ +package pages + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/dwn/front/blocks" +) + +func AllocateView(c echo.Context) error { + return echoComponentResponse(c, renderAuthorizeView()) +} + +templ renderAuthorizeView() { + @blocks.Layout("Login | Sonr.ID") { + @blocks.Card("authorize-view", blocks.SizeMedium) { + @blocks.H1("Sonr.ID") + @blocks.Text("Neo-tree is a file manager for NeoFS.") + } + } +} + diff --git a/web/src/pages/allocate_templ.go b/web/src/pages/allocate_templ.go new file mode 100644 index 000000000..a914ab84b --- /dev/null +++ b/web/src/pages/allocate_templ.go @@ -0,0 +1,90 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package pages + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/dwn/front/blocks" +) + +func AllocateView(c echo.Context) error { + return echoComponentResponse(c, renderAuthorizeView()) +} + +func renderAuthorizeView() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = blocks.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.Card("authorize-view", blocks.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.Layout("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/web/src/pages/home.templ b/web/src/pages/home.templ new file mode 100644 index 000000000..3da6a5bdb --- /dev/null +++ b/web/src/pages/home.templ @@ -0,0 +1,30 @@ +package pages + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/dwn/front/blocks" +) + +func HomeView(c echo.Context) error { + return echoComponentResponse(c, renderHomeView()) +} + +templ renderHomeView() { + @blocks.Layout("Sonr.ID") { + @blocks.Card("home-view", blocks.SizeLarge) { + @blocks.H1("Sonr.ID") + @blocks.Text("A Decentralized Web Node Client for the Sonr Network.") + @blocks.Spacer() +
+ @blocks.Button(blocks.GET("/register", "#home-view"), blocks.PrimaryButtonStyle()) { + @blocks.Text("Get Started") + } + @blocks.Button(blocks.GET("/login", "#home-view")) { + @blocks.Text("Login") + } +
+ @blocks.PoweredBySonr() + } + } +} + diff --git a/web/src/pages/home_templ.go b/web/src/pages/home_templ.go new file mode 100644 index 000000000..68d6bb306 --- /dev/null +++ b/web/src/pages/home_templ.go @@ -0,0 +1,154 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package pages + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/dwn/front/blocks" +) + +func HomeView(c echo.Context) error { + return echoComponentResponse(c, renderHomeView()) +} + +func renderHomeView() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = blocks.Text("A Decentralized Web Node Client for the Sonr Network.").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = blocks.Text("Get Started").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.Button(blocks.GET("/register", "#home-view"), blocks.PrimaryButtonStyle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = blocks.Text("Login").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.Button(blocks.GET("/login", "#home-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = blocks.PoweredBySonr().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.Card("home-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.Layout("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/web/src/pages/pages.go b/web/src/pages/pages.go new file mode 100644 index 000000000..fe5c5f248 --- /dev/null +++ b/web/src/pages/pages.go @@ -0,0 +1,27 @@ +package pages + +import ( + "bytes" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" +) + +// render renders a templ.Component +func echoComponentResponse(c echo.Context, cmp templ.Component) error { + // Create a buffer to store the rendered HTML + buf := &bytes.Buffer{} + + // Render the component to the buffer + err := cmp.Render(c.Request().Context(), buf) + if err != nil { + return err + } + + // Set the content type + c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) + + // Write the buffered content to the response + _, err = c.Response().Write(buf.Bytes()) + return err +} diff --git a/x/did/builder/api.go b/x/did/builder/api.go deleted file mode 100644 index 115b02cdd..000000000 --- a/x/did/builder/api.go +++ /dev/null @@ -1,226 +0,0 @@ -package builder - -import ( - "encoding/base64" - "fmt" - - "github.com/go-webauthn/webauthn/protocol" - - "github.com/go-webauthn/webauthn/protocol/webauthncose" - didv1 "github.com/onsonr/sonr/api/did/v1" - "github.com/onsonr/sonr/x/did/types" -) - -func APIFormatDIDNamespace(namespace types.DIDNamespace) didv1.DIDNamespace { - return didv1.DIDNamespace(namespace) -} - -func APIFormatDIDNamespaces(namespaces []types.DIDNamespace) []didv1.DIDNamespace { - var s []didv1.DIDNamespace - for _, namespace := range namespaces { - s = append(s, APIFormatDIDNamespace(namespace)) - } - return s -} - -func APIFormatKeyRole(role types.KeyRole) didv1.KeyRole { - return didv1.KeyRole(role) -} - -func APIFormatKeyAlgorithm(algorithm types.KeyAlgorithm) didv1.KeyAlgorithm { - return didv1.KeyAlgorithm(algorithm) -} - -func APIFormatKeyEncoding(encoding types.KeyEncoding) didv1.KeyEncoding { - return didv1.KeyEncoding(encoding) -} - -func APIFormatKeyCurve(curve types.KeyCurve) didv1.KeyCurve { - return didv1.KeyCurve(curve) -} - -func APIFormatKeyType(keyType types.KeyType) didv1.KeyType { - return didv1.KeyType(keyType) -} - -func APIFormatPermissions(permissions *types.Permissions) *didv1.Permissions { - if permissions == nil { - return nil - } - p := didv1.Permissions{ - Grants: APIFormatDIDNamespaces(permissions.Grants), - Scopes: APIFormatPermissionScopes(permissions.Scopes), - } - return &p -} - -func APIFormatPermissionScope(scope types.PermissionScope) didv1.PermissionScope { - return didv1.PermissionScope(scope) -} - -func APIFormatPermissionScopes(scopes []types.PermissionScope) []didv1.PermissionScope { - var s []didv1.PermissionScope - for _, scope := range scopes { - s = append(s, APIFormatPermissionScope(scope)) - } - return s -} - -func APIFormatPubKeyJWK(jwk *types.PubKey_JWK) *didv1.PubKey_JWK { - return &didv1.PubKey_JWK{ - Kty: jwk.Kty, - Crv: jwk.Crv, - X: jwk.X, - Y: jwk.Y, - N: jwk.N, - E: jwk.E, - } -} - -func APIFormatPubKey(key *types.PubKey) *didv1.PubKey { - return &didv1.PubKey{ - Role: APIFormatKeyRole(key.GetRole()), - Algorithm: APIFormatKeyAlgorithm(key.GetAlgorithm()), - Encoding: APIFormatKeyEncoding(key.GetEncoding()), - Curve: APIFormatKeyCurve(key.GetCurve()), - KeyType: APIFormatKeyType(key.GetKeyType()), - Raw: key.GetRaw(), - } -} - -func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*types.PubKey_JWK, error) { - curve, err := GetCOSECurveName(key.Curve) - if err != nil { - return nil, err - } - - jwkMap := map[string]interface{}{ - "kty": "EC", - "crv": curve, - "x": base64.RawURLEncoding.EncodeToString(key.XCoord), - "y": base64.RawURLEncoding.EncodeToString(key.YCoord), - } - - return MapToJWK(jwkMap) -} - -func FormatRSAPublicKey(key *webauthncose.RSAPublicKeyData) (*types.PubKey_JWK, error) { - jwkMap := map[string]interface{}{ - "kty": "RSA", - "n": base64.RawURLEncoding.EncodeToString(key.Modulus), - "e": base64.RawURLEncoding.EncodeToString(key.Exponent), - } - - return MapToJWK(jwkMap) -} - -func FormatOKPPublicKey(key *webauthncose.OKPPublicKeyData) (*types.PubKey_JWK, error) { - curve, err := GetOKPCurveName(key.Curve) - if err != nil { - return nil, err - } - - jwkMap := map[string]interface{}{ - "kty": "OKP", - "crv": curve, - "x": base64.RawURLEncoding.EncodeToString(key.XCoord), - } - - return MapToJWK(jwkMap) -} - -func MapToJWK(m map[string]interface{}) (*types.PubKey_JWK, error) { - jwk := &types.PubKey_JWK{} - for k, v := range m { - switch k { - case "kty": - jwk.Kty = v.(string) - case "crv": - jwk.Crv = v.(string) - case "x": - jwk.X = v.(string) - case "y": - jwk.Y = v.(string) - case "n": - jwk.N = v.(string) - case "e": - jwk.E = v.(string) - } - } - return jwk, nil -} - -func GetCOSECurveName(curveID int64) (string, error) { - switch curveID { - case int64(webauthncose.P256): - return "P-256", nil - case int64(webauthncose.P384): - return "P-384", nil - case int64(webauthncose.P521): - return "P-521", nil - default: - return "", fmt.Errorf("unknown curve ID: %d", curveID) - } -} - -func GetOKPCurveName(curveID int64) (string, error) { - switch curveID { - case int64(webauthncose.Ed25519): - return "Ed25519", nil - default: - return "", fmt.Errorf("unknown OKP curve ID: %d", curveID) - } -} - -// NormalizeTransports returns the transports as strings -func NormalizeTransports(transports []protocol.AuthenticatorTransport) []string { - tss := make([]string, len(transports)) - for i, t := range transports { - tss[i] = string(t) - } - return tss -} - -// GetTransports returns the protocol.AuthenticatorTransport -func ModuleTransportsToProtocol(transport []string) []protocol.AuthenticatorTransport { - tss := make([]protocol.AuthenticatorTransport, len(transport)) - for i, t := range transport { - tss[i] = protocol.AuthenticatorTransport(t) - } - return tss -} - -func ModuleFormatAPIPermissions(permissions *didv1.Permissions) *types.Permissions { - if permissions == nil { - return nil - } - p := types.Permissions{ - Grants: ModuleFormatAPIDIDNamespaces(permissions.Grants), - Scopes: ModuleFormatAPIPermissionScopes(permissions.Scopes), - } - return &p -} - -func ModuleFormatAPIPermissionScope(scope didv1.PermissionScope) types.PermissionScope { - return types.PermissionScope(scope) -} - -func ModuleFormatAPIPermissionScopes(scopes []didv1.PermissionScope) []types.PermissionScope { - var s []types.PermissionScope - for _, scope := range scopes { - s = append(s, ModuleFormatAPIPermissionScope(scope)) - } - return s -} - -func ModuleFormatAPIDIDNamespace(namespace didv1.DIDNamespace) types.DIDNamespace { - return types.DIDNamespace(namespace) -} - -func ModuleFormatAPIDIDNamespaces(namespaces []didv1.DIDNamespace) []types.DIDNamespace { - var s []types.DIDNamespace - for _, namespace := range namespaces { - s = append(s, ModuleFormatAPIDIDNamespace(namespace)) - } - return s -} diff --git a/x/did/builder/macroon.go b/x/did/builder/macroon.go deleted file mode 100644 index aacdbfb2a..000000000 --- a/x/did/builder/macroon.go +++ /dev/null @@ -1,48 +0,0 @@ -package builder - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "gopkg.in/macaroon.v2" - - "gopkg.in/macaroon-bakery.v2/bakery/checkers" -) - -var PermissionNamespace *checkers.Namespace - -func ValidateMacaroonMiddleware(secretKey []byte, location string) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - // Extract the macaroon from the Authorization header - auth := c.Request().Header.Get("Authorization") - if auth == "" { - return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Missing Authorization header"}) - } - - // Decode the macaroon - mac, err := macaroon.Base64Decode([]byte(auth)) - if err != nil { - return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon encoding"}) - } - - token, err := macaroon.New(secretKey, mac, location, macaroon.LatestVersion) - if err != nil { - return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon"}) - } - - // Verify the macaroon - err = token.Verify(secretKey, func(caveat string) error { - // Implement your caveat verification logic here - // For example, you might check if the caveat is still valid (e.g., not expired) - return nil // Return nil if the caveat is valid - }, nil) - if err != nil { - return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"}) - } - - // Macaroon is valid, proceed to the next handler - return next(c) - } - } -} diff --git a/x/did/builder/openid.go b/x/did/builder/openid.go deleted file mode 100644 index cd39cda9a..000000000 --- a/x/did/builder/openid.go +++ /dev/null @@ -1,22 +0,0 @@ -package builder - -// -// func GetDiscovery(origin string) *types.DiscoveryDocument { -// baseURL := "https://" + origin // Ensure this is the correct base URL for your service -// discoveryDoc := &types.DiscoveryDocument{ -// Issuer: baseURL, -// AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), -// TokenEndpoint: fmt.Sprintf("%s/token", baseURL), -// UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), -// JwksUri: fmt.Sprintf("%s/jwks", baseURL), -// RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), -// ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, -// ResponseTypesSupported: []string{"code"}, -// ResponseModesSupported: []string{"query", "form_post"}, -// GrantTypesSupported: []string{"authorization_code", "refresh_token"}, -// AcrValuesSupported: []string{"passkey"}, -// SubjectTypesSupported: []string{"public"}, -// ClaimsSupported: []string{"sub", "iss", "name", "email"}, -// } -// return discoveryDoc -// } diff --git a/x/did/builder/options.go b/x/did/builder/options.go deleted file mode 100644 index 828af608e..000000000 --- a/x/did/builder/options.go +++ /dev/null @@ -1,82 +0,0 @@ -package builder - -import ( - "encoding/json" - - "github.com/onsonr/sonr/x/did/types" -) - -type AuthenticatorResponse struct { - // From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson - // This attribute contains a JSON serialization of the client data passed to the authenticator - // by the client in its call to either create() or get(). - ClientDataJSON URLEncodedBase64 `json:"clientDataJSON"` -} - -type AuthenticatorAttestationResponse struct { - // The byte slice of clientDataJSON, which becomes CollectedClientData - AuthenticatorResponse - - Transports []string `json:"transports,omitempty"` - - AuthenticatorData URLEncodedBase64 `json:"authenticatorData"` - - PublicKey URLEncodedBase64 `json:"publicKey"` - - PublicKeyAlgorithm int64 `json:"publicKeyAlgorithm"` - - // AttestationObject is the byte slice version of attestationObject. - // This attribute contains an attestation object, which is opaque to, and - // cryptographically protected against tampering by, the client. The - // attestation object contains both authenticator data and an attestation - // statement. The former contains the AAGUID, a unique credential ID, and - // the credential public key. The contents of the attestation statement are - // determined by the attestation statement format used by the authenticator. - // It also contains any additional information that the Relying Party's server - // requires to validate the attestation statement, as well as to decode and - // validate the authenticator data along with the JSON-serialized client data. - AttestationObject URLEncodedBase64 `json:"attestationObject"` -} - -type PublicKeyCredentialCreationOptions struct { - RelyingParty RelyingPartyEntity `json:"rp"` - User UserEntity `json:"user"` - Challenge URLEncodedBase64 `json:"challenge"` - Parameters []CredentialParameter `json:"pubKeyCredParams,omitempty"` - Timeout int `json:"timeout,omitempty"` - CredentialExcludeList []CredentialDescriptor `json:"excludeCredentials,omitempty"` - AuthenticatorSelection AuthenticatorSelection `json:"authenticatorSelection,omitempty"` - Hints []PublicKeyCredentialHints `json:"hints,omitempty"` - Attestation ConveyancePreference `json:"attestation,omitempty"` - AttestationFormats []AttestationFormat `json:"attestationFormats,omitempty"` - Extensions AuthenticationExtensions `json:"extensions,omitempty"` -} - -func GetPublicKeyCredentialCreationOptions(origin string, subject string, vaultCID string, params *types.Params) (*PublicKeyCredentialCreationOptions, error) { - chal, err := CreateChallenge() - if err != nil { - return nil, err - } - return &PublicKeyCredentialCreationOptions{ - RelyingParty: NewRelayingParty(origin, subject), - User: NewUserEntity(subject, subject, vaultCID), - Parameters: ExtractCredentialParameters(params), - Timeout: 20, - CredentialExcludeList: nil, - Challenge: chal, - AuthenticatorSelection: AuthenticatorSelection{}, - Hints: nil, - Attestation: ExtractConveyancePreference(params), - AttestationFormats: ExtractAttestationFormats(params), - Extensions: nil, - }, nil -} - -func UnmarshalAuthenticatorResponse(data []byte) (*AuthenticatorResponse, error) { - var ar AuthenticatorResponse - err := json.Unmarshal(data, &ar) - if err != nil { - return nil, err - } - return &ar, nil -} diff --git a/x/did/builder/pubkey.go b/x/did/builder/pubkey.go deleted file mode 100644 index f53f6ff9a..000000000 --- a/x/did/builder/pubkey.go +++ /dev/null @@ -1,81 +0,0 @@ -package builder - -import ( - "fmt" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - didv1 "github.com/onsonr/sonr/api/did/v1" - "github.com/onsonr/sonr/x/did/types" - - "github.com/go-webauthn/webauthn/protocol/webauthncose" -) - -// PublicKey is an interface for a public key -type PublicKey interface { - cryptotypes.PubKey - Clone() cryptotypes.PubKey - GetRaw() []byte - GetRole() types.KeyRole - GetAlgorithm() types.KeyAlgorithm - GetEncoding() types.KeyEncoding - GetCurve() types.KeyCurve - GetKeyType() types.KeyType -} - -// CreateAuthnVerification creates a new verification method for an authn method -func CreateAuthnVerification(namespace types.DIDNamespace, issuer string, controller string, pubkey *types.PubKey, identifier string) *types.Verification { - return &types.Verification{ - Method: namespace, - Controller: controller, - PublicKey: pubkey, - Id: identifier, - Issuer: issuer, - } -} - -// CreateWalletVerification creates a new verification method for a wallet -func CreateWalletVerification(namespace types.DIDNamespace, controller string, pubkey *types.PubKey, identifier string) *didv1.Verification { - return &didv1.Verification{ - Method: APIFormatDIDNamespace(namespace), - Controller: controller, - PublicKey: APIFormatPubKey(pubkey), - Id: identifier, - } -} - -// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation -func ExtractWebAuthnPublicKey(keyBytes []byte) (*types.PubKey_JWK, error) { - key, err := webauthncose.ParsePublicKey(keyBytes) - if err != nil { - return nil, fmt.Errorf("failed to parse public key: %w", err) - } - - switch k := key.(type) { - case *webauthncose.EC2PublicKeyData: - return FormatEC2PublicKey(k) - case *webauthncose.RSAPublicKeyData: - return FormatRSAPublicKey(k) - case *webauthncose.OKPPublicKeyData: - return FormatOKPPublicKey(k) - default: - return nil, fmt.Errorf("unsupported key type") - } -} - -// NewInitialWalletAccounts creates a new set of verification methods for a wallet -func NewInitialWalletAccounts(controller string, pubkey *types.PubKey) ([]*didv1.Verification, error) { - var verificationMethods []*didv1.Verification - for method, chain := range types.InitialChainCodes { - nk, err := computeBip32AccountPublicKey(pubkey, chain, 0) - if err != nil { - return nil, err - } - - addr, err := chain.FormatAddress(nk) - if err != nil { - return nil, nil - } - verificationMethods = append(verificationMethods, CreateWalletVerification(method, controller, nk, method.FormatDID(addr))) - } - return verificationMethods, nil -} diff --git a/x/did/builder/scopes.go b/x/did/builder/scopes.go deleted file mode 100644 index 2635d6204..000000000 --- a/x/did/builder/scopes.go +++ /dev/null @@ -1,56 +0,0 @@ -package builder - -import ( - "github.com/onsonr/sonr/x/did/types" - "gopkg.in/macaroon-bakery.v2/bakery/checkers" -) - -var ( - GenericPermissionScopeStrings = [...]string{ - "profile.name", - "identifiers.email", - "identifiers.phone", - "transactions.read", - "transactions.write", - "wallets.read", - "wallets.create", - "wallets.subscribe", - "wallets.update", - "transactions.verify", - "transactions.broadcast", - "admin.user", - "admin.validator", - } - - StringToModulePermissionScope = map[string]types.PermissionScope{ - "PERMISSION_SCOPE_UNSPECIFIED": types.PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, - "PERMISSION_SCOPE_BASIC_INFO": types.PermissionScope_PERMISSION_SCOPE_BASIC_INFO, - "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": types.PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ, - "PERMISSION_SCOPE_IDENTIFIERS_PHONE": types.PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE, - "PERMISSION_SCOPE_TRANSACTIONS_READ": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ, - "PERMISSION_SCOPE_TRANSACTIONS_WRITE": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE, - "PERMISSION_SCOPE_WALLETS_READ": types.PermissionScope_PERMISSION_SCOPE_WALLETS_READ, - "PERMISSION_SCOPE_WALLETS_CREATE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE, - "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE, - "PERMISSION_SCOPE_WALLETS_UPDATE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE, - "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY, - "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST, - "PERMISSION_SCOPE_ADMIN_USER": types.PermissionScope_PERMISSION_SCOPE_ADMIN_USER, - "PERMISSION_SCOPE_ADMIN_VALIDATOR": types.PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, - } -) - -func ResolvePermissionScope(scope string) (types.PermissionScope, bool) { - uriToPrefix := make(map[string]string) - for _, scope := range GenericPermissionScopeStrings { - uriToPrefix["https://example.com/auth/"+scope] = scope - } - PermissionNamespace := checkers.NewNamespace(uriToPrefix) - - prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope) - if !ok { - return 0, false - } - permScope, ok := StringToModulePermissionScope[prefix] - return permScope, ok -} diff --git a/x/did/builder/service.go b/x/did/builder/service.go deleted file mode 100644 index b5e33a96f..000000000 --- a/x/did/builder/service.go +++ /dev/null @@ -1,103 +0,0 @@ -package builder - -import ( - "crypto/rand" - "strings" - - "github.com/onsonr/sonr/x/did/types" -) - -// ChallengeLength - Length of bytes to generate for a challenge. -const ChallengeLength = 32 - -// CreateChallenge creates a new challenge that should be signed and returned by the authenticator. The spec recommends -// using at least 16 bytes with 100 bits of entropy. We use 32 bytes. -func CreateChallenge() (challenge URLEncodedBase64, err error) { - challenge = make([]byte, ChallengeLength) - - if _, err = rand.Read(challenge); err != nil { - return nil, err - } - - return challenge, nil -} - -type CredentialEntity struct { - // A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: - // - // When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, - // intended only for display. For example, "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". - // - // When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is - // intended only for display, i.e., aiding the user in determining the difference between user accounts with similar - // displayNames. For example, "alexm", "alex.p.mueller@example.com" or "+14255551234". - Name string `json:"name"` -} - -func NewCredentialEntity(name string) CredentialEntity { - return CredentialEntity{ - Name: name, - } -} - -type CredentialParameter struct { - Type CredentialType `json:"type"` - Algorithm types.COSEAlgorithmIdentifier `json:"alg"` -} - -func NewCredentialParameter(ki *types.KeyInfo) CredentialParameter { - return CredentialParameter{ - Type: CredentialTypePublicKeyCredential, - Algorithm: ki.Algorithm.CoseIdentifier(), - } -} - -func ExtractCredentialParameters(p *types.Params) []CredentialParameter { - var keys []*types.KeyInfo - for k, v := range p.AllowedPublicKeys { - if strings.Contains(k, "webauthn") { - keys = append(keys, v) - } - } - var cparams []CredentialParameter - for _, ki := range keys { - cparams = append(cparams, NewCredentialParameter(ki)) - } - return cparams -} - -type RelyingPartyEntity struct { - CredentialEntity - - // A unique identifier for the Relying Party entity, which sets the RP ID. - ID string `json:"id"` -} - -func NewRelayingParty(name string, origin string) RelyingPartyEntity { - return RelyingPartyEntity{ - CredentialEntity: NewCredentialEntity(origin), - ID: origin, - } -} - -type UserEntity struct { - CredentialEntity - // A human-palatable name for the user account, intended only for display. - // For example, "Alex P. Müller" or "田中 倫". The Relying Party SHOULD let - // the user choose this, and SHOULD NOT restrict the choice more than necessary. - DisplayName string `json:"displayName"` - - // ID is the user handle of the user account entity. To ensure secure operation, - // authentication and authorization decisions MUST be made on the basis of this id - // member, not the displayName nor name members. See Section 6.1 of - // [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266). - ID any `json:"id"` -} - -func NewUserEntity(name string, subject string, cid string) UserEntity { - return UserEntity{ - CredentialEntity: NewCredentialEntity(name), - DisplayName: subject, - ID: cid, - } -} diff --git a/x/did/builder/vault.go b/x/did/builder/vault.go deleted file mode 100644 index e647fb226..000000000 --- a/x/did/builder/vault.go +++ /dev/null @@ -1 +0,0 @@ -package builder diff --git a/x/did/builder/webauthn.go b/x/did/builder/webauthn.go deleted file mode 100644 index 098f91356..000000000 --- a/x/did/builder/webauthn.go +++ /dev/null @@ -1,169 +0,0 @@ -package builder - -import ( - "bytes" - "encoding/base64" - "reflect" - - "github.com/go-webauthn/webauthn/protocol" -) - -// Credential contains all needed information about a WebAuthn credential for storage. -type Credential struct { - Subject string `json:"handle"` - AttestationType string `json:"attestationType"` - Origin string `json:"origin"` - CredentialID []byte `json:"id"` - PublicKey []byte `json:"publicKey"` - Transport []string `json:"transport"` - SignCount uint32 `json:"signCount"` - UserPresent bool `json:"userPresent"` - UserVerified bool `json:"userVerified"` - BackupEligible bool `json:"backupEligible"` - BackupState bool `json:"backupState"` - CloneWarning bool `json:"cloneWarning"` -} - -// NewCredential will return a credential pointer on successful validation of a registration response. -func NewCredential(c *protocol.ParsedCredentialCreationData, origin, handle string) *Credential { - return &Credential{ - Subject: handle, - Origin: origin, - AttestationType: c.Response.AttestationObject.Format, - CredentialID: c.Response.AttestationObject.AuthData.AttData.CredentialID, - PublicKey: c.Response.AttestationObject.AuthData.AttData.CredentialPublicKey, - Transport: NormalizeTransports(c.Response.Transports), - SignCount: c.Response.AttestationObject.AuthData.Counter, - UserPresent: c.Response.AttestationObject.AuthData.Flags.HasUserPresent(), - UserVerified: c.Response.AttestationObject.AuthData.Flags.HasUserVerified(), - BackupEligible: c.Response.AttestationObject.AuthData.Flags.HasBackupEligible(), - BackupState: c.Response.AttestationObject.AuthData.Flags.HasAttestedCredentialData(), - } -} - -// Descriptor converts a Credential into a protocol.CredentialDescriptor. -func (c *Credential) Descriptor() protocol.CredentialDescriptor { - return protocol.CredentialDescriptor{ - Type: protocol.PublicKeyCredentialType, - CredentialID: c.CredentialID, - Transport: ModuleTransportsToProtocol(c.Transport), - AttestationType: c.AttestationType, - } -} - -// This is a signal that the authenticator may be cloned, see CloneWarning above for more information. -func (a *Credential) UpdateCounter(authDataCount uint32) { - if authDataCount <= a.SignCount && (authDataCount != 0 || a.SignCount != 0) { - a.CloneWarning = true - return - } - - a.SignCount = authDataCount -} - -type CredentialDescriptor struct { - // The valid credential types. - Type CredentialType `json:"type"` - - // CredentialID The ID of a credential to allow/disallow. - CredentialID URLEncodedBase64 `json:"id"` - - // The authenticator transports that can be used. - Transport []AuthenticatorTransport `json:"transports,omitempty"` - - // The AttestationType from the Credential. Used internally only. - AttestationType string `json:"-"` -} - -func NewCredentialDescriptor(credentialID string, transports []AuthenticatorTransport, attestationType string) *CredentialDescriptor { - return &CredentialDescriptor{ - CredentialID: URLEncodedBase64(credentialID), - Transport: transports, - AttestationType: attestationType, - Type: CredentialTypePublicKeyCredential, - } -} - -type AuthenticatorSelection struct { - // AuthenticatorAttachment If this member is present, eligible authenticators are filtered to only - // authenticators attached with the specified AuthenticatorAttachment enum. - AuthenticatorAttachment AuthenticatorAttachment `json:"authenticatorAttachment,omitempty"` - - // RequireResidentKey this member describes the Relying Party's requirements regarding resident - // credentials. If the parameter is set to true, the authenticator MUST create a client-side-resident - // public key credential source when creating a public key credential. - RequireResidentKey *bool `json:"requireResidentKey,omitempty"` - - // ResidentKey this member describes the Relying Party's requirements regarding resident - // credentials per Webauthn Level 2. - ResidentKey ResidentKeyRequirement `json:"residentKey,omitempty"` - - // UserVerification This member describes the Relying Party's requirements regarding user verification for - // the create() operation. Eligible authenticators are filtered to only those capable of satisfying this - // requirement. - UserVerification UserVerificationRequirement `json:"userVerification,omitempty"` -} - -type AuthenticatorData struct { - RPIDHash []byte `json:"rpid"` - Flags AuthenticatorFlags `json:"flags"` - Counter uint32 `json:"sign_count"` - AttData AttestedCredentialData `json:"att_data"` - ExtData []byte `json:"ext_data"` -} - -type AttestationObject struct { - // The authenticator data, including the newly created public key. See AuthenticatorData for more info - AuthData AuthenticatorData - - // The byteform version of the authenticator data, used in part for signature validation - RawAuthData []byte `json:"authData"` - - // The format of the Attestation data. - Format string `json:"fmt"` - - // The attestation statement data sent back if attestation is requested. - AttStatement map[string]any `json:"attStmt,omitempty"` -} - -type URLEncodedBase64 []byte - -func (e URLEncodedBase64) String() string { - return base64.RawURLEncoding.EncodeToString(e) -} - -// UnmarshalJSON base64 decodes a URL-encoded value, storing the result in the -// provided byte slice. -func (e *URLEncodedBase64) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte("null")) { - return nil - } - - // Trim the leading spaces. - data = bytes.Trim(data, "\"") - - // Trim the trailing equal characters. - data = bytes.TrimRight(data, "=") - - out := make([]byte, base64.RawURLEncoding.DecodedLen(len(data))) - - n, err := base64.RawURLEncoding.Decode(out, data) - if err != nil { - return err - } - - v := reflect.ValueOf(e).Elem() - v.SetBytes(out[:n]) - - return nil -} - -// MarshalJSON base64 encodes a non URL-encoded value, storing the result in the -// provided byte slice. -func (e URLEncodedBase64) MarshalJSON() ([]byte, error) { - if e == nil { - return []byte("null"), nil - } - - return []byte(`"` + base64.RawURLEncoding.EncodeToString(e) + `"`), nil -} diff --git a/x/did/keeper/context.go b/x/did/keeper/context.go index be42a917a..0aa199bf6 100644 --- a/x/did/keeper/context.go +++ b/x/did/keeper/context.go @@ -1,7 +1,9 @@ package keeper import ( - "context" + "time" + + "github.com/ipfs/kubo/client/rpc" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/onsonr/sonr/x/did/types" @@ -14,18 +16,26 @@ type Context struct { Peer *peer.Peer } -func (k Keeper) CurrentCtx(goCtx context.Context) Context { - ctx := sdk.UnwrapSDKContext(goCtx) - peer, _ := peer.FromContext(goCtx) - return Context{SDKCtx: ctx, Peer: peer, Keeper: k} +// AverageBlockTime returns the average block time in seconds +func (c Context) AverageBlockTime() float64 { + return float64(c.SDK().BlockTime().Sub(c.SDK().BlockTime()).Seconds()) } -func (c Context) Params() *types.Params { - return c.Keeper.GetParams(c.SDK()) +// GetExpirationBlockHeight returns the block height at which the given duration will have passed +func (c Context) CalculateExpiration(duration time.Duration) int64 { + return c.SDKCtx.BlockHeight() + int64(duration.Seconds()/c.AverageBlockTime()) } -func (c Context) SDK() sdk.Context { - return c.SDKCtx +// IPFSConnected returns true if the IPFS client is initialized +func (c Context) IPFSConnected() bool { + if c.Keeper.ipfsClient == nil { + ipfsClient, err := rpc.NewLocalApi() + if err != nil { + return false + } + c.Keeper.ipfsClient = ipfsClient + } + return c.Keeper.ipfsClient != nil } func (c Context) IsAnonymous() bool { @@ -35,9 +45,50 @@ func (c Context) IsAnonymous() bool { return c.Peer.Addr == nil } +func (c Context) Params() *types.Params { + p, err := c.Keeper.Params.Get(c.SDK()) + if err != nil { + p = types.DefaultParams() + } + params := p.ActiveParams(c.IPFSConnected()) + return ¶ms +} + func (c Context) PeerID() string { if c.Peer == nil { return "" } return c.Peer.Addr.String() } + +func (c Context) SDK() sdk.Context { + return c.SDKCtx +} + +// ValidateOrigin checks if a service origin is valid +func (c Context) ValidateOrigin(origin string) error { + if origin == "localhost" { + return nil + } + return types.ErrInvalidServiceOrigin +} + +// VerifyMinimumStake checks if a validator has a minimum stake +func (c Context) VerifyMinimumStake(addr string) bool { + address, err := sdk.AccAddressFromBech32(addr) + if err != nil { + return false + } + addval, err := sdk.ValAddressFromBech32(addr) + if err != nil { + return false + } + del, err := c.Keeper.StakingKeeper.GetDelegation(c.SDK(), address, addval) + if err != nil { + return false + } + if del.Shares.IsZero() { + return false + } + return del.Shares.IsPositive() +} diff --git a/x/did/keeper/genesis.go b/x/did/keeper/genesis.go index b727c262b..42aae121e 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -2,10 +2,11 @@ package keeper import ( "context" - "time" "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ipfs/boxo/path" + "google.golang.org/grpc/peer" "github.com/onsonr/sonr/x/did/types" ) @@ -54,22 +55,25 @@ func (k Keeper) CheckValidatorExists(ctx sdk.Context, addr string) bool { return false } -// GetAverageBlockTime returns the average block time in seconds -func (k Keeper) GetAverageBlockTime(ctx sdk.Context) float64 { - return float64(ctx.BlockTime().Sub(ctx.BlockTime()).Seconds()) -} - -// GetParams returns the module parameters. -func (k Keeper) GetParams(ctx sdk.Context) *types.Params { - p, err := k.Params.Get(ctx) +// HasPathInIPFS checks if a file is in the local IPFS node +func (k Keeper) HasPathInIPFS(ctx sdk.Context, cid string) (bool, error) { + path, err := path.NewPath(cid) if err != nil { - p = types.DefaultParams() + return false, err } - params := p.ActiveParams(k.HasIPFSConnection()) - return ¶ms + v, err := k.ipfsClient.Unixfs().Get(ctx, path) + if err != nil { + return false, err + } + + if v == nil { + return false, nil + } + return true, nil } -// GetExpirationBlockHeight returns the block height at which the given duration will have passed -func (k Keeper) GetExpirationBlockHeight(ctx sdk.Context, duration time.Duration) int64 { - return ctx.BlockHeight() + int64(duration.Seconds()/k.GetAverageBlockTime(ctx)) +func (k Keeper) UnwrapCtx(goCtx context.Context) Context { + ctx := sdk.UnwrapSDKContext(goCtx) + peer, _ := peer.FromContext(goCtx) + return Context{SDKCtx: ctx, Peer: peer, Keeper: k} } diff --git a/x/did/keeper/ipfs.go b/x/did/keeper/ipfs.go deleted file mode 100644 index 3c1bf8b0b..000000000 --- a/x/did/keeper/ipfs.go +++ /dev/null @@ -1,117 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/path" - "github.com/ipfs/kubo/client/rpc" - "github.com/ipfs/kubo/core/coreiface/options" - "github.com/onsonr/sonr/internal/vfs" -) - -// assembleInitialVault assembles the initial vault -func (k Keeper) assembleInitialVault(ctx sdk.Context) (string, int64, error) { - cnfg, err := vfs.NewDWNConfigFile("test", "test") - if err != nil { - return "", 0, err - } - fileMap := map[string]files.Node{ - "config.pkl": cnfg, - "sw.js": vfs.SWJSFile(), - "app.wasm": vfs.DWNWasmFile(), - "index.html": vfs.IndexFile(), - } - - cid, err := k.ipfsClient.Unixfs().Add(context.Background(), files.NewMapDirectory(fileMap)) - if err != nil { - return "", 0, err - } - return cid.String(), k.GetExpirationBlockHeight(ctx, time.Second*15), nil -} - -// pinInitialVault pins the initial vault to the local IPFS node -func (k Keeper) pinInitialVault(_ sdk.Context, cid string, address string) (bool, error) { - // Resolve the path - path, err := path.NewPath(cid) - if err != nil { - return false, err - } - - // 1. Initialize vault.db sqlite database in local IPFS with Mount - - // 2. Insert the InitialWalletAccounts - - // 3. Publish the path to the IPNS - _, err = k.ipfsClient.Name().Publish(context.Background(), path, options.Name.Key(address)) - if err != nil { - return false, err - } - - // 4. Insert the accounts into x/auth - - // 5. Insert the controller into state - return true, nil -} - -// GetFromIPFS gets a file from the local IPFS node -func (k Keeper) GetFromIPFS(ctx sdk.Context, cid string) (files.Directory, error) { - path, err := path.NewPath(cid) - if err != nil { - return nil, err - } - node, err := k.ipfsClient.Unixfs().Get(ctx, path) - if err != nil { - return nil, err - } - dir, ok := node.(files.Directory) - if !ok { - return nil, fmt.Errorf("retrieved node is not a directory") - } - return dir, nil -} - -// HasIPFSConnection returns true if the IPFS client is initialized -func (k *Keeper) HasIPFSConnection() bool { - if k.ipfsClient == nil { - ipfsClient, err := rpc.NewLocalApi() - if err != nil { - return false - } - k.ipfsClient = ipfsClient - } - return k.ipfsClient != nil -} - -// HasPathInIPFS checks if a file is in the local IPFS node -func (k Keeper) HasPathInIPFS(ctx sdk.Context, cid string) (bool, error) { - path, err := path.NewPath(cid) - if err != nil { - return false, err - } - v, err := k.ipfsClient.Unixfs().Get(ctx, path) - if err != nil { - return false, err - } - - if v == nil { - return false, nil - } - return true, nil -} - -// PinToIPFS pins a file to the local IPFS node -func (k Keeper) PinToIPFS(ctx sdk.Context, cid string, name string) error { - path, err := path.NewPath(cid) - if err != nil { - return err - } - err = k.ipfsClient.Pin().Add(ctx, path, options.Pin.Name(name)) - if err != nil { - return err - } - return nil -} diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index 39de55e1a..20a10ea34 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -92,26 +92,6 @@ func NewKeeper( return k } -// VerifyMinimumStake checks if a validator has a minimum stake -func (k Keeper) VerifyMinimumStake(ctx sdk.Context, addr string) bool { - address, err := sdk.AccAddressFromBech32(addr) - if err != nil { - return false - } - addval, err := sdk.ValAddressFromBech32(addr) - if err != nil { - return false - } - del, err := k.StakingKeeper.GetDelegation(ctx, address, addval) - if err != nil { - return false - } - if del.Shares.IsZero() { - return false - } - return del.Shares.IsPositive() -} - // VerifyServicePermissions checks if a service has permission func (k Keeper) VerifyServicePermissions( ctx sdk.Context, diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index 9b62f17f4..d95f04018 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -21,8 +21,8 @@ func (k Querier) Params( goCtx context.Context, req *types.QueryRequest, ) (*types.QueryParamsResponse, error) { - ctx := k.CurrentCtx(goCtx) - return &types.QueryParamsResponse{Params: k.GetParams(ctx.SDK())}, nil + ctx := k.UnwrapCtx(goCtx) + return &types.QueryParamsResponse{Params: ctx.Params()}, nil } // Resolve implements types.QueryServer. @@ -30,22 +30,12 @@ func (k Querier) Resolve( goCtx context.Context, req *types.QueryRequest, ) (*types.QueryResolveResponse, error) { - _ = k.CurrentCtx(goCtx) + _ = k.UnwrapCtx(goCtx) return &types.QueryResolveResponse{}, nil } -// Service implements types.QueryServer. -func (k Querier) Service( - goCtx context.Context, - req *types.QueryRequest, -) (*types.QueryServiceResponse, error) { - // ctx := k.CurrentCtx(goCtx) - return &types.QueryServiceResponse{}, nil -} - // Sync implements types.QueryServer. func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.SyncResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("Sync is unimplemented") return &types.SyncResponse{}, nil } diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index d05543592..1b87e9e79 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -2,13 +2,11 @@ package keeper import ( "context" - "encoding/json" "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/onsonr/sonr/x/did/builder" "github.com/onsonr/sonr/x/did/types" ) @@ -23,21 +21,6 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{k: keeper} } -// # AuthorizeService -// -// AuthorizeService implements types.MsgServer. -func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthorizeService) (*types.MsgAuthorizeServiceResponse, error) { - if ms.k.authority != msg.Controller { - return nil, errors.Wrapf( - govtypes.ErrInvalidSigner, - "invalid authority; expected %s, got %s", - ms.k.authority, - msg.Controller, - ) - } - return &types.MsgAuthorizeServiceResponse{}, nil -} - // # AllocateVault // // AllocateVault implements types.MsgServer. @@ -45,32 +28,22 @@ func (ms msgServer) AllocateVault( goCtx context.Context, msg *types.MsgAllocateVault, ) (*types.MsgAllocateVaultResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) // 1.Check if the service origin is valid - // if ms.k.IsValidServiceOrigin(ctx, msg.Origin) { - // return nil, types.ErrInvalidServiceOrigin - // } + ctx := ms.k.UnwrapCtx(goCtx) + if err := ctx.ValidateOrigin(msg.Origin); err != nil { + return nil, err + } - cid, expiryBlock, err := ms.k.assembleInitialVault(ctx) - if err != nil { - return nil, err - } - - regOpts, err := builder.GetPublicKeyCredentialCreationOptions(msg.Origin, msg.Subject, cid, ms.k.GetParams(ctx)) - if err != nil { - return nil, err - } - - // Convert to string - regOptsJSON, err := json.Marshal(regOpts) + // 2.Allocate the vault + cid, expiryBlock, err := ms.k.AssembleVault(ctx, msg.GetSubject(), msg.GetOrigin()) if err != nil { return nil, err } + // 3.Return the response return &types.MsgAllocateVaultResponse{ - ExpiryBlock: expiryBlock, - Cid: cid, - RegistrationOptions: string(regOptsJSON), + ExpiryBlock: expiryBlock, + Cid: cid, }, nil } @@ -101,6 +74,21 @@ func (ms msgServer) RegisterService( return nil, errors.Wrapf(types.ErrInvalidServiceOrigin, "invalid service origin") } +// # AuthorizeService +// +// AuthorizeService implements types.MsgServer. +func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthorizeService) (*types.MsgAuthorizeServiceResponse, error) { + if ms.k.authority != msg.Controller { + return nil, errors.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority; expected %s, got %s", + ms.k.authority, + msg.Controller, + ) + } + return &types.MsgAuthorizeServiceResponse{}, nil +} + // # UpdateParams // // UpdateParams updates the x/did module parameters. diff --git a/x/did/keeper/vault.go b/x/did/keeper/vault.go new file mode 100644 index 000000000..465599745 --- /dev/null +++ b/x/did/keeper/vault.go @@ -0,0 +1,86 @@ +package keeper + +import ( + "context" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/ipfs/boxo/files" + "github.com/ipfs/boxo/path" + "github.com/ipfs/kubo/core/coreiface/options" + "github.com/onsonr/crypto/mpc" + "github.com/onsonr/sonr/internal/vfs" +) + +type Vault struct { + FS files.Node + ValKs mpc.Share +} + +func NewVault(subject string, origin string, chainID string) (*Vault, error) { + shares, err := mpc.GenerateKeyshares() + var ( + valKs = shares[0] + usrKs = shares[1] + ) + usrKsJSON, err := usrKs.Marshal() + if err != nil { + return nil, err + } + sonrAddr, err := bech32.ConvertAndEncode("idx", valKs.GetPublicKey()) + if err != nil { + return nil, err + } + cnfg, err := vfs.NewDWNConfigFile(usrKsJSON, sonrAddr, chainID) + if err != nil { + return nil, err + } + fileMap := map[string]files.Node{ + "config.json": cnfg, + "sw.js": vfs.SWJSFile(), + "app.wasm": vfs.DWNWasmFile(), + "index.html": vfs.IndexFile(), + } + return &Vault{ + FS: files.NewMapDirectory(fileMap), + ValKs: valKs, + }, nil +} + +// AssembleVault assembles the initial vault +func (k Keeper) AssembleVault(ctx Context, subject string, origin string) (string, int64, error) { + v, err := NewVault(subject, origin, "sonr-testnet") + if err != nil { + return "", 0, err + } + cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) + if err != nil { + return "", 0, err + } + return cid.String(), ctx.CalculateExpiration(time.Second * 15), nil +} + +// PinVaultController pins the initial vault to the local IPFS node +func (k Keeper) PinVaultController(_ sdk.Context, cid string, address string) (bool, error) { + // Resolve the path + path, err := path.NewPath(cid) + if err != nil { + return false, err + } + + // 1. Initialize vault.db sqlite database in local IPFS with Mount + + // 2. Insert the InitialWalletAccounts + + // 3. Publish the path to the IPNS + _, err = k.ipfsClient.Name().Publish(context.Background(), path, options.Name.Key(address)) + if err != nil { + return false, err + } + + // 4. Insert the accounts into x/auth + + // 5. Insert the controller into state + return true, nil +} diff --git a/x/did/module.go b/x/did/module.go index 8592126a1..95e5090aa 100644 --- a/x/did/module.go +++ b/x/did/module.go @@ -10,7 +10,6 @@ import ( "cosmossdk.io/client/v2/autocli" errorsmod "cosmossdk.io/errors" - "cosmossdk.io/x/nft" nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/client" @@ -68,8 +67,7 @@ func (a AppModuleBasic) Name() string { func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(&types.GenesisState{ - GlobalIntegrity: types.DefaultGlobalIntegrity(), - Params: types.DefaultParams(), + Params: types.DefaultParams(), }) } @@ -105,11 +103,7 @@ func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, messa if err := a.keeper.Params.Set(ctx, didGenesisState.Params); err != nil { panic(err) } - nftGenesisState := nft.DefaultGenesisState() - if err := types.DefaultNFTClasses(nftGenesisState); err != nil { - panic(err) - } - a.nftKeeper.InitGenesis(ctx, nftGenesisState) + return nil } diff --git a/x/did/types/address.go b/x/did/types/address.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/did/types/address.go @@ -0,0 +1 @@ +package types diff --git a/x/did/types/codec.go b/x/did/types/codec.go index b985400f8..4755546e2 100644 --- a/x/did/types/codec.go +++ b/x/did/types/codec.go @@ -2,24 +2,17 @@ package types import ( "crypto/ecdsa" - "crypto/sha256" - "encoding/hex" "strings" - fmt "fmt" - ethcrypto "github.com/ethereum/go-ethereum/crypto" "golang.org/x/crypto/sha3" - "github.com/cosmos/btcutil/bech32" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - "github.com/mr-tron/base58/base58" - "github.com/onsonr/crypto" // this line is used by starport scaffolding # 1 ) @@ -42,7 +35,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*cryptotypes.PubKey)(nil), - &PubKey{}, + // &PubKey{}, ) registry.RegisterImplementations( @@ -55,160 +48,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -type ChainCode uint32 - -const ( - ChainCodeBTC ChainCode = 0 - ChainCodeETH ChainCode = 60 - ChainCodeIBC ChainCode = 118 - ChainCodeSNR ChainCode = 703 -) - -var InitialChainCodes = map[DIDNamespace]ChainCode{ - DIDNamespace_DID_NAMESPACE_BITCOIN: ChainCodeBTC, - DIDNamespace_DID_NAMESPACE_IBC: ChainCodeIBC, - DIDNamespace_DID_NAMESPACE_ETHEREUM: ChainCodeETH, - DIDNamespace_DID_NAMESPACE_SONR: ChainCodeSNR, -} - -func (c ChainCode) FormatAddress(pubKey *PubKey) (string, error) { - switch c { - case ChainCodeBTC: - return bech32.Encode("bc", pubKey.Bytes()) - - case ChainCodeETH: - epk, err := pubKey.ECDSA() - if err != nil { - return "", err - } - return ComputeEthAddress(*epk), nil - - case ChainCodeSNR: - return bech32.Encode("idx", pubKey.Bytes()) - - case ChainCodeIBC: - return bech32.Encode("cosmos", pubKey.Bytes()) - - } - return "", ErrUnsopportedChainCode -} - -func (n DIDNamespace) ChainCode() (uint32, error) { - switch n { - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return 0, nil - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return 64, nil - case DIDNamespace_DID_NAMESPACE_IBC: - return 118, nil - case DIDNamespace_DID_NAMESPACE_SONR: - return 703, nil - default: - return 0, fmt.Errorf("unsupported chain") - } -} - -func (n DIDNamespace) DIDMethod() string { - switch n { - case DIDNamespace_DID_NAMESPACE_IPFS: - return "ipfs" - case DIDNamespace_DID_NAMESPACE_SONR: - return "sonr" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "btcr" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "ethr" - case DIDNamespace_DID_NAMESPACE_IBC: - return "ibcr" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "webauthn" - case DIDNamespace_DID_NAMESPACE_DWN: - return "motr" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "web" - default: - return "n/a" - } -} - -func (n DIDNamespace) FormatDID(subject string) string { - return fmt.Sprintf("%s:%s", n.DIDMethod(), subject) -} - -type EncodedKey []byte - -func (e KeyEncoding) EncodeRaw(data []byte) (EncodedKey, error) { - switch e { - case KeyEncoding_KEY_ENCODING_RAW: - return data, nil - case KeyEncoding_KEY_ENCODING_HEX: - return []byte(hex.EncodeToString(data)), nil - case KeyEncoding_KEY_ENCODING_MULTIBASE: - return []byte(base58.Encode(data)), nil - default: - return nil, nil - } -} - -func (e KeyEncoding) DecodeRaw(data EncodedKey) ([]byte, error) { - switch e { - case KeyEncoding_KEY_ENCODING_RAW: - return data, nil - case KeyEncoding_KEY_ENCODING_HEX: - return hex.DecodeString(string(data)) - case KeyEncoding_KEY_ENCODING_MULTIBASE: - return base58.Decode(string(data)) - default: - return nil, nil - } -} - -type COSEAlgorithmIdentifier int - -func (k KeyAlgorithm) CoseIdentifier() COSEAlgorithmIdentifier { - switch k { - case KeyAlgorithm_KEY_ALGORITHM_ES256: - return COSEAlgorithmIdentifier(-7) - case KeyAlgorithm_KEY_ALGORITHM_ES384: - return COSEAlgorithmIdentifier(-35) - case KeyAlgorithm_KEY_ALGORITHM_ES512: - return COSEAlgorithmIdentifier(-36) - case KeyAlgorithm_KEY_ALGORITHM_EDDSA: - return COSEAlgorithmIdentifier(-8) - case KeyAlgorithm_KEY_ALGORITHM_ES256K: - return COSEAlgorithmIdentifier(-10) - default: - return COSEAlgorithmIdentifier(0) - } -} - -func (k KeyCurve) ComputePublicKey(data []byte) (*PubKey, error) { - return nil, ErrUnsupportedKeyCurve -} - -func (k *Keyshare) Equals(o crypto.MPCShare) bool { - opk := o.GetPublicKey() - if opk != nil && k.PublicKey == nil { - return false - } - return k.GetRole() == o.GetRole() -} - -func (k *Keyshare) IsUser() bool { - return k.Role == 2 -} - -func (k *Keyshare) IsValidator() bool { - return k.Role == 1 -} - -// ComputeOriginTXTRecord generates a fingerprint for a given origin -func ComputeOriginTXTRecord(origin string) string { - h := sha256.New() - h.Write([]byte(origin)) - return fmt.Sprintf("v=sonr,o=%s,p=%x", origin, h.Sum(nil)) -} - func ComputeEthAddress(pk ecdsa.PublicKey) string { // Generate Ethereum address address := ethcrypto.PubkeyToAddress(pk) diff --git a/x/did/types/coins.go b/x/did/types/coins.go deleted file mode 100644 index f5e03ab09..000000000 --- a/x/did/types/coins.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -// Coin represents a cryptocurrency -type Coin interface { - // FormatAddress formats a public key into an address - FormatAddress(pubKey []byte) (string, error) - - // GetIndex returns the coin type index - GetIndex() int64 - - // GetPath returns the coin component path - GetPath() uint32 - - // GetSymbol returns the coin symbol - GetSymbol() string - - // GetMethod returns the coin DID method - GetMethod() string - - // GetName returns the coin name - GetName() string -} - -// CoinBTCType is the coin type for BTC -const CoinBTCType = int64(0) - -// CoinETHType is the coin type for ETH -const CoinETHType = int64(60) - -// CoinSNRType is the coin type for SNR -const CoinSNRType = int64(703) diff --git a/x/did/types/genesis.go b/x/did/types/genesis.go index d2e0d5252..2a4ea7fc6 100644 --- a/x/did/types/genesis.go +++ b/x/did/types/genesis.go @@ -6,7 +6,12 @@ import ( ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" "cosmossdk.io/collections" - "cosmossdk.io/x/nft" + "github.com/onsonr/sonr/internal/orm/assettype" + "github.com/onsonr/sonr/internal/orm/keyalgorithm" + "github.com/onsonr/sonr/internal/orm/keycurve" + "github.com/onsonr/sonr/internal/orm/keyencoding" + "github.com/onsonr/sonr/internal/orm/keyrole" + "github.com/onsonr/sonr/internal/orm/keytype" ) // ParamsKey saves the current module params. @@ -36,8 +41,7 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # genesis/types/default - GlobalIntegrity: DefaultGlobalIntegrity(), - Params: DefaultParams(), + Params: DefaultParams(), } } @@ -45,20 +49,19 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # genesis/types/validate - if gs.GlobalIntegrity == nil { - return fmt.Errorf("global integrity proof is nil") - } + return gs.Params.Validate() } -// DefaultNFTClasses configures the Initial DIDNamespace NFT classes -func DefaultNFTClasses(nftGenesis *nft.GenesisState) error { - for _, n := range DIDNamespace_value { - nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass()) - } - return nil -} - +// // DefaultNFTClasses configures the Initial DIDNamespace NFT classes +// +// func DefaultNFTClasses(nftGenesis *nft.GenesisState) error { +// for _, n := range DIDNamespace_value { +// nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass()) +// } +// return nil +// } +// // DefaultParams returns default module parameters. func DefaultParams() Params { return Params{ @@ -70,16 +73,6 @@ func DefaultParams() Params { } } -// DefaultGlobalIntegrity returns the default global integrity proof -func DefaultGlobalIntegrity() *GlobalIntegrity { - return &GlobalIntegrity{ - Controller: "did:sonr:0x0", - Seed: DefaultSeedMessage(), - Accumulator: []byte{}, - Count: 0, - } -} - // DefaultSeedMessage returns the default seed message func DefaultSeedMessage() string { l1 := "The Sonr Network shall make no protocol that respects the establishment of centralized authority," @@ -97,7 +90,7 @@ func DefaultAssets() []*AssetInfo { Symbol: "BTC", Hrp: "bc", Index: 0, - AssetType: AssetType_ASSET_TYPE_NATIVE, + AssetType: assettype.Native.String(), IconUrl: "https://cdn.sonr.land/BTC.svg", }, { @@ -105,7 +98,7 @@ func DefaultAssets() []*AssetInfo { Symbol: "ETH", Hrp: "eth", Index: 64, - AssetType: AssetType_ASSET_TYPE_NATIVE, + AssetType: assettype.Native.String(), IconUrl: "https://cdn.sonr.land/ETH.svg", }, { @@ -113,76 +106,75 @@ func DefaultAssets() []*AssetInfo { Symbol: "SNR", Hrp: "idx", Index: 703, - AssetType: AssetType_ASSET_TYPE_NATIVE, + AssetType: assettype.Native.String(), IconUrl: "https://cdn.sonr.land/SNR.svg", }, } } -// DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12381. func DefaultKeyInfos() map[string]*KeyInfo { return map[string]*KeyInfo{ // Identity Key Info // Sonr Controller Key Info - From MPC "auth.dwn": { - Role: KeyRole_KEY_ROLE_INVOCATION, - Curve: KeyCurve_KEY_CURVE_P256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_MPC, + Role: keyrole.Invocation.String(), + Curve: keycurve.P256.String(), + Algorithm: keyalgorithm.Ecdsa.String(), + Encoding: keyencoding.Hex.String(), + Type: keytype.Mpc.String(), }, // Sonr Vault Shared Key Info - From Registration "auth.zk": { - Role: KeyRole_KEY_ROLE_ASSERTION, - Curve: KeyCurve_KEY_CURVE_BLS12381, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED, - Encoding: KeyEncoding_KEY_ENCODING_MULTIBASE, - Type: KeyType_KEY_TYPE_ZK, + Role: keyrole.Assertion.String(), + Curve: keycurve.Bls12381.String(), + Algorithm: keyalgorithm.Es256k.String(), + Encoding: keyencoding.Multibase.String(), + Type: keytype.Zk.String(), }, // Blockchain Key Info // Ethereum Key Info "auth.ethereum": { - Role: KeyRole_KEY_ROLE_DELEGATION, - Curve: KeyCurve_KEY_CURVE_KECCAK256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_BIP32, + Role: keyrole.Delegation.String(), + Curve: keycurve.Keccak256.String(), + Algorithm: keyalgorithm.Ecdsa.String(), + Encoding: keyencoding.Hex.String(), + Type: keytype.Bip32.String(), }, // Bitcoin/IBC Key Info "auth.bitcoin": { - Role: KeyRole_KEY_ROLE_DELEGATION, - Curve: KeyCurve_KEY_CURVE_SECP256K1, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_BIP32, + Role: keyrole.Delegation.String(), + Curve: keycurve.Secp256k1.String(), + Algorithm: keyalgorithm.Ecdsa.String(), + Encoding: keyencoding.Hex.String(), + Type: keytype.Bip32.String(), }, // Authentication Key Info // Browser based WebAuthn "webauthn.browser": { - Role: KeyRole_KEY_ROLE_AUTHENTICATION, - Curve: KeyCurve_KEY_CURVE_P256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, - Encoding: KeyEncoding_KEY_ENCODING_RAW, - Type: KeyType_KEY_TYPE_WEBAUTHN, + Role: keyrole.Authentication.String(), + Curve: keycurve.P256.String(), + Algorithm: keyalgorithm.Es256.String(), + Encoding: keyencoding.Raw.String(), + Type: keytype.Webauthn.String(), }, // FIDO U2F "webauthn.fido": { - Role: KeyRole_KEY_ROLE_AUTHENTICATION, - Curve: KeyCurve_KEY_CURVE_P256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, - Encoding: KeyEncoding_KEY_ENCODING_RAW, - Type: KeyType_KEY_TYPE_WEBAUTHN, + Role: keyrole.Authentication.String(), + Curve: keycurve.P256.String(), + Algorithm: keyalgorithm.Es256.String(), + Encoding: keyencoding.Raw.String(), + Type: keytype.Webauthn.String(), }, // Cross-Platform Passkeys "webauthn.passkey": { - Role: KeyRole_KEY_ROLE_AUTHENTICATION, - Curve: KeyCurve_KEY_CURVE_ED25519, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_EDDSA, - Encoding: KeyEncoding_KEY_ENCODING_RAW, - Type: KeyType_KEY_TYPE_WEBAUTHN, + Role: keyrole.Authentication.String(), + Curve: keycurve.Ed25519.String(), + Algorithm: keyalgorithm.Eddsa.String(), + Encoding: keyencoding.Raw.String(), + Type: keytype.Webauthn.String(), }, } } diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index b97ac7f7b..24b1d6dce 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -24,401 +24,10 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified -type AssetType int32 - -const ( - AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0 - AssetType_ASSET_TYPE_NATIVE AssetType = 1 - AssetType_ASSET_TYPE_WRAPPED AssetType = 2 - AssetType_ASSET_TYPE_STAKING AssetType = 3 - AssetType_ASSET_TYPE_POOL AssetType = 4 - AssetType_ASSET_TYPE_IBC AssetType = 5 - AssetType_ASSET_TYPE_CW20 AssetType = 6 -) - -var AssetType_name = map[int32]string{ - 0: "ASSET_TYPE_UNSPECIFIED", - 1: "ASSET_TYPE_NATIVE", - 2: "ASSET_TYPE_WRAPPED", - 3: "ASSET_TYPE_STAKING", - 4: "ASSET_TYPE_POOL", - 5: "ASSET_TYPE_IBC", - 6: "ASSET_TYPE_CW20", -} - -var AssetType_value = map[string]int32{ - "ASSET_TYPE_UNSPECIFIED": 0, - "ASSET_TYPE_NATIVE": 1, - "ASSET_TYPE_WRAPPED": 2, - "ASSET_TYPE_STAKING": 3, - "ASSET_TYPE_POOL": 4, - "ASSET_TYPE_IBC": 5, - "ASSET_TYPE_CW20": 6, -} - -func (x AssetType) String() string { - return proto.EnumName(AssetType_name, int32(x)) -} - -func (AssetType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{0} -} - -// DIDNamespace define the different namespaces of DID -type DIDNamespace int32 - -const ( - DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0 - DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1 - DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2 - DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3 - DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4 - DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5 - DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6 - DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7 - DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8 -) - -var DIDNamespace_name = map[int32]string{ - 0: "DID_NAMESPACE_UNSPECIFIED", - 1: "DID_NAMESPACE_IPFS", - 2: "DID_NAMESPACE_SONR", - 3: "DID_NAMESPACE_BITCOIN", - 4: "DID_NAMESPACE_ETHEREUM", - 5: "DID_NAMESPACE_IBC", - 6: "DID_NAMESPACE_WEBAUTHN", - 7: "DID_NAMESPACE_DWN", - 8: "DID_NAMESPACE_SERVICE", -} - -var DIDNamespace_value = map[string]int32{ - "DID_NAMESPACE_UNSPECIFIED": 0, - "DID_NAMESPACE_IPFS": 1, - "DID_NAMESPACE_SONR": 2, - "DID_NAMESPACE_BITCOIN": 3, - "DID_NAMESPACE_ETHEREUM": 4, - "DID_NAMESPACE_IBC": 5, - "DID_NAMESPACE_WEBAUTHN": 6, - "DID_NAMESPACE_DWN": 7, - "DID_NAMESPACE_SERVICE": 8, -} - -func (x DIDNamespace) String() string { - return proto.EnumName(DIDNamespace_name, int32(x)) -} - -func (DIDNamespace) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{1} -} - -// KeyAlgorithm defines the key algorithm -type KeyAlgorithm int32 - -const ( - KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0 - KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1 - KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2 - KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3 - KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4 - KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5 - KeyAlgorithm_KEY_ALGORITHM_ECDSA KeyAlgorithm = 6 -) - -var KeyAlgorithm_name = map[int32]string{ - 0: "KEY_ALGORITHM_UNSPECIFIED", - 1: "KEY_ALGORITHM_ES256", - 2: "KEY_ALGORITHM_ES384", - 3: "KEY_ALGORITHM_ES512", - 4: "KEY_ALGORITHM_EDDSA", - 5: "KEY_ALGORITHM_ES256K", - 6: "KEY_ALGORITHM_ECDSA", -} - -var KeyAlgorithm_value = map[string]int32{ - "KEY_ALGORITHM_UNSPECIFIED": 0, - "KEY_ALGORITHM_ES256": 1, - "KEY_ALGORITHM_ES384": 2, - "KEY_ALGORITHM_ES512": 3, - "KEY_ALGORITHM_EDDSA": 4, - "KEY_ALGORITHM_ES256K": 5, - "KEY_ALGORITHM_ECDSA": 6, -} - -func (x KeyAlgorithm) String() string { - return proto.EnumName(KeyAlgorithm_name, int32(x)) -} - -func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{2} -} - -// KeyCurve defines the key curve -type KeyCurve int32 - -const ( - KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0 - KeyCurve_KEY_CURVE_P256 KeyCurve = 1 - KeyCurve_KEY_CURVE_P384 KeyCurve = 2 - KeyCurve_KEY_CURVE_P521 KeyCurve = 3 - KeyCurve_KEY_CURVE_X25519 KeyCurve = 4 - KeyCurve_KEY_CURVE_X448 KeyCurve = 5 - KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6 - KeyCurve_KEY_CURVE_ED448 KeyCurve = 7 - KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8 - KeyCurve_KEY_CURVE_BLS12381 KeyCurve = 9 - KeyCurve_KEY_CURVE_KECCAK256 KeyCurve = 10 -) - -var KeyCurve_name = map[int32]string{ - 0: "KEY_CURVE_UNSPECIFIED", - 1: "KEY_CURVE_P256", - 2: "KEY_CURVE_P384", - 3: "KEY_CURVE_P521", - 4: "KEY_CURVE_X25519", - 5: "KEY_CURVE_X448", - 6: "KEY_CURVE_ED25519", - 7: "KEY_CURVE_ED448", - 8: "KEY_CURVE_SECP256K1", - 9: "KEY_CURVE_BLS12381", - 10: "KEY_CURVE_KECCAK256", -} - -var KeyCurve_value = map[string]int32{ - "KEY_CURVE_UNSPECIFIED": 0, - "KEY_CURVE_P256": 1, - "KEY_CURVE_P384": 2, - "KEY_CURVE_P521": 3, - "KEY_CURVE_X25519": 4, - "KEY_CURVE_X448": 5, - "KEY_CURVE_ED25519": 6, - "KEY_CURVE_ED448": 7, - "KEY_CURVE_SECP256K1": 8, - "KEY_CURVE_BLS12381": 9, - "KEY_CURVE_KECCAK256": 10, -} - -func (x KeyCurve) String() string { - return proto.EnumName(KeyCurve_name, int32(x)) -} - -func (KeyCurve) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{3} -} - -// KeyEncoding defines the key encoding -type KeyEncoding int32 - -const ( - KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0 - KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1 - KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2 - KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3 -) - -var KeyEncoding_name = map[int32]string{ - 0: "KEY_ENCODING_UNSPECIFIED", - 1: "KEY_ENCODING_RAW", - 2: "KEY_ENCODING_HEX", - 3: "KEY_ENCODING_MULTIBASE", -} - -var KeyEncoding_value = map[string]int32{ - "KEY_ENCODING_UNSPECIFIED": 0, - "KEY_ENCODING_RAW": 1, - "KEY_ENCODING_HEX": 2, - "KEY_ENCODING_MULTIBASE": 3, -} - -func (x KeyEncoding) String() string { - return proto.EnumName(KeyEncoding_name, int32(x)) -} - -func (KeyEncoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{4} -} - -// KeyRole defines the kind of key -type KeyRole int32 - -const ( - KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0 - KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1 - KeyRole_KEY_ROLE_ASSERTION KeyRole = 2 - KeyRole_KEY_ROLE_DELEGATION KeyRole = 3 - KeyRole_KEY_ROLE_INVOCATION KeyRole = 4 -) - -var KeyRole_name = map[int32]string{ - 0: "KEY_ROLE_UNSPECIFIED", - 1: "KEY_ROLE_AUTHENTICATION", - 2: "KEY_ROLE_ASSERTION", - 3: "KEY_ROLE_DELEGATION", - 4: "KEY_ROLE_INVOCATION", -} - -var KeyRole_value = map[string]int32{ - "KEY_ROLE_UNSPECIFIED": 0, - "KEY_ROLE_AUTHENTICATION": 1, - "KEY_ROLE_ASSERTION": 2, - "KEY_ROLE_DELEGATION": 3, - "KEY_ROLE_INVOCATION": 4, -} - -func (x KeyRole) String() string { - return proto.EnumName(KeyRole_name, int32(x)) -} - -func (KeyRole) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{5} -} - -// KeyType defines the key type -type KeyType int32 - -const ( - KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0 - KeyType_KEY_TYPE_OCTET KeyType = 1 - KeyType_KEY_TYPE_ELLIPTIC KeyType = 2 - KeyType_KEY_TYPE_RSA KeyType = 3 - KeyType_KEY_TYPE_SYMMETRIC KeyType = 4 - KeyType_KEY_TYPE_HMAC KeyType = 5 - KeyType_KEY_TYPE_MPC KeyType = 6 - KeyType_KEY_TYPE_ZK KeyType = 7 - KeyType_KEY_TYPE_WEBAUTHN KeyType = 8 - KeyType_KEY_TYPE_BIP32 KeyType = 9 -) - -var KeyType_name = map[int32]string{ - 0: "KEY_TYPE_UNSPECIFIED", - 1: "KEY_TYPE_OCTET", - 2: "KEY_TYPE_ELLIPTIC", - 3: "KEY_TYPE_RSA", - 4: "KEY_TYPE_SYMMETRIC", - 5: "KEY_TYPE_HMAC", - 6: "KEY_TYPE_MPC", - 7: "KEY_TYPE_ZK", - 8: "KEY_TYPE_WEBAUTHN", - 9: "KEY_TYPE_BIP32", -} - -var KeyType_value = map[string]int32{ - "KEY_TYPE_UNSPECIFIED": 0, - "KEY_TYPE_OCTET": 1, - "KEY_TYPE_ELLIPTIC": 2, - "KEY_TYPE_RSA": 3, - "KEY_TYPE_SYMMETRIC": 4, - "KEY_TYPE_HMAC": 5, - "KEY_TYPE_MPC": 6, - "KEY_TYPE_ZK": 7, - "KEY_TYPE_WEBAUTHN": 8, - "KEY_TYPE_BIP32": 9, -} - -func (x KeyType) String() string { - return proto.EnumName(KeyType_name, int32(x)) -} - -func (KeyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{6} -} - -type KeyshareRole int32 - -const ( - KeyshareRole_KEYSHARE_ROLE_UNSPECIFIED KeyshareRole = 0 - KeyshareRole_KEYSHARE_ROLE_USER KeyshareRole = 1 - KeyshareRole_KEYSHARE_ROLE_VALIDATOR KeyshareRole = 2 -) - -var KeyshareRole_name = map[int32]string{ - 0: "KEYSHARE_ROLE_UNSPECIFIED", - 1: "KEYSHARE_ROLE_USER", - 2: "KEYSHARE_ROLE_VALIDATOR", -} - -var KeyshareRole_value = map[string]int32{ - "KEYSHARE_ROLE_UNSPECIFIED": 0, - "KEYSHARE_ROLE_USER": 1, - "KEYSHARE_ROLE_VALIDATOR": 2, -} - -func (x KeyshareRole) String() string { - return proto.EnumName(KeyshareRole_name, int32(x)) -} - -func (KeyshareRole) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{7} -} - -// PermissionScope define the Capabilities Controllers can grant for Services -type PermissionScope int32 - -const ( - PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0 - PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1 - PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ PermissionScope = 2 - PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE PermissionScope = 3 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5 - PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6 - PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7 - PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8 - PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10 - PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11 - PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12 - PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13 -) - -var PermissionScope_name = map[int32]string{ - 0: "PERMISSION_SCOPE_UNSPECIFIED", - 1: "PERMISSION_SCOPE_BASIC_INFO", - 2: "PERMISSION_SCOPE_PERMISSIONS_READ", - 3: "PERMISSION_SCOPE_PERMISSIONS_WRITE", - 4: "PERMISSION_SCOPE_TRANSACTIONS_READ", - 5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE", - 6: "PERMISSION_SCOPE_WALLETS_READ", - 7: "PERMISSION_SCOPE_WALLETS_CREATE", - 8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE", - 9: "PERMISSION_SCOPE_WALLETS_UPDATE", - 10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY", - 11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST", - 12: "PERMISSION_SCOPE_ADMIN_USER", - 13: "PERMISSION_SCOPE_ADMIN_VALIDATOR", -} - -var PermissionScope_value = map[string]int32{ - "PERMISSION_SCOPE_UNSPECIFIED": 0, - "PERMISSION_SCOPE_BASIC_INFO": 1, - "PERMISSION_SCOPE_PERMISSIONS_READ": 2, - "PERMISSION_SCOPE_PERMISSIONS_WRITE": 3, - "PERMISSION_SCOPE_TRANSACTIONS_READ": 4, - "PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5, - "PERMISSION_SCOPE_WALLETS_READ": 6, - "PERMISSION_SCOPE_WALLETS_CREATE": 7, - "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8, - "PERMISSION_SCOPE_WALLETS_UPDATE": 9, - "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10, - "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11, - "PERMISSION_SCOPE_ADMIN_USER": 12, - "PERMISSION_SCOPE_ADMIN_VALIDATOR": 13, -} - -func (x PermissionScope) String() string { - return proto.EnumName(PermissionScope_name, int32(x)) -} - -func (PermissionScope) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{8} -} - // GenesisState defines the module genesis state type GenesisState struct { // Params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace - GlobalIntegrity *GlobalIntegrity `protobuf:"bytes,2,opt,name=global_integrity,json=globalIntegrity,proto3" json:"global_integrity,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -461,82 +70,6 @@ func (m *GenesisState) GetParams() Params { return Params{} } -func (m *GenesisState) GetGlobalIntegrity() *GlobalIntegrity { - if m != nil { - return m.GlobalIntegrity - } - return nil -} - -// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace -type GlobalIntegrity struct { - Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` - Seed string `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` - Accumulator []byte `protobuf:"bytes,3,opt,name=accumulator,proto3" json:"accumulator,omitempty"` - Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` -} - -func (m *GlobalIntegrity) Reset() { *m = GlobalIntegrity{} } -func (m *GlobalIntegrity) String() string { return proto.CompactTextString(m) } -func (*GlobalIntegrity) ProtoMessage() {} -func (*GlobalIntegrity) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{1} -} -func (m *GlobalIntegrity) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GlobalIntegrity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GlobalIntegrity.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 *GlobalIntegrity) XXX_Merge(src proto.Message) { - xxx_messageInfo_GlobalIntegrity.Merge(m, src) -} -func (m *GlobalIntegrity) XXX_Size() int { - return m.Size() -} -func (m *GlobalIntegrity) XXX_DiscardUnknown() { - xxx_messageInfo_GlobalIntegrity.DiscardUnknown(m) -} - -var xxx_messageInfo_GlobalIntegrity proto.InternalMessageInfo - -func (m *GlobalIntegrity) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *GlobalIntegrity) GetSeed() string { - if m != nil { - return m.Seed - } - return "" -} - -func (m *GlobalIntegrity) GetAccumulator() []byte { - if m != nil { - return m.Accumulator - } - return nil -} - -func (m *GlobalIntegrity) GetCount() uint64 { - if m != nil { - return m.Count - } - return 0 -} - // Params defines the set of module parameters. type Params struct { // Whitelisted Assets @@ -556,7 +89,7 @@ type Params struct { func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{2} + return fileDescriptor_fda181cae44f7c00, []int{1} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -636,7 +169,7 @@ type AssetInfo struct { // The coin symbol Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` // The coin name - AssetType AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=did.v1.AssetType" json:"asset_type,omitempty"` + AssetType string `protobuf:"bytes,4,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"` // The name of the asset Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` // The icon url @@ -647,7 +180,7 @@ func (m *AssetInfo) Reset() { *m = AssetInfo{} } func (m *AssetInfo) String() string { return proto.CompactTextString(m) } func (*AssetInfo) ProtoMessage() {} func (*AssetInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{3} + return fileDescriptor_fda181cae44f7c00, []int{2} } func (m *AssetInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -697,11 +230,11 @@ func (m *AssetInfo) GetSymbol() string { return "" } -func (m *AssetInfo) GetAssetType() AssetType { +func (m *AssetInfo) GetAssetType() string { if m != nil { return m.AssetType } - return AssetType_ASSET_TYPE_UNSPECIFIED + return "" } func (m *AssetInfo) GetName() string { @@ -718,13 +251,106 @@ func (m *AssetInfo) GetIconUrl() string { return "" } +// Document defines a DID document +type Document struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{3} +} +func (m *Document) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Document.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Document) XXX_Merge(src proto.Message) { + xxx_messageInfo_Document.Merge(m, src) +} +func (m *Document) XXX_Size() int { + return m.Size() +} +func (m *Document) XXX_DiscardUnknown() { + xxx_messageInfo_Document.DiscardUnknown(m) +} + +var xxx_messageInfo_Document proto.InternalMessageInfo + +func (m *Document) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Document) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *Document) GetAuthentication() []string { + if m != nil { + return m.Authentication + } + return nil +} + +func (m *Document) GetAssertionMethod() []string { + if m != nil { + return m.AssertionMethod + } + return nil +} + +func (m *Document) GetCapabilityDelegation() []string { + if m != nil { + return m.CapabilityDelegation + } + return nil +} + +func (m *Document) GetCapabilityInvocation() []string { + if m != nil { + return m.CapabilityInvocation + } + return nil +} + +func (m *Document) GetService() []string { + if m != nil { + return m.Service + } + return nil +} + // KeyInfo defines information for accepted PubKey types type KeyInfo struct { - Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` - Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` - Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` - Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` - Type KeyType `protobuf:"varint,5,opt,name=type,proto3,enum=did.v1.KeyType" json:"type,omitempty"` + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` } func (m *KeyInfo) Reset() { *m = KeyInfo{} } @@ -760,160 +386,392 @@ func (m *KeyInfo) XXX_DiscardUnknown() { var xxx_messageInfo_KeyInfo proto.InternalMessageInfo -func (m *KeyInfo) GetRole() KeyRole { +func (m *KeyInfo) GetRole() string { if m != nil { return m.Role } - return KeyRole_KEY_ROLE_UNSPECIFIED + return "" } -func (m *KeyInfo) GetAlgorithm() KeyAlgorithm { +func (m *KeyInfo) GetAlgorithm() string { if m != nil { return m.Algorithm } - return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED + return "" } -func (m *KeyInfo) GetEncoding() KeyEncoding { +func (m *KeyInfo) GetEncoding() string { if m != nil { return m.Encoding } - return KeyEncoding_KEY_ENCODING_UNSPECIFIED + return "" } -func (m *KeyInfo) GetCurve() KeyCurve { +func (m *KeyInfo) GetCurve() string { if m != nil { return m.Curve } - return KeyCurve_KEY_CURVE_UNSPECIFIED + return "" } -func (m *KeyInfo) GetType() KeyType { +func (m *KeyInfo) GetType() string { if m != nil { return m.Type } - return KeyType_KEY_TYPE_UNSPECIFIED + return "" +} + +// PubKey defines a public key for a did +type PubKey struct { + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` + KeyType string `protobuf:"bytes,5,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` + Jwk *PubKey_JWK `protobuf:"bytes,7,opt,name=jwk,proto3" json:"jwk,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (m *PubKey) String() string { return proto.CompactTextString(m) } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (m *PubKey) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +func (m *PubKey) GetAlgorithm() string { + if m != nil { + return m.Algorithm + } + return "" +} + +func (m *PubKey) GetEncoding() string { + if m != nil { + return m.Encoding + } + return "" +} + +func (m *PubKey) GetCurve() string { + if m != nil { + return m.Curve + } + return "" +} + +func (m *PubKey) GetKeyType() string { + if m != nil { + return m.KeyType + } + return "" +} + +func (m *PubKey) GetRaw() []byte { + if m != nil { + return m.Raw + } + return nil +} + +func (m *PubKey) GetJwk() *PubKey_JWK { + if m != nil { + return m.Jwk + } + return nil +} + +// JWK represents a JSON Web Key +type PubKey_JWK struct { + Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` + Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` + X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` + Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` + N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` + E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` +} + +func (m *PubKey_JWK) Reset() { *m = PubKey_JWK{} } +func (m *PubKey_JWK) String() string { return proto.CompactTextString(m) } +func (*PubKey_JWK) ProtoMessage() {} +func (*PubKey_JWK) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5, 0} +} +func (m *PubKey_JWK) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey_JWK) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey_JWK.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PubKey_JWK) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey_JWK.Merge(m, src) +} +func (m *PubKey_JWK) XXX_Size() int { + return m.Size() +} +func (m *PubKey_JWK) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey_JWK.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey_JWK proto.InternalMessageInfo + +func (m *PubKey_JWK) GetKty() string { + if m != nil { + return m.Kty + } + return "" +} + +func (m *PubKey_JWK) GetCrv() string { + if m != nil { + return m.Crv + } + return "" +} + +func (m *PubKey_JWK) GetX() string { + if m != nil { + return m.X + } + return "" +} + +func (m *PubKey_JWK) GetY() string { + if m != nil { + return m.Y + } + return "" +} + +func (m *PubKey_JWK) GetN() string { + if m != nil { + return m.N + } + return "" +} + +func (m *PubKey_JWK) GetE() string { + if m != nil { + return m.E + } + return "" +} + +// Service defines a Decentralized Service on the Sonr Blockchain +type Service struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Permissions map[string]string `protobuf:"bytes,7,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +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_fda181cae44f7c00, []int{6} +} +func (m *Service) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Service.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 *Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_Service.Merge(m, src) +} +func (m *Service) XXX_Size() int { + return m.Size() +} +func (m *Service) XXX_DiscardUnknown() { + xxx_messageInfo_Service.DiscardUnknown(m) +} + +var xxx_messageInfo_Service proto.InternalMessageInfo + +func (m *Service) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Service) GetServiceType() string { + if m != nil { + return m.ServiceType + } + return "" +} + +func (m *Service) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *Service) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *Service) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Service) GetServiceEndpoints() map[string]string { + if m != nil { + return m.ServiceEndpoints + } + return nil +} + +func (m *Service) GetPermissions() map[string]string { + if m != nil { + return m.Permissions + } + return nil } func init() { - proto.RegisterEnum("did.v1.AssetType", AssetType_name, AssetType_value) - proto.RegisterEnum("did.v1.DIDNamespace", DIDNamespace_name, DIDNamespace_value) - proto.RegisterEnum("did.v1.KeyAlgorithm", KeyAlgorithm_name, KeyAlgorithm_value) - proto.RegisterEnum("did.v1.KeyCurve", KeyCurve_name, KeyCurve_value) - proto.RegisterEnum("did.v1.KeyEncoding", KeyEncoding_name, KeyEncoding_value) - proto.RegisterEnum("did.v1.KeyRole", KeyRole_name, KeyRole_value) - proto.RegisterEnum("did.v1.KeyType", KeyType_name, KeyType_value) - proto.RegisterEnum("did.v1.KeyshareRole", KeyshareRole_name, KeyshareRole_value) - proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value) proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") - proto.RegisterType((*GlobalIntegrity)(nil), "did.v1.GlobalIntegrity") proto.RegisterType((*Params)(nil), "did.v1.Params") proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.Params.AllowedPublicKeysEntry") proto.RegisterType((*AssetInfo)(nil), "did.v1.AssetInfo") + proto.RegisterType((*Document)(nil), "did.v1.Document") proto.RegisterType((*KeyInfo)(nil), "did.v1.KeyInfo") + proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") + proto.RegisterType((*PubKey_JWK)(nil), "did.v1.PubKey.JWK") + proto.RegisterType((*Service)(nil), "did.v1.Service") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Service.PermissionsEntry") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Service.ServiceEndpointsEntry") } func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 1547 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x57, 0x3d, 0x73, 0xe3, 0xc6, - 0x19, 0x16, 0xf8, 0x25, 0xf2, 0x95, 0x2c, 0xad, 0x56, 0x3a, 0x1d, 0xef, 0x7c, 0x96, 0x64, 0x9d, - 0xcf, 0xd6, 0x30, 0x19, 0xd1, 0xa2, 0x4e, 0x99, 0x8b, 0x27, 0x45, 0x40, 0x70, 0x25, 0x61, 0x48, - 0x82, 0x98, 0x05, 0x28, 0xf9, 0xdc, 0x60, 0x20, 0x72, 0x45, 0x61, 0x0c, 0x02, 0x1c, 0x00, 0x92, - 0xcd, 0x22, 0x33, 0x49, 0xeb, 0x2a, 0x65, 0x4a, 0x77, 0x69, 0x52, 0xe4, 0x47, 0xa4, 0x70, 0xe9, - 0x32, 0x69, 0x3c, 0x9e, 0xbb, 0x22, 0xf9, 0x0b, 0xe9, 0x3c, 0xbb, 0xe0, 0x07, 0xf8, 0x61, 0x35, - 0x9c, 0xdd, 0xe7, 0x79, 0xde, 0x77, 0xdf, 0xaf, 0xdd, 0x01, 0x61, 0xa7, 0xeb, 0x74, 0xcb, 0x0f, - 0x27, 0xe5, 0x1e, 0xf3, 0x58, 0xe8, 0x84, 0xc7, 0x83, 0xc0, 0x8f, 0x7c, 0x9c, 0xeb, 0x3a, 0xdd, - 0xe3, 0x87, 0x93, 0xe7, 0x5b, 0x76, 0xdf, 0xf1, 0xfc, 0xb2, 0xf8, 0x8d, 0xa9, 0xe7, 0x3b, 0x3d, - 0xbf, 0xe7, 0x8b, 0x65, 0x99, 0xaf, 0x62, 0xf4, 0xf0, 0xcf, 0x12, 0xac, 0x5f, 0xc4, 0x2e, 0x8c, - 0xc8, 0x8e, 0x18, 0xfe, 0x2d, 0xe4, 0x06, 0x76, 0x60, 0xf7, 0xc3, 0xa2, 0x74, 0x20, 0x1d, 0xad, - 0x55, 0x36, 0x8e, 0x63, 0x97, 0xc7, 0xba, 0x40, 0xab, 0x99, 0x1f, 0x7e, 0xda, 0x5f, 0xa1, 0x23, - 0x0d, 0xae, 0x02, 0xea, 0xb9, 0xfe, 0x8d, 0xed, 0x5a, 0x8e, 0x17, 0xb1, 0x5e, 0xe0, 0x44, 0xc3, - 0x62, 0x4a, 0xd8, 0x3d, 0x1d, 0xdb, 0x5d, 0x08, 0x5e, 0x1d, 0xd3, 0x74, 0xb3, 0x37, 0x0b, 0x1c, - 0xfe, 0x09, 0x36, 0xe7, 0x34, 0x78, 0x0f, 0xa0, 0xe3, 0x7b, 0x51, 0xe0, 0xbb, 0x2e, 0x0b, 0x44, - 0x20, 0x05, 0x9a, 0x40, 0x30, 0x86, 0x4c, 0xc8, 0x58, 0x57, 0x1c, 0x55, 0xa0, 0x62, 0x8d, 0x0f, - 0x60, 0xcd, 0xee, 0x74, 0xee, 0xfb, 0xf7, 0xae, 0x1d, 0xf9, 0x41, 0x31, 0x7d, 0x20, 0x1d, 0xad, - 0xd3, 0x24, 0x84, 0x77, 0x20, 0xdb, 0xf1, 0xef, 0xbd, 0xa8, 0x98, 0x39, 0x90, 0x8e, 0x32, 0x34, - 0xde, 0x1c, 0xfe, 0x94, 0x86, 0x5c, 0x9c, 0x1b, 0xfe, 0x23, 0xe0, 0x6f, 0xee, 0x9c, 0x88, 0xb9, - 0x4e, 0x18, 0xb1, 0xae, 0x65, 0x87, 0x21, 0x8b, 0x78, 0x1d, 0xd2, 0x47, 0x6b, 0x95, 0xad, 0x71, - 0x3e, 0x32, 0x47, 0x55, 0xef, 0xd6, 0xa7, 0x5b, 0x09, 0xb1, 0x40, 0x43, 0xdc, 0x86, 0x6d, 0xdb, - 0x75, 0xfd, 0x6f, 0x58, 0xd7, 0x1a, 0xdc, 0xdf, 0xb8, 0x4e, 0xc7, 0xfa, 0x9a, 0x0d, 0xc3, 0x62, - 0x4a, 0xb8, 0x78, 0x35, 0x5b, 0xca, 0x63, 0x39, 0x56, 0xea, 0x42, 0x58, 0x67, 0xc3, 0x90, 0x78, - 0x51, 0x30, 0xa4, 0x5b, 0xf6, 0x3c, 0x8e, 0xf7, 0x61, 0xcd, 0x19, 0xdc, 0x86, 0x96, 0xdd, 0x89, - 0x9c, 0x07, 0x26, 0x72, 0xcb, 0x53, 0xe0, 0x90, 0x2c, 0x10, 0x5c, 0x83, 0x3d, 0xd7, 0xef, 0xd8, - 0xee, 0x9d, 0x1f, 0x46, 0x56, 0xc0, 0x7a, 0x4e, 0x18, 0x05, 0x76, 0xe4, 0xf8, 0x9e, 0xc5, 0x3c, - 0xfb, 0xc6, 0x65, 0x5d, 0x91, 0x73, 0x9e, 0xbe, 0x98, 0xa8, 0x68, 0x42, 0x44, 0x62, 0x0d, 0x3e, - 0x85, 0x27, 0x1d, 0xdf, 0x7b, 0x60, 0x43, 0xdb, 0xeb, 0x30, 0x6b, 0x10, 0xb0, 0x5b, 0x16, 0x30, - 0xaf, 0xc3, 0x8a, 0x59, 0x51, 0xe7, 0x9d, 0x29, 0xa9, 0x4f, 0x38, 0x5c, 0x86, 0x6d, 0x3b, 0x8a, - 0x58, 0x18, 0xc5, 0xe7, 0xdd, 0xfa, 0x41, 0xdf, 0x8e, 0xc2, 0x62, 0xee, 0x20, 0x7d, 0x54, 0xa0, - 0x38, 0x41, 0x9d, 0xc7, 0xcc, 0xf3, 0x36, 0xec, 0x2e, 0xcf, 0x1c, 0x23, 0x48, 0x7f, 0xcd, 0x86, - 0xa3, 0x7e, 0xf3, 0x25, 0x7e, 0x05, 0xd9, 0x07, 0xdb, 0xbd, 0x67, 0xa3, 0xa1, 0xda, 0x1c, 0x57, - 0xb0, 0xce, 0x86, 0xa2, 0x05, 0x31, 0xfb, 0x45, 0xea, 0x8d, 0xf4, 0xc5, 0xd3, 0xbf, 0x7d, 0xbf, - 0xbf, 0xf2, 0xbf, 0xef, 0xf7, 0xa5, 0xef, 0xfe, 0xfb, 0xcf, 0x12, 0xf0, 0xdb, 0x11, 0xcf, 0xe8, - 0xe1, 0x3f, 0x24, 0x28, 0x4c, 0x9a, 0xc6, 0x87, 0xc0, 0xf1, 0xba, 0xec, 0x5b, 0x71, 0x4a, 0x9a, - 0xc6, 0x1b, 0x7e, 0xf2, 0x5d, 0x30, 0x18, 0xcd, 0x13, 0x5f, 0xe2, 0x5d, 0xc8, 0x85, 0xc3, 0xfe, - 0x8d, 0xef, 0x8a, 0x6a, 0x17, 0xe8, 0x68, 0x87, 0x3f, 0x07, 0x10, 0x73, 0x61, 0x45, 0xc3, 0x01, - 0x13, 0x55, 0xdd, 0x98, 0x9b, 0x0d, 0x73, 0x38, 0x60, 0xb4, 0x60, 0x8f, 0x97, 0x7c, 0x58, 0x3d, - 0xbb, 0x3f, 0x2e, 0xa2, 0x58, 0xe3, 0x67, 0x90, 0x77, 0x3a, 0xbe, 0x67, 0xdd, 0x07, 0x6e, 0x31, - 0x27, 0xf0, 0x55, 0xbe, 0x6f, 0x07, 0xee, 0xe1, 0xcf, 0x12, 0xac, 0x8e, 0xd2, 0xc3, 0x2f, 0x21, - 0x13, 0xf8, 0x2e, 0x13, 0xb1, 0x6e, 0xcc, 0x64, 0x4f, 0x7d, 0x97, 0x51, 0x41, 0xe2, 0x0a, 0x14, - 0x6c, 0xb7, 0xe7, 0x07, 0x4e, 0x74, 0xd7, 0x17, 0x19, 0x6c, 0x54, 0x76, 0x12, 0x4a, 0x79, 0xcc, - 0xd1, 0xa9, 0x0c, 0x97, 0x21, 0xcf, 0xbc, 0x8e, 0xdf, 0x75, 0xbc, 0x9e, 0xc8, 0x6f, 0xa3, 0xb2, - 0x9d, 0x30, 0x21, 0x23, 0x8a, 0x4e, 0x44, 0xf8, 0x53, 0xc8, 0x76, 0xee, 0x83, 0x87, 0x71, 0xc6, - 0x28, 0xa1, 0x56, 0x38, 0x4e, 0x63, 0x9a, 0x47, 0x2c, 0x0a, 0x93, 0x5d, 0x88, 0x58, 0x94, 0x45, - 0x90, 0xa5, 0x49, 0x47, 0x44, 0x7d, 0x9e, 0xc3, 0xae, 0x6c, 0x18, 0xc4, 0xb4, 0xcc, 0xb7, 0x3a, - 0xb1, 0xda, 0x9a, 0xa1, 0x13, 0x45, 0x3d, 0x57, 0x49, 0x0d, 0xad, 0xe0, 0x27, 0xb0, 0x95, 0xe0, - 0x34, 0xd9, 0x54, 0xaf, 0x08, 0x92, 0xf0, 0x2e, 0xe0, 0x04, 0x7c, 0x4d, 0x65, 0x5d, 0x27, 0x35, - 0x94, 0x9a, 0xc3, 0x0d, 0x53, 0xae, 0xab, 0xda, 0x05, 0x4a, 0xe3, 0x6d, 0xd8, 0x4c, 0xe0, 0x7a, - 0xab, 0xd5, 0x40, 0x19, 0x8c, 0x61, 0x23, 0x01, 0xaa, 0x55, 0x05, 0x65, 0xe7, 0x84, 0xca, 0x75, - 0xe5, 0x73, 0x94, 0x2b, 0xfd, 0x5f, 0x82, 0xf5, 0x9a, 0x5a, 0xd3, 0xec, 0x3e, 0x0b, 0x07, 0x76, - 0x87, 0xe1, 0x8f, 0xe0, 0x59, 0x4d, 0xad, 0x59, 0x9a, 0xdc, 0x24, 0x86, 0x2e, 0x2b, 0xf3, 0x41, - 0xef, 0x02, 0x9e, 0xa5, 0x55, 0xfd, 0xdc, 0x88, 0xa3, 0x9e, 0xc5, 0x8d, 0x96, 0x46, 0x51, 0x0a, - 0x3f, 0x83, 0x27, 0xb3, 0x78, 0x55, 0x35, 0x95, 0x96, 0xaa, 0xa1, 0x34, 0xaf, 0xcd, 0x2c, 0x45, - 0xcc, 0x4b, 0x42, 0x49, 0xbb, 0x89, 0x32, 0xbc, 0x36, 0x73, 0xc7, 0x88, 0x14, 0x16, 0x4c, 0xae, - 0x49, 0x55, 0x6e, 0x9b, 0x97, 0x1a, 0xca, 0x2d, 0x9a, 0xd4, 0xae, 0x35, 0xb4, 0xba, 0x18, 0x80, - 0x41, 0xe8, 0x95, 0xaa, 0x10, 0x94, 0x2f, 0xfd, 0x4b, 0x82, 0xf5, 0xe4, 0x10, 0xf1, 0xdc, 0xeb, - 0xe4, 0xad, 0x25, 0x37, 0x2e, 0x5a, 0x54, 0x35, 0x2f, 0x9b, 0x73, 0xb9, 0x3f, 0x85, 0xed, 0x59, - 0x9a, 0x18, 0x95, 0xb3, 0xdf, 0x21, 0x69, 0x19, 0x71, 0xfa, 0xe6, 0x35, 0x4a, 0x2d, 0x23, 0xce, - 0x4e, 0x2a, 0x28, 0xbd, 0x84, 0xa8, 0xd5, 0x0c, 0x19, 0x65, 0x70, 0x11, 0x76, 0x96, 0x9c, 0x51, - 0x47, 0xd9, 0x25, 0x26, 0x0a, 0x37, 0xc9, 0x95, 0xfe, 0x92, 0x82, 0xfc, 0x78, 0x54, 0x79, 0xba, - 0x5c, 0xa5, 0xb4, 0xe9, 0xd5, 0x7c, 0xeb, 0x30, 0x6c, 0x4c, 0x29, 0x3d, 0x8e, 0x7c, 0x16, 0x8b, - 0x83, 0x9e, 0xc5, 0xce, 0x2a, 0x27, 0x28, 0x8d, 0x77, 0x00, 0x4d, 0xb1, 0x2f, 0x2b, 0x67, 0x67, - 0x27, 0xbf, 0x8f, 0xa7, 0x2c, 0x81, 0xbe, 0x7e, 0xfd, 0x06, 0x65, 0x79, 0x1b, 0xa6, 0x18, 0xa9, - 0xc5, 0xd2, 0x1c, 0x1f, 0xbe, 0x24, 0xcc, 0xb5, 0xab, 0xe3, 0x94, 0x62, 0xd0, 0x20, 0x0a, 0x0f, - 0xaa, 0x7e, 0x82, 0xf2, 0x7c, 0x9a, 0xa6, 0x44, 0xb5, 0x61, 0x9c, 0x54, 0x4e, 0xdf, 0x9c, 0xa0, - 0xc2, 0xac, 0x41, 0x9d, 0x28, 0x8a, 0x5c, 0xe7, 0x79, 0x40, 0x29, 0x84, 0xb5, 0xc4, 0xdd, 0xc6, - 0x2f, 0xa0, 0xc8, 0x75, 0x44, 0x53, 0x5a, 0x35, 0x55, 0xbb, 0x98, 0x2b, 0xc4, 0x28, 0x99, 0x09, - 0x4b, 0xe5, 0x6b, 0x24, 0x2d, 0xa0, 0x97, 0xe4, 0x4b, 0x94, 0xe2, 0x13, 0x37, 0x83, 0x36, 0xdb, - 0x0d, 0x53, 0xad, 0xca, 0x06, 0x41, 0xe9, 0xd2, 0x77, 0xf1, 0x6b, 0xc6, 0x9f, 0xab, 0x71, 0xdf, - 0x68, 0xab, 0x31, 0x5f, 0xf6, 0x0f, 0xe1, 0xe9, 0x84, 0xe1, 0xb3, 0x4a, 0x34, 0x53, 0x55, 0x64, - 0x53, 0x6d, 0x69, 0xf1, 0xb5, 0x99, 0x92, 0x86, 0x41, 0xa8, 0xc0, 0x27, 0x83, 0x23, 0xf0, 0x1a, - 0x69, 0x90, 0x8b, 0xd8, 0x20, 0x3d, 0x43, 0xa8, 0xda, 0x55, 0x6b, 0xe4, 0x29, 0x53, 0xfa, 0x4f, - 0x1c, 0x8c, 0x78, 0x75, 0x46, 0xc1, 0x2c, 0x79, 0x73, 0x46, 0x1d, 0x13, 0x4c, 0x4b, 0x31, 0x89, - 0x89, 0xa4, 0x71, 0xc7, 0x04, 0x46, 0x1a, 0x0d, 0x55, 0x37, 0x55, 0x05, 0xa5, 0x30, 0x82, 0xf5, - 0x09, 0x4c, 0x0d, 0x19, 0xa5, 0xc7, 0xc1, 0xc6, 0xef, 0xcf, 0xdb, 0x66, 0x93, 0x98, 0x54, 0x55, - 0x50, 0x06, 0x6f, 0xc1, 0x07, 0x13, 0xfc, 0xb2, 0x29, 0xf3, 0x8b, 0x9a, 0x34, 0x6e, 0xea, 0x0a, - 0xca, 0xe1, 0x4d, 0x58, 0x9b, 0x20, 0x5f, 0xd5, 0xd1, 0xea, 0xcc, 0xb1, 0x93, 0x6b, 0x9c, 0x9f, - 0x89, 0xb0, 0xaa, 0xea, 0xa7, 0x15, 0x54, 0x28, 0xdd, 0x88, 0x7b, 0x1a, 0xde, 0xd9, 0x01, 0x13, - 0xc5, 0x8e, 0xef, 0xa9, 0x71, 0x29, 0x53, 0xb2, 0xac, 0xe2, 0x71, 0x9c, 0x49, 0xda, 0x20, 0x14, - 0x49, 0xa3, 0x4e, 0x24, 0xf0, 0x2b, 0xb9, 0xa1, 0xd6, 0x64, 0xb3, 0x45, 0x51, 0xaa, 0xf4, 0xf7, - 0x0c, 0x6c, 0xea, 0x2c, 0xe8, 0x3b, 0x61, 0xe8, 0xf8, 0x9e, 0xd1, 0xf1, 0x07, 0x0c, 0x1f, 0xc0, - 0x0b, 0x9d, 0xd0, 0xa6, 0x6a, 0x18, 0x6a, 0x4b, 0xb3, 0x0c, 0xa5, 0xb5, 0x50, 0xcf, 0x7d, 0xf8, - 0x70, 0x41, 0x51, 0x95, 0x0d, 0x55, 0xb1, 0x54, 0xed, 0xbc, 0x85, 0x24, 0xfc, 0x0a, 0x3e, 0x5e, - 0x10, 0x4c, 0x01, 0xc3, 0xa2, 0x44, 0xe6, 0x8f, 0xfb, 0xa7, 0x70, 0xf8, 0xa8, 0xec, 0x9a, 0xaa, - 0x26, 0x41, 0xe9, 0xa5, 0x3a, 0x93, 0xca, 0x9a, 0x21, 0x2b, 0xe6, 0xd4, 0x5f, 0x06, 0x7f, 0x06, - 0x2f, 0x1f, 0xd7, 0xc5, 0x0e, 0xb3, 0xf8, 0x63, 0xf8, 0x68, 0x41, 0x78, 0x2d, 0x37, 0x1a, 0xc4, - 0x1c, 0xf9, 0xca, 0xe1, 0x97, 0xb0, 0xff, 0xab, 0x12, 0x85, 0x12, 0xd9, 0x24, 0x68, 0x75, 0x69, - 0x60, 0x63, 0x91, 0xd1, 0xae, 0x1a, 0x0a, 0x55, 0xab, 0x04, 0xe5, 0x1f, 0x75, 0xd6, 0xd6, 0x6b, - 0xdc, 0x59, 0x01, 0x1f, 0xc1, 0x27, 0x8f, 0x47, 0x7f, 0x45, 0xa8, 0x7a, 0xfe, 0x16, 0x01, 0xfe, - 0x0d, 0x7c, 0xf6, 0xb8, 0xb2, 0x4a, 0x5b, 0x72, 0x4d, 0x91, 0x0d, 0x13, 0xad, 0x2d, 0x6d, 0x96, - 0x5c, 0x6b, 0xaa, 0x5a, 0x3c, 0x20, 0xeb, 0xf8, 0x13, 0x38, 0xf8, 0x15, 0xc1, 0x74, 0x52, 0x3e, - 0xa8, 0xfe, 0xe1, 0x87, 0x77, 0x7b, 0xd2, 0x8f, 0xef, 0xf6, 0xa4, 0x9f, 0xdf, 0xed, 0x49, 0x7f, - 0x7d, 0xbf, 0xb7, 0xf2, 0xe3, 0xfb, 0xbd, 0x95, 0x7f, 0xbf, 0xdf, 0x5b, 0xf9, 0xea, 0xb0, 0xe7, - 0x44, 0x77, 0xf7, 0x37, 0xc7, 0x1d, 0xbf, 0x5f, 0xf6, 0xbd, 0xd0, 0xf7, 0x82, 0xb2, 0xf8, 0xf9, - 0xb6, 0xcc, 0x3f, 0xd9, 0xf8, 0xe7, 0x41, 0x78, 0x93, 0x13, 0xff, 0x4d, 0x4e, 0x7f, 0x09, 0x00, - 0x00, 0xff, 0xff, 0x75, 0x67, 0x23, 0xa4, 0xe4, 0x0c, 0x00, 0x00, + // 983 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x7a, 0x1b, 0x3b, 0x7e, 0x8e, 0xd2, 0x64, 0xea, 0x96, 0xad, 0x55, 0x1c, 0x63, 0x51, + 0x14, 0x10, 0xb2, 0xd5, 0xf4, 0x82, 0xaa, 0x0a, 0x91, 0x90, 0x80, 0xda, 0x08, 0x29, 0xda, 0x12, + 0x55, 0xe2, 0xb2, 0x1a, 0xef, 0xbe, 0xd8, 0x83, 0xd7, 0x33, 0xab, 0x99, 0xb1, 0x93, 0x3d, 0x72, + 0xe5, 0x04, 0x37, 0xb8, 0x55, 0xfc, 0x02, 0xf8, 0x17, 0x3d, 0xf6, 0xc8, 0xa9, 0x42, 0xc9, 0x01, + 0x7e, 0x06, 0x9a, 0xd9, 0xb1, 0xbd, 0x98, 0x5c, 0xb8, 0x70, 0x59, 0xbf, 0xf7, 0xbd, 0x37, 0xef, + 0xbd, 0x79, 0xdf, 0x9b, 0x67, 0x68, 0x26, 0x2c, 0xe9, 0xcf, 0x1e, 0xf5, 0x87, 0xc8, 0x51, 0x31, + 0xd5, 0xcb, 0xa4, 0xd0, 0x82, 0x54, 0x13, 0x96, 0xf4, 0x66, 0x8f, 0x5a, 0x3b, 0x74, 0xc2, 0xb8, + 0xe8, 0xdb, 0x6f, 0x61, 0x6a, 0x35, 0x87, 0x62, 0x28, 0xac, 0xd8, 0x37, 0x52, 0x81, 0x76, 0x9f, + 0xc2, 0xe6, 0x97, 0x45, 0x84, 0x17, 0x9a, 0x6a, 0x24, 0x1f, 0x43, 0x35, 0xa3, 0x92, 0x4e, 0x54, + 0xe0, 0x75, 0xbc, 0xbd, 0xc6, 0xfe, 0x56, 0xaf, 0x88, 0xd8, 0x3b, 0xb5, 0xe8, 0xe1, 0xad, 0xd7, + 0x6f, 0x77, 0xd7, 0x42, 0xe7, 0xd3, 0x7d, 0xeb, 0x43, 0xb5, 0x30, 0x90, 0xcf, 0x80, 0x5c, 0x8c, + 0x98, 0xc6, 0x94, 0x29, 0x8d, 0x49, 0x44, 0x95, 0x42, 0x6d, 0x82, 0xf8, 0x7b, 0x8d, 0xfd, 0x9d, + 0x79, 0x90, 0x03, 0x83, 0x3e, 0xe3, 0xe7, 0x22, 0xdc, 0x29, 0x39, 0x5b, 0x54, 0x91, 0x33, 0xb8, + 0x43, 0xd3, 0x54, 0x5c, 0x60, 0x12, 0x65, 0xd3, 0x41, 0xca, 0xe2, 0x68, 0x8c, 0xb9, 0x0a, 0x2a, + 0x36, 0xc4, 0xc3, 0x7f, 0xd6, 0xd1, 0x3b, 0x28, 0x3c, 0x4f, 0xad, 0xe3, 0x09, 0xe6, 0xea, 0x98, + 0x6b, 0x99, 0x87, 0x3b, 0x74, 0x15, 0x27, 0xbb, 0xd0, 0x60, 0xd9, 0xb9, 0x8a, 0x68, 0xac, 0xd9, + 0x0c, 0x03, 0xbf, 0xe3, 0xed, 0x6d, 0x84, 0x60, 0xa0, 0x03, 0x8b, 0x90, 0x23, 0x68, 0xa7, 0x22, + 0xa6, 0xe9, 0x48, 0x28, 0x1d, 0x49, 0x1c, 0x32, 0xa5, 0x25, 0xd5, 0x4c, 0xf0, 0x08, 0x39, 0x1d, + 0xa4, 0x98, 0x04, 0xb7, 0xec, 0x99, 0x07, 0x0b, 0xaf, 0xb0, 0xe4, 0x74, 0x5c, 0xf8, 0x90, 0xc7, + 0x70, 0x37, 0x16, 0x7c, 0x86, 0x39, 0xe5, 0x31, 0x46, 0x99, 0xc4, 0x73, 0x94, 0xc8, 0x63, 0x0c, + 0xd6, 0x3b, 0xde, 0x5e, 0x3d, 0x6c, 0x2e, 0x8d, 0xa7, 0x0b, 0x1b, 0xe9, 0xc3, 0x1d, 0xaa, 0x35, + 0x2a, 0x5d, 0xe4, 0x3b, 0x17, 0x72, 0x42, 0xb5, 0x0a, 0xaa, 0x1d, 0x7f, 0xaf, 0x1e, 0x92, 0x92, + 0xe9, 0x8b, 0xc2, 0xd2, 0x3a, 0x83, 0x7b, 0x37, 0xdf, 0x9c, 0x6c, 0x83, 0x3f, 0xc6, 0xdc, 0xb2, + 0x56, 0x0f, 0x8d, 0x48, 0x1e, 0xc2, 0xfa, 0x8c, 0xa6, 0x53, 0x0c, 0x2a, 0x96, 0xc9, 0xdb, 0xf3, + 0x0e, 0x9e, 0x60, 0x6e, 0x29, 0x28, 0xac, 0x4f, 0x2a, 0x9f, 0x78, 0x4f, 0xde, 0xf9, 0xe9, 0xd5, + 0xee, 0xda, 0x5f, 0xaf, 0x76, 0xbd, 0xef, 0xff, 0xfc, 0xf5, 0x23, 0x30, 0x93, 0xe5, 0x08, 0xfe, + 0xd9, 0x83, 0xfa, 0x82, 0x34, 0xd2, 0x84, 0x75, 0xc6, 0x13, 0xbc, 0xb4, 0x59, 0xfc, 0xb0, 0x50, + 0x4c, 0xe6, 0x91, 0xcc, 0x6c, 0x96, 0x7a, 0x68, 0x44, 0x72, 0x0f, 0xaa, 0x2a, 0x9f, 0x0c, 0x44, + 0x6a, 0xbb, 0x5d, 0x0f, 0x9d, 0x46, 0xde, 0x05, 0xb0, 0x73, 0x11, 0xe9, 0x3c, 0x43, 0xdb, 0xd5, + 0x7a, 0x58, 0xb7, 0xc8, 0xd7, 0x79, 0x86, 0x84, 0xc0, 0x2d, 0x4e, 0x27, 0xf3, 0x8e, 0x59, 0x99, + 0xdc, 0x87, 0x0d, 0x16, 0x0b, 0x1e, 0x4d, 0x65, 0x1a, 0x54, 0x2d, 0x5e, 0x33, 0xfa, 0x99, 0x4c, + 0xbb, 0x3f, 0x56, 0x60, 0xe3, 0x48, 0xc4, 0xd3, 0x09, 0x72, 0x4d, 0xb6, 0xa0, 0xc2, 0x12, 0x77, + 0xfb, 0x0a, 0x4b, 0x48, 0x1b, 0x20, 0x16, 0x5c, 0x4b, 0x91, 0xa6, 0x28, 0x5d, 0x6d, 0x25, 0x84, + 0x7c, 0x00, 0x5b, 0x74, 0xaa, 0x47, 0xc8, 0x35, 0x8b, 0x6d, 0x87, 0x03, 0xdf, 0x36, 0x7d, 0x05, + 0x25, 0x1f, 0xc2, 0xb6, 0x29, 0x50, 0x5a, 0x7e, 0x26, 0xa8, 0x47, 0xc2, 0x8c, 0x83, 0xf1, 0xbc, + 0xbd, 0xc0, 0xbf, 0xb2, 0xb0, 0x9d, 0x00, 0x9a, 0xd1, 0x01, 0x4b, 0x99, 0xce, 0xa3, 0x04, 0x53, + 0x1c, 0x16, 0x91, 0xd7, 0xad, 0x7f, 0x73, 0x69, 0x3c, 0x5a, 0xd8, 0x56, 0x0e, 0x31, 0x3e, 0x13, + 0xae, 0x9c, 0xea, 0xea, 0xa1, 0x67, 0x0b, 0x1b, 0x09, 0xa0, 0xa6, 0x50, 0xce, 0x58, 0x8c, 0x41, + 0xcd, 0xba, 0xcd, 0xd5, 0xee, 0x77, 0x1e, 0xd4, 0x1c, 0xbf, 0xa6, 0x9d, 0x52, 0xa4, 0xe8, 0x9a, + 0x62, 0x65, 0xf2, 0x00, 0xea, 0x34, 0x1d, 0x0a, 0xc9, 0xf4, 0x68, 0xe2, 0xba, 0xb2, 0x04, 0x48, + 0x0b, 0x36, 0x90, 0xc7, 0x22, 0x61, 0x7c, 0xe8, 0x98, 0x5b, 0xe8, 0x86, 0xfb, 0x78, 0x2a, 0x67, + 0x73, 0xda, 0x0a, 0xc5, 0xe4, 0xb0, 0x5c, 0x3a, 0xca, 0x8c, 0xdc, 0xfd, 0xa5, 0x02, 0xd5, 0xd3, + 0xe9, 0xe0, 0x04, 0xf3, 0xff, 0xa5, 0x84, 0xfb, 0xb0, 0x31, 0xc6, 0x3c, 0x2a, 0x95, 0x51, 0x1b, + 0x63, 0x6e, 0x07, 0x6a, 0x1b, 0x7c, 0x49, 0x2f, 0xec, 0xdc, 0x6c, 0x86, 0x46, 0x24, 0xef, 0x83, + 0xff, 0xed, 0xc5, 0x38, 0xa8, 0xd9, 0x17, 0x41, 0x16, 0x3b, 0xc5, 0x56, 0xdb, 0x7b, 0xfe, 0xf2, + 0x24, 0x34, 0xe6, 0x16, 0x05, 0xff, 0xf9, 0xcb, 0x13, 0xfb, 0xa4, 0xf4, 0xf2, 0x49, 0x69, 0xfb, + 0xc8, 0x62, 0x39, 0x9b, 0x8f, 0x7a, 0x2c, 0x67, 0x64, 0x13, 0xbc, 0x4b, 0x57, 0xa8, 0x77, 0x69, + 0xb4, 0xdc, 0x55, 0xe7, 0xe5, 0x46, 0xe3, 0xae, 0x24, 0x8f, 0x1b, 0x0d, 0xdd, 0x08, 0x7b, 0xd8, + 0xfd, 0xcd, 0x87, 0xda, 0x8b, 0x82, 0xb4, 0x7f, 0xcd, 0xee, 0x7b, 0xb0, 0xe9, 0xf8, 0x2c, 0x6e, + 0x55, 0xa4, 0x6b, 0x38, 0xcc, 0xde, 0xcc, 0x34, 0x71, 0xaa, 0x47, 0xa6, 0x69, 0xb9, 0x4b, 0xbf, + 0x04, 0xcc, 0xfb, 0x13, 0x92, 0x0d, 0x19, 0x77, 0xb5, 0x38, 0x8d, 0x74, 0xa0, 0x91, 0xa0, 0x8a, + 0x25, 0xcb, 0xdc, 0x5c, 0xda, 0xb8, 0x25, 0x88, 0x84, 0xb0, 0x33, 0x4f, 0x8d, 0x3c, 0xc9, 0x04, + 0xe3, 0x6e, 0x1d, 0x95, 0x36, 0xb0, 0x2b, 0x7b, 0xfe, 0x7b, 0x3c, 0xf7, 0x2b, 0x36, 0xf0, 0xb6, + 0x5a, 0x81, 0xc9, 0x21, 0x34, 0x32, 0x94, 0x13, 0xa6, 0x14, 0x13, 0x5c, 0xd9, 0x89, 0x6d, 0xec, + 0x77, 0x56, 0xa3, 0x9d, 0x2e, 0x5d, 0x8a, 0x40, 0xe5, 0x43, 0xad, 0xcf, 0xe1, 0xee, 0x8d, 0xe9, + 0x6e, 0x58, 0x7b, 0xcd, 0xf2, 0xda, 0xab, 0x97, 0xb6, 0x5c, 0xeb, 0x53, 0xd8, 0x5e, 0xcd, 0xf2, + 0x5f, 0xce, 0x1f, 0x3e, 0x7d, 0x7d, 0xd5, 0xf6, 0xde, 0x5c, 0xb5, 0xbd, 0x3f, 0xae, 0xda, 0xde, + 0x0f, 0xd7, 0xed, 0xb5, 0x37, 0xd7, 0xed, 0xb5, 0xdf, 0xaf, 0xdb, 0x6b, 0xdf, 0x74, 0x87, 0x4c, + 0x8f, 0xa6, 0x83, 0x5e, 0x2c, 0x26, 0x7d, 0xc1, 0x95, 0xe0, 0xb2, 0x6f, 0x3f, 0x97, 0x7d, 0xb3, + 0x4b, 0x0d, 0x89, 0x6a, 0x50, 0xb5, 0x7f, 0xb8, 0x8f, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x96, + 0x98, 0xb5, 0xcd, 0xb9, 0x07, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -990,18 +848,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.GlobalIntegrity != nil { - { - size, err := m.GlobalIntegrity.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1015,55 +861,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GlobalIntegrity) 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 *GlobalIntegrity) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GlobalIntegrity) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Count != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Count)) - i-- - dAtA[i] = 0x20 - } - if len(m.Accumulator) > 0 { - i -= len(m.Accumulator) - copy(dAtA[i:], m.Accumulator) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Accumulator))) - i-- - dAtA[i] = 0x1a - } - if len(m.Seed) > 0 { - i -= len(m.Seed) - copy(dAtA[i:], m.Seed) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Seed))) - i-- - dAtA[i] = 0x12 - } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1197,10 +994,12 @@ func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if m.AssetType != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.AssetType)) + if len(m.AssetType) > 0 { + i -= len(m.AssetType) + copy(dAtA[i:], m.AssetType) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AssetType))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } if len(m.Symbol) > 0 { i -= len(m.Symbol) @@ -1224,6 +1023,88 @@ func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Document) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Document) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Service) > 0 { + for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Service[iNdEx]) + copy(dAtA[i:], m.Service[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Service[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.CapabilityInvocation) > 0 { + for iNdEx := len(m.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], m.CapabilityInvocation[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.CapabilityDelegation) > 0 { + for iNdEx := len(m.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], m.CapabilityDelegation[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.AssertionMethod) > 0 { + for iNdEx := len(m.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AssertionMethod[iNdEx]) + copy(dAtA[i:], m.AssertionMethod[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Authentication) > 0 { + for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Authentication[iNdEx]) + copy(dAtA[i:], m.Authentication[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Authentication[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *KeyInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1244,30 +1125,278 @@ func (m *KeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Type != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Type)) + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Type))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } - if m.Curve != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Curve)) + if len(m.Curve) > 0 { + i -= len(m.Curve) + copy(dAtA[i:], m.Curve) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Curve))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } - if m.Encoding != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Encoding)) + if len(m.Encoding) > 0 { + i -= len(m.Encoding) + copy(dAtA[i:], m.Encoding) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Encoding))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.Algorithm != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Algorithm)) + if len(m.Algorithm) > 0 { + i -= len(m.Algorithm) + copy(dAtA[i:], m.Algorithm) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Algorithm))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if m.Role != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Role)) + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Role))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PubKey) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Jwk != nil { + { + size, err := m.Jwk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Raw) > 0 { + i -= len(m.Raw) + copy(dAtA[i:], m.Raw) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Raw))) + i-- + dAtA[i] = 0x32 + } + if len(m.KeyType) > 0 { + i -= len(m.KeyType) + copy(dAtA[i:], m.KeyType) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.KeyType))) + i-- + dAtA[i] = 0x2a + } + if len(m.Curve) > 0 { + i -= len(m.Curve) + copy(dAtA[i:], m.Curve) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Curve))) + i-- + dAtA[i] = 0x22 + } + if len(m.Encoding) > 0 { + i -= len(m.Encoding) + copy(dAtA[i:], m.Encoding) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Encoding))) + i-- + dAtA[i] = 0x1a + } + if len(m.Algorithm) > 0 { + i -= len(m.Algorithm) + copy(dAtA[i:], m.Algorithm) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Algorithm))) + i-- + dAtA[i] = 0x12 + } + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PubKey_JWK) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PubKey_JWK) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey_JWK) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.E) > 0 { + i -= len(m.E) + copy(dAtA[i:], m.E) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.E))) + i-- + dAtA[i] = 0x32 + } + if len(m.N) > 0 { + i -= len(m.N) + copy(dAtA[i:], m.N) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.N))) + i-- + dAtA[i] = 0x2a + } + if len(m.Y) > 0 { + i -= len(m.Y) + copy(dAtA[i:], m.Y) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Y))) + i-- + dAtA[i] = 0x22 + } + if len(m.X) > 0 { + i -= len(m.X) + copy(dAtA[i:], m.X) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.X))) + i-- + dAtA[i] = 0x1a + } + if len(m.Crv) > 0 { + i -= len(m.Crv) + copy(dAtA[i:], m.Crv) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Crv))) + i-- + dAtA[i] = 0x12 + } + if len(m.Kty) > 0 { + i -= len(m.Kty) + copy(dAtA[i:], m.Kty) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Kty))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Service) 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 *Service) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Permissions) > 0 { + for k := range m.Permissions { + v := m.Permissions[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenesis(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGenesis(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if len(m.ServiceEndpoints) > 0 { + for k := range m.ServiceEndpoints { + v := m.ServiceEndpoints[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenesis(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGenesis(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x22 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a + } + if len(m.ServiceType) > 0 { + i -= len(m.ServiceType) + copy(dAtA[i:], m.ServiceType) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ServiceType))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -1291,34 +1420,6 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) - if m.GlobalIntegrity != nil { - l = m.GlobalIntegrity.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func (m *GlobalIntegrity) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Seed) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Accumulator) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Count != 0 { - n += 1 + sovGenesis(uint64(m.Count)) - } return n } @@ -1383,8 +1484,9 @@ func (m *AssetInfo) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - if m.AssetType != 0 { - n += 1 + sovGenesis(uint64(m.AssetType)) + l = len(m.AssetType) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) } l = len(m.Name) if l > 0 { @@ -1397,26 +1499,193 @@ func (m *AssetInfo) Size() (n int) { return n } +func (m *Document) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.Authentication) > 0 { + for _, s := range m.Authentication { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AssertionMethod) > 0 { + for _, s := range m.AssertionMethod { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.CapabilityDelegation) > 0 { + for _, s := range m.CapabilityDelegation { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.CapabilityInvocation) > 0 { + for _, s := range m.CapabilityInvocation { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Service) > 0 { + for _, s := range m.Service { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + func (m *KeyInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Role != 0 { - n += 1 + sovGenesis(uint64(m.Role)) + l = len(m.Role) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) } - if m.Algorithm != 0 { - n += 1 + sovGenesis(uint64(m.Algorithm)) + l = len(m.Algorithm) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) } - if m.Encoding != 0 { - n += 1 + sovGenesis(uint64(m.Encoding)) + l = len(m.Encoding) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) } - if m.Curve != 0 { - n += 1 + sovGenesis(uint64(m.Curve)) + l = len(m.Curve) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) } - if m.Type != 0 { - n += 1 + sovGenesis(uint64(m.Type)) + l = len(m.Type) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Role) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Algorithm) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Encoding) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Curve) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.KeyType) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Raw) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Jwk != nil { + l = m.Jwk.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *PubKey_JWK) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Kty) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Crv) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.X) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Y) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.N) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.E) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *Service) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ServiceType) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.ServiceEndpoints) > 0 { + for k, v := range m.ServiceEndpoints { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + 1 + len(v) + sovGenesis(uint64(len(v))) + n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) + } + } + if len(m.Permissions) > 0 { + for k, v := range m.Permissions { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + 1 + len(v) + sovGenesis(uint64(len(v))) + n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) + } } return n } @@ -1489,209 +1758,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GlobalIntegrity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.GlobalIntegrity == nil { - m.GlobalIntegrity = &GlobalIntegrity{} - } - if err := m.GlobalIntegrity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GlobalIntegrity) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GlobalIntegrity: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GlobalIntegrity: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Seed = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Accumulator = append(m.Accumulator[:0], dAtA[iNdEx:postIndex]...) - if m.Accumulator == nil { - m.Accumulator = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -2143,10 +2209,10 @@ func (m *AssetInfo) Unmarshal(dAtA []byte) error { m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AssetType", wireType) } - m.AssetType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -2156,11 +2222,24 @@ func (m *AssetInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AssetType |= AssetType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) @@ -2246,6 +2325,280 @@ func (m *AssetInfo) Unmarshal(dAtA []byte) error { } return nil } +func (m *Document) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssertionMethod = append(m.AssertionMethod, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CapabilityDelegation = append(m.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CapabilityInvocation = append(m.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Service = append(m.Service, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *KeyInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2276,10 +2629,10 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } - m.Role = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -2289,16 +2642,29 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Role |= KeyRole(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) } - m.Algorithm = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -2308,16 +2674,29 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Algorithm |= KeyAlgorithm(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Algorithm = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) } - m.Encoding = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -2327,16 +2706,29 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Encoding |= KeyEncoding(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Encoding = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) } - m.Curve = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -2346,16 +2738,29 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Curve |= KeyCurve(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Curve = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - m.Type = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -2365,11 +2770,1010 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= KeyType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Algorithm = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Encoding = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Curve = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...) + if m.Raw == nil { + m.Raw = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Jwk == nil { + m.Jwk = &PubKey_JWK{} + } + if err := m.Jwk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubKey_JWK) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JWK: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JWK: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kty", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kty = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Crv", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Crv = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.X = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Y", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Y = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field N", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.N = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.E = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Service) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Service: 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServiceEndpoints == nil { + m.ServiceEndpoints = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.ServiceEndpoints[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Permissions == nil { + m.Permissions = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Permissions[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/did/types/models.pb.go b/x/did/types/models.pb.go deleted file mode 100644 index 5c971ead1..000000000 --- a/x/did/types/models.pb.go +++ /dev/null @@ -1,4717 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: did/v1/models.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Credential struct { - Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` - AttestationType string `protobuf:"bytes,2,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` - Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` - CredentialId []byte `protobuf:"bytes,4,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` - PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Transport []string `protobuf:"bytes,6,rep,name=transport,proto3" json:"transport,omitempty"` - SignCount uint32 `protobuf:"varint,7,opt,name=sign_count,json=signCount,proto3" json:"sign_count,omitempty"` - UserPresent bool `protobuf:"varint,8,opt,name=user_present,json=userPresent,proto3" json:"user_present,omitempty"` - UserVerified bool `protobuf:"varint,9,opt,name=user_verified,json=userVerified,proto3" json:"user_verified,omitempty"` - BackupEligible bool `protobuf:"varint,10,opt,name=backup_eligible,json=backupEligible,proto3" json:"backup_eligible,omitempty"` - BackupState bool `protobuf:"varint,11,opt,name=backup_state,json=backupState,proto3" json:"backup_state,omitempty"` - CloneWarning bool `protobuf:"varint,12,opt,name=clone_warning,json=cloneWarning,proto3" json:"clone_warning,omitempty"` -} - -func (m *Credential) Reset() { *m = Credential{} } -func (m *Credential) String() string { return proto.CompactTextString(m) } -func (*Credential) ProtoMessage() {} -func (*Credential) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{0} -} -func (m *Credential) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Credential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Credential.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 *Credential) XXX_Merge(src proto.Message) { - xxx_messageInfo_Credential.Merge(m, src) -} -func (m *Credential) XXX_Size() int { - return m.Size() -} -func (m *Credential) XXX_DiscardUnknown() { - xxx_messageInfo_Credential.DiscardUnknown(m) -} - -var xxx_messageInfo_Credential proto.InternalMessageInfo - -func (m *Credential) GetSubject() string { - if m != nil { - return m.Subject - } - return "" -} - -func (m *Credential) GetAttestationType() string { - if m != nil { - return m.AttestationType - } - return "" -} - -func (m *Credential) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *Credential) GetCredentialId() []byte { - if m != nil { - return m.CredentialId - } - return nil -} - -func (m *Credential) GetPublicKey() []byte { - if m != nil { - return m.PublicKey - } - return nil -} - -func (m *Credential) GetTransport() []string { - if m != nil { - return m.Transport - } - return nil -} - -func (m *Credential) GetSignCount() uint32 { - if m != nil { - return m.SignCount - } - return 0 -} - -func (m *Credential) GetUserPresent() bool { - if m != nil { - return m.UserPresent - } - return false -} - -func (m *Credential) GetUserVerified() bool { - if m != nil { - return m.UserVerified - } - return false -} - -func (m *Credential) GetBackupEligible() bool { - if m != nil { - return m.BackupEligible - } - return false -} - -func (m *Credential) GetBackupState() bool { - if m != nil { - return m.BackupState - } - return false -} - -func (m *Credential) GetCloneWarning() bool { - if m != nil { - return m.CloneWarning - } - return false -} - -// Document defines a DID document -type Document struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` -} - -func (m *Document) Reset() { *m = Document{} } -func (m *Document) String() string { return proto.CompactTextString(m) } -func (*Document) ProtoMessage() {} -func (*Document) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{1} -} -func (m *Document) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Document.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Document) XXX_Merge(src proto.Message) { - xxx_messageInfo_Document.Merge(m, src) -} -func (m *Document) XXX_Size() int { - return m.Size() -} -func (m *Document) XXX_DiscardUnknown() { - xxx_messageInfo_Document.DiscardUnknown(m) -} - -var xxx_messageInfo_Document proto.InternalMessageInfo - -func (m *Document) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Document) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Document) GetAuthentication() []string { - if m != nil { - return m.Authentication - } - return nil -} - -func (m *Document) GetAssertionMethod() []string { - if m != nil { - return m.AssertionMethod - } - return nil -} - -func (m *Document) GetCapabilityDelegation() []string { - if m != nil { - return m.CapabilityDelegation - } - return nil -} - -func (m *Document) GetCapabilityInvocation() []string { - if m != nil { - return m.CapabilityInvocation - } - return nil -} - -func (m *Document) GetService() []string { - if m != nil { - return m.Service - } - return nil -} - -// Keyshare defines a keyshare from the MPC protocol -type Keyshare struct { - Metadata map[string]string `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Payloads map[string][]byte `protobuf:"bytes,2,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` - PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` - Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` -} - -func (m *Keyshare) Reset() { *m = Keyshare{} } -func (m *Keyshare) String() string { return proto.CompactTextString(m) } -func (*Keyshare) ProtoMessage() {} -func (*Keyshare) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{2} -} -func (m *Keyshare) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Keyshare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Keyshare.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 *Keyshare) XXX_Merge(src proto.Message) { - xxx_messageInfo_Keyshare.Merge(m, src) -} -func (m *Keyshare) XXX_Size() int { - return m.Size() -} -func (m *Keyshare) XXX_DiscardUnknown() { - xxx_messageInfo_Keyshare.DiscardUnknown(m) -} - -var xxx_messageInfo_Keyshare proto.InternalMessageInfo - -func (m *Keyshare) GetMetadata() map[string]string { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *Keyshare) GetPayloads() map[string][]byte { - if m != nil { - return m.Payloads - } - return nil -} - -func (m *Keyshare) GetProtocol() string { - if m != nil { - return m.Protocol - } - return "" -} - -func (m *Keyshare) GetPublicKey() []byte { - if m != nil { - return m.PublicKey - } - return nil -} - -func (m *Keyshare) GetVersion() uint32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *Keyshare) GetRole() int32 { - if m != nil { - return m.Role - } - return 0 -} - -// Permissions contains a list of grants and access control rules for -// a Service. -type Permissions struct { - Grants []DIDNamespace `protobuf:"varint,1,rep,packed,name=grants,proto3,enum=did.v1.DIDNamespace" json:"grants,omitempty"` - Scopes []PermissionScope `protobuf:"varint,2,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"` -} - -func (m *Permissions) Reset() { *m = Permissions{} } -func (m *Permissions) String() string { return proto.CompactTextString(m) } -func (*Permissions) ProtoMessage() {} -func (*Permissions) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{3} -} -func (m *Permissions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Permissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Permissions.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 *Permissions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Permissions.Merge(m, src) -} -func (m *Permissions) XXX_Size() int { - return m.Size() -} -func (m *Permissions) XXX_DiscardUnknown() { - xxx_messageInfo_Permissions.DiscardUnknown(m) -} - -var xxx_messageInfo_Permissions proto.InternalMessageInfo - -func (m *Permissions) GetGrants() []DIDNamespace { - if m != nil { - return m.Grants - } - return nil -} - -func (m *Permissions) GetScopes() []PermissionScope { - if m != nil { - return m.Scopes - } - return nil -} - -// PubKey defines a public key for a did -type PubKey struct { - Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` - Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` - Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` - Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` - KeyType KeyType `protobuf:"varint,5,opt,name=key_type,json=keyType,proto3,enum=did.v1.KeyType" json:"key_type,omitempty"` - Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` - Jwk *PubKey_JWK `protobuf:"bytes,7,opt,name=jwk,proto3" json:"jwk,omitempty"` -} - -func (m *PubKey) Reset() { *m = PubKey{} } -func (m *PubKey) String() string { return proto.CompactTextString(m) } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{4} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo - -func (m *PubKey) GetRole() KeyRole { - if m != nil { - return m.Role - } - return KeyRole_KEY_ROLE_UNSPECIFIED -} - -func (m *PubKey) GetAlgorithm() KeyAlgorithm { - if m != nil { - return m.Algorithm - } - return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED -} - -func (m *PubKey) GetEncoding() KeyEncoding { - if m != nil { - return m.Encoding - } - return KeyEncoding_KEY_ENCODING_UNSPECIFIED -} - -func (m *PubKey) GetCurve() KeyCurve { - if m != nil { - return m.Curve - } - return KeyCurve_KEY_CURVE_UNSPECIFIED -} - -func (m *PubKey) GetKeyType() KeyType { - if m != nil { - return m.KeyType - } - return KeyType_KEY_TYPE_UNSPECIFIED -} - -func (m *PubKey) GetRaw() []byte { - if m != nil { - return m.Raw - } - return nil -} - -func (m *PubKey) GetJwk() *PubKey_JWK { - if m != nil { - return m.Jwk - } - return nil -} - -// JWK represents a JSON Web Key -type PubKey_JWK struct { - Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` - Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` - X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` - Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` - N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` - E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` -} - -func (m *PubKey_JWK) Reset() { *m = PubKey_JWK{} } -func (m *PubKey_JWK) String() string { return proto.CompactTextString(m) } -func (*PubKey_JWK) ProtoMessage() {} -func (*PubKey_JWK) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{4, 0} -} -func (m *PubKey_JWK) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey_JWK) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey_JWK.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PubKey_JWK) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey_JWK.Merge(m, src) -} -func (m *PubKey_JWK) XXX_Size() int { - return m.Size() -} -func (m *PubKey_JWK) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey_JWK.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey_JWK proto.InternalMessageInfo - -func (m *PubKey_JWK) GetKty() string { - if m != nil { - return m.Kty - } - return "" -} - -func (m *PubKey_JWK) GetCrv() string { - if m != nil { - return m.Crv - } - return "" -} - -func (m *PubKey_JWK) GetX() string { - if m != nil { - return m.X - } - return "" -} - -func (m *PubKey_JWK) GetY() string { - if m != nil { - return m.Y - } - return "" -} - -func (m *PubKey_JWK) GetN() string { - if m != nil { - return m.N - } - return "" -} - -func (m *PubKey_JWK) GetE() string { - if m != nil { - return m.E - } - return "" -} - -// Service defines a Decentralized Service on the Sonr Blockchain -type Service struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (m *Service) Reset() { *m = Service{} } -func (m *Service) String() string { return proto.CompactTextString(m) } -func (*Service) ProtoMessage() {} -func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{5} -} -func (m *Service) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Service.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 *Service) XXX_Merge(src proto.Message) { - xxx_messageInfo_Service.Merge(m, src) -} -func (m *Service) XXX_Size() int { - return m.Size() -} -func (m *Service) XXX_DiscardUnknown() { - xxx_messageInfo_Service.DiscardUnknown(m) -} - -var xxx_messageInfo_Service proto.InternalMessageInfo - -func (m *Service) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Service) GetServiceType() string { - if m != nil { - return m.ServiceType - } - return "" -} - -func (m *Service) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *Service) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *Service) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Service) GetServiceEndpoints() map[string]string { - if m != nil { - return m.ServiceEndpoints - } - return nil -} - -func (m *Service) GetPermissions() *Permissions { - if m != nil { - return m.Permissions - } - return nil -} - -// ServicceInfo defines a Decentralized Service on the Sonr Blockchain -type ServiceInfo struct { - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - Fingerprint string `protobuf:"bytes,3,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` -} - -func (m *ServiceInfo) Reset() { *m = ServiceInfo{} } -func (m *ServiceInfo) String() string { return proto.CompactTextString(m) } -func (*ServiceInfo) ProtoMessage() {} -func (*ServiceInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{6} -} -func (m *ServiceInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceInfo.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 *ServiceInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceInfo.Merge(m, src) -} -func (m *ServiceInfo) XXX_Size() int { - return m.Size() -} -func (m *ServiceInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceInfo proto.InternalMessageInfo - -func (m *ServiceInfo) GetExists() bool { - if m != nil { - return m.Exists - } - return false -} - -func (m *ServiceInfo) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *ServiceInfo) GetFingerprint() string { - if m != nil { - return m.Fingerprint - } - return "" -} - -func (m *ServiceInfo) GetService() *Service { - if m != nil { - return m.Service - } - return nil -} - -// FirstPartyCaveat defines a first party caveat -type FirstPartyCaveat struct { - Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` - Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` - Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` - Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` -} - -func (m *FirstPartyCaveat) Reset() { *m = FirstPartyCaveat{} } -func (m *FirstPartyCaveat) String() string { return proto.CompactTextString(m) } -func (*FirstPartyCaveat) ProtoMessage() {} -func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{7} -} -func (m *FirstPartyCaveat) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FirstPartyCaveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FirstPartyCaveat.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 *FirstPartyCaveat) XXX_Merge(src proto.Message) { - xxx_messageInfo_FirstPartyCaveat.Merge(m, src) -} -func (m *FirstPartyCaveat) XXX_Size() int { - return m.Size() -} -func (m *FirstPartyCaveat) XXX_DiscardUnknown() { - xxx_messageInfo_FirstPartyCaveat.DiscardUnknown(m) -} - -var xxx_messageInfo_FirstPartyCaveat proto.InternalMessageInfo - -func (m *FirstPartyCaveat) GetScope() *Permissions { - if m != nil { - return m.Scope - } - return nil -} - -func (m *FirstPartyCaveat) GetExp() int64 { - if m != nil { - return m.Exp - } - return 0 -} - -func (m *FirstPartyCaveat) GetCnf() string { - if m != nil { - return m.Cnf - } - return "" -} - -func (m *FirstPartyCaveat) GetAud() string { - if m != nil { - return m.Aud - } - return "" -} - -// ThirdPartyCaveat defines a third party caveat -type ThirdPartyCaveat struct { - Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` - Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` - Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` - Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` -} - -func (m *ThirdPartyCaveat) Reset() { *m = ThirdPartyCaveat{} } -func (m *ThirdPartyCaveat) String() string { return proto.CompactTextString(m) } -func (*ThirdPartyCaveat) ProtoMessage() {} -func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{8} -} -func (m *ThirdPartyCaveat) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ThirdPartyCaveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ThirdPartyCaveat.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 *ThirdPartyCaveat) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThirdPartyCaveat.Merge(m, src) -} -func (m *ThirdPartyCaveat) XXX_Size() int { - return m.Size() -} -func (m *ThirdPartyCaveat) XXX_DiscardUnknown() { - xxx_messageInfo_ThirdPartyCaveat.DiscardUnknown(m) -} - -var xxx_messageInfo_ThirdPartyCaveat proto.InternalMessageInfo - -func (m *ThirdPartyCaveat) GetScope() *Permissions { - if m != nil { - return m.Scope - } - return nil -} - -func (m *ThirdPartyCaveat) GetExp() int64 { - if m != nil { - return m.Exp - } - return 0 -} - -func (m *ThirdPartyCaveat) GetCnf() string { - if m != nil { - return m.Cnf - } - return "" -} - -func (m *ThirdPartyCaveat) GetAud() string { - if m != nil { - return m.Aud - } - return "" -} - -func init() { - proto.RegisterType((*Credential)(nil), "did.v1.Credential") - proto.RegisterType((*Document)(nil), "did.v1.Document") - proto.RegisterType((*Keyshare)(nil), "did.v1.Keyshare") - proto.RegisterMapType((map[string]string)(nil), "did.v1.Keyshare.MetadataEntry") - proto.RegisterMapType((map[string][]byte)(nil), "did.v1.Keyshare.PayloadsEntry") - proto.RegisterType((*Permissions)(nil), "did.v1.Permissions") - proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") - proto.RegisterType((*PubKey_JWK)(nil), "did.v1.PubKey.JWK") - proto.RegisterType((*Service)(nil), "did.v1.Service") - proto.RegisterMapType((map[string]string)(nil), "did.v1.Service.ServiceEndpointsEntry") - proto.RegisterType((*ServiceInfo)(nil), "did.v1.ServiceInfo") - proto.RegisterType((*FirstPartyCaveat)(nil), "did.v1.FirstPartyCaveat") - proto.RegisterType((*ThirdPartyCaveat)(nil), "did.v1.ThirdPartyCaveat") -} - -func init() { proto.RegisterFile("did/v1/models.proto", fileDescriptor_739bb5ab5cb60751) } - -var fileDescriptor_739bb5ab5cb60751 = []byte{ - // 1125 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xef, 0x7a, 0x63, 0xc7, 0x3b, 0x76, 0x9d, 0x30, 0x4d, 0x61, 0x15, 0x15, 0xcb, 0x75, 0xa1, - 0xb8, 0x08, 0xd9, 0xaa, 0x2b, 0x24, 0x54, 0xb8, 0x40, 0x12, 0xa4, 0x34, 0x2a, 0x8a, 0xb6, 0x15, - 0x95, 0xb8, 0x58, 0xe3, 0xdd, 0x97, 0xf5, 0x34, 0xeb, 0x99, 0xd5, 0xcc, 0xac, 0x9b, 0x3d, 0x72, - 0xe5, 0x04, 0x9f, 0x81, 0x2f, 0xc3, 0xb1, 0x47, 0x8e, 0xa8, 0x85, 0xef, 0x81, 0xe6, 0xcf, 0xda, - 0x5b, 0x97, 0x0a, 0x71, 0xe1, 0x92, 0xbc, 0xf7, 0x7b, 0xbf, 0xb7, 0xf3, 0xf6, 0xf7, 0xde, 0x9b, - 0x35, 0xba, 0x91, 0xd0, 0x64, 0xb2, 0xba, 0x3f, 0x59, 0xf2, 0x04, 0x32, 0x39, 0xce, 0x05, 0x57, - 0x1c, 0xb7, 0x12, 0x9a, 0x8c, 0x57, 0xf7, 0x0f, 0x0f, 0x5c, 0x30, 0x05, 0x06, 0x92, 0xba, 0xe8, - 0xe1, 0x41, 0xca, 0x53, 0x6e, 0xcc, 0x89, 0xb6, 0x2c, 0x3a, 0xfc, 0xd5, 0x47, 0xe8, 0x48, 0x40, - 0x02, 0x4c, 0x51, 0x92, 0xe1, 0x10, 0xed, 0xca, 0x62, 0xfe, 0x1c, 0x62, 0x15, 0x7a, 0x03, 0x6f, - 0x14, 0x44, 0x95, 0x8b, 0xef, 0xa1, 0x7d, 0xa2, 0x14, 0x48, 0x45, 0x14, 0xe5, 0x6c, 0xa6, 0xca, - 0x1c, 0xc2, 0x86, 0xa1, 0xec, 0xd5, 0xf0, 0xa7, 0x65, 0x0e, 0xf8, 0x7d, 0xd4, 0xe2, 0x82, 0xa6, - 0x94, 0x85, 0xbe, 0x21, 0x38, 0x0f, 0xdf, 0x41, 0xd7, 0xe3, 0xf5, 0x51, 0x33, 0x9a, 0x84, 0x3b, - 0x03, 0x6f, 0xd4, 0x8d, 0xba, 0x1b, 0xf0, 0x34, 0xc1, 0x1f, 0x22, 0x94, 0x17, 0xf3, 0x8c, 0xc6, - 0xb3, 0x4b, 0x28, 0xc3, 0xa6, 0x61, 0x04, 0x16, 0x39, 0x83, 0x12, 0xdf, 0x42, 0x81, 0x12, 0x84, - 0xc9, 0x9c, 0x0b, 0x15, 0xb6, 0x06, 0xfe, 0x28, 0x88, 0x36, 0x80, 0x4e, 0x96, 0x34, 0x65, 0xb3, - 0x98, 0x17, 0x4c, 0x85, 0xbb, 0x03, 0x6f, 0x74, 0x3d, 0x0a, 0x34, 0x72, 0xa4, 0x01, 0x7c, 0x1b, - 0x75, 0x0b, 0x09, 0x62, 0x96, 0x0b, 0x90, 0xc0, 0x54, 0xd8, 0x1e, 0x78, 0xa3, 0x76, 0xd4, 0xd1, - 0xd8, 0xb9, 0x85, 0x74, 0x8d, 0x86, 0xb2, 0x02, 0x41, 0x2f, 0x28, 0x24, 0x61, 0x60, 0x38, 0x26, - 0xef, 0x7b, 0x87, 0xe1, 0x4f, 0xd0, 0xde, 0x9c, 0xc4, 0x97, 0x45, 0x3e, 0x83, 0x8c, 0xa6, 0x74, - 0x9e, 0x41, 0x88, 0x0c, 0xad, 0x67, 0xe1, 0x13, 0x87, 0xea, 0x03, 0x1d, 0x51, 0xeb, 0x03, 0x61, - 0xc7, 0x1e, 0x68, 0xb1, 0x27, 0x1a, 0x32, 0xa2, 0x64, 0x9c, 0xc1, 0xec, 0x05, 0x11, 0x8c, 0xb2, - 0x34, 0xec, 0xda, 0x03, 0x0d, 0xf8, 0xcc, 0x62, 0xc3, 0x5f, 0x1a, 0xa8, 0x7d, 0xcc, 0xe3, 0x62, - 0xa9, 0x4b, 0xec, 0xa1, 0x06, 0x4d, 0x5c, 0x7b, 0x1a, 0x34, 0xc1, 0x7d, 0x84, 0x62, 0xce, 0x94, - 0xe0, 0x59, 0x06, 0xc2, 0xf5, 0xa4, 0x86, 0xe0, 0xbb, 0xa8, 0x47, 0x0a, 0xb5, 0xd0, 0x0a, 0xc7, - 0xa6, 0x49, 0xa1, 0x6f, 0x74, 0xdb, 0x42, 0x4d, 0x87, 0xa5, 0x04, 0x61, 0xfa, 0xbb, 0x04, 0xb5, - 0xe0, 0xba, 0x43, 0xbe, 0xe9, 0x70, 0x85, 0x3f, 0x36, 0x30, 0x7e, 0x80, 0x6e, 0xc6, 0x24, 0x27, - 0x73, 0x9a, 0x51, 0x55, 0xce, 0x12, 0xc8, 0x20, 0xb5, 0x4f, 0x6e, 0x1a, 0xfe, 0xc1, 0x26, 0x78, - 0xbc, 0x8e, 0x6d, 0x25, 0x51, 0xb6, 0xe2, 0xae, 0x9c, 0xd6, 0x76, 0xd2, 0xe9, 0x3a, 0x66, 0x06, - 0x12, 0xc4, 0x8a, 0xc6, 0x10, 0xee, 0x1a, 0x5a, 0xe5, 0x0e, 0xff, 0x6a, 0xa0, 0xf6, 0x19, 0x94, - 0x72, 0x41, 0x04, 0xe0, 0x87, 0xa8, 0xbd, 0x04, 0x45, 0x12, 0xa2, 0x48, 0xe8, 0x0d, 0xfc, 0x51, - 0x67, 0xda, 0x1f, 0xdb, 0x6d, 0x18, 0x57, 0x9c, 0xf1, 0x63, 0x47, 0x38, 0x61, 0x4a, 0x94, 0xd1, - 0x9a, 0xaf, 0x73, 0x73, 0x52, 0x66, 0x9c, 0x24, 0x32, 0x6c, 0xbc, 0x23, 0xf7, 0xdc, 0x11, 0x5c, - 0x6e, 0xc5, 0xc7, 0x87, 0xa8, 0x6d, 0xf6, 0x28, 0xe6, 0x99, 0x1b, 0xf6, 0xb5, 0xbf, 0x35, 0xc9, - 0x3b, 0xdb, 0x93, 0x1c, 0xa2, 0xdd, 0x15, 0x08, 0x69, 0x55, 0xd3, 0x83, 0x5a, 0xb9, 0x18, 0xa3, - 0x1d, 0xc1, 0x33, 0x08, 0x5b, 0x03, 0x6f, 0xd4, 0x8c, 0x8c, 0x7d, 0xf8, 0x25, 0xba, 0xfe, 0x46, - 0xfd, 0x78, 0x1f, 0xf9, 0xfa, 0xb1, 0x76, 0x0c, 0xb4, 0x89, 0x0f, 0x50, 0x73, 0x45, 0xb2, 0xa2, - 0x5a, 0x4b, 0xeb, 0x3c, 0x6c, 0x7c, 0xe1, 0xe9, 0xe4, 0x37, 0x5e, 0xe0, 0xdf, 0x92, 0xbb, 0xb5, - 0xe4, 0x61, 0x86, 0x3a, 0xe7, 0x20, 0x96, 0x54, 0xea, 0xda, 0x24, 0xfe, 0x0c, 0xb5, 0x52, 0x41, - 0x98, 0x92, 0x46, 0xe7, 0xde, 0xf4, 0xa0, 0xd2, 0xea, 0xf8, 0xf4, 0xf8, 0x3b, 0xb2, 0x04, 0x99, - 0x93, 0x18, 0x22, 0xc7, 0xc1, 0x13, 0xd4, 0x92, 0x31, 0xcf, 0xc1, 0x2a, 0xdb, 0x9b, 0x7e, 0x50, - 0xb1, 0x37, 0x8f, 0x7c, 0xa2, 0xe3, 0x91, 0xa3, 0x0d, 0x7f, 0xf4, 0x51, 0xeb, 0xbc, 0x98, 0x6b, - 0x81, 0xee, 0x38, 0x19, 0x74, 0x95, 0xbd, 0xe9, 0x5e, 0xad, 0x27, 0x11, 0xcf, 0xc0, 0xea, 0x82, - 0xa7, 0x28, 0x20, 0x59, 0xca, 0x05, 0x55, 0x8b, 0xa5, 0xa9, 0xbd, 0x56, 0xd1, 0x19, 0x94, 0x5f, - 0x57, 0xb1, 0x68, 0x43, 0xc3, 0x13, 0xd4, 0x06, 0x16, 0xf3, 0x44, 0x6f, 0x9b, 0x6f, 0x52, 0x6e, - 0xd4, 0x52, 0x4e, 0x5c, 0x28, 0x5a, 0x93, 0xf0, 0x5d, 0xd4, 0x8c, 0x0b, 0xb1, 0x02, 0xd3, 0xc4, - 0xde, 0x74, 0xbf, 0xc6, 0x3e, 0xd2, 0x78, 0x64, 0xc3, 0xf8, 0x53, 0xd4, 0xbe, 0x84, 0xd2, 0xde, - 0x8d, 0xcd, 0xb7, 0xaa, 0xd6, 0x77, 0x63, 0xb4, 0x7b, 0x69, 0x0d, 0xdd, 0x02, 0x41, 0x5e, 0x98, - 0x1e, 0x77, 0x23, 0x6d, 0xe2, 0x8f, 0x90, 0xff, 0xfc, 0xc5, 0xa5, 0xb9, 0xb5, 0x3a, 0x53, 0xbc, - 0x16, 0xca, 0x88, 0x31, 0x7e, 0xf4, 0xec, 0x2c, 0xd2, 0xe1, 0x43, 0x82, 0xfc, 0x47, 0xcf, 0xce, - 0x4c, 0x07, 0xd5, 0xa6, 0x83, 0xca, 0xf4, 0x34, 0x16, 0x2b, 0xd7, 0x7c, 0x6d, 0xe2, 0x2e, 0xf2, - 0xae, 0xdc, 0x54, 0x7a, 0x57, 0xda, 0xb3, 0x53, 0x18, 0x44, 0x5e, 0xa9, 0x3d, 0x3b, 0x77, 0x41, - 0xe4, 0x31, 0xed, 0xd9, 0x71, 0x0b, 0x22, 0x0f, 0x86, 0x7f, 0x36, 0xd0, 0xee, 0x13, 0xbb, 0x65, - 0x6f, 0x5d, 0x36, 0xb7, 0x51, 0xd7, 0x2d, 0x60, 0xfd, 0x13, 0xd0, 0x71, 0x98, 0x79, 0xb3, 0x5b, - 0x28, 0xd0, 0x37, 0x8b, 0x16, 0xbb, 0x74, 0xc7, 0x6f, 0x80, 0xda, 0xc7, 0x61, 0xe7, 0x8d, 0x8f, - 0xc3, 0x00, 0x75, 0x12, 0x90, 0xb1, 0xa0, 0xb9, 0xaa, 0x56, 0x22, 0x88, 0xea, 0x10, 0x8e, 0xd0, - 0x7b, 0xd5, 0xd1, 0xc0, 0x92, 0x9c, 0x53, 0x3d, 0x84, 0x2d, 0xb3, 0xb0, 0x1f, 0x57, 0x6a, 0xb9, - 0xb2, 0xab, 0xff, 0x27, 0x15, 0xcf, 0xee, 0xed, 0xbe, 0xdc, 0x82, 0xf1, 0xe7, 0xa8, 0x93, 0x6f, - 0x86, 0xdb, 0x69, 0x7f, 0xe3, 0xed, 0x21, 0x95, 0x51, 0x9d, 0x77, 0x78, 0x84, 0x6e, 0xfe, 0xe3, - 0x09, 0xff, 0x65, 0x2b, 0x87, 0x3f, 0x79, 0xa8, 0xe3, 0x9e, 0x72, 0xca, 0x2e, 0xb8, 0x56, 0x06, - 0xae, 0xa8, 0x34, 0x9b, 0xa5, 0x3f, 0x01, 0xce, 0xab, 0x29, 0xd6, 0xd8, 0x56, 0xec, 0x82, 0xb2, - 0x14, 0x44, 0x2e, 0x28, 0x53, 0x4e, 0xe9, 0x3a, 0x84, 0xef, 0x6d, 0x2e, 0xcf, 0x1d, 0xf3, 0x66, - 0x7b, 0x5b, 0x3a, 0x6d, 0x6e, 0x53, 0x89, 0xf6, 0xbf, 0xa5, 0x42, 0xaa, 0x73, 0x22, 0x54, 0x79, - 0x44, 0x56, 0x40, 0x74, 0x7a, 0xd3, 0x6c, 0xa5, 0xa9, 0xe7, 0x1d, 0xb2, 0x58, 0x86, 0x7e, 0x6f, - 0xb8, 0xca, 0x4d, 0x81, 0x7e, 0xa4, 0x4d, 0x33, 0x8e, 0xec, 0xc2, 0x55, 0xa5, 0x4d, 0x8d, 0x90, - 0x22, 0x71, 0x6d, 0xd7, 0xa6, 0x3e, 0xf4, 0xe9, 0x82, 0x8a, 0xe4, 0xff, 0x3c, 0xf4, 0x9b, 0xaf, - 0x7e, 0x7b, 0xd5, 0xf7, 0x5e, 0xbe, 0xea, 0x7b, 0x7f, 0xbc, 0xea, 0x7b, 0x3f, 0xbf, 0xee, 0x5f, - 0x7b, 0xf9, 0xba, 0x7f, 0xed, 0xf7, 0xd7, 0xfd, 0x6b, 0x3f, 0x0c, 0x53, 0xaa, 0x16, 0xc5, 0x7c, - 0x1c, 0xf3, 0xe5, 0x84, 0x33, 0xc9, 0x99, 0x98, 0x98, 0x3f, 0x57, 0x13, 0xfd, 0x83, 0x4a, 0x8f, - 0xbb, 0x9c, 0xb7, 0xcc, 0xf5, 0xfe, 0xe0, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x9b, 0xe9, - 0xda, 0x81, 0x09, 0x00, 0x00, -} - -func (m *Credential) Marshal() (dAtA []byte, err error) { - 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 *Credential) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Credential) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CloneWarning { - i-- - if m.CloneWarning { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x60 - } - if m.BackupState { - i-- - if m.BackupState { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - if m.BackupEligible { - i-- - if m.BackupEligible { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if m.UserVerified { - i-- - if m.UserVerified { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if m.UserPresent { - i-- - if m.UserPresent { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.SignCount != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.SignCount)) - i-- - dAtA[i] = 0x38 - } - if len(m.Transport) > 0 { - for iNdEx := len(m.Transport) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Transport[iNdEx]) - copy(dAtA[i:], m.Transport[iNdEx]) - i = encodeVarintModels(dAtA, i, uint64(len(m.Transport[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintModels(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x2a - } - if len(m.CredentialId) > 0 { - i -= len(m.CredentialId) - copy(dAtA[i:], m.CredentialId) - i = encodeVarintModels(dAtA, i, uint64(len(m.CredentialId))) - i-- - dAtA[i] = 0x22 - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x1a - } - if len(m.AttestationType) > 0 { - i -= len(m.AttestationType) - copy(dAtA[i:], m.AttestationType) - i = encodeVarintModels(dAtA, i, uint64(len(m.AttestationType))) - i-- - dAtA[i] = 0x12 - } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintModels(dAtA, i, uint64(len(m.Subject))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Document) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Document) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Service) > 0 { - for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Service[iNdEx]) - copy(dAtA[i:], m.Service[iNdEx]) - i = encodeVarintModels(dAtA, i, uint64(len(m.Service[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(m.CapabilityInvocation) > 0 { - for iNdEx := len(m.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CapabilityInvocation[iNdEx]) - copy(dAtA[i:], m.CapabilityInvocation[iNdEx]) - i = encodeVarintModels(dAtA, i, uint64(len(m.CapabilityInvocation[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.CapabilityDelegation) > 0 { - for iNdEx := len(m.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CapabilityDelegation[iNdEx]) - copy(dAtA[i:], m.CapabilityDelegation[iNdEx]) - i = encodeVarintModels(dAtA, i, uint64(len(m.CapabilityDelegation[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.AssertionMethod) > 0 { - for iNdEx := len(m.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AssertionMethod[iNdEx]) - copy(dAtA[i:], m.AssertionMethod[iNdEx]) - i = encodeVarintModels(dAtA, i, uint64(len(m.AssertionMethod[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Authentication) > 0 { - for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Authentication[iNdEx]) - copy(dAtA[i:], m.Authentication[iNdEx]) - i = encodeVarintModels(dAtA, i, uint64(len(m.Authentication[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintModels(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintModels(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Keyshare) 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 *Keyshare) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Keyshare) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Role != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x30 - } - if m.Version != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x28 - } - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintModels(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x22 - } - if len(m.Protocol) > 0 { - i -= len(m.Protocol) - copy(dAtA[i:], m.Protocol) - i = encodeVarintModels(dAtA, i, uint64(len(m.Protocol))) - i-- - dAtA[i] = 0x1a - } - if len(m.Payloads) > 0 { - for k := range m.Payloads { - v := m.Payloads[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintModels(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintModels(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintModels(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Metadata) > 0 { - for k := range m.Metadata { - v := m.Metadata[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintModels(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintModels(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintModels(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Permissions) 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 *Permissions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Scopes) > 0 { - dAtA2 := make([]byte, len(m.Scopes)*10) - var j1 int - for _, num := range m.Scopes { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintModels(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x12 - } - if len(m.Grants) > 0 { - dAtA4 := make([]byte, len(m.Grants)*10) - var j3 int - for _, num := range m.Grants { - for num >= 1<<7 { - dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j3++ - } - dAtA4[j3] = uint8(num) - j3++ - } - i -= j3 - copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintModels(dAtA, i, uint64(j3)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PubKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Jwk != nil { - { - size, err := m.Jwk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModels(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.Raw) > 0 { - i -= len(m.Raw) - copy(dAtA[i:], m.Raw) - i = encodeVarintModels(dAtA, i, uint64(len(m.Raw))) - i-- - dAtA[i] = 0x32 - } - if m.KeyType != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.KeyType)) - i-- - dAtA[i] = 0x28 - } - if m.Curve != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Curve)) - i-- - dAtA[i] = 0x20 - } - if m.Encoding != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Encoding)) - i-- - dAtA[i] = 0x18 - } - if m.Algorithm != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Algorithm)) - i-- - dAtA[i] = 0x10 - } - if m.Role != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PubKey_JWK) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKey_JWK) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey_JWK) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.E) > 0 { - i -= len(m.E) - copy(dAtA[i:], m.E) - i = encodeVarintModels(dAtA, i, uint64(len(m.E))) - i-- - dAtA[i] = 0x32 - } - if len(m.N) > 0 { - i -= len(m.N) - copy(dAtA[i:], m.N) - i = encodeVarintModels(dAtA, i, uint64(len(m.N))) - i-- - dAtA[i] = 0x2a - } - if len(m.Y) > 0 { - i -= len(m.Y) - copy(dAtA[i:], m.Y) - i = encodeVarintModels(dAtA, i, uint64(len(m.Y))) - i-- - dAtA[i] = 0x22 - } - if len(m.X) > 0 { - i -= len(m.X) - copy(dAtA[i:], m.X) - i = encodeVarintModels(dAtA, i, uint64(len(m.X))) - i-- - dAtA[i] = 0x1a - } - if len(m.Crv) > 0 { - i -= len(m.Crv) - copy(dAtA[i:], m.Crv) - i = encodeVarintModels(dAtA, i, uint64(len(m.Crv))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kty) > 0 { - i -= len(m.Kty) - copy(dAtA[i:], m.Kty) - i = encodeVarintModels(dAtA, i, uint64(len(m.Kty))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Service) 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 *Service) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Permissions != nil { - { - size, err := m.Permissions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModels(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.ServiceEndpoints) > 0 { - for k := range m.ServiceEndpoints { - v := m.ServiceEndpoints[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintModels(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintModels(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintModels(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintModels(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x2a - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x22 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintModels(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1a - } - if len(m.ServiceType) > 0 { - i -= len(m.ServiceType) - copy(dAtA[i:], m.ServiceType) - i = encodeVarintModels(dAtA, i, uint64(len(m.ServiceType))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintModels(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ServiceInfo) 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 *ServiceInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModels(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Fingerprint) > 0 { - i -= len(m.Fingerprint) - copy(dAtA[i:], m.Fingerprint) - i = encodeVarintModels(dAtA, i, uint64(len(m.Fingerprint))) - i-- - dAtA[i] = 0x1a - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x12 - } - if m.Exists { - i-- - if m.Exists { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *FirstPartyCaveat) 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 *FirstPartyCaveat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FirstPartyCaveat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Aud) > 0 { - i -= len(m.Aud) - copy(dAtA[i:], m.Aud) - i = encodeVarintModels(dAtA, i, uint64(len(m.Aud))) - i-- - dAtA[i] = 0x22 - } - if len(m.Cnf) > 0 { - i -= len(m.Cnf) - copy(dAtA[i:], m.Cnf) - i = encodeVarintModels(dAtA, i, uint64(len(m.Cnf))) - i-- - dAtA[i] = 0x1a - } - if m.Exp != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Exp)) - i-- - dAtA[i] = 0x10 - } - if m.Scope != nil { - { - size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModels(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ThirdPartyCaveat) 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 *ThirdPartyCaveat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ThirdPartyCaveat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Aud) > 0 { - i -= len(m.Aud) - copy(dAtA[i:], m.Aud) - i = encodeVarintModels(dAtA, i, uint64(len(m.Aud))) - i-- - dAtA[i] = 0x22 - } - if len(m.Cnf) > 0 { - i -= len(m.Cnf) - copy(dAtA[i:], m.Cnf) - i = encodeVarintModels(dAtA, i, uint64(len(m.Cnf))) - i-- - dAtA[i] = 0x1a - } - if m.Exp != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Exp)) - i-- - dAtA[i] = 0x10 - } - if m.Scope != nil { - { - size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModels(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintModels(dAtA []byte, offset int, v uint64) int { - offset -= sovModels(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Credential) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subject) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.AttestationType) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.CredentialId) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if len(m.Transport) > 0 { - for _, s := range m.Transport { - l = len(s) - n += 1 + l + sovModels(uint64(l)) - } - } - if m.SignCount != 0 { - n += 1 + sovModels(uint64(m.SignCount)) - } - if m.UserPresent { - n += 2 - } - if m.UserVerified { - n += 2 - } - if m.BackupEligible { - n += 2 - } - if m.BackupState { - n += 2 - } - if m.CloneWarning { - n += 2 - } - return n -} - -func (m *Document) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if len(m.Authentication) > 0 { - for _, s := range m.Authentication { - l = len(s) - n += 1 + l + sovModels(uint64(l)) - } - } - if len(m.AssertionMethod) > 0 { - for _, s := range m.AssertionMethod { - l = len(s) - n += 1 + l + sovModels(uint64(l)) - } - } - if len(m.CapabilityDelegation) > 0 { - for _, s := range m.CapabilityDelegation { - l = len(s) - n += 1 + l + sovModels(uint64(l)) - } - } - if len(m.CapabilityInvocation) > 0 { - for _, s := range m.CapabilityInvocation { - l = len(s) - n += 1 + l + sovModels(uint64(l)) - } - } - if len(m.Service) > 0 { - for _, s := range m.Service { - l = len(s) - n += 1 + l + sovModels(uint64(l)) - } - } - return n -} - -func (m *Keyshare) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Metadata) > 0 { - for k, v := range m.Metadata { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + 1 + len(v) + sovModels(uint64(len(v))) - n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) - } - } - if len(m.Payloads) > 0 { - for k, v := range m.Payloads { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovModels(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + l - n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) - } - } - l = len(m.Protocol) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if m.Version != 0 { - n += 1 + sovModels(uint64(m.Version)) - } - if m.Role != 0 { - n += 1 + sovModels(uint64(m.Role)) - } - return n -} - -func (m *Permissions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Grants) > 0 { - l = 0 - for _, e := range m.Grants { - l += sovModels(uint64(e)) - } - n += 1 + sovModels(uint64(l)) + l - } - if len(m.Scopes) > 0 { - l = 0 - for _, e := range m.Scopes { - l += sovModels(uint64(e)) - } - n += 1 + sovModels(uint64(l)) + l - } - return n -} - -func (m *PubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Role != 0 { - n += 1 + sovModels(uint64(m.Role)) - } - if m.Algorithm != 0 { - n += 1 + sovModels(uint64(m.Algorithm)) - } - if m.Encoding != 0 { - n += 1 + sovModels(uint64(m.Encoding)) - } - if m.Curve != 0 { - n += 1 + sovModels(uint64(m.Curve)) - } - if m.KeyType != 0 { - n += 1 + sovModels(uint64(m.KeyType)) - } - l = len(m.Raw) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if m.Jwk != nil { - l = m.Jwk.Size() - n += 1 + l + sovModels(uint64(l)) - } - return n -} - -func (m *PubKey_JWK) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kty) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Crv) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.X) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Y) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.N) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.E) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - return n -} - -func (m *Service) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.ServiceType) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if len(m.ServiceEndpoints) > 0 { - for k, v := range m.ServiceEndpoints { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + 1 + len(v) + sovModels(uint64(len(v))) - n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) - } - } - if m.Permissions != nil { - l = m.Permissions.Size() - n += 1 + l + sovModels(uint64(l)) - } - return n -} - -func (m *ServiceInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Exists { - n += 2 - } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Fingerprint) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovModels(uint64(l)) - } - return n -} - -func (m *FirstPartyCaveat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Scope != nil { - l = m.Scope.Size() - n += 1 + l + sovModels(uint64(l)) - } - if m.Exp != 0 { - n += 1 + sovModels(uint64(m.Exp)) - } - l = len(m.Cnf) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Aud) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - return n -} - -func (m *ThirdPartyCaveat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Scope != nil { - l = m.Scope.Size() - n += 1 + l + sovModels(uint64(l)) - } - if m.Exp != 0 { - n += 1 + sovModels(uint64(m.Exp)) - } - l = len(m.Cnf) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - l = len(m.Aud) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - return n -} - -func sovModels(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozModels(x uint64) (n int) { - return sovModels(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Credential) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Credential: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Credential: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttestationType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttestationType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CredentialId = append(m.CredentialId[:0], dAtA[iNdEx:postIndex]...) - if m.CredentialId == nil { - m.CredentialId = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Transport", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Transport = append(m.Transport, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SignCount", wireType) - } - m.SignCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SignCount |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UserPresent", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UserPresent = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UserVerified", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UserVerified = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BackupEligible", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BackupEligible = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BackupState", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BackupState = bool(v != 0) - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CloneWarning", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CloneWarning = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Document) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Document: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssertionMethod = append(m.AssertionMethod, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CapabilityDelegation = append(m.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CapabilityInvocation = append(m.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Service = append(m.Service, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Keyshare) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Keyshare: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Keyshare: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthModels - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthModels - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthModels - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthModels - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = mapvalue - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payloads", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Payloads == nil { - m.Payloads = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthModels - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthModels - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthModels - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthModels - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Payloads[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Protocol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - m.Role = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Role |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Permissions) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Permissions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Permissions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v DIDNamespace - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= DIDNamespace(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Grants = append(m.Grants, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Grants) == 0 { - m.Grants = make([]DIDNamespace, 0, elementCount) - } - for iNdEx < postIndex { - var v DIDNamespace - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= DIDNamespace(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Grants = append(m.Grants, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Grants", wireType) - } - case 2: - if wireType == 0 { - var v PermissionScope - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= PermissionScope(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Scopes = append(m.Scopes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Scopes) == 0 { - m.Scopes = make([]PermissionScope, 0, elementCount) - } - for iNdEx < postIndex { - var v PermissionScope - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= PermissionScope(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Scopes = append(m.Scopes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PubKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - m.Role = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Role |= KeyRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) - } - m.Algorithm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Algorithm |= KeyAlgorithm(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) - } - m.Encoding = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Encoding |= KeyEncoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) - } - m.Curve = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Curve |= KeyCurve(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) - } - m.KeyType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.KeyType |= KeyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...) - if m.Raw == nil { - m.Raw = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Jwk == nil { - m.Jwk = &PubKey_JWK{} - } - if err := m.Jwk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PubKey_JWK) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JWK: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JWK: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kty", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kty = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Crv", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Crv = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.X = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Y", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Y = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field N", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.N = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.E = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Service) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Service: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Service: 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 ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ServiceEndpoints == nil { - m.ServiceEndpoints = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthModels - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthModels - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthModels - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthModels - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.ServiceEndpoints[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Permissions == nil { - m.Permissions = &Permissions{} - } - if err := m.Permissions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ServiceInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Exists = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fingerprint = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &Service{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FirstPartyCaveat) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FirstPartyCaveat: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FirstPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scope == nil { - m.Scope = &Permissions{} - } - if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) - } - m.Exp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Exp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cnf = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aud = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ThirdPartyCaveat) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ThirdPartyCaveat: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ThirdPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scope == nil { - m.Scope = &Permissions{} - } - if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) - } - m.Exp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Exp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cnf = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModels - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModels - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModels - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aud = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModels(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModels - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipModels(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModels - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModels - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModels - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthModels - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupModels - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthModels - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthModels = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowModels = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/did/types/namespace.go b/x/did/types/namespace.go deleted file mode 100644 index 1e6da75c9..000000000 --- a/x/did/types/namespace.go +++ /dev/null @@ -1,102 +0,0 @@ -package types - -import ( - "cosmossdk.io/x/nft" -) - -func (n DIDNamespace) ID() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "did:dwn:0" - case DIDNamespace_DID_NAMESPACE_SONR: - return "did:sonr:0" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "did:btc:0" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "did:eth:0" - case DIDNamespace_DID_NAMESPACE_IBC: - return "did:ibc:0" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "did:authn:0" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "did:web:0" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "did:ipfs:0" - } - return "" -} - -func (n DIDNamespace) Name() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "DecentralizedWebNode" - case DIDNamespace_DID_NAMESPACE_SONR: - return "SonrNetwork" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "BitcoinNetwork" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "EthereumNetwork" - case DIDNamespace_DID_NAMESPACE_IBC: - return "IBCNetwork" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "WebAuthentication" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "DecentrlizedService" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "IPFSStorage" - } - return "" -} - -func (n DIDNamespace) Symbol() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "DWN" - case DIDNamespace_DID_NAMESPACE_SONR: - return "SONR" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "BTC" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "ETH" - case DIDNamespace_DID_NAMESPACE_IBC: - return "IBC" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "WEBAUTHN" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "SERVICE" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "IPFS" - } - return "" -} - -func (n DIDNamespace) Description() string { - switch n { - case DIDNamespace_DID_NAMESPACE_DWN: - return "DWN Service Provider" - case DIDNamespace_DID_NAMESPACE_SONR: - return "Sonr Network Gateway" - case DIDNamespace_DID_NAMESPACE_BITCOIN: - return "Bitcoin Network Gateway" - case DIDNamespace_DID_NAMESPACE_ETHEREUM: - return "Ethereum Network Gateway" - case DIDNamespace_DID_NAMESPACE_IBC: - return "IBC Network Gateway" - case DIDNamespace_DID_NAMESPACE_WEBAUTHN: - return "Web Authentication Key" - case DIDNamespace_DID_NAMESPACE_SERVICE: - return "Decentrlized Service" - case DIDNamespace_DID_NAMESPACE_IPFS: - return "Data Storage on IPFS" - } - return "" -} - -func (n DIDNamespace) GetNFTClass() *nft.Class { - return &nft.Class{ - Id: n.ID(), - Name: n.Name(), - Symbol: n.Symbol(), - Description: n.Description(), - } -} diff --git a/x/did/types/perms.go b/x/did/types/perms.go deleted file mode 100644 index ec434aaa2..000000000 --- a/x/did/types/perms.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -var ( - PermissionScopeStrings = [...]string{ - "profile", - "permissions.read", - "permissions.write", - "transactions.read", - "transactions.write", - "wallets.read", - "wallets.create", - "wallets.subscribe", - "wallets.update", - "transactions.verify", - "transactions.broadcast", - "admin.user", - "admin.validator", - } - - StringToPermissionScope = map[string]PermissionScope{ - "PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, - "PERMISSION_SCOPE_PROFILE_NAME": PermissionScope_PERMISSION_SCOPE_BASIC_INFO, - "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ, - "PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE, - "PERMISSION_SCOPE_TRANSACTIONS_READ": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ, - "PERMISSION_SCOPE_TRANSACTIONS_WRITE": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE, - "PERMISSION_SCOPE_WALLETS_READ": PermissionScope_PERMISSION_SCOPE_WALLETS_READ, - "PERMISSION_SCOPE_WALLETS_CREATE": PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE, - "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE, - "PERMISSION_SCOPE_WALLETS_UPDATE": PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE, - "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY, - "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST, - "PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER, - "PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, - } -) diff --git a/x/did/types/pubkey.go b/x/did/types/pubkey.go deleted file mode 100644 index 8d75ac1fb..000000000 --- a/x/did/types/pubkey.go +++ /dev/null @@ -1,153 +0,0 @@ -package types - -import ( - "crypto/ecdsa" - "encoding/hex" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/mr-tron/base58/base58" - "github.com/onsonr/crypto" - "github.com/onsonr/crypto/macaroon" -) - -var WalletKeyInfo = &KeyInfo{ - Role: KeyRole_KEY_ROLE_DELEGATION, - Curve: KeyCurve_KEY_CURVE_SECP256K1, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_BIP32, -} - -var EthKeyInfo = &KeyInfo{ - Role: KeyRole_KEY_ROLE_DELEGATION, - Curve: KeyCurve_KEY_CURVE_KECCAK256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_BIP32, -} - -var SonrKeyInfo = &KeyInfo{ - Role: KeyRole_KEY_ROLE_INVOCATION, - Curve: KeyCurve_KEY_CURVE_P256, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - Type: KeyType_KEY_TYPE_MPC, -} - -var ChainCodeKeyInfos = map[ChainCode]*KeyInfo{ - ChainCodeBTC: WalletKeyInfo, - ChainCodeETH: EthKeyInfo, - ChainCodeSNR: SonrKeyInfo, - ChainCodeIBC: WalletKeyInfo, -} - -// NewEthPublicKey returns a new ethereum public key -func NewPublicKey(data []byte, keyInfo *KeyInfo) (*PubKey, error) { - encKey, err := keyInfo.Encoding.EncodeRaw(data) - if err != nil { - return nil, err - } - - return &PubKey{ - Raw: encKey, - Role: keyInfo.Role, - Encoding: keyInfo.Encoding, - Algorithm: keyInfo.Algorithm, - Curve: keyInfo.Curve, - KeyType: keyInfo.Type, - }, nil -} - -// Address returns the address of the public key -func (k *PubKey) Address() cryptotypes.Address { - return nil -} - -// Bytes returns the raw bytes of the public key -func (k *PubKey) Bytes() []byte { - bz, _ := k.GetEncoding().DecodeRaw(k.GetRaw()) - return bz -} - -// Clone returns a copy of the public key -func (k *PubKey) Clone() cryptotypes.PubKey { - return &PubKey{ - Raw: k.GetRaw(), - Role: k.GetRole(), - Encoding: k.GetEncoding(), - Algorithm: k.GetAlgorithm(), - Curve: k.GetCurve(), - KeyType: k.GetKeyType(), - } -} - -// IssueMacaroon returns a macaroon for the public key with the given id and location -func (pk *PubKey) IssueMacaroon(subject string, origin string) (*macaroon.Macaroon, error) { - return macaroon.New(pk.Bytes(), []byte(subject), origin, macaroon.LatestVersion) -} - -// ECDSA returns the ECDSA public key -func (k *PubKey) ECDSA() (*ecdsa.PublicKey, error) { - return crypto.ComputeEcdsaPublicKey(k.Bytes()) -} - -// VerifySignature verifies a signature over the given message -func (k *PubKey) VerifySignature(msg []byte, sig []byte) bool { - pk, err := crypto.ComputeEcdsaPublicKey(k.Bytes()) - sigMpc, err := crypto.DeserializeMPCSignature(sig) - if err != nil { - return false - } - return crypto.VerifyMPCSignature(sigMpc, msg, pk) -} - -// Equals returns true if two public keys are equal -func (k *PubKey) Equals(k2 cryptotypes.PubKey) bool { - if k == nil && k2 == nil { - return true - } - return false -} - -// Type returns the type of the public key -func (k *PubKey) Type() string { - return k.KeyType.String() -} - -// DecodePublicKey extracts the public key from the given data -func (k *KeyInfo) DecodePublicKey(data interface{}) ([]byte, error) { - var bz []byte - switch v := data.(type) { - case string: - bz = []byte(v) - case []byte: - bz = v - default: - return nil, ErrUnsupportedKeyEncoding - } - - if k.Encoding == KeyEncoding_KEY_ENCODING_RAW { - return bz, nil - } - if k.Encoding == KeyEncoding_KEY_ENCODING_HEX { - return hex.DecodeString(string(bz)) - } - if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE { - return base58.Decode(string(bz)) - } - return nil, ErrUnsupportedKeyEncoding -} - -// EncodePublicKey encodes the public key according to the KeyInfo's encoding -func (k *KeyInfo) EncodePublicKey(data []byte) (string, error) { - if k.Encoding == KeyEncoding_KEY_ENCODING_RAW { - return string(data), nil - } - if k.Encoding == KeyEncoding_KEY_ENCODING_HEX { - return hex.EncodeToString(data), nil - } - if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE { - return base58.Encode(data), nil - } - return "", ErrUnsupportedKeyEncoding -} diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index dd564cc60..7f51d14fa 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -258,68 +258,6 @@ func (m *QueryResolveResponse) GetDocument() *Document { return nil } -// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. -type QueryServiceResponse struct { - // options is the PublicKeyCredentialAttestationOptions - Existing bool `protobuf:"varint,1,opt,name=existing,proto3" json:"existing,omitempty"` - Service *ServiceInfo `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` - TxtRecord string `protobuf:"bytes,3,opt,name=txt_record,json=txtRecord,proto3" json:"txt_record,omitempty"` -} - -func (m *QueryServiceResponse) Reset() { *m = QueryServiceResponse{} } -func (m *QueryServiceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryServiceResponse) ProtoMessage() {} -func (*QueryServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{4} -} -func (m *QueryServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryServiceResponse.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 *QueryServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryServiceResponse.Merge(m, src) -} -func (m *QueryServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryServiceResponse proto.InternalMessageInfo - -func (m *QueryServiceResponse) GetExisting() bool { - if m != nil { - return m.Existing - } - return false -} - -func (m *QueryServiceResponse) GetService() *ServiceInfo { - if m != nil { - return m.Service - } - return nil -} - -func (m *QueryServiceResponse) GetTxtRecord() string { - if m != nil { - return m.TxtRecord - } - return "" -} - // SyncRequest is the request type for the Sync RPC method. type SyncRequest struct { Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` @@ -329,7 +267,7 @@ func (m *SyncRequest) Reset() { *m = SyncRequest{} } func (m *SyncRequest) String() string { return proto.CompactTextString(m) } func (*SyncRequest) ProtoMessage() {} func (*SyncRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{5} + return fileDescriptor_ae1fa9bb626e2869, []int{4} } func (m *SyncRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -374,7 +312,7 @@ func (m *SyncResponse) Reset() { *m = SyncResponse{} } func (m *SyncResponse) String() string { return proto.CompactTextString(m) } func (*SyncResponse) ProtoMessage() {} func (*SyncResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{6} + return fileDescriptor_ae1fa9bb626e2869, []int{5} } func (m *SyncResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,7 +353,6 @@ func init() { proto.RegisterType((*QueryResponse)(nil), "did.v1.QueryResponse") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse") - proto.RegisterType((*QueryServiceResponse)(nil), "did.v1.QueryServiceResponse") proto.RegisterType((*SyncRequest)(nil), "did.v1.SyncRequest") proto.RegisterType((*SyncResponse)(nil), "did.v1.SyncResponse") } @@ -423,41 +360,35 @@ func init() { func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xba, 0xb5, 0x69, 0x5f, 0x3b, 0x18, 0x6e, 0x85, 0x42, 0x19, 0x01, 0xf9, 0x80, 0x76, - 0x80, 0x5a, 0x2b, 0x57, 0x90, 0x10, 0xda, 0x05, 0x89, 0x03, 0xcb, 0x2e, 0x88, 0x0b, 0x64, 0xb1, - 0x09, 0xd6, 0x5a, 0xbb, 0x8b, 0xdd, 0xaa, 0xd1, 0x34, 0x09, 0xf1, 0x0b, 0x90, 0x10, 0xff, 0x88, - 0x03, 0xc7, 0x49, 0x5c, 0x38, 0xa2, 0x96, 0x1f, 0x82, 0x62, 0x3b, 0xed, 0x3a, 0x69, 0x8c, 0x4b, - 0x94, 0xf7, 0xbd, 0xcf, 0xdf, 0x7b, 0xef, 0x7b, 0x36, 0x20, 0xca, 0x29, 0x99, 0xee, 0x91, 0x93, - 0x09, 0xcb, 0xf2, 0xfe, 0x38, 0x93, 0x5a, 0xa2, 0x3a, 0xe5, 0xb4, 0x3f, 0xdd, 0xeb, 0x75, 0x5d, - 0x2e, 0x65, 0x82, 0x29, 0xae, 0x6c, 0xb6, 0xd7, 0x71, 0xe8, 0x48, 0x52, 0x36, 0x2c, 0xc1, 0x9d, - 0x54, 0xca, 0x74, 0xc8, 0x48, 0x3c, 0xe6, 0x24, 0x16, 0x42, 0xea, 0x58, 0x73, 0x29, 0x5c, 0x16, - 0xbf, 0x87, 0xf6, 0x41, 0xa1, 0x1f, 0xb1, 0x93, 0x09, 0x53, 0x1a, 0x6d, 0xc3, 0x06, 0xe5, 0x34, - 0xf0, 0x1e, 0x78, 0xbb, 0xcd, 0xa8, 0xf8, 0x45, 0xb7, 0xa1, 0x2e, 0x33, 0x9e, 0x72, 0x11, 0x54, - 0x0d, 0xe8, 0xa2, 0x82, 0x79, 0xcc, 0xf2, 0x60, 0xc3, 0x32, 0x8f, 0x59, 0x8e, 0xba, 0x50, 0x8b, - 0x95, 0x62, 0x3a, 0xd8, 0x34, 0x98, 0x0d, 0xf0, 0x37, 0x0f, 0xb6, 0x5c, 0x09, 0x35, 0x96, 0x42, - 0x31, 0x14, 0x80, 0xaf, 0x26, 0x49, 0xc2, 0x94, 0x32, 0x75, 0x1a, 0x51, 0x19, 0x16, 0x0a, 0x66, - 0x5a, 0x57, 0xca, 0x06, 0xe8, 0x11, 0x34, 0xa8, 0x4c, 0x26, 0x23, 0x26, 0xb4, 0x29, 0xd7, 0x1a, - 0x6c, 0xf7, 0xad, 0x0f, 0xfd, 0x7d, 0x87, 0x47, 0x4b, 0x06, 0x7a, 0x08, 0xf5, 0x71, 0x9c, 0xc5, - 0x23, 0x15, 0xd4, 0x0c, 0xf7, 0x46, 0xc9, 0x7d, 0x6d, 0xd0, 0xc8, 0x65, 0xf1, 0x33, 0xe8, 0x98, - 0xb6, 0x1c, 0x5c, 0x36, 0xb7, 0x3a, 0xee, 0xfd, 0xf3, 0xf8, 0x3e, 0x74, 0xcb, 0xa9, 0xe4, 0x70, - 0xca, 0x96, 0xe7, 0x2f, 0x36, 0xeb, 0x5d, 0xd7, 0x2c, 0xfe, 0xe4, 0x39, 0x99, 0x43, 0x96, 0x4d, - 0x79, 0xb2, 0x92, 0xe9, 0x41, 0x83, 0xcd, 0xb8, 0xd2, 0x5c, 0xa4, 0xce, 0xa4, 0x65, 0x8c, 0x1e, - 0x83, 0xaf, 0x2c, 0xdd, 0xf8, 0xd4, 0x1a, 0x74, 0xca, 0x0a, 0x4e, 0xe5, 0xa5, 0xf8, 0x20, 0xa3, - 0x92, 0x83, 0xee, 0x01, 0xe8, 0x99, 0x7e, 0x97, 0xb1, 0x44, 0x66, 0xd4, 0xed, 0xab, 0xa9, 0x67, - 0x3a, 0x32, 0x00, 0xbe, 0x0f, 0xad, 0xc3, 0x5c, 0x24, 0x57, 0x5e, 0x00, 0xbc, 0x0b, 0x6d, 0x4b, - 0xb8, 0x6e, 0x7d, 0x83, 0xef, 0x55, 0xa8, 0x99, 0x69, 0xd0, 0x2b, 0xa8, 0x5b, 0xbf, 0x50, 0xb7, - 0xec, 0xed, 0xe2, 0x35, 0xeb, 0xdd, 0x5d, 0x43, 0xd7, 0x57, 0x80, 0x6f, 0x7e, 0xfe, 0xf9, 0xe7, - 0x6b, 0xb5, 0x89, 0x7c, 0x62, 0xbd, 0x46, 0x07, 0xe0, 0x3b, 0x9b, 0xaf, 0x90, 0xdb, 0xb9, 0x84, - 0xae, 0xad, 0x04, 0x23, 0xa3, 0xd7, 0x46, 0x40, 0x8a, 0xf7, 0x71, 0x4a, 0x39, 0x3d, 0x43, 0x6f, - 0xc0, 0x77, 0x66, 0xfd, 0x97, 0xe4, 0xa5, 0xf5, 0xe0, 0x3b, 0x46, 0xb2, 0x83, 0x6e, 0x11, 0xe7, - 0x32, 0x39, 0xb5, 0xcf, 0xe2, 0x0c, 0x3d, 0x87, 0xcd, 0xc2, 0x2e, 0xb4, 0x5a, 0xca, 0xca, 0xdd, - 0x5e, 0x77, 0x1d, 0x74, 0x6a, 0x5b, 0x46, 0xcd, 0xc7, 0x35, 0xa2, 0x72, 0x91, 0xbc, 0x78, 0xfa, - 0x63, 0x1e, 0x7a, 0xe7, 0xf3, 0xd0, 0xfb, 0x3d, 0x0f, 0xbd, 0x2f, 0x8b, 0xb0, 0x72, 0xbe, 0x08, - 0x2b, 0xbf, 0x16, 0x61, 0xe5, 0x2d, 0x4e, 0xb9, 0xfe, 0x38, 0x39, 0xea, 0x27, 0x72, 0x44, 0xa4, - 0x50, 0x52, 0x64, 0xc4, 0x7c, 0x66, 0x66, 0x32, 0x9d, 0x8f, 0x99, 0x3a, 0xaa, 0x9b, 0x87, 0xfd, - 0xe4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x65, 0xe3, 0x8b, 0x3f, 0x04, 0x00, 0x00, + // 446 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4f, 0x6b, 0xd4, 0x40, + 0x14, 0xdf, 0x69, 0xbb, 0xd9, 0xf6, 0x75, 0xab, 0xe5, 0x35, 0x48, 0x58, 0x4b, 0x94, 0x39, 0x48, + 0x0f, 0x92, 0xa1, 0xf5, 0xaa, 0x20, 0xd2, 0xa3, 0x07, 0x1b, 0x6f, 0x9e, 0x4c, 0x33, 0x43, 0x1c, + 0xda, 0x9d, 0x49, 0x33, 0xc9, 0x62, 0x10, 0x2f, 0x7e, 0x02, 0x41, 0xfc, 0x4e, 0x1e, 0x0b, 0x5e, + 0x3c, 0xca, 0xae, 0x27, 0x3f, 0x85, 0x64, 0x66, 0x52, 0x77, 0x85, 0xba, 0x97, 0x65, 0xdf, 0xef, + 0xbd, 0xf7, 0xfb, 0xf3, 0x32, 0x80, 0x5c, 0x72, 0x36, 0x3b, 0x66, 0x57, 0x8d, 0xa8, 0xda, 0xa4, + 0xac, 0x74, 0xad, 0x31, 0xe0, 0x92, 0x27, 0xb3, 0xe3, 0x49, 0xe8, 0x7b, 0x85, 0x50, 0xc2, 0x48, + 0xe3, 0xba, 0x93, 0xc3, 0x42, 0xeb, 0xe2, 0x52, 0xb0, 0xac, 0x94, 0x2c, 0x53, 0x4a, 0xd7, 0x59, + 0x2d, 0xb5, 0xf2, 0x5d, 0xfa, 0x16, 0xc6, 0x67, 0x1d, 0x55, 0x2a, 0xae, 0x1a, 0x61, 0x6a, 0xdc, + 0x87, 0x4d, 0x2e, 0x79, 0x44, 0x1e, 0x92, 0xa3, 0x9d, 0xb4, 0xfb, 0x8b, 0xf7, 0x20, 0xd0, 0x95, + 0x2c, 0xa4, 0x8a, 0x36, 0x2c, 0xe8, 0xab, 0x6e, 0xf2, 0x42, 0xb4, 0xd1, 0xa6, 0x9b, 0xbc, 0x10, + 0x2d, 0x86, 0x30, 0xcc, 0x8c, 0x11, 0x75, 0xb4, 0x65, 0x31, 0x57, 0xd0, 0xaf, 0x04, 0xf6, 0xbc, + 0x84, 0x29, 0xb5, 0x32, 0x02, 0x23, 0x18, 0x99, 0x26, 0xcf, 0x85, 0x31, 0x56, 0x67, 0x3b, 0xed, + 0xcb, 0x8e, 0xc1, 0x06, 0xf3, 0x52, 0xae, 0xc0, 0xc7, 0xb0, 0xcd, 0x75, 0xde, 0x4c, 0x85, 0xaa, + 0xad, 0xdc, 0xee, 0xc9, 0x7e, 0xe2, 0x22, 0x27, 0xa7, 0x1e, 0x4f, 0x6f, 0x26, 0xf0, 0x11, 0x04, + 0x65, 0x56, 0x65, 0x53, 0x13, 0x0d, 0xed, 0xec, 0x9d, 0x7e, 0xf6, 0x95, 0x45, 0x53, 0xdf, 0xa5, + 0xcf, 0xe0, 0xc0, 0xda, 0xf2, 0x70, 0x6f, 0xee, 0xef, 0x3a, 0xf9, 0xef, 0xfa, 0x29, 0x84, 0x7d, + 0x2a, 0x7d, 0x39, 0x13, 0x37, 0xfb, 0xcb, 0x66, 0xc9, 0x3a, 0xb3, 0xf4, 0x01, 0xec, 0xbe, 0x6e, + 0x55, 0x7e, 0xeb, 0xf5, 0xe9, 0x11, 0x8c, 0xdd, 0xc0, 0xba, 0xdb, 0x9d, 0xfc, 0x26, 0x30, 0xb4, + 0x8e, 0xf0, 0x25, 0x04, 0xce, 0x2c, 0x86, 0xbd, 0xf4, 0xf2, 0x37, 0x9e, 0xdc, 0x5f, 0x41, 0x57, + 0xf3, 0xd3, 0xbb, 0x9f, 0xbe, 0xff, 0xfa, 0xb2, 0xb1, 0x83, 0x23, 0xe6, 0x82, 0xe2, 0x19, 0x8c, + 0x7c, 0xc6, 0x5b, 0xe8, 0x0e, 0xff, 0x41, 0x57, 0xee, 0x41, 0xd1, 0xf2, 0x8d, 0x11, 0x58, 0xf7, + 0x3a, 0x3f, 0x70, 0xc9, 0x3f, 0xe2, 0x73, 0xd8, 0xea, 0x42, 0xe1, 0x41, 0xbf, 0xb9, 0x74, 0x83, + 0x49, 0xb8, 0x0a, 0x7a, 0x9a, 0x3d, 0x4b, 0x33, 0xa2, 0x43, 0x66, 0x5a, 0x95, 0xbf, 0x78, 0xfa, + 0x6d, 0x1e, 0x93, 0xeb, 0x79, 0x4c, 0x7e, 0xce, 0x63, 0xf2, 0x79, 0x11, 0x0f, 0xae, 0x17, 0xf1, + 0xe0, 0xc7, 0x22, 0x1e, 0xbc, 0xa1, 0x85, 0xac, 0xdf, 0x35, 0xe7, 0x49, 0xae, 0xa7, 0x4c, 0x2b, + 0xa3, 0x55, 0xc5, 0xec, 0xcf, 0x7b, 0xab, 0x5f, 0xb7, 0xa5, 0x30, 0xe7, 0x81, 0x7d, 0xfb, 0x4f, + 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x31, 0x4b, 0x75, 0xe8, 0x4d, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -476,10 +407,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // Service returns associated ServiceInfo for a given Origin - // if the servie is not found, a fingerprint is generated to be used - // as a TXT record in DNS. v=sonr, o=origin, p=protocol - Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) // Sync queries the DID document by its id. And returns the required PKL information Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) } @@ -510,15 +437,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { - out := new(QueryServiceResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/Service", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) { out := new(SyncResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Sync", in, out, opts...) @@ -534,10 +452,6 @@ type QueryServer interface { Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) - // Service returns associated ServiceInfo for a given Origin - // if the servie is not found, a fingerprint is generated to be used - // as a TXT record in DNS. v=sonr, o=origin, p=protocol - Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) // Sync queries the DID document by its id. And returns the required PKL information Sync(context.Context, *SyncRequest) (*SyncResponse, error) } @@ -552,9 +466,6 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (*UnimplementedQueryServer) Service(ctx context.Context, req *QueryRequest) (*QueryServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") -} func (*UnimplementedQueryServer) Sync(ctx context.Context, req *SyncRequest) (*SyncResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") } @@ -599,24 +510,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Service(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Query/Service", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Service(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SyncRequest) if err := dec(in); err != nil { @@ -647,10 +540,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, - { - MethodName: "Service", - Handler: _Query_Service_Handler, - }, { MethodName: "Sync", Handler: _Query_Sync_Handler, @@ -845,58 +734,6 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryServiceResponse) 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 *QueryServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TxtRecord) > 0 { - i -= len(m.TxtRecord) - copy(dAtA[i:], m.TxtRecord) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TxtRecord))) - i-- - dAtA[i] = 0x1a - } - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Existing { - i-- - if m.Existing { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *SyncRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1046,26 +883,6 @@ func (m *QueryResolveResponse) Size() (n int) { return n } -func (m *QueryServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Existing { - n += 2 - } - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TxtRecord) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - func (m *SyncRequest) Size() (n int) { if m == nil { return 0 @@ -1621,144 +1438,6 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Existing", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Existing = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &ServiceInfo{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxtRecord", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxtRecord = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *SyncRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/query.pb.gw.go b/x/did/types/query.pb.gw.go index 02f068586..4080b92e3 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -141,78 +141,6 @@ func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marsha } -var ( - filter_Query_Service_0 = &utilities.DoubleArray{Encoding: map[string]int{"origin": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["origin"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") - } - - protoReq.Origin, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Service_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["origin"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") - } - - protoReq.Origin, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Service_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Service(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_Sync_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -301,29 +229,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Service_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -428,26 +333,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Service_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -476,8 +361,6 @@ var ( pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0}, []string{"did"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"service", "origin"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"sync"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -486,7 +369,5 @@ var ( forward_Query_Resolve_0 = runtime.ForwardResponseMessage - forward_Query_Service_0 = runtime.ForwardResponseMessage - forward_Query_Sync_0 = runtime.ForwardResponseMessage ) diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index eaa582b3a..a2c173085 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -27,16 +27,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Alias struct { // The unique identifier of the alias Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The DID of the alias - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // The alias of the DID - Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // Origin of the alias - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // Permissions of the alias - Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"` - // Expiration of the alias - Expiration int64 `protobuf:"varint,6,opt,name=expiration,proto3" json:"expiration,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` } func (m *Alias) Reset() { *m = Alias{} } @@ -79,16 +73,9 @@ func (m *Alias) GetId() string { return "" } -func (m *Alias) GetDid() string { +func (m *Alias) GetSubject() string { if m != nil { - return m.Did - } - return "" -} - -func (m *Alias) GetAlias() string { - if m != nil { - return m.Alias + return m.Subject } return "" } @@ -100,36 +87,26 @@ func (m *Alias) GetOrigin() string { return "" } -func (m *Alias) GetScopes() []string { - if m != nil { - return m.Scopes - } - return nil -} - -func (m *Alias) GetExpiration() int64 { - if m != nil { - return m.Expiration - } - return 0 -} - // Controller represents a Sonr DWN Vault type Controller struct { // The unique identifier of the controller Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The DID of the controller - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + SonrAddress string `protobuf:"bytes,2,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` + // The DID of the controller + EthAddress string `protobuf:"bytes,3,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` + // The DID of the controller + BtcAddress string `protobuf:"bytes,4,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` // Aliases of the controller - Aliases []*Alias `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` + Aliases []string `protobuf:"bytes,5,rep,name=aliases,proto3" json:"aliases,omitempty"` // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // The vault address or identifier - VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` + VaultCid string `protobuf:"bytes,7,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` // The Authentications of the controller - Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"` + Authentication []string `protobuf:"bytes,8,rep,name=authentication,proto3" json:"authentication,omitempty"` // The Status of the claims for the controller - Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` + Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` } func (m *Controller) Reset() { *m = Controller{} } @@ -172,14 +149,28 @@ func (m *Controller) GetId() string { return "" } -func (m *Controller) GetAddress() string { +func (m *Controller) GetSonrAddress() string { if m != nil { - return m.Address + return m.SonrAddress } return "" } -func (m *Controller) GetAliases() []*Alias { +func (m *Controller) GetEthAddress() string { + if m != nil { + return m.EthAddress + } + return "" +} + +func (m *Controller) GetBtcAddress() string { + if m != nil { + return m.BtcAddress + } + return "" +} + +func (m *Controller) GetAliases() []string { if m != nil { return m.Aliases } @@ -200,7 +191,7 @@ func (m *Controller) GetVaultCid() string { return "" } -func (m *Controller) GetAuthentication() []*Credential { +func (m *Controller) GetAuthentication() []string { if m != nil { return m.Authentication } @@ -221,15 +212,15 @@ type Verification struct { // The controller of the verification Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DIDNamespace of the verification - Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` + DidMethod string `protobuf:"bytes,3,opt,name=did_method,json=didMethod,proto3" json:"did_method,omitempty"` // The value of the linked identifier Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` // The subject of the verification Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) - Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` + // The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation) + VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` } func (m *Verification) Reset() { *m = Verification{} } @@ -279,11 +270,11 @@ func (m *Verification) GetController() string { return "" } -func (m *Verification) GetMethod() DIDNamespace { +func (m *Verification) GetDidMethod() string { if m != nil { - return m.Method + return m.DidMethod } - return DIDNamespace_DID_NAMESPACE_UNSPECIFIED + return "" } func (m *Verification) GetIssuer() string { @@ -307,9 +298,9 @@ func (m *Verification) GetPublicKey() *PubKey { return nil } -func (m *Verification) GetKind() string { +func (m *Verification) GetVerificationType() string { if m != nil { - return m.Kind + return m.VerificationType } return "" } @@ -323,43 +314,42 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 561 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x31, 0x8f, 0xd3, 0x3e, - 0x18, 0xc6, 0x2f, 0x49, 0x9b, 0xfe, 0xfb, 0xde, 0xff, 0x4a, 0x65, 0x2a, 0x30, 0x87, 0x14, 0xaa, - 0x0e, 0xd0, 0xa1, 0x34, 0x5c, 0x41, 0x0c, 0x15, 0x0b, 0xf4, 0x16, 0x74, 0x12, 0x42, 0x19, 0x18, - 0x58, 0x4e, 0x69, 0x6c, 0x5a, 0x73, 0x49, 0x1c, 0xd9, 0x4e, 0x75, 0xfd, 0x12, 0x88, 0x95, 0x85, - 0xcf, 0xc0, 0xce, 0x17, 0x60, 0x3c, 0x89, 0x85, 0x11, 0xb5, 0xdf, 0x80, 0x4f, 0x80, 0xec, 0x38, - 0xe5, 0x54, 0x06, 0x96, 0xca, 0xef, 0xe3, 0xa7, 0x7e, 0x9f, 0xf7, 0x17, 0x1b, 0x10, 0x61, 0x24, - 0x5c, 0x9d, 0x84, 0x52, 0xc5, 0x8a, 0x8e, 0x0b, 0xc1, 0x15, 0x47, 0x3e, 0x61, 0x64, 0xbc, 0x3a, - 0x39, 0xbe, 0x9d, 0x70, 0x99, 0x71, 0x19, 0x72, 0x91, 0x69, 0x0b, 0x17, 0x59, 0x65, 0x38, 0xee, - 0xd9, 0x3f, 0x2d, 0x68, 0x4e, 0x25, 0x93, 0x56, 0xbd, 0x69, 0xd5, 0x8c, 0x13, 0x9a, 0x5a, 0x71, - 0xf0, 0xc5, 0x81, 0xe6, 0xf3, 0x94, 0xc5, 0x12, 0x75, 0xc0, 0x65, 0x04, 0x3b, 0x7d, 0x67, 0xd8, - 0x8e, 0x5c, 0x46, 0x50, 0x17, 0x3c, 0xc2, 0x08, 0x76, 0x8d, 0xa0, 0x97, 0xa8, 0x07, 0xcd, 0x58, - 0x5b, 0xb1, 0x67, 0xb4, 0xaa, 0x40, 0xb7, 0xc0, 0xe7, 0x82, 0x2d, 0x58, 0x8e, 0x1b, 0x46, 0xb6, - 0x95, 0xd6, 0x65, 0xc2, 0x0b, 0x2a, 0x71, 0xb3, 0xef, 0x69, 0xbd, 0xaa, 0x50, 0x00, 0x40, 0x2f, - 0x0b, 0x26, 0x62, 0xc5, 0x78, 0x8e, 0xfd, 0xbe, 0x33, 0xf4, 0xa2, 0x6b, 0xca, 0xf4, 0xde, 0xaf, - 0xcf, 0xdf, 0x3f, 0x78, 0x77, 0xa0, 0xa1, 0xf3, 0xa0, 0x1b, 0xd0, 0x26, 0x8c, 0x8c, 0x4c, 0xab, - 0xae, 0x83, 0x1d, 0xec, 0x0c, 0xbe, 0xba, 0x00, 0x33, 0x9e, 0x2b, 0xc1, 0xd3, 0x94, 0x8a, 0xbf, - 0x72, 0x63, 0x68, 0xc5, 0x84, 0x08, 0x2a, 0xa5, 0xcd, 0x5e, 0x97, 0xe8, 0x01, 0xb4, 0xcc, 0x39, - 0x54, 0x4f, 0xe0, 0x0d, 0x0f, 0x27, 0x47, 0xe3, 0x8a, 0xe4, 0xd8, 0x10, 0x88, 0xea, 0x5d, 0xf4, - 0x10, 0xa0, 0x28, 0xe7, 0x29, 0x4b, 0xce, 0x2f, 0xe8, 0xda, 0x8c, 0x75, 0x38, 0xe9, 0xd4, 0xde, - 0xd7, 0xe5, 0xfc, 0x8c, 0xae, 0xa3, 0x76, 0xe5, 0x38, 0xa3, 0x6b, 0x74, 0x17, 0xda, 0xab, 0xb8, - 0x4c, 0xd5, 0x79, 0xc2, 0x08, 0x6e, 0x9a, 0x9e, 0xff, 0x19, 0x61, 0xc6, 0x08, 0x9a, 0x42, 0x27, - 0x2e, 0xd5, 0x92, 0xe6, 0x8a, 0x25, 0xf5, 0xc8, 0xba, 0x37, 0xaa, 0xcf, 0x9b, 0x09, 0x4a, 0xf4, - 0x6e, 0x9c, 0x46, 0x7b, 0x4e, 0x83, 0x50, 0xc5, 0xaa, 0x94, 0xb8, 0x55, 0xa1, 0xad, 0xaa, 0xe9, - 0xd4, 0x20, 0x7a, 0x62, 0x11, 0x1d, 0xed, 0x06, 0xd6, 0x80, 0x34, 0xb1, 0x5d, 0x9a, 0xae, 0x8b, - 0x1d, 0x04, 0xf5, 0x29, 0x5d, 0x0f, 0xbb, 0x83, 0x4f, 0x2e, 0xfc, 0xff, 0x86, 0x0a, 0xf6, 0xae, - 0x6e, 0xb2, 0xcf, 0x2f, 0x00, 0x48, 0x76, 0x74, 0x2d, 0xc2, 0x6b, 0x0a, 0x1a, 0x81, 0x9f, 0x51, - 0xb5, 0xe4, 0xc4, 0x5c, 0x83, 0xce, 0xa4, 0x57, 0x0f, 0x72, 0xfa, 0xf2, 0xf4, 0x55, 0x9c, 0x51, - 0x59, 0xc4, 0x09, 0x8d, 0xac, 0x47, 0x8f, 0xc0, 0xa4, 0x2c, 0xa9, 0xa8, 0x6f, 0x47, 0x55, 0xe9, - 0xaf, 0x24, 0xcb, 0xf9, 0x7b, 0x9a, 0x28, 0x4b, 0xac, 0x2e, 0xf7, 0xe0, 0xfb, 0xff, 0x82, 0x8f, - 0xa0, 0x71, 0xc1, 0x72, 0x62, 0x09, 0x99, 0xf5, 0xf4, 0xa9, 0xe1, 0xf3, 0xc8, 0xf2, 0xb9, 0x0f, - 0xfd, 0x3f, 0xf1, 0x47, 0x55, 0xae, 0x51, 0x15, 0x63, 0x64, 0x9b, 0x9a, 0x9b, 0xd5, 0x7c, 0xf1, - 0xec, 0xdb, 0x26, 0x70, 0xae, 0x36, 0x81, 0xf3, 0x73, 0x13, 0x38, 0x1f, 0xb7, 0xc1, 0xc1, 0xd5, - 0x36, 0x38, 0xf8, 0xb1, 0x0d, 0x0e, 0xde, 0x0e, 0x16, 0x4c, 0x2d, 0xcb, 0xf9, 0x38, 0xe1, 0x59, - 0xc8, 0x73, 0xc9, 0x73, 0x11, 0x9a, 0x9f, 0xcb, 0x50, 0x3f, 0x2a, 0xb5, 0x2e, 0xa8, 0x9c, 0xfb, - 0xe6, 0x45, 0x3d, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x70, 0x7b, 0x75, 0x51, 0xb3, 0x03, 0x00, - 0x00, + // 557 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xed, 0xd8, 0x79, 0x34, 0x37, 0x55, 0x70, 0x47, 0x55, 0x19, 0x15, 0x30, 0x21, 0x42, 0x55, + 0x25, 0x42, 0xac, 0xc2, 0x2e, 0x62, 0x53, 0xba, 0xac, 0x90, 0x50, 0x85, 0x58, 0xb0, 0x89, 0x6c, + 0xcf, 0x90, 0x4c, 0x9b, 0x78, 0x82, 0x67, 0x1c, 0x91, 0x9f, 0x40, 0xac, 0x59, 0xf0, 0x3d, 0x2c, + 0x2b, 0xb1, 0x61, 0x83, 0x84, 0x92, 0x3f, 0xe0, 0x0b, 0xd0, 0x3c, 0x92, 0x38, 0xed, 0x8a, 0x8d, + 0xa5, 0x7b, 0xe6, 0x78, 0xce, 0xbd, 0xe7, 0xdc, 0x01, 0x4c, 0x39, 0x8d, 0x66, 0xa7, 0x91, 0x54, + 0xb1, 0x62, 0xbd, 0x69, 0x2e, 0x94, 0xc0, 0x35, 0xca, 0x69, 0x6f, 0x76, 0x7a, 0x74, 0x3f, 0x15, + 0x72, 0x22, 0x64, 0x24, 0xf2, 0x89, 0xa6, 0x88, 0x7c, 0x62, 0x09, 0x47, 0x07, 0xee, 0xa7, 0x21, + 0xcb, 0x98, 0xe4, 0xd2, 0xa2, 0x1d, 0x01, 0xd5, 0xb3, 0x31, 0x8f, 0x25, 0x6e, 0x81, 0xc7, 0x29, + 0x41, 0x6d, 0x74, 0xd2, 0xb8, 0xf4, 0x38, 0xc5, 0x04, 0xea, 0xb2, 0x48, 0xae, 0x58, 0xaa, 0x88, + 0x67, 0xc0, 0x55, 0x89, 0x0f, 0xa1, 0x26, 0x72, 0x3e, 0xe4, 0x19, 0xf1, 0xcd, 0x81, 0xab, 0xfa, + 0x4f, 0xff, 0x7e, 0xff, 0xf9, 0xc5, 0x0f, 0xa1, 0xa2, 0x6f, 0xc2, 0x07, 0xd0, 0x72, 0x3f, 0x74, + 0xed, 0x79, 0x80, 0x08, 0x22, 0xa8, 0xf3, 0xcd, 0x07, 0x38, 0x17, 0x99, 0xca, 0xc5, 0x78, 0xcc, + 0xf2, 0x3b, 0xb2, 0x4f, 0x60, 0x4f, 0x8a, 0x2c, 0x1f, 0xc4, 0x94, 0xe6, 0x4c, 0x4a, 0xa7, 0xdd, + 0xd4, 0xd8, 0x99, 0x85, 0xf0, 0x63, 0x68, 0x32, 0x35, 0x5a, 0x33, 0x6c, 0x13, 0xc0, 0xd4, 0xa8, + 0x44, 0x48, 0x54, 0xba, 0x26, 0x54, 0x2c, 0x21, 0x51, 0xe9, 0x8a, 0x40, 0xa0, 0x1e, 0xeb, 0xa1, + 0x99, 0x24, 0xd5, 0xb6, 0xaf, 0x67, 0x73, 0x25, 0x7e, 0x0e, 0x30, 0x2d, 0x92, 0x31, 0x4f, 0x07, + 0xd7, 0x6c, 0x4e, 0x6a, 0x6d, 0x74, 0xd2, 0x7c, 0xd1, 0xea, 0x59, 0x6b, 0x7b, 0x6f, 0x8b, 0xe4, + 0x82, 0xcd, 0x2f, 0x1b, 0x96, 0x71, 0xc1, 0xe6, 0xf8, 0x01, 0x34, 0x66, 0x71, 0x31, 0x56, 0x83, + 0x94, 0x53, 0x52, 0x37, 0x3a, 0xbb, 0x06, 0x38, 0xe7, 0x14, 0x1f, 0x43, 0x2b, 0x2e, 0xd4, 0x88, + 0x65, 0x8a, 0xa7, 0xb1, 0xe2, 0x22, 0x23, 0xbb, 0x46, 0xec, 0x16, 0xaa, 0xfd, 0xd4, 0x41, 0x16, + 0x92, 0x34, 0xac, 0x9f, 0xb6, 0xea, 0x7f, 0x32, 0x7e, 0x5e, 0x3b, 0x3f, 0xf1, 0xb6, 0x31, 0xda, + 0x4d, 0xbc, 0xbf, 0xe5, 0x44, 0xe0, 0x59, 0xa8, 0x34, 0x7b, 0xe0, 0x13, 0x84, 0xef, 0x95, 0x9a, + 0x0c, 0x2a, 0x04, 0xe1, 0x43, 0x08, 0xac, 0x44, 0x77, 0x83, 0x57, 0x09, 0x22, 0x5e, 0xe7, 0xb7, + 0x07, 0x7b, 0xef, 0x59, 0xce, 0x3f, 0xae, 0x7a, 0xbb, 0x1d, 0x4f, 0x08, 0x90, 0xae, 0xc3, 0x73, + 0xe1, 0x94, 0x10, 0xfc, 0x08, 0x80, 0x72, 0x3a, 0x98, 0x30, 0x35, 0x12, 0xd4, 0x45, 0xd3, 0xa0, + 0x9c, 0xbe, 0x31, 0x80, 0x1e, 0x95, 0x4b, 0x59, 0xb0, 0xdc, 0x85, 0xe2, 0xaa, 0xf2, 0xb2, 0x55, + 0xb7, 0x97, 0xed, 0x3f, 0x03, 0x79, 0x06, 0xfb, 0xb3, 0x52, 0xff, 0x03, 0x35, 0x9f, 0x32, 0x17, + 0x4c, 0x50, 0x3e, 0x78, 0x37, 0x9f, 0xb2, 0xfe, 0xd4, 0x18, 0x7c, 0xb5, 0x59, 0x58, 0xdb, 0x4d, + 0xd7, 0x69, 0x1b, 0x8b, 0x3b, 0xf0, 0x70, 0x33, 0x5e, 0x77, 0x33, 0x5b, 0xd7, 0x72, 0x8d, 0xe7, + 0xc7, 0xd0, 0xbe, 0x23, 0xba, 0xba, 0x64, 0xc5, 0xf3, 0x09, 0x22, 0xd5, 0xd7, 0xaf, 0x7e, 0x2c, + 0x42, 0x74, 0xb3, 0x08, 0xd1, 0x9f, 0x45, 0x88, 0xbe, 0x2e, 0xc3, 0x9d, 0x9b, 0x65, 0xb8, 0xf3, + 0x6b, 0x19, 0xee, 0x7c, 0xe8, 0x0c, 0xb9, 0x1a, 0x15, 0x49, 0x2f, 0x15, 0x93, 0x48, 0x64, 0x3a, + 0xe9, 0xc8, 0x7c, 0x3e, 0x47, 0xfa, 0xd9, 0xea, 0x1b, 0x65, 0x52, 0x33, 0x4f, 0xf6, 0xe5, 0xbf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x58, 0x8d, 0xb9, 0xaa, 0xff, 0x03, 0x00, 0x00, } func (m *Alias) Marshal() (dAtA []byte, err error) { @@ -382,38 +372,17 @@ func (m *Alias) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Expiration != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Expiration)) - i-- - dAtA[i] = 0x30 - } - if len(m.Scopes) > 0 { - for iNdEx := len(m.Scopes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Scopes[iNdEx]) - copy(dAtA[i:], m.Scopes[iNdEx]) - i = encodeVarintState(dAtA, i, uint64(len(m.Scopes[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if len(m.Origin) > 0 { i -= len(m.Origin) copy(dAtA[i:], m.Origin) i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) i-- - dAtA[i] = 0x22 - } - if len(m.Alias) > 0 { - i -= len(m.Alias) - copy(dAtA[i:], m.Alias) - i = encodeVarintState(dAtA, i, uint64(len(m.Alias))) - i-- dAtA[i] = 0x1a } - if len(m.Did) > 0 { - i -= len(m.Did) - copy(dAtA[i:], m.Did) - i = encodeVarintState(dAtA, i, uint64(len(m.Did))) + 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] = 0x12 } @@ -452,20 +421,15 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Status) i = encodeVarintState(dAtA, i, uint64(len(m.Status))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x4a } if len(m.Authentication) > 0 { for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Authentication[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + i -= len(m.Authentication[iNdEx]) + copy(dAtA[i:], m.Authentication[iNdEx]) + i = encodeVarintState(dAtA, i, uint64(len(m.Authentication[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x42 } } if len(m.VaultCid) > 0 { @@ -473,7 +437,7 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.VaultCid) i = encodeVarintState(dAtA, i, uint64(len(m.VaultCid))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } if m.PublicKey != nil { { @@ -485,26 +449,35 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintState(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 } if len(m.Aliases) > 0 { for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Aliases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintState(dAtA, i, uint64(len(m.Aliases[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintState(dAtA, i, uint64(len(m.Address))) + if len(m.BtcAddress) > 0 { + i -= len(m.BtcAddress) + copy(dAtA[i:], m.BtcAddress) + i = encodeVarintState(dAtA, i, uint64(len(m.BtcAddress))) + i-- + dAtA[i] = 0x22 + } + if len(m.EthAddress) > 0 { + i -= len(m.EthAddress) + copy(dAtA[i:], m.EthAddress) + i = encodeVarintState(dAtA, i, uint64(len(m.EthAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.SonrAddress) > 0 { + i -= len(m.SonrAddress) + copy(dAtA[i:], m.SonrAddress) + i = encodeVarintState(dAtA, i, uint64(len(m.SonrAddress))) i-- dAtA[i] = 0x12 } @@ -538,10 +511,10 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintState(dAtA, i, uint64(len(m.Kind))) + if len(m.VerificationType) > 0 { + i -= len(m.VerificationType) + copy(dAtA[i:], m.VerificationType) + i = encodeVarintState(dAtA, i, uint64(len(m.VerificationType))) i-- dAtA[i] = 0x3a } @@ -571,10 +544,12 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Method != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Method)) + if len(m.DidMethod) > 0 { + i -= len(m.DidMethod) + copy(dAtA[i:], m.DidMethod) + i = encodeVarintState(dAtA, i, uint64(len(m.DidMethod))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if len(m.Controller) > 0 { i -= len(m.Controller) @@ -614,11 +589,7 @@ func (m *Alias) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Did) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Alias) + l = len(m.Subject) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -626,15 +597,6 @@ func (m *Alias) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if len(m.Scopes) > 0 { - for _, s := range m.Scopes { - l = len(s) - n += 1 + l + sovState(uint64(l)) - } - } - if m.Expiration != 0 { - n += 1 + sovState(uint64(m.Expiration)) - } return n } @@ -648,13 +610,21 @@ func (m *Controller) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Address) + l = len(m.SonrAddress) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.EthAddress) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.BtcAddress) if l > 0 { n += 1 + l + sovState(uint64(l)) } if len(m.Aliases) > 0 { - for _, e := range m.Aliases { - l = e.Size() + for _, s := range m.Aliases { + l = len(s) n += 1 + l + sovState(uint64(l)) } } @@ -667,8 +637,8 @@ func (m *Controller) Size() (n int) { n += 1 + l + sovState(uint64(l)) } if len(m.Authentication) > 0 { - for _, e := range m.Authentication { - l = e.Size() + for _, s := range m.Authentication { + l = len(s) n += 1 + l + sovState(uint64(l)) } } @@ -693,8 +663,9 @@ func (m *Verification) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.Method != 0 { - n += 1 + sovState(uint64(m.Method)) + l = len(m.DidMethod) + if l > 0 { + n += 1 + l + sovState(uint64(l)) } l = len(m.Issuer) if l > 0 { @@ -708,7 +679,7 @@ func (m *Verification) Size() (n int) { l = m.PublicKey.Size() n += 1 + l + sovState(uint64(l)) } - l = len(m.Kind) + l = len(m.VerificationType) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -784,7 +755,7 @@ func (m *Alias) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -812,41 +783,9 @@ func (m *Alias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Did = string(dAtA[iNdEx:postIndex]) + m.Subject = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alias", 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.Alias = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } @@ -878,57 +817,6 @@ func (m *Alias) Unmarshal(dAtA []byte) error { } m.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scopes", 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.Scopes = append(m.Scopes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - 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 |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -1013,7 +901,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1041,13 +929,13 @@ func (m *Controller) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.SonrAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1057,27 +945,89 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.Aliases = append(m.Aliases, &Alias{}) - if err := m.Aliases[len(m.Aliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EthAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", 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.BtcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aliases", 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.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } @@ -1113,7 +1063,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType) } @@ -1145,11 +1095,11 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } m.VaultCid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1159,27 +1109,25 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.Authentication = append(m.Authentication, &Credential{}) - if err := m.Authentication[len(m.Authentication)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } @@ -1326,10 +1274,10 @@ func (m *Verification) Unmarshal(dAtA []byte) error { m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DidMethod", wireType) } - m.Method = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1339,11 +1287,24 @@ func (m *Verification) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Method |= DIDNamespace(b&0x7F) << shift + 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.DidMethod = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) @@ -1446,7 +1407,7 @@ func (m *Verification) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VerificationType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1474,7 +1435,7 @@ func (m *Verification) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kind = string(dAtA[iNdEx:postIndex]) + m.VerificationType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index 6ebc0d1ff..8e17af2ae 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -207,7 +207,7 @@ type MsgAllocateVaultResponse struct { // ExpiryBlock is the block number at which the vault will expire. ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn - RegistrationOptions string `protobuf:"bytes,3,opt,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` // IsLocalhost is a flag to indicate if the vault is localhost Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` } @@ -259,9 +259,9 @@ func (m *MsgAllocateVaultResponse) GetExpiryBlock() int64 { return 0 } -func (m *MsgAllocateVaultResponse) GetRegistrationOptions() string { +func (m *MsgAllocateVaultResponse) GetToken() string { if m != nil { - return m.RegistrationOptions + return m.Token } return "" } @@ -417,7 +417,7 @@ type MsgAuthorizeService struct { // Origin is the origin of the request in wildcard form. Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` // Permissions is the scope of the service. - Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // token is the macron token to authenticate the operation. Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } @@ -469,9 +469,9 @@ func (m *MsgAuthorizeService) GetOrigin() string { return "" } -func (m *MsgAuthorizeService) GetScopes() *Permissions { +func (m *MsgAuthorizeService) GetPermissions() map[string]string { if m != nil { - return m.Scopes + return m.Permissions } return nil } @@ -653,6 +653,7 @@ func init() { proto.RegisterType((*MsgRegisterControllerResponse)(nil), "did.v1.MsgRegisterControllerResponse") proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgRegisterControllerResponse.AccountsEntry") proto.RegisterType((*MsgAuthorizeService)(nil), "did.v1.MsgAuthorizeService") + proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgAuthorizeService.PermissionsEntry") proto.RegisterType((*MsgAuthorizeServiceResponse)(nil), "did.v1.MsgAuthorizeServiceResponse") proto.RegisterType((*MsgRegisterService)(nil), "did.v1.MsgRegisterService") proto.RegisterType((*MsgRegisterServiceResponse)(nil), "did.v1.MsgRegisterServiceResponse") @@ -661,59 +662,58 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 824 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbf, 0x8f, 0x1b, 0x45, - 0x14, 0xbe, 0xb1, 0x1d, 0xe7, 0xfc, 0x7c, 0x17, 0x5b, 0x63, 0xc3, 0x6d, 0x36, 0xc4, 0x31, 0x0b, - 0x48, 0x26, 0x80, 0xad, 0x73, 0x24, 0x14, 0x05, 0x9a, 0x33, 0x42, 0x8a, 0x84, 0xac, 0xc0, 0x06, - 0x28, 0xd2, 0x9c, 0xd6, 0xbb, 0xc3, 0x7a, 0xf0, 0x7a, 0x67, 0x35, 0x33, 0xb6, 0xce, 0x54, 0x40, - 0x89, 0x28, 0xf8, 0x07, 0x90, 0x28, 0x29, 0x53, 0xd0, 0x51, 0xd2, 0xa4, 0x8c, 0xa8, 0xa8, 0x10, - 0xba, 0x2b, 0xf2, 0x6f, 0xa0, 0xd9, 0xd9, 0x5d, 0xaf, 0x7f, 0x9c, 0x75, 0x84, 0xc6, 0x9e, 0xf7, - 0xbe, 0x37, 0xdf, 0x7c, 0xdf, 0xcc, 0x9b, 0x59, 0xa8, 0x79, 0xd4, 0xeb, 0xcd, 0x8f, 0x7b, 0xf2, - 0xac, 0x1b, 0x71, 0x26, 0x19, 0x2e, 0x7b, 0xd4, 0xeb, 0xce, 0x8f, 0xcd, 0x23, 0x97, 0x89, 0x29, - 0x13, 0xbd, 0xa9, 0xf0, 0x15, 0x3e, 0x15, 0xbe, 0x2e, 0x30, 0x6f, 0x6a, 0xe0, 0x34, 0x8e, 0x7a, - 0x3a, 0x48, 0xa0, 0x66, 0x42, 0xe6, 0x93, 0x90, 0x08, 0x9a, 0x66, 0x1b, 0x49, 0x76, 0xca, 0x3c, - 0x12, 0x64, 0xa5, 0x3e, 0xf3, 0x99, 0xa6, 0x50, 0x23, 0x9d, 0xb5, 0x7e, 0x46, 0x50, 0x1b, 0x0a, - 0xff, 0x8b, 0xc8, 0x73, 0x24, 0xf9, 0xd4, 0xe1, 0xce, 0x54, 0xe0, 0xf7, 0xa1, 0xe2, 0xcc, 0xe4, - 0x98, 0x71, 0x2a, 0x17, 0x06, 0x6a, 0xa3, 0x4e, 0x65, 0x60, 0xfc, 0xf9, 0xdb, 0x7b, 0xcd, 0x64, - 0xe5, 0x13, 0xcf, 0xe3, 0x44, 0x88, 0xc7, 0x92, 0xd3, 0xd0, 0xb7, 0x97, 0xa5, 0xf8, 0x5d, 0x28, - 0x47, 0x31, 0x83, 0x51, 0x68, 0xa3, 0x4e, 0xb5, 0x7f, 0xa3, 0xab, 0x9d, 0x75, 0x35, 0xef, 0xa0, - 0xf4, 0xec, 0xef, 0x3b, 0x7b, 0x76, 0x52, 0x83, 0x9b, 0x70, 0x4d, 0xb2, 0x09, 0x09, 0x8d, 0xa2, - 0x5a, 0xc1, 0xd6, 0xc1, 0x83, 0x1b, 0xdf, 0xbf, 0x78, 0x7a, 0x77, 0xc9, 0x69, 0xdd, 0x84, 0xa3, - 0x35, 0x79, 0x36, 0x11, 0x11, 0x0b, 0x05, 0xb1, 0x7e, 0x44, 0x50, 0x1f, 0x0a, 0xff, 0x24, 0x08, - 0x98, 0xeb, 0x48, 0xf2, 0xa5, 0x33, 0x0b, 0xe4, 0x4b, 0x6b, 0x37, 0xe0, 0xba, 0x98, 0x8d, 0xbe, - 0x26, 0xae, 0x8c, 0xc5, 0x57, 0xec, 0x34, 0xc4, 0xaf, 0x42, 0x99, 0x71, 0xea, 0xd3, 0x54, 0x68, - 0x12, 0x6d, 0x28, 0xfd, 0x05, 0x81, 0xb1, 0x2e, 0x27, 0xd5, 0x8a, 0xeb, 0x50, 0x74, 0xa9, 0xa7, - 0x05, 0xd9, 0x6a, 0x88, 0x5f, 0x87, 0x03, 0x72, 0x16, 0x51, 0xbe, 0x38, 0x1d, 0x05, 0xcc, 0x9d, - 0xc4, 0xab, 0x16, 0xed, 0xaa, 0xce, 0x0d, 0x54, 0x0a, 0x1f, 0x43, 0x93, 0x13, 0x9f, 0x0a, 0xc9, - 0x1d, 0x49, 0x59, 0x78, 0xca, 0x22, 0xf5, 0x27, 0x12, 0x1d, 0x8d, 0x3c, 0xf6, 0x48, 0x43, 0xf8, - 0x35, 0xa8, 0xa8, 0xe5, 0x83, 0x31, 0x13, 0xd2, 0x28, 0xb5, 0x51, 0x67, 0xdf, 0x5e, 0x26, 0xac, - 0x3f, 0x10, 0xbc, 0x32, 0x14, 0xbe, 0x1d, 0x4f, 0x24, 0xfc, 0x23, 0x16, 0x4a, 0xce, 0x82, 0x80, - 0xf0, 0x97, 0xde, 0xb6, 0x16, 0x80, 0x23, 0x04, 0xe1, 0x5a, 0x58, 0xa1, 0x5d, 0xec, 0x1c, 0xd8, - 0xb9, 0x8c, 0xd2, 0x33, 0x21, 0x0b, 0x31, 0x76, 0x38, 0x51, 0xba, 0x15, 0xbc, 0x4c, 0xe0, 0x37, - 0xe1, 0x70, 0x4e, 0x38, 0xfd, 0x8a, 0xba, 0x8e, 0x26, 0x28, 0xc5, 0x15, 0xab, 0xc9, 0x8d, 0x8d, - 0xfe, 0xae, 0x00, 0xb7, 0xb7, 0xba, 0xc8, 0x76, 0x3b, 0x3e, 0x4c, 0xd7, 0x25, 0x42, 0xc4, 0x5e, - 0xf6, 0xed, 0x34, 0xc4, 0xf7, 0x01, 0xdc, 0xac, 0x5e, 0x9f, 0xf4, 0x0e, 0xa3, 0xb9, 0x5a, 0xfc, - 0x08, 0xf6, 0x1d, 0xd7, 0x65, 0xb3, 0x50, 0x6a, 0x23, 0xd5, 0xfe, 0xbd, 0xb4, 0xbd, 0x77, 0x8a, - 0xe9, 0x9e, 0x24, 0xb3, 0x3e, 0x0e, 0x25, 0x5f, 0xd8, 0x19, 0x89, 0xf9, 0x01, 0x1c, 0xae, 0x40, - 0xaa, 0x47, 0x26, 0x64, 0x91, 0xf6, 0xc8, 0x84, 0x2c, 0xd4, 0x15, 0x99, 0x3b, 0xc1, 0x8c, 0x24, - 0x2d, 0xa9, 0x83, 0x07, 0x85, 0xfb, 0xc8, 0xfa, 0x1d, 0x41, 0x43, 0x35, 0x9b, 0xde, 0x94, 0x6f, - 0xc8, 0x63, 0xc2, 0xe7, 0xd4, 0x25, 0x6b, 0xfe, 0xd0, 0x7f, 0xf0, 0xb7, 0x6c, 0xf3, 0x42, 0xbe, - 0xcd, 0xf1, 0x3b, 0x50, 0x16, 0x2e, 0x8b, 0x88, 0x6e, 0xbb, 0x6a, 0xbf, 0x91, 0x5d, 0x6a, 0xc2, - 0xa7, 0x54, 0x08, 0x75, 0x44, 0x76, 0x52, 0xb2, 0xbc, 0xd3, 0xa5, 0xfc, 0x9d, 0xae, 0xa9, 0x03, - 0xcc, 0xad, 0x65, 0x0d, 0xe1, 0xd6, 0x16, 0xf1, 0x57, 0x38, 0xbe, 0x8c, 0xbf, 0x90, 0xe3, 0xb7, - 0x7e, 0x40, 0x80, 0x73, 0x67, 0xf0, 0xff, 0xf7, 0xe2, 0x6d, 0xb8, 0x2e, 0x34, 0x49, 0xf2, 0x92, - 0xd5, 0x52, 0xd3, 0xa9, 0xd4, 0x14, 0xdf, 0xf4, 0xf6, 0x10, 0xcc, 0x4d, 0x2d, 0x57, 0xb0, 0x56, - 0x87, 0xa2, 0x47, 0xbd, 0xc4, 0x98, 0x1a, 0xf6, 0x7f, 0x2d, 0x42, 0x71, 0x28, 0x7c, 0xfc, 0x10, - 0x0e, 0x56, 0x9e, 0xe7, 0xa3, 0x5c, 0xdf, 0xe5, 0x01, 0xf3, 0xce, 0x25, 0x40, 0xb6, 0xfa, 0xe7, - 0x50, 0xdf, 0xe8, 0x98, 0x5b, 0xb9, 0x49, 0xeb, 0xa0, 0xf9, 0xc6, 0x0e, 0x30, 0x63, 0xfd, 0x04, - 0x0e, 0x57, 0xdf, 0x60, 0x23, 0x3f, 0x2b, 0x8f, 0x98, 0xed, 0xcb, 0x90, 0x8c, 0xec, 0x09, 0xe0, - 0x2d, 0xcf, 0xd3, 0xed, 0x9d, 0x57, 0xcd, 0x7c, 0xeb, 0x4a, 0x37, 0x11, 0x7f, 0x06, 0xb5, 0xf5, - 0x1e, 0x31, 0xb7, 0xcc, 0x4c, 0xcd, 0x5b, 0x97, 0x63, 0x29, 0xa5, 0x79, 0xed, 0xdb, 0x17, 0x4f, - 0xef, 0xa2, 0xc1, 0x87, 0xcf, 0xce, 0x5b, 0xe8, 0xf9, 0x79, 0x0b, 0xfd, 0x73, 0xde, 0x42, 0x3f, - 0x5d, 0xb4, 0xf6, 0x9e, 0x5f, 0xb4, 0xf6, 0xfe, 0xba, 0x68, 0xed, 0x3d, 0xb1, 0x7c, 0x2a, 0xc7, - 0xb3, 0x51, 0xd7, 0x65, 0xd3, 0x1e, 0x0b, 0x05, 0x0b, 0x79, 0x2f, 0xfe, 0x39, 0xeb, 0xa9, 0x6f, - 0xb4, 0x5c, 0x44, 0x44, 0x8c, 0xca, 0xf1, 0xa7, 0xf8, 0xde, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xf9, 0xc0, 0x77, 0x8b, 0x1a, 0x08, 0x00, 0x00, + // 806 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xfb, 0x44, + 0x10, 0x8d, 0xe3, 0xfc, 0xf2, 0x6b, 0x26, 0x6d, 0x13, 0x2d, 0x85, 0xba, 0x2e, 0x4d, 0x83, 0x01, + 0x29, 0x54, 0x25, 0x51, 0x5b, 0x09, 0x55, 0x05, 0x21, 0x35, 0x08, 0xa9, 0x12, 0x0a, 0x14, 0x17, + 0x38, 0xf4, 0x52, 0x39, 0xf6, 0xe2, 0x2c, 0x71, 0xbc, 0xd1, 0xee, 0x26, 0x6a, 0x38, 0xf1, 0xe7, + 0x86, 0x38, 0xf0, 0x05, 0xe0, 0xcc, 0xb1, 0x07, 0xbe, 0x01, 0x97, 0x1e, 0x2b, 0x4e, 0x9c, 0x10, + 0x6a, 0x0f, 0xfd, 0x1a, 0xc8, 0x5e, 0xdb, 0x71, 0xfe, 0x34, 0x6a, 0xcb, 0x25, 0xf2, 0xcc, 0x1b, + 0xcf, 0xbe, 0x37, 0xf3, 0xb2, 0x86, 0x92, 0x43, 0x9c, 0xc6, 0x70, 0xaf, 0x21, 0x2e, 0xeb, 0x7d, + 0x46, 0x05, 0x45, 0x79, 0x87, 0x38, 0xf5, 0xe1, 0x9e, 0xbe, 0x6e, 0x53, 0xde, 0xa3, 0xbc, 0xd1, + 0xe3, 0x6e, 0x80, 0xf7, 0xb8, 0x2b, 0x0b, 0xf4, 0x0d, 0x09, 0x5c, 0x84, 0x51, 0x43, 0x06, 0x11, + 0xb4, 0x16, 0x35, 0x73, 0xb1, 0x8f, 0x39, 0x49, 0xb2, 0x2e, 0x75, 0xa9, 0xac, 0x0e, 0x9e, 0x64, + 0xd6, 0xf8, 0x55, 0x81, 0x52, 0x8b, 0xbb, 0x5f, 0xf6, 0x1d, 0x4b, 0xe0, 0x53, 0x8b, 0x59, 0x3d, + 0x8e, 0xde, 0x83, 0x82, 0x35, 0x10, 0x1d, 0xca, 0x88, 0x18, 0x69, 0x4a, 0x55, 0xa9, 0x15, 0x9a, + 0xda, 0x5f, 0x7f, 0xbc, 0xbb, 0x16, 0x1d, 0x72, 0xec, 0x38, 0x0c, 0x73, 0x7e, 0x26, 0x18, 0xf1, + 0x5d, 0x73, 0x5c, 0x8a, 0x76, 0x21, 0xdf, 0x0f, 0x3b, 0x68, 0xd9, 0xaa, 0x52, 0x2b, 0xee, 0xaf, + 0xd6, 0xa5, 0x88, 0xba, 0xec, 0xdb, 0xcc, 0x5d, 0xff, 0xb3, 0x9d, 0x31, 0xa3, 0x1a, 0xb4, 0x06, + 0x2f, 0x04, 0xed, 0x62, 0x5f, 0x53, 0x83, 0x13, 0x4c, 0x19, 0x1c, 0xad, 0xfe, 0x70, 0x7f, 0xb5, + 0x33, 0xee, 0x69, 0x6c, 0xc0, 0xfa, 0x14, 0x3d, 0x13, 0xf3, 0x3e, 0xf5, 0x39, 0x36, 0x7e, 0x56, + 0xa0, 0xdc, 0xe2, 0xee, 0xb1, 0xe7, 0x51, 0xdb, 0x12, 0xf8, 0x2b, 0x6b, 0xe0, 0x89, 0x67, 0x73, + 0xd7, 0xe0, 0x25, 0x1f, 0xb4, 0xbf, 0xc1, 0xb6, 0x08, 0xc9, 0x17, 0xcc, 0x38, 0x44, 0xaf, 0x41, + 0x9e, 0x32, 0xe2, 0x92, 0x98, 0x68, 0x14, 0xcd, 0x30, 0xfd, 0x51, 0x01, 0x6d, 0x9a, 0x4e, 0xcc, + 0x15, 0x95, 0x41, 0xb5, 0x89, 0x23, 0x09, 0x99, 0xc1, 0x23, 0x7a, 0x03, 0x96, 0xf1, 0x65, 0x9f, + 0xb0, 0xd1, 0x45, 0xdb, 0xa3, 0x76, 0x37, 0x3c, 0x55, 0x35, 0x8b, 0x32, 0xd7, 0x0c, 0x52, 0xf3, + 0x27, 0x84, 0x5e, 0x87, 0x42, 0x70, 0x82, 0xd7, 0xa1, 0x5c, 0x68, 0xb9, 0xaa, 0x52, 0x5b, 0x32, + 0xc7, 0x09, 0xe3, 0x4f, 0x05, 0x5e, 0x6d, 0x71, 0xd7, 0xc4, 0x2e, 0xe1, 0x02, 0xb3, 0x8f, 0xa8, + 0x2f, 0x18, 0xf5, 0x3c, 0xcc, 0x9e, 0x3d, 0x99, 0x0a, 0x80, 0xc5, 0x39, 0x66, 0x82, 0x50, 0x3f, + 0xd8, 0xac, 0x5a, 0x5b, 0x36, 0x53, 0x99, 0x80, 0x4f, 0x17, 0x8f, 0x78, 0xc7, 0x62, 0x98, 0x6b, + 0x6a, 0x08, 0x8f, 0x13, 0xe8, 0x2d, 0x58, 0x19, 0x62, 0x46, 0xbe, 0x26, 0xb6, 0x25, 0x1b, 0xe4, + 0xc2, 0x8a, 0xc9, 0xe4, 0xcc, 0x2c, 0xbf, 0xcf, 0xc2, 0xd6, 0x5c, 0x15, 0xc9, 0x40, 0xc3, 0x7d, + 0xd9, 0x36, 0xe6, 0x3c, 0xd4, 0xb2, 0x64, 0xc6, 0x21, 0x3a, 0x04, 0xb0, 0x93, 0x7a, 0xb9, 0xcc, + 0x05, 0x42, 0x53, 0xb5, 0xe8, 0x33, 0x58, 0xb2, 0x6c, 0x9b, 0x0e, 0x7c, 0x21, 0x85, 0x14, 0xf7, + 0x0f, 0x62, 0x07, 0x2f, 0x24, 0x53, 0x3f, 0x8e, 0xde, 0xfa, 0xd8, 0x17, 0x6c, 0x64, 0x26, 0x4d, + 0xf4, 0xf7, 0x61, 0x65, 0x02, 0x0a, 0x6c, 0xd0, 0xc5, 0xa3, 0xd8, 0x06, 0x5d, 0x3c, 0x0a, 0x76, + 0x3c, 0xb4, 0xbc, 0x01, 0x8e, 0x5c, 0x27, 0x83, 0xa3, 0xec, 0xa1, 0x62, 0xfc, 0x96, 0x85, 0x57, + 0x02, 0x3f, 0xc9, 0xa1, 0x7c, 0x8b, 0xcf, 0x30, 0x1b, 0x12, 0x1b, 0x4f, 0xe9, 0x53, 0x9e, 0xa0, + 0x6f, 0xec, 0xe4, 0x6c, 0xda, 0xc9, 0xe8, 0x53, 0x28, 0xf6, 0x31, 0xeb, 0x11, 0xce, 0xc3, 0x0d, + 0x49, 0xe9, 0xbb, 0x29, 0xe9, 0xd3, 0x1c, 0xea, 0xa7, 0xe3, 0x72, 0xa9, 0x39, 0xdd, 0x60, 0xec, + 0xdb, 0x5c, 0xca, 0xb7, 0xfa, 0x87, 0x50, 0x9e, 0x7e, 0xed, 0x29, 0xf3, 0x38, 0x2a, 0x05, 0x1e, + 0x49, 0xc9, 0x31, 0x5a, 0xb0, 0x39, 0x87, 0xdb, 0x23, 0x1c, 0x92, 0xf0, 0xcb, 0xa6, 0xf8, 0x19, + 0x3f, 0x29, 0x80, 0x52, 0x6b, 0xfe, 0xff, 0xe3, 0x7e, 0x07, 0x5e, 0x72, 0xd9, 0x24, 0xba, 0x0f, + 0x4b, 0xf1, 0x48, 0x63, 0xaa, 0x31, 0x3e, 0xab, 0xed, 0x04, 0xf4, 0x59, 0x2e, 0x8f, 0x90, 0x56, + 0x06, 0xd5, 0x21, 0x4e, 0x24, 0x2c, 0x78, 0xdc, 0xff, 0x5d, 0x05, 0xb5, 0xc5, 0x5d, 0x74, 0x02, + 0xcb, 0x13, 0x97, 0xfc, 0x7a, 0x6a, 0xbf, 0x69, 0x40, 0xdf, 0x7e, 0x00, 0x48, 0x4e, 0xff, 0x02, + 0xca, 0x33, 0xa6, 0xdc, 0x5c, 0xe0, 0x16, 0xfd, 0xcd, 0x05, 0x60, 0xd2, 0xf5, 0x13, 0x58, 0x99, + 0xbc, 0xc9, 0xb5, 0xf4, 0x5b, 0x69, 0x44, 0xaf, 0x3e, 0x84, 0x24, 0xcd, 0xce, 0x01, 0xcd, 0xb9, + 0x01, 0xb7, 0x16, 0xfe, 0x9b, 0xf5, 0xb7, 0x1f, 0xf5, 0x67, 0x47, 0x9f, 0x43, 0x69, 0xda, 0x23, + 0xfa, 0x9c, 0x37, 0x63, 0xf1, 0xc6, 0xc3, 0x58, 0xdc, 0x52, 0x7f, 0xf1, 0xdd, 0xfd, 0xd5, 0x8e, + 0xd2, 0xfc, 0xe0, 0xfa, 0xb6, 0xa2, 0xdc, 0xdc, 0x56, 0x94, 0x7f, 0x6f, 0x2b, 0xca, 0x2f, 0x77, + 0x95, 0xcc, 0xcd, 0x5d, 0x25, 0xf3, 0xf7, 0x5d, 0x25, 0x73, 0x6e, 0xb8, 0x44, 0x74, 0x06, 0xed, + 0xba, 0x4d, 0x7b, 0x0d, 0xea, 0x73, 0xea, 0xb3, 0x46, 0xf8, 0x73, 0xd9, 0x08, 0x3e, 0xf5, 0x62, + 0xd4, 0xc7, 0xbc, 0x9d, 0x0f, 0x3f, 0xe8, 0x07, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x20, 0x91, + 0xda, 0xb5, 0x4b, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1100,10 +1100,10 @@ func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error i-- dAtA[i] = 0x20 } - if len(m.RegistrationOptions) > 0 { - i -= len(m.RegistrationOptions) - copy(dAtA[i:], m.RegistrationOptions) - i = encodeVarintTx(dAtA, i, uint64(len(m.RegistrationOptions))) + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x1a } @@ -1265,17 +1265,24 @@ func (m *MsgAuthorizeService) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Scopes != nil { - { - size, err := m.Scopes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + if len(m.Permissions) > 0 { + for k := range m.Permissions { + v := m.Permissions[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintTx(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTx(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTx(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a } if len(m.Origin) > 0 { i -= len(m.Origin) @@ -1489,7 +1496,7 @@ func (m *MsgAllocateVaultResponse) Size() (n int) { if m.ExpiryBlock != 0 { n += 1 + sovTx(uint64(m.ExpiryBlock)) } - l = len(m.RegistrationOptions) + l = len(m.Token) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1568,9 +1575,13 @@ func (m *MsgAuthorizeService) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Scopes != nil { - l = m.Scopes.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.Permissions) > 0 { + for k, v := range m.Permissions { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + 1 + len(v) + sovTx(uint64(len(v))) + n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) + } } l = len(m.Token) if l > 0 { @@ -2059,7 +2070,7 @@ func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error { } case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2087,7 +2098,7 @@ func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RegistrationOptions = string(dAtA[iNdEx:postIndex]) + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -2632,7 +2643,7 @@ func (m *MsgAuthorizeService) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2659,12 +2670,103 @@ func (m *MsgAuthorizeService) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Scopes == nil { - m.Scopes = &Permissions{} + if m.Permissions == nil { + m.Permissions = make(map[string]string) } - if err := m.Scopes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthTx + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthTx + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthTx + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthTx + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.Permissions[mapkey] = mapvalue iNdEx = postIndex case 4: if wireType != 2 {