diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 91e8a8260..27c87bde2 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -18,6 +18,10 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} +permissions: + contents: read + packages: write + jobs: release-image: runs-on: ubuntu-latest diff --git a/.github/workflows/docker-vm-release.yml b/.github/workflows/docker-vm-release.yml index 6747a2db3..1e0292546 100644 --- a/.github/workflows/docker-vm-release.yml +++ b/.github/workflows/docker-vm-release.yml @@ -13,6 +13,10 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} +permissions: + contents: read + packages: write + jobs: release-image: runs-on: ubuntu-latest @@ -23,26 +27,33 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 - # all lowercase ghcr registry + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - run: | DOCKER_REGISTRY=`echo "${{ env.REGISTRY }}/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'` echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV REPO_NAME=`echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]'` echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV - - - name: Parse tag - id: tag - run: | - # v0.0.1 - VERSION=$(echo ${{ github.ref_name }} | sed "s/v//") - # 0.0.1 - echo "VERSION=$VERSION" >> $GITHUB_ENV - - # build and publish package to ghcr (public) with codebase remaining private + # login to ghcr (public) with codebase remaining private - name: Log in to the Container registry uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push sonrvm image + uses: docker/build-push-action@v6 + with: + push: true + target: sonrvm + tags: ghcr.io/${{ github.repository_owner }}/sonrvm:latest + + - name: Build and push sonr-runner image + uses: docker/build-push-action@v6 + with: + push: true + target: sonr-runner + tags: ghcr.io/${{ github.repository_owner }}/sonr-runner:latest diff --git a/.gitignore b/.gitignore index f93bcc367..07c449c9b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,9 @@ aof* *.out buf.lock +# Exclude embedded files +!internal/files/dist + # Dependency directories node_modules/ diff --git a/Dockerfile b/Dockerfile index f76c6cd2b..a23e314b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,31 @@ RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code USER ${DEVBOX_USER}:${DEVBOX_USER} COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} process-compose.yaml process-compose.yaml RUN devbox run -- echo "Installed Packages." ENTRYPOINT ["devbox", "run"] +# -------------------------------------------------------- +FROM jetpackio/devbox:latest AS sonr-runner + +WORKDIR /code +USER root:root + +RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code + +USER ${DEVBOX_USER}:${DEVBOX_USER} + +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} process-compose.yaml process-compose.yaml +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} . . + +RUN devbox run -- echo "Installed Packages." + +RUN git config --global --add safe.directory /code +ENTRYPOINT ["devbox", "run", "testnet"] + # -------------------------------------------------------- FROM golang:1.22-alpine AS go-builder diff --git a/Makefile b/Makefile index 1159b3d32..632b87d35 100644 --- a/Makefile +++ b/Makefile @@ -305,17 +305,17 @@ templ: @echo "Generating templ files" templ generate -vault: +dwn: + @echo "Generating go-pkl files" + go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/txns.pkl + go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/vault.pkl @echo "Building vault.wasm" - GOOS=js GOARCH=wasm go build -o ./internal/files/vault.wasm ./cmd/vault/main.go + GOOS=js GOARCH=wasm go build -o ./internal/vfs/dwn.wasm ./cmd/dwn/main.go ############################################################################### ### help ### ############################################################################### -.PHONY: explorer -explorer: - docker compose up help: @echo "Usage: make " diff --git a/api/did/v1/constants.pulsar.go b/api/did/v1/constants.pulsar.go deleted file mode 100644 index 44e845b41..000000000 --- a/api/did/v1/constants.pulsar.go +++ /dev/null @@ -1,727 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package didv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: did/v1/constants.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) -) - -// 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_constants_proto_enumTypes[0].Descriptor() -} - -func (AssetType) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_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_constants_proto_enumTypes[1].Descriptor() -} - -func (DIDNamespace) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_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_BLS12377 KeyAlgorithm = 6 - KeyAlgorithm_KEY_ALGORITHM_KECCAK256 KeyAlgorithm = 7 -) - -// 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_BLS12377", - 7: "KEY_ALGORITHM_KECCAK256", - } - 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_BLS12377": 6, - "KEY_ALGORITHM_KECCAK256": 7, - } -) - -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_constants_proto_enumTypes[2].Descriptor() -} - -func (KeyAlgorithm) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_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 - 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 -) - -// 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", - } - 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, - } -) - -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_constants_proto_enumTypes[3].Descriptor() -} - -func (KeyCurve) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_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 - KeyEncoding_KEY_ENCODING_JWK KeyEncoding = 4 -) - -// 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", - 4: "KEY_ENCODING_JWK", - } - KeyEncoding_value = map[string]int32{ - "KEY_ENCODING_UNSPECIFIED": 0, - "KEY_ENCODING_RAW": 1, - "KEY_ENCODING_HEX": 2, - "KEY_ENCODING_MULTIBASE": 3, - "KEY_ENCODING_JWK": 4, - } -) - -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_constants_proto_enumTypes[4].Descriptor() -} - -func (KeyEncoding) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_proto_rawDescGZIP(), []int{4} -} - -// KeyRole defines the kind of key -type KeyRole int32 - -const ( - KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0 - // Blockchain key types - 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_constants_proto_enumTypes[5].Descriptor() -} - -func (KeyRole) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_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 -) - -// 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", - } - 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, - } -) - -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_constants_proto_enumTypes[6].Descriptor() -} - -func (KeyType) Type() protoreflect.EnumType { - return &file_did_v1_constants_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_constants_proto_rawDescGZIP(), []int{6} -} - -// 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_RECORDS_READ PermissionScope = 2 - PermissionScope_PERMISSION_SCOPE_RECORDS_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_RECORDS_READ", - 3: "PERMISSION_SCOPE_RECORDS_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_RECORDS_READ": 2, - "PERMISSION_SCOPE_RECORDS_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_constants_proto_enumTypes[7].Descriptor() -} - -func (PermissionScope) Type() protoreflect.EnumType { - return &file_did_v1_constants_proto_enumTypes[7] -} - -func (x PermissionScope) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PermissionScope.Descriptor instead. -func (PermissionScope) EnumDescriptor() ([]byte, []int) { - return file_did_v1_constants_proto_rawDescGZIP(), []int{7} -} - -var File_did_v1_constants_proto protoreflect.FileDescriptor - -var file_did_v1_constants_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 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, 0xe4, 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, 0x1a, 0x0a, 0x16, 0x4b, 0x45, 0x59, - 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x42, 0x4c, 0x53, 0x31, 0x32, - 0x33, 0x37, 0x37, 0x10, 0x06, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, - 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x32, 0x35, 0x36, - 0x10, 0x07, 0x2a, 0xd0, 0x01, 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, 0x2a, 0x89, 0x01, 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, 0x12, 0x14, 0x0a, 0x10, 0x4b, - 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4a, 0x57, 0x4b, 0x10, - 0x04, 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, 0x8b, - 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, 0x2a, 0x9f, 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, 0x21, 0x0a, 0x1d, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x53, 0x5f, - 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, - 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52, - 0x44, 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, 0x7e, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x43, 0x6f, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 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_constants_proto_rawDescOnce sync.Once - file_did_v1_constants_proto_rawDescData = file_did_v1_constants_proto_rawDesc -) - -func file_did_v1_constants_proto_rawDescGZIP() []byte { - file_did_v1_constants_proto_rawDescOnce.Do(func() { - file_did_v1_constants_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_constants_proto_rawDescData) - }) - return file_did_v1_constants_proto_rawDescData -} - -var file_did_v1_constants_proto_enumTypes = make([]protoimpl.EnumInfo, 8) -var file_did_v1_constants_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 - (PermissionScope)(0), // 7: did.v1.PermissionScope -} -var file_did_v1_constants_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_did_v1_constants_proto_init() } -func file_did_v1_constants_proto_init() { - if File_did_v1_constants_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_did_v1_constants_proto_rawDesc, - NumEnums: 8, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_did_v1_constants_proto_goTypes, - DependencyIndexes: file_did_v1_constants_proto_depIdxs, - EnumInfos: file_did_v1_constants_proto_enumTypes, - }.Build() - File_did_v1_constants_proto = out.File - file_did_v1_constants_proto_rawDesc = nil - file_did_v1_constants_proto_goTypes = nil - file_did_v1_constants_proto_depIdxs = nil -} diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index c526c1028..0ea43ccb7 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -604,12 +604,62 @@ func (x *_Params_3_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Params_8_list)(nil) + +type _Params_8_list struct { + list *[]string +} + +func (x *_Params_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field AttestationFormats as it is not of Message kind")) +} + +func (x *_Params_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_8_list) IsValid() bool { + return x.list != nil +} + var ( - md_Params protoreflect.MessageDescriptor - fd_Params_whitelisted_assets protoreflect.FieldDescriptor - fd_Params_whitelisted_chains protoreflect.FieldDescriptor - fd_Params_allowed_public_keys protoreflect.FieldDescriptor - fd_Params_openid_config protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_whitelisted_assets protoreflect.FieldDescriptor + fd_Params_whitelisted_chains protoreflect.FieldDescriptor + fd_Params_allowed_public_keys protoreflect.FieldDescriptor + fd_Params_openid_config protoreflect.FieldDescriptor + fd_Params_ipfs_active protoreflect.FieldDescriptor + fd_Params_localhost_registration_enabled protoreflect.FieldDescriptor + fd_Params_conveyance_preference protoreflect.FieldDescriptor + fd_Params_attestation_formats protoreflect.FieldDescriptor ) func init() { @@ -619,6 +669,10 @@ func init() { fd_Params_whitelisted_chains = md_Params.Fields().ByName("whitelisted_chains") fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") fd_Params_openid_config = md_Params.Fields().ByName("openid_config") + fd_Params_ipfs_active = md_Params.Fields().ByName("ipfs_active") + fd_Params_localhost_registration_enabled = md_Params.Fields().ByName("localhost_registration_enabled") + fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference") + fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -710,6 +764,30 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.IpfsActive != false { + value := protoreflect.ValueOfBool(x.IpfsActive) + if !f(fd_Params_ipfs_active, value) { + return + } + } + if x.LocalhostRegistrationEnabled != false { + value := protoreflect.ValueOfBool(x.LocalhostRegistrationEnabled) + if !f(fd_Params_localhost_registration_enabled, value) { + return + } + } + if x.ConveyancePreference != "" { + value := protoreflect.ValueOfString(x.ConveyancePreference) + if !f(fd_Params_conveyance_preference, value) { + return + } + } + if len(x.AttestationFormats) != 0 { + value := protoreflect.ValueOfList(&_Params_8_list{list: &x.AttestationFormats}) + if !f(fd_Params_attestation_formats, value) { + return + } + } } // Has reports whether a field is populated. @@ -733,6 +811,14 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return len(x.AllowedPublicKeys) != 0 case "did.v1.Params.openid_config": return x.OpenidConfig != nil + case "did.v1.Params.ipfs_active": + return x.IpfsActive != false + case "did.v1.Params.localhost_registration_enabled": + return x.LocalhostRegistrationEnabled != false + case "did.v1.Params.conveyance_preference": + return x.ConveyancePreference != "" + case "did.v1.Params.attestation_formats": + return len(x.AttestationFormats) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -757,6 +843,14 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.AllowedPublicKeys = nil case "did.v1.Params.openid_config": x.OpenidConfig = nil + case "did.v1.Params.ipfs_active": + x.IpfsActive = false + case "did.v1.Params.localhost_registration_enabled": + x.LocalhostRegistrationEnabled = false + case "did.v1.Params.conveyance_preference": + x.ConveyancePreference = "" + case "did.v1.Params.attestation_formats": + x.AttestationFormats = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -794,6 +888,21 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "did.v1.Params.openid_config": value := x.OpenidConfig return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Params.ipfs_active": + value := x.IpfsActive + return protoreflect.ValueOfBool(value) + case "did.v1.Params.localhost_registration_enabled": + value := x.LocalhostRegistrationEnabled + return protoreflect.ValueOfBool(value) + case "did.v1.Params.conveyance_preference": + value := x.ConveyancePreference + return protoreflect.ValueOfString(value) + case "did.v1.Params.attestation_formats": + if len(x.AttestationFormats) == 0 { + return protoreflect.ValueOfList(&_Params_8_list{}) + } + listValue := &_Params_8_list{list: &x.AttestationFormats} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -828,6 +937,16 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.AllowedPublicKeys = *clv.list case "did.v1.Params.openid_config": x.OpenidConfig = value.Message().Interface().(*OpenIDConfig) + case "did.v1.Params.ipfs_active": + x.IpfsActive = value.Bool() + case "did.v1.Params.localhost_registration_enabled": + x.LocalhostRegistrationEnabled = value.Bool() + case "did.v1.Params.conveyance_preference": + x.ConveyancePreference = value.Interface().(string) + case "did.v1.Params.attestation_formats": + lv := value.List() + clv := lv.(*_Params_8_list) + x.AttestationFormats = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -871,6 +990,18 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore x.OpenidConfig = new(OpenIDConfig) } return protoreflect.ValueOfMessage(x.OpenidConfig.ProtoReflect()) + case "did.v1.Params.attestation_formats": + if x.AttestationFormats == nil { + x.AttestationFormats = []string{} + } + value := &_Params_8_list{list: &x.AttestationFormats} + return protoreflect.ValueOfList(value) + case "did.v1.Params.ipfs_active": + panic(fmt.Errorf("field ipfs_active of message did.v1.Params is not mutable")) + case "did.v1.Params.localhost_registration_enabled": + panic(fmt.Errorf("field localhost_registration_enabled of message did.v1.Params is not mutable")) + case "did.v1.Params.conveyance_preference": + panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -896,6 +1027,15 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "did.v1.Params.openid_config": m := new(OpenIDConfig) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Params.ipfs_active": + return protoreflect.ValueOfBool(false) + case "did.v1.Params.localhost_registration_enabled": + return protoreflect.ValueOfBool(false) + case "did.v1.Params.conveyance_preference": + return protoreflect.ValueOfString("") + case "did.v1.Params.attestation_formats": + list := []string{} + return protoreflect.ValueOfList(&_Params_8_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -987,6 +1127,22 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { l = options.Size(x.OpenidConfig) n += 1 + l + runtime.Sov(uint64(l)) } + if x.IpfsActive { + n += 2 + } + if x.LocalhostRegistrationEnabled { + n += 2 + } + l = len(x.ConveyancePreference) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.AttestationFormats) > 0 { + for _, s := range x.AttestationFormats { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1016,6 +1172,42 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.AttestationFormats) > 0 { + for iNdEx := len(x.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AttestationFormats[iNdEx]) + copy(dAtA[i:], x.AttestationFormats[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(x.ConveyancePreference) > 0 { + i -= len(x.ConveyancePreference) + copy(dAtA[i:], x.ConveyancePreference) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) + i-- + dAtA[i] = 0x3a + } + if x.LocalhostRegistrationEnabled { + i-- + if x.LocalhostRegistrationEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.IpfsActive { + i-- + if x.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } if x.OpenidConfig != nil { encoded, err := options.Marshal(x.OpenidConfig) if err != nil { @@ -1265,6 +1457,110 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", 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.LocalhostRegistrationEnabled = bool(v != 0) + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", 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.ConveyancePreference = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", 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.AttestationFormats = append(x.AttestationFormats, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7849,6 +8145,535 @@ 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} +} + +// 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[7].Descriptor() +} + +func (PermissionScope) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[7] +} + +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{7} +} + // GenesisState defines the module genesis state type GenesisState struct { state protoimpl.MessageState @@ -7900,6 +8725,14 @@ type Params struct { AllowedPublicKeys []*KeyInfo `protobuf:"bytes,3,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty"` // OpenIDConfig defines the base openid configuration across all did services OpenidConfig *OpenIDConfig `protobuf:"bytes,4,opt,name=openid_config,json=openidConfig,proto3" json:"openid_config,omitempty"` + // IpfsActive is a flag to enable/disable ipfs + IpfsActive bool `protobuf:"varint,5,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + // Localhost Registration Enabled + LocalhostRegistrationEnabled bool `protobuf:"varint,6,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` + // ConveyancePreference defines the conveyance preference + ConveyancePreference string `protobuf:"bytes,7,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + // AttestationFormats defines the attestation formats + AttestationFormats []string `protobuf:"bytes,8,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (x *Params) Reset() { @@ -7950,6 +8783,34 @@ func (x *Params) GetOpenidConfig() *OpenIDConfig { return nil } +func (x *Params) GetIpfsActive() bool { + if x != nil { + return x.IpfsActive + } + return false +} + +func (x *Params) GetLocalhostRegistrationEnabled() bool { + if x != nil { + return x.LocalhostRegistrationEnabled + } + return false +} + +func (x *Params) GetConveyancePreference() string { + if x != nil { + return x.ConveyancePreference + } + return "" +} + +func (x *Params) GetAttestationFormats() []string { + if x != nil { + return x.AttestationFormats + } + return nil +} + // AssetInfo defines the asset info type AssetInfo struct { state protoimpl.MessageState @@ -8567,152 +9428,284 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x0a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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, 0x16, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x74, 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, - 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, 0xa1, 0x02, - 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, 0x40, 0x0a, 0x12, 0x77, 0x68, - 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, - 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x3f, 0x0a, 0x13, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x39, 0x0a, - 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0xc4, 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, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x19, 0x0a, - 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x35, 0x0a, - 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 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, 0x22, 0xee, 0x03, 0x0a, 0x0c, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, - 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2b, - 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x73, 0x65, 0x72, 0x69, - 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x53, 0x75, 0x70, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x12, 0x38, 0x0a, 0x18, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x6d, 0x6f, 0x64, - 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x16, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x6f, 0x64, 0x65, - 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x30, - 0x0a, 0x14, 0x61, 0x63, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x63, - 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x12, 0x36, 0x0a, 0x17, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x15, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0xcd, 0x05, 0x0a, 0x0d, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, - 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, - 0x69, 0x6b, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x65, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x67, 0x72, - 0x70, 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, 0x0e, 0x72, - 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x70, 0x6c, - 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, - 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x66, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x41, 0x0a, 0x0b, - 0x69, 0x62, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x52, 0x0a, 0x69, 0x62, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, - 0x3b, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, - 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x1a, 0x34, 0x0a, 0x0c, - 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x72, 0x6c, 0x1a, 0xb1, 0x01, 0x0a, 0x07, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, - 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1b, 0x0a, - 0x09, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, - 0x69, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x61, 0x73, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x67, 0x61, 0x73, 0x4d, 0x75, - 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x1a, 0x30, 0x0a, 0x0a, 0x49, 0x42, 0x43, 0x43, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 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, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 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, 0xee, 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, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x73, 0x12, 0x3f, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x39, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, + 0x05, 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, 0x06, 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, 0x07, 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, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 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, 0xc4, 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, 0x16, 0x0a, 0x06, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0x99, 0x01, + 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x12, 0x35, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 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, 0x22, 0xee, 0x03, 0x0a, + 0x0c, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, + 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x5f, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, + 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x29, 0x0a, 0x10, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x73, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, + 0x32, 0x0a, 0x15, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x63, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x12, 0x61, 0x63, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0xcd, 0x05, + 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x67, 0x72, 0x70, + 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x0d, 0x67, 0x72, 0x70, 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0x45, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x45, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6c, 0x6f, + 0x72, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, + 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x66, 0x65, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x41, 0x0a, 0x0b, 0x69, 0x62, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x42, + 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0a, 0x69, 0x62, 0x63, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x3b, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x1a, 0x34, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x1a, 0xb1, 0x01, 0x0a, 0x07, 0x46, 0x65, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, + 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x61, 0x73, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x73, 0x69, 0x6d, 0x75, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x53, + 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x61, 0x73, 0x5f, + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, + 0x67, 0x61, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x1a, 0x30, 0x0a, 0x0a, 0x49, + 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 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, 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, } var ( @@ -8727,44 +9720,47 @@ 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, 8) var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_did_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: did.v1.GenesisState - (*Params)(nil), // 1: did.v1.Params - (*AssetInfo)(nil), // 2: did.v1.AssetInfo - (*ChainInfo)(nil), // 3: did.v1.ChainInfo - (*KeyInfo)(nil), // 4: did.v1.KeyInfo - (*OpenIDConfig)(nil), // 5: did.v1.OpenIDConfig - (*ValidatorInfo)(nil), // 6: did.v1.ValidatorInfo - (*ValidatorInfo_Endpoint)(nil), // 7: did.v1.ValidatorInfo.Endpoint - (*ValidatorInfo_ExplorerInfo)(nil), // 8: did.v1.ValidatorInfo.ExplorerInfo - (*ValidatorInfo_FeeInfo)(nil), // 9: did.v1.ValidatorInfo.FeeInfo - (*ValidatorInfo_IBCChannel)(nil), // 10: did.v1.ValidatorInfo.IBCChannel - (AssetType)(0), // 11: did.v1.AssetType - (KeyRole)(0), // 12: did.v1.KeyRole - (KeyAlgorithm)(0), // 13: did.v1.KeyAlgorithm - (KeyEncoding)(0), // 14: did.v1.KeyEncoding - (KeyCurve)(0), // 15: did.v1.KeyCurve - (KeyType)(0), // 16: did.v1.KeyType + (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 + (PermissionScope)(0), // 7: did.v1.PermissionScope + (*GenesisState)(nil), // 8: did.v1.GenesisState + (*Params)(nil), // 9: did.v1.Params + (*AssetInfo)(nil), // 10: did.v1.AssetInfo + (*ChainInfo)(nil), // 11: did.v1.ChainInfo + (*KeyInfo)(nil), // 12: did.v1.KeyInfo + (*OpenIDConfig)(nil), // 13: did.v1.OpenIDConfig + (*ValidatorInfo)(nil), // 14: did.v1.ValidatorInfo + (*ValidatorInfo_Endpoint)(nil), // 15: did.v1.ValidatorInfo.Endpoint + (*ValidatorInfo_ExplorerInfo)(nil), // 16: did.v1.ValidatorInfo.ExplorerInfo + (*ValidatorInfo_FeeInfo)(nil), // 17: did.v1.ValidatorInfo.FeeInfo + (*ValidatorInfo_IBCChannel)(nil), // 18: did.v1.ValidatorInfo.IBCChannel } var file_did_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params - 2, // 1: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo - 3, // 2: did.v1.Params.whitelisted_chains:type_name -> did.v1.ChainInfo - 4, // 3: did.v1.Params.allowed_public_keys:type_name -> did.v1.KeyInfo - 5, // 4: did.v1.Params.openid_config:type_name -> did.v1.OpenIDConfig - 11, // 5: did.v1.AssetInfo.asset_type:type_name -> did.v1.AssetType - 6, // 6: did.v1.ChainInfo.validators:type_name -> did.v1.ValidatorInfo - 12, // 7: did.v1.KeyInfo.role:type_name -> did.v1.KeyRole - 13, // 8: did.v1.KeyInfo.algorithm:type_name -> did.v1.KeyAlgorithm - 14, // 9: did.v1.KeyInfo.encoding:type_name -> did.v1.KeyEncoding - 15, // 10: did.v1.KeyInfo.curve:type_name -> did.v1.KeyCurve - 16, // 11: did.v1.KeyInfo.type:type_name -> did.v1.KeyType - 7, // 12: did.v1.ValidatorInfo.grpc_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint - 7, // 13: did.v1.ValidatorInfo.rest_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint - 8, // 14: did.v1.ValidatorInfo.explorer:type_name -> did.v1.ValidatorInfo.ExplorerInfo - 9, // 15: did.v1.ValidatorInfo.fee_info:type_name -> did.v1.ValidatorInfo.FeeInfo - 10, // 16: did.v1.ValidatorInfo.ibc_channel:type_name -> did.v1.ValidatorInfo.IBCChannel + 9, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params + 10, // 1: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo + 11, // 2: did.v1.Params.whitelisted_chains:type_name -> did.v1.ChainInfo + 12, // 3: did.v1.Params.allowed_public_keys:type_name -> did.v1.KeyInfo + 13, // 4: did.v1.Params.openid_config:type_name -> did.v1.OpenIDConfig + 0, // 5: did.v1.AssetInfo.asset_type:type_name -> did.v1.AssetType + 14, // 6: did.v1.ChainInfo.validators:type_name -> did.v1.ValidatorInfo + 5, // 7: did.v1.KeyInfo.role:type_name -> did.v1.KeyRole + 2, // 8: did.v1.KeyInfo.algorithm:type_name -> did.v1.KeyAlgorithm + 4, // 9: did.v1.KeyInfo.encoding:type_name -> did.v1.KeyEncoding + 3, // 10: did.v1.KeyInfo.curve:type_name -> did.v1.KeyCurve + 6, // 11: did.v1.KeyInfo.type:type_name -> did.v1.KeyType + 15, // 12: did.v1.ValidatorInfo.grpc_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint + 15, // 13: did.v1.ValidatorInfo.rest_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint + 16, // 14: did.v1.ValidatorInfo.explorer:type_name -> did.v1.ValidatorInfo.ExplorerInfo + 17, // 15: did.v1.ValidatorInfo.fee_info:type_name -> did.v1.ValidatorInfo.FeeInfo + 18, // 16: did.v1.ValidatorInfo.ibc_channel:type_name -> did.v1.ValidatorInfo.IBCChannel 17, // [17:17] is the sub-list for method output_type 17, // [17:17] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name @@ -8777,7 +9773,6 @@ func file_did_v1_genesis_proto_init() { if File_did_v1_genesis_proto != nil { return } - file_did_v1_constants_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { @@ -8917,13 +9912,14 @@ func file_did_v1_genesis_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, - NumEnums: 0, + NumEnums: 8, 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 index 46371f374..de130b26d 100644 --- a/api/did/v1/models.pulsar.go +++ b/api/did/v1/models.pulsar.go @@ -3136,6 +3136,746 @@ func (x *fastReflection_Document) ProtoMethods() *protoiface.Methods { } } +var ( + md_JWK protoreflect.MessageDescriptor + fd_JWK_kty protoreflect.FieldDescriptor + fd_JWK_crv protoreflect.FieldDescriptor + fd_JWK_x protoreflect.FieldDescriptor + fd_JWK_y protoreflect.FieldDescriptor + fd_JWK_n protoreflect.FieldDescriptor + fd_JWK_e protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_JWK = File_did_v1_models_proto.Messages().ByName("JWK") + fd_JWK_kty = md_JWK.Fields().ByName("kty") + fd_JWK_crv = md_JWK.Fields().ByName("crv") + fd_JWK_x = md_JWK.Fields().ByName("x") + fd_JWK_y = md_JWK.Fields().ByName("y") + fd_JWK_n = md_JWK.Fields().ByName("n") + fd_JWK_e = md_JWK.Fields().ByName("e") +} + +var _ protoreflect.Message = (*fastReflection_JWK)(nil) + +type fastReflection_JWK JWK + +func (x *JWK) ProtoReflect() protoreflect.Message { + return (*fastReflection_JWK)(x) +} + +func (x *JWK) 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_JWK_messageType fastReflection_JWK_messageType +var _ protoreflect.MessageType = fastReflection_JWK_messageType{} + +type fastReflection_JWK_messageType struct{} + +func (x fastReflection_JWK_messageType) Zero() protoreflect.Message { + return (*fastReflection_JWK)(nil) +} +func (x fastReflection_JWK_messageType) New() protoreflect.Message { + return new(fastReflection_JWK) +} +func (x fastReflection_JWK_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_JWK +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_JWK) Descriptor() protoreflect.MessageDescriptor { + return md_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_JWK) Type() protoreflect.MessageType { + return _fastReflection_JWK_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_JWK) New() protoreflect.Message { + return new(fastReflection_JWK) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_JWK) Interface() protoreflect.ProtoMessage { + return (*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_JWK) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Kty != "" { + value := protoreflect.ValueOfString(x.Kty) + if !f(fd_JWK_kty, value) { + return + } + } + if x.Crv != "" { + value := protoreflect.ValueOfString(x.Crv) + if !f(fd_JWK_crv, value) { + return + } + } + if x.X != "" { + value := protoreflect.ValueOfString(x.X) + if !f(fd_JWK_x, value) { + return + } + } + if x.Y != "" { + value := protoreflect.ValueOfString(x.Y) + if !f(fd_JWK_y, value) { + return + } + } + if x.N != "" { + value := protoreflect.ValueOfString(x.N) + if !f(fd_JWK_n, value) { + return + } + } + if x.E != "" { + value := protoreflect.ValueOfString(x.E) + if !f(fd_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_JWK) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.JWK.kty": + return x.Kty != "" + case "did.v1.JWK.crv": + return x.Crv != "" + case "did.v1.JWK.x": + return x.X != "" + case "did.v1.JWK.y": + return x.Y != "" + case "did.v1.JWK.n": + return x.N != "" + case "did.v1.JWK.e": + return x.E != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JWK")) + } + panic(fmt.Errorf("message did.v1.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_JWK) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.JWK.kty": + x.Kty = "" + case "did.v1.JWK.crv": + x.Crv = "" + case "did.v1.JWK.x": + x.X = "" + case "did.v1.JWK.y": + x.Y = "" + case "did.v1.JWK.n": + x.N = "" + case "did.v1.JWK.e": + x.E = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JWK")) + } + panic(fmt.Errorf("message did.v1.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_JWK) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.JWK.kty": + value := x.Kty + return protoreflect.ValueOfString(value) + case "did.v1.JWK.crv": + value := x.Crv + return protoreflect.ValueOfString(value) + case "did.v1.JWK.x": + value := x.X + return protoreflect.ValueOfString(value) + case "did.v1.JWK.y": + value := x.Y + return protoreflect.ValueOfString(value) + case "did.v1.JWK.n": + value := x.N + return protoreflect.ValueOfString(value) + case "did.v1.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.JWK")) + } + panic(fmt.Errorf("message did.v1.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_JWK) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.JWK.kty": + x.Kty = value.Interface().(string) + case "did.v1.JWK.crv": + x.Crv = value.Interface().(string) + case "did.v1.JWK.x": + x.X = value.Interface().(string) + case "did.v1.JWK.y": + x.Y = value.Interface().(string) + case "did.v1.JWK.n": + x.N = value.Interface().(string) + case "did.v1.JWK.e": + x.E = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JWK")) + } + panic(fmt.Errorf("message did.v1.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_JWK) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.JWK.kty": + panic(fmt.Errorf("field kty of message did.v1.JWK is not mutable")) + case "did.v1.JWK.crv": + panic(fmt.Errorf("field crv of message did.v1.JWK is not mutable")) + case "did.v1.JWK.x": + panic(fmt.Errorf("field x of message did.v1.JWK is not mutable")) + case "did.v1.JWK.y": + panic(fmt.Errorf("field y of message did.v1.JWK is not mutable")) + case "did.v1.JWK.n": + panic(fmt.Errorf("field n of message did.v1.JWK is not mutable")) + case "did.v1.JWK.e": + panic(fmt.Errorf("field e of message did.v1.JWK is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JWK")) + } + panic(fmt.Errorf("message did.v1.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_JWK) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.JWK.kty": + return protoreflect.ValueOfString("") + case "did.v1.JWK.crv": + return protoreflect.ValueOfString("") + case "did.v1.JWK.x": + return protoreflect.ValueOfString("") + case "did.v1.JWK.y": + return protoreflect.ValueOfString("") + case "did.v1.JWK.n": + return protoreflect.ValueOfString("") + case "did.v1.JWK.e": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JWK")) + } + panic(fmt.Errorf("message did.v1.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_JWK) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.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_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_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_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_JWK) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*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().(*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().(*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: JWK: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: 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 = (*_Metadata_2_map)(nil) type _Metadata_2_map struct { @@ -3332,7 +4072,7 @@ func (x *Metadata) ProtoReflect() protoreflect.Message { } func (x *Metadata) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[4] + mi := &file_did_v1_models_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4300,7 +5040,7 @@ func (x *Permissions) ProtoReflect() protoreflect.Message { } func (x *Permissions) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[5] + mi := &file_did_v1_models_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4916,7 +5656,7 @@ func (x *Profile) ProtoReflect() protoreflect.Message { } func (x *Profile) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[6] + mi := &file_did_v1_models_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5539,7 +6279,7 @@ func (x *Property) ProtoReflect() protoreflect.Message { } func (x *Property) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[7] + mi := &file_did_v1_models_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6005,96 +6745,14 @@ func (x *fastReflection_Property) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.Map = (*_PubKey_7_map)(nil) - -type _PubKey_7_map struct { - m *map[string]string -} - -func (x *_PubKey_7_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_PubKey_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 *_PubKey_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 *_PubKey_7_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_PubKey_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 *_PubKey_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 *_PubKey_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 *_PubKey_7_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_PubKey_7_map) IsValid() bool { - return x.m != 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_hex protoreflect.FieldDescriptor - fd_PubKey_multibase protoreflect.FieldDescriptor fd_PubKey_jwk protoreflect.FieldDescriptor ) @@ -6104,9 +6762,9 @@ func init() { 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_hex = md_PubKey.Fields().ByName("hex") - fd_PubKey_multibase = md_PubKey.Fields().ByName("multibase") fd_PubKey_jwk = md_PubKey.Fields().ByName("jwk") } @@ -6119,7 +6777,7 @@ func (x *PubKey) ProtoReflect() protoreflect.Message { } func (x *PubKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[8] + mi := &file_did_v1_models_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6193,26 +6851,26 @@ func (x *fastReflection_PubKey) Range(f func(protoreflect.FieldDescriptor, proto 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.Hex != "" { - value := protoreflect.ValueOfString(x.Hex) - if !f(fd_PubKey_hex, value) { - return - } - } - if x.Multibase != "" { - value := protoreflect.ValueOfString(x.Multibase) - if !f(fd_PubKey_multibase, value) { - return - } - } - if len(x.Jwk) != 0 { - value := protoreflect.ValueOfMap(&_PubKey_7_map{m: &x.Jwk}) + if x.Jwk != nil { + value := protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) if !f(fd_PubKey_jwk, value) { return } @@ -6238,14 +6896,14 @@ func (x *fastReflection_PubKey) Has(fd protoreflect.FieldDescriptor) bool { 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.hex": - return x.Hex != "" - case "did.v1.PubKey.multibase": - return x.Multibase != "" case "did.v1.PubKey.jwk": - return len(x.Jwk) != 0 + return x.Jwk != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) @@ -6268,12 +6926,12 @@ func (x *fastReflection_PubKey) Clear(fd protoreflect.FieldDescriptor) { 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.hex": - x.Hex = "" - case "did.v1.PubKey.multibase": - x.Multibase = "" case "did.v1.PubKey.jwk": x.Jwk = nil default: @@ -6301,21 +6959,18 @@ func (x *fastReflection_PubKey) Get(descriptor protoreflect.FieldDescriptor) pro 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.hex": - value := x.Hex - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.multibase": - value := x.Multibase - return protoreflect.ValueOfString(value) case "did.v1.PubKey.jwk": - if len(x.Jwk) == 0 { - return protoreflect.ValueOfMap(&_PubKey_7_map{}) - } - mapValue := &_PubKey_7_map{m: &x.Jwk} - return protoreflect.ValueOfMap(mapValue) + 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")) @@ -6342,16 +6997,14 @@ func (x *fastReflection_PubKey) Set(fd protoreflect.FieldDescriptor, value proto 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.hex": - x.Hex = value.Interface().(string) - case "did.v1.PubKey.multibase": - x.Multibase = value.Interface().(string) case "did.v1.PubKey.jwk": - mv := value.Map() - cmv := mv.(*_PubKey_7_map) - x.Jwk = *cmv.m + x.Jwk = value.Message().Interface().(*JWK) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) @@ -6374,22 +7027,21 @@ func (x *fastReflection_PubKey) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { case "did.v1.PubKey.jwk": if x.Jwk == nil { - x.Jwk = make(map[string]string) + x.Jwk = new(JWK) } - value := &_PubKey_7_map{m: &x.Jwk} - return protoreflect.ValueOfMap(value) + 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")) - case "did.v1.PubKey.hex": - panic(fmt.Errorf("field hex of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.multibase": - panic(fmt.Errorf("field multibase 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")) @@ -6409,15 +7061,15 @@ func (x *fastReflection_PubKey) NewField(fd protoreflect.FieldDescriptor) protor 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.hex": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.multibase": - return protoreflect.ValueOfString("") case "did.v1.PubKey.jwk": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_PubKey_7_map{m: &m}) + m := new(JWK) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) @@ -6496,39 +7148,20 @@ func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { 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)) } - l = len(x.Hex) - if l > 0 { + if x.Jwk != nil { + l = options.Size(x.Jwk) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Multibase) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Jwk) > 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.Jwk)) - for k := range x.Jwk { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Jwk[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Jwk { - SiZeMaP(k, v) - } - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -6558,69 +7191,36 @@ func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Jwk) > 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 x.Jwk != nil { + encoded, err := options.Marshal(x.Jwk) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err } - if options.Deterministic { - keysForJwk := make([]string, 0, len(x.Jwk)) - for k := range x.Jwk { - keysForJwk = append(keysForJwk, string(k)) - } - sort.Slice(keysForJwk, func(i, j int) bool { - return keysForJwk[i] < keysForJwk[j] - }) - for iNdEx := len(keysForJwk) - 1; iNdEx >= 0; iNdEx-- { - v := x.Jwk[string(keysForJwk[iNdEx])] - out, err := MaRsHaLmAp(keysForJwk[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Jwk { - v := x.Jwk[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Multibase) > 0 { - i -= len(x.Multibase) - copy(dAtA[i:], x.Multibase) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Multibase))) + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x32 - } - if len(x.Hex) > 0 { - i -= len(x.Hex) - copy(dAtA[i:], x.Hex) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hex))) - i-- - dAtA[i] = 0x2a + 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] = 0x22 + 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)) @@ -6744,6 +7344,44 @@ func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { } } 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) } @@ -6777,70 +7415,6 @@ func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { x.Raw = []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 Hex", 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.Hex = 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 Multibase", 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.Multibase = 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 Jwk", wireType) @@ -6871,102 +7445,11 @@ func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Jwk == nil { - x.Jwk = make(map[string]string) + x.Jwk = &JWK{} } - 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 - } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Jwk); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Jwk[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -7033,7 +7516,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { } func (x *Service) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[9] + mi := &file_did_v1_models_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7812,7 +8295,7 @@ func (x *Token) ProtoReflect() protoreflect.Message { } func (x *Token) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[10] + mi := &file_did_v1_models_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8340,21 +8823,21 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { var ( md_VerificationMethod protoreflect.MessageDescriptor + fd_VerificationMethod_method protoreflect.FieldDescriptor fd_VerificationMethod_id protoreflect.FieldDescriptor fd_VerificationMethod_controller protoreflect.FieldDescriptor - fd_VerificationMethod_method protoreflect.FieldDescriptor + fd_VerificationMethod_issuer protoreflect.FieldDescriptor fd_VerificationMethod_public_key protoreflect.FieldDescriptor - fd_VerificationMethod_service protoreflect.FieldDescriptor ) func init() { file_did_v1_models_proto_init() md_VerificationMethod = File_did_v1_models_proto.Messages().ByName("VerificationMethod") + fd_VerificationMethod_method = md_VerificationMethod.Fields().ByName("method") fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id") fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller") - fd_VerificationMethod_method = md_VerificationMethod.Fields().ByName("method") + fd_VerificationMethod_issuer = md_VerificationMethod.Fields().ByName("issuer") fd_VerificationMethod_public_key = md_VerificationMethod.Fields().ByName("public_key") - fd_VerificationMethod_service = md_VerificationMethod.Fields().ByName("service") } var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil) @@ -8366,7 +8849,7 @@ func (x *VerificationMethod) ProtoReflect() protoreflect.Message { } func (x *VerificationMethod) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[11] + mi := &file_did_v1_models_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8422,6 +8905,12 @@ func (x *fastReflection_VerificationMethod) Interface() protoreflect.ProtoMessag // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Method != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Method)) + if !f(fd_VerificationMethod_method, value) { + return + } + } if x.Id != "" { value := protoreflect.ValueOfString(x.Id) if !f(fd_VerificationMethod_id, value) { @@ -8434,9 +8923,9 @@ func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescr return } } - if x.Method != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Method)) - if !f(fd_VerificationMethod_method, value) { + if x.Issuer != "" { + value := protoreflect.ValueOfString(x.Issuer) + if !f(fd_VerificationMethod_issuer, value) { return } } @@ -8446,12 +8935,6 @@ func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescr return } } - if x.Service != nil { - value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) - if !f(fd_VerificationMethod_service, value) { - return - } - } } // Has reports whether a field is populated. @@ -8467,16 +8950,16 @@ func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescr // a repeated field is populated if it is non-empty. func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "did.v1.VerificationMethod.method": + return x.Method != 0 case "did.v1.VerificationMethod.id": return x.Id != "" case "did.v1.VerificationMethod.controller": return x.Controller != "" - case "did.v1.VerificationMethod.method": - return x.Method != 0 + case "did.v1.VerificationMethod.issuer": + return x.Issuer != "" case "did.v1.VerificationMethod.public_key": return x.PublicKey != nil - case "did.v1.VerificationMethod.service": - return x.Service != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -8493,16 +8976,16 @@ func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor) // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "did.v1.VerificationMethod.method": + x.Method = 0 case "did.v1.VerificationMethod.id": x.Id = "" case "did.v1.VerificationMethod.controller": x.Controller = "" - case "did.v1.VerificationMethod.method": - x.Method = 0 + case "did.v1.VerificationMethod.issuer": + x.Issuer = "" case "did.v1.VerificationMethod.public_key": x.PublicKey = nil - case "did.v1.VerificationMethod.service": - x.Service = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -8519,21 +9002,21 @@ func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescripto // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "did.v1.VerificationMethod.method": + value := x.Method + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) case "did.v1.VerificationMethod.id": value := x.Id return protoreflect.ValueOfString(value) case "did.v1.VerificationMethod.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.VerificationMethod.method": - value := x.Method - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.VerificationMethod.issuer": + value := x.Issuer + return protoreflect.ValueOfString(value) case "did.v1.VerificationMethod.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.VerificationMethod.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.VerificationMethod")) @@ -8554,16 +9037,16 @@ func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDes // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "did.v1.VerificationMethod.method": + x.Method = (DIDNamespace)(value.Enum()) case "did.v1.VerificationMethod.id": x.Id = value.Interface().(string) case "did.v1.VerificationMethod.controller": x.Controller = value.Interface().(string) - case "did.v1.VerificationMethod.method": - x.Method = (DIDNamespace)(value.Enum()) + case "did.v1.VerificationMethod.issuer": + x.Issuer = value.Interface().(string) case "did.v1.VerificationMethod.public_key": x.PublicKey = value.Message().Interface().(*PubKey) - case "did.v1.VerificationMethod.service": - x.Service = value.Message().Interface().(*Service) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -8589,17 +9072,14 @@ func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescrip x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.VerificationMethod.service": - if x.Service == nil { - x.Service = new(Service) - } - return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "did.v1.VerificationMethod.method": + panic(fmt.Errorf("field method of message did.v1.VerificationMethod is not mutable")) case "did.v1.VerificationMethod.id": panic(fmt.Errorf("field id of message did.v1.VerificationMethod is not mutable")) case "did.v1.VerificationMethod.controller": panic(fmt.Errorf("field controller of message did.v1.VerificationMethod is not mutable")) - case "did.v1.VerificationMethod.method": - panic(fmt.Errorf("field method of message did.v1.VerificationMethod is not mutable")) + case "did.v1.VerificationMethod.issuer": + panic(fmt.Errorf("field issuer of message did.v1.VerificationMethod is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) @@ -8613,18 +9093,17 @@ func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescrip // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_VerificationMethod) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.VerificationMethod.method": + return protoreflect.ValueOfEnum(0) case "did.v1.VerificationMethod.id": return protoreflect.ValueOfString("") case "did.v1.VerificationMethod.controller": return protoreflect.ValueOfString("") - case "did.v1.VerificationMethod.method": - return protoreflect.ValueOfEnum(0) + case "did.v1.VerificationMethod.issuer": + return protoreflect.ValueOfString("") case "did.v1.VerificationMethod.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.VerificationMethod.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.VerificationMethod")) @@ -8694,6 +9173,9 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + if x.Method != 0 { + n += 1 + runtime.Sov(uint64(x.Method)) + } l = len(x.Id) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -8702,17 +9184,14 @@ func (x *fastReflection_VerificationMethod) 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.Issuer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.PublicKey != nil { l = options.Size(x.PublicKey) 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) } @@ -8742,20 +9221,6 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { 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] = 0x3a - } if x.PublicKey != nil { encoded, err := options.Marshal(x.PublicKey) if err != nil { @@ -8768,26 +9233,33 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } - if x.Method != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Method)) + if len(x.Issuer) > 0 { + i -= len(x.Issuer) + copy(dAtA[i:], x.Issuer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Issuer))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x22 } 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 + dAtA[i] = 0x1a } 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 + dAtA[i] = 0x12 + } + if x.Method != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Method)) + i-- + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -8839,6 +9311,25 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + x.Method = 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.Method |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } @@ -8870,7 +9361,7 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { } x.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } @@ -8902,11 +9393,11 @@ func (x *fastReflection_VerificationMethod) 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) + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Issuer", 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 @@ -8916,12 +9407,25 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Method |= DIDNamespace(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } @@ -8957,42 +9461,6 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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:]) @@ -9048,7 +9516,7 @@ func (x *Witness) ProtoReflect() protoreflect.Message { } func (x *Witness) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[12] + mi := &file_did_v1_models_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9727,6 +10195,82 @@ func (x *Document) GetService() []string { return nil } +// JWK represents a JSON Web Key +type 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 *JWK) Reset() { + *x = JWK{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JWK) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JWK) ProtoMessage() {} + +// Deprecated: Use JWK.ProtoReflect.Descriptor instead. +func (*JWK) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{4} +} + +func (x *JWK) GetKty() string { + if x != nil { + return x.Kty + } + return "" +} + +func (x *JWK) GetCrv() string { + if x != nil { + return x.Crv + } + return "" +} + +func (x *JWK) GetX() string { + if x != nil { + return x.X + } + return "" +} + +func (x *JWK) GetY() string { + if x != nil { + return x.Y + } + return "" +} + +func (x *JWK) GetN() string { + if x != nil { + return x.N + } + return "" +} + +func (x *JWK) GetE() string { + if x != nil { + return x.E + } + return "" +} + // Metadata defines additional information provided to a did type Metadata struct { state protoimpl.MessageState @@ -9741,7 +10285,7 @@ type Metadata struct { func (x *Metadata) Reset() { *x = Metadata{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[4] + mi := &file_did_v1_models_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9755,7 +10299,7 @@ func (*Metadata) ProtoMessage() {} // Deprecated: Use Metadata.ProtoReflect.Descriptor instead. func (*Metadata) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{4} + return file_did_v1_models_proto_rawDescGZIP(), []int{5} } func (x *Metadata) GetOriginUri() string { @@ -9793,7 +10337,7 @@ type Permissions struct { func (x *Permissions) Reset() { *x = Permissions{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[5] + mi := &file_did_v1_models_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9807,7 +10351,7 @@ func (*Permissions) ProtoMessage() {} // Deprecated: Use Permissions.ProtoReflect.Descriptor instead. func (*Permissions) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{5} + return file_did_v1_models_proto_rawDescGZIP(), []int{6} } func (x *Permissions) GetGrants() []DIDNamespace { @@ -9839,7 +10383,7 @@ type Profile struct { func (x *Profile) Reset() { *x = Profile{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[6] + mi := &file_did_v1_models_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9853,7 +10397,7 @@ func (*Profile) ProtoMessage() {} // Deprecated: Use Profile.ProtoReflect.Descriptor instead. func (*Profile) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{6} + return file_did_v1_models_proto_rawDescGZIP(), []int{7} } func (x *Profile) GetId() string { @@ -9898,7 +10442,7 @@ type Property struct { func (x *Property) Reset() { *x = Property{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[7] + mi := &file_did_v1_models_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9912,7 +10456,7 @@ func (*Property) ProtoMessage() {} // Deprecated: Use Property.ProtoReflect.Descriptor instead. func (*Property) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{7} + return file_did_v1_models_proto_rawDescGZIP(), []int{8} } func (x *Property) GetAccumulator() []byte { @@ -9935,19 +10479,19 @@ type PubKey struct { 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"` - Raw []byte `protobuf:"bytes,4,opt,name=raw,proto3" json:"raw,omitempty"` - Hex string `protobuf:"bytes,5,opt,name=hex,proto3" json:"hex,omitempty"` - Multibase string `protobuf:"bytes,6,opt,name=multibase,proto3" json:"multibase,omitempty"` - Jwk map[string]string `protobuf:"bytes,7,rep,name=jwk,proto3" json:"jwk,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + 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 *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[8] + mi := &file_did_v1_models_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9961,7 +10505,7 @@ func (*PubKey) ProtoMessage() {} // Deprecated: Use PubKey.ProtoReflect.Descriptor instead. func (*PubKey) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{8} + return file_did_v1_models_proto_rawDescGZIP(), []int{9} } func (x *PubKey) GetRole() KeyRole { @@ -9985,6 +10529,20 @@ func (x *PubKey) GetEncoding() KeyEncoding { 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 @@ -9992,21 +10550,7 @@ func (x *PubKey) GetRaw() []byte { return nil } -func (x *PubKey) GetHex() string { - if x != nil { - return x.Hex - } - return "" -} - -func (x *PubKey) GetMultibase() string { - if x != nil { - return x.Multibase - } - return "" -} - -func (x *PubKey) GetJwk() map[string]string { +func (x *PubKey) GetJwk() *JWK { if x != nil { return x.Jwk } @@ -10030,7 +10574,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[9] + mi := &file_did_v1_models_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10044,7 +10588,7 @@ func (*Service) ProtoMessage() {} // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{9} + return file_did_v1_models_proto_rawDescGZIP(), []int{10} } func (x *Service) GetId() string { @@ -10103,7 +10647,7 @@ type Token struct { func (x *Token) Reset() { *x = Token{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[10] + mi := &file_did_v1_models_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10117,7 +10661,7 @@ func (*Token) ProtoMessage() {} // Deprecated: Use Token.ProtoReflect.Descriptor instead. func (*Token) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{10} + return file_did_v1_models_proto_rawDescGZIP(), []int{11} } func (x *Token) GetId() string { @@ -10147,17 +10691,17 @@ type VerificationMethod struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Service *Service `protobuf:"bytes,7,opt,name=service,proto3" json:"service,omitempty"` + Method DIDNamespace `protobuf:"varint,1,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` + PublicKey *PubKey `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` } func (x *VerificationMethod) Reset() { *x = VerificationMethod{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[11] + mi := &file_did_v1_models_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10171,7 +10715,14 @@ func (*VerificationMethod) ProtoMessage() {} // Deprecated: Use VerificationMethod.ProtoReflect.Descriptor instead. func (*VerificationMethod) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{11} + return file_did_v1_models_proto_rawDescGZIP(), []int{12} +} + +func (x *VerificationMethod) GetMethod() DIDNamespace { + if x != nil { + return x.Method + } + return DIDNamespace_DID_NAMESPACE_UNSPECIFIED } func (x *VerificationMethod) GetId() string { @@ -10188,11 +10739,11 @@ func (x *VerificationMethod) GetController() string { return "" } -func (x *VerificationMethod) GetMethod() DIDNamespace { +func (x *VerificationMethod) GetIssuer() string { if x != nil { - return x.Method + return x.Issuer } - return DIDNamespace_DID_NAMESPACE_UNSPECIFIED + return "" } func (x *VerificationMethod) GetPublicKey() *PubKey { @@ -10202,13 +10753,6 @@ func (x *VerificationMethod) GetPublicKey() *PubKey { return nil } -func (x *VerificationMethod) GetService() *Service { - if x != nil { - return x.Service - } - return nil -} - // Witness defines a BLS witness type Witness struct { state protoimpl.MessageState @@ -10221,7 +10765,7 @@ type Witness struct { func (x *Witness) Reset() { *x = Witness{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[12] + mi := &file_did_v1_models_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10235,7 +10779,7 @@ func (*Witness) ProtoMessage() {} // Deprecated: Use Witness.ProtoReflect.Descriptor instead. func (*Witness) Descriptor() ([]byte, []int) { - return file_did_v1_models_proto_rawDescGZIP(), []int{12} + return file_did_v1_models_proto_rawDescGZIP(), []int{13} } func (x *Witness) GetWitness() []byte { @@ -10249,157 +10793,159 @@ 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, 0x16, 0x64, - 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 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, 0x14, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x2f, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, - 0x6f, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x9d, 0x01, 0x0a, 0x03, 0x44, 0x49, 0x44, 0x12, - 0x2c, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 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, 0x18, 0x0a, - 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0xc0, 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, 0x4d, 0x0a, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x13, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, - 0x05, 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, - 0x07, 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, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xa1, 0x02, 0x0a, 0x08, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x37, 0x0a, 0x07, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 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, 0x4c, 0x0a, 0x0c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 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, 0x01, 0x0a, - 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 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, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 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, 0x2f, 0x0a, 0x0b, 0x41, 0x63, 0x63, + 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, + 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, + 0x9d, 0x01, 0x0a, 0x03, 0x44, 0x49, 0x44, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x18, 0x01, 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, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, + 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, + 0xc0, 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, 0x4d, 0x0a, 0x14, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x61, + 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, 0x05, 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, 0x07, 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, 0x08, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x22, 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, 0xa1, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x69, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, 0x72, + 0x69, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 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, 0x4c, 0x0a, 0x0c, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 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, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 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, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3e, 0x0a, 0x08, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x97, 0x02, 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, 0x1d, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x57, 0x4b, + 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x22, 0xe4, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 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, + 0x12, 0x2c, 0x0a, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x44, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x12, 0x2c, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x4f, 0x0a, 0x05, + 0x54, 0x6f, 0x6b, 0x65, 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, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x6e, 0x22, 0xb9, 0x01, + 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, + 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, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x3e, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, - 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x22, 0xb7, 0x02, 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, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x65, 0x78, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x65, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x75, 0x6c, - 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x75, - 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, - 0x62, 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x77, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6a, - 0x77, 0x6b, 0x1a, 0x36, 0x0a, 0x08, 0x4a, 0x77, 0x6b, 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, 0xe4, 0x01, 0x0a, 0x07, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x35, - 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 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, 0x12, 0x2c, 0x0a, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x6f, 0x70, 0x65, - 0x6e, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x4f, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 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, 0x16, 0x0a, 0x06, 0x6d, 0x61, - 0x63, 0x72, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x61, 0x63, 0x72, - 0x6f, 0x6e, 0x22, 0xcc, 0x01, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 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, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x18, 0x07, 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, 0x23, 0x0a, 0x07, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, - 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 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, + 0x65, 0x72, 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, 0x2d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 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, 0x22, 0x23, 0x0a, 0x07, 0x57, 0x69, 0x74, + 0x6e, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 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 ( @@ -10420,49 +10966,52 @@ var file_did_v1_models_proto_goTypes = []interface{}{ (*Credential)(nil), // 1: did.v1.Credential (*DID)(nil), // 2: did.v1.DID (*Document)(nil), // 3: did.v1.Document - (*Metadata)(nil), // 4: did.v1.Metadata - (*Permissions)(nil), // 5: did.v1.Permissions - (*Profile)(nil), // 6: did.v1.Profile - (*Property)(nil), // 7: did.v1.Property - (*PubKey)(nil), // 8: did.v1.PubKey - (*Service)(nil), // 9: did.v1.Service - (*Token)(nil), // 10: did.v1.Token - (*VerificationMethod)(nil), // 11: did.v1.VerificationMethod - (*Witness)(nil), // 12: did.v1.Witness - nil, // 13: did.v1.Metadata.PublicEntry - nil, // 14: did.v1.Metadata.PrivateEntry - nil, // 15: did.v1.PubKey.JwkEntry + (*JWK)(nil), // 4: did.v1.JWK + (*Metadata)(nil), // 5: did.v1.Metadata + (*Permissions)(nil), // 6: did.v1.Permissions + (*Profile)(nil), // 7: did.v1.Profile + (*Property)(nil), // 8: did.v1.Property + (*PubKey)(nil), // 9: did.v1.PubKey + (*Service)(nil), // 10: did.v1.Service + (*Token)(nil), // 11: did.v1.Token + (*VerificationMethod)(nil), // 12: did.v1.VerificationMethod + (*Witness)(nil), // 13: did.v1.Witness + nil, // 14: did.v1.Metadata.PublicEntry + nil, // 15: did.v1.Metadata.PrivateEntry (DIDNamespace)(0), // 16: did.v1.DIDNamespace (PermissionScope)(0), // 17: did.v1.PermissionScope (KeyRole)(0), // 18: did.v1.KeyRole (KeyAlgorithm)(0), // 19: did.v1.KeyAlgorithm (KeyEncoding)(0), // 20: did.v1.KeyEncoding - (*OpenIDConfig)(nil), // 21: did.v1.OpenIDConfig + (KeyCurve)(0), // 21: did.v1.KeyCurve + (KeyType)(0), // 22: did.v1.KeyType + (*OpenIDConfig)(nil), // 23: did.v1.OpenIDConfig } var file_did_v1_models_proto_depIdxs = []int32{ 16, // 0: did.v1.DID.method:type_name -> did.v1.DIDNamespace - 11, // 1: did.v1.Document.verification_methods:type_name -> did.v1.VerificationMethod - 13, // 2: did.v1.Metadata.public:type_name -> did.v1.Metadata.PublicEntry - 14, // 3: did.v1.Metadata.private:type_name -> did.v1.Metadata.PrivateEntry + 12, // 1: did.v1.Document.verification_methods:type_name -> did.v1.VerificationMethod + 14, // 2: did.v1.Metadata.public:type_name -> did.v1.Metadata.PublicEntry + 15, // 3: did.v1.Metadata.private:type_name -> did.v1.Metadata.PrivateEntry 16, // 4: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace 17, // 5: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope - 4, // 6: did.v1.Profile.metadata:type_name -> did.v1.Metadata + 5, // 6: did.v1.Profile.metadata:type_name -> did.v1.Metadata 18, // 7: did.v1.PubKey.role:type_name -> did.v1.KeyRole 19, // 8: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm 20, // 9: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding - 15, // 10: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JwkEntry - 5, // 11: did.v1.Service.permissions:type_name -> did.v1.Permissions - 21, // 12: did.v1.Service.openid:type_name -> did.v1.OpenIDConfig - 4, // 13: did.v1.Service.metadata:type_name -> did.v1.Metadata - 16, // 14: did.v1.VerificationMethod.method:type_name -> did.v1.DIDNamespace - 8, // 15: did.v1.VerificationMethod.public_key:type_name -> did.v1.PubKey - 9, // 16: did.v1.VerificationMethod.service:type_name -> did.v1.Service - 7, // 17: did.v1.Metadata.PrivateEntry.value:type_name -> did.v1.Property - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 21, // 10: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve + 22, // 11: did.v1.PubKey.key_type:type_name -> did.v1.KeyType + 4, // 12: did.v1.PubKey.jwk:type_name -> did.v1.JWK + 6, // 13: did.v1.Service.permissions:type_name -> did.v1.Permissions + 23, // 14: did.v1.Service.openid:type_name -> did.v1.OpenIDConfig + 5, // 15: did.v1.Service.metadata:type_name -> did.v1.Metadata + 16, // 16: did.v1.VerificationMethod.method:type_name -> did.v1.DIDNamespace + 9, // 17: did.v1.VerificationMethod.public_key:type_name -> did.v1.PubKey + 8, // 18: did.v1.Metadata.PrivateEntry.value:type_name -> did.v1.Property + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_did_v1_models_proto_init() } @@ -10470,7 +11019,6 @@ func file_did_v1_models_proto_init() { if File_did_v1_models_proto != nil { return } - file_did_v1_constants_proto_init() file_did_v1_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_models_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -10522,7 +11070,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Metadata); i { + switch v := v.(*JWK); i { case 0: return &v.state case 1: @@ -10534,7 +11082,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Permissions); i { + switch v := v.(*Metadata); i { case 0: return &v.state case 1: @@ -10546,7 +11094,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Profile); i { + switch v := v.(*Permissions); i { case 0: return &v.state case 1: @@ -10558,7 +11106,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Property); i { + switch v := v.(*Profile); i { case 0: return &v.state case 1: @@ -10570,7 +11118,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PubKey); i { + switch v := v.(*Property); i { case 0: return &v.state case 1: @@ -10582,7 +11130,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Service); i { + switch v := v.(*PubKey); i { case 0: return &v.state case 1: @@ -10594,7 +11142,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Token); i { + switch v := v.(*Service); i { case 0: return &v.state case 1: @@ -10606,7 +11154,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerificationMethod); i { + switch v := v.(*Token); i { case 0: return &v.state case 1: @@ -10618,6 +11166,18 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerificationMethod); 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[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Witness); i { case 0: return &v.state diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index e27a2b820..3dc25f521 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -5,6 +5,7 @@ import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "google.golang.org/genproto/googleapis/api/annotations" + _ "google.golang.org/genproto/googleapis/api/httpbody" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -13,63 +14,12 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_QueryRequest_4_list)(nil) - -type _QueryRequest_4_list struct { - list *[]*Credential -} - -func (x *_QueryRequest_4_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryRequest_4_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryRequest_4_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Credential) - (*x.list)[i] = concreteValue -} - -func (x *_QueryRequest_4_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Credential) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryRequest_4_list) AppendMutable() protoreflect.Value { - v := new(Credential) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryRequest_4_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryRequest_4_list) NewElement() protoreflect.Value { - v := new(Credential) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryRequest_4_list) IsValid() bool { - return x.list != nil -} - var ( - md_QueryRequest protoreflect.MessageDescriptor - fd_QueryRequest_did protoreflect.FieldDescriptor - fd_QueryRequest_origin protoreflect.FieldDescriptor - fd_QueryRequest_subject protoreflect.FieldDescriptor - fd_QueryRequest_credentials protoreflect.FieldDescriptor + md_QueryRequest protoreflect.MessageDescriptor + fd_QueryRequest_did protoreflect.FieldDescriptor + fd_QueryRequest_origin protoreflect.FieldDescriptor + fd_QueryRequest_subject protoreflect.FieldDescriptor + fd_QueryRequest_endpoint protoreflect.FieldDescriptor ) func init() { @@ -78,7 +28,7 @@ func init() { fd_QueryRequest_did = md_QueryRequest.Fields().ByName("did") fd_QueryRequest_origin = md_QueryRequest.Fields().ByName("origin") fd_QueryRequest_subject = md_QueryRequest.Fields().ByName("subject") - fd_QueryRequest_credentials = md_QueryRequest.Fields().ByName("credentials") + fd_QueryRequest_endpoint = md_QueryRequest.Fields().ByName("endpoint") } var _ protoreflect.Message = (*fastReflection_QueryRequest)(nil) @@ -164,9 +114,9 @@ func (x *fastReflection_QueryRequest) Range(f func(protoreflect.FieldDescriptor, return } } - if len(x.Credentials) != 0 { - value := protoreflect.ValueOfList(&_QueryRequest_4_list{list: &x.Credentials}) - if !f(fd_QueryRequest_credentials, value) { + if x.Endpoint != "" { + value := protoreflect.ValueOfString(x.Endpoint) + if !f(fd_QueryRequest_endpoint, value) { return } } @@ -191,8 +141,8 @@ func (x *fastReflection_QueryRequest) Has(fd protoreflect.FieldDescriptor) bool return x.Origin != "" case "did.v1.QueryRequest.subject": return x.Subject != "" - case "did.v1.QueryRequest.credentials": - return len(x.Credentials) != 0 + case "did.v1.QueryRequest.endpoint": + return x.Endpoint != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -215,8 +165,8 @@ func (x *fastReflection_QueryRequest) Clear(fd protoreflect.FieldDescriptor) { x.Origin = "" case "did.v1.QueryRequest.subject": x.Subject = "" - case "did.v1.QueryRequest.credentials": - x.Credentials = nil + case "did.v1.QueryRequest.endpoint": + x.Endpoint = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -242,12 +192,9 @@ func (x *fastReflection_QueryRequest) Get(descriptor protoreflect.FieldDescripto case "did.v1.QueryRequest.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.QueryRequest.credentials": - if len(x.Credentials) == 0 { - return protoreflect.ValueOfList(&_QueryRequest_4_list{}) - } - listValue := &_QueryRequest_4_list{list: &x.Credentials} - return protoreflect.ValueOfList(listValue) + case "did.v1.QueryRequest.endpoint": + value := x.Endpoint + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -274,10 +221,8 @@ func (x *fastReflection_QueryRequest) Set(fd protoreflect.FieldDescriptor, value x.Origin = value.Interface().(string) case "did.v1.QueryRequest.subject": x.Subject = value.Interface().(string) - case "did.v1.QueryRequest.credentials": - lv := value.List() - clv := lv.(*_QueryRequest_4_list) - x.Credentials = *clv.list + case "did.v1.QueryRequest.endpoint": + x.Endpoint = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -298,18 +243,14 @@ func (x *fastReflection_QueryRequest) Set(fd protoreflect.FieldDescriptor, value // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryRequest.credentials": - if x.Credentials == nil { - x.Credentials = []*Credential{} - } - value := &_QueryRequest_4_list{list: &x.Credentials} - return protoreflect.ValueOfList(value) case "did.v1.QueryRequest.did": panic(fmt.Errorf("field did of message did.v1.QueryRequest is not mutable")) case "did.v1.QueryRequest.origin": panic(fmt.Errorf("field origin of message did.v1.QueryRequest is not mutable")) case "did.v1.QueryRequest.subject": panic(fmt.Errorf("field subject of message did.v1.QueryRequest is not mutable")) + case "did.v1.QueryRequest.endpoint": + panic(fmt.Errorf("field endpoint of message did.v1.QueryRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -329,9 +270,8 @@ func (x *fastReflection_QueryRequest) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "did.v1.QueryRequest.subject": return protoreflect.ValueOfString("") - case "did.v1.QueryRequest.credentials": - list := []*Credential{} - return protoreflect.ValueOfList(&_QueryRequest_4_list{list: &list}) + case "did.v1.QueryRequest.endpoint": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -413,11 +353,9 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Credentials) > 0 { - for _, e := range x.Credentials { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } + l = len(x.Endpoint) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -448,21 +386,12 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Credentials) > 0 { - for iNdEx := len(x.Credentials) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Credentials[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-- - dAtA[i] = 0x22 - } + if len(x.Endpoint) > 0 { + i -= len(x.Endpoint) + copy(dAtA[i:], x.Endpoint) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Endpoint))) + i-- + dAtA[i] = 0x22 } if len(x.Subject) > 0 { i -= len(x.Subject) @@ -632,9 +561,9 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Endpoint", 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 @@ -644,25 +573,23 @@ func (x *fastReflection_QueryRequest) 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.Credentials = append(x.Credentials, &Credential{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Credentials[len(x.Credentials)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -700,16 +627,14 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { } var ( - md_QueryParamsResponse protoreflect.MessageDescriptor - fd_QueryParamsResponse_params protoreflect.FieldDescriptor - fd_QueryParamsResponse_ipfs_active protoreflect.FieldDescriptor + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() md_QueryParamsResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsResponse") fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") - fd_QueryParamsResponse_ipfs_active = md_QueryParamsResponse.Fields().ByName("ipfs_active") } var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) @@ -783,12 +708,6 @@ func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDesc return } } - if x.IpfsActive != false { - value := protoreflect.ValueOfBool(x.IpfsActive) - if !f(fd_QueryParamsResponse_ipfs_active, value) { - return - } - } } // Has reports whether a field is populated. @@ -806,8 +725,6 @@ func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor switch fd.FullName() { case "did.v1.QueryParamsResponse.params": return x.Params != nil - case "did.v1.QueryParamsResponse.ipfs_active": - return x.IpfsActive != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) @@ -826,8 +743,6 @@ func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescript switch fd.FullName() { case "did.v1.QueryParamsResponse.params": x.Params = nil - case "did.v1.QueryParamsResponse.ipfs_active": - x.IpfsActive = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) @@ -847,9 +762,6 @@ func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDe case "did.v1.QueryParamsResponse.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.QueryParamsResponse.ipfs_active": - value := x.IpfsActive - return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) @@ -872,8 +784,6 @@ func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor switch fd.FullName() { case "did.v1.QueryParamsResponse.params": x.Params = value.Message().Interface().(*Params) - case "did.v1.QueryParamsResponse.ipfs_active": - x.IpfsActive = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) @@ -899,8 +809,6 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "did.v1.QueryParamsResponse.ipfs_active": - panic(fmt.Errorf("field ipfs_active of message did.v1.QueryParamsResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) @@ -917,8 +825,6 @@ func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescr case "did.v1.QueryParamsResponse.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.QueryParamsResponse.ipfs_active": - return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) @@ -992,9 +898,6 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } - if x.IpfsActive { - n += 2 - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1024,16 +927,6 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.IpfsActive { - i-- - if x.IpfsActive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -1133,26 +1026,6 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods 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 IpfsActive", 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.IpfsActive = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1188,26 +1061,95 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } } +var _ protoreflect.List = (*_QueryResponse_8_list)(nil) + +type _QueryResponse_8_list struct { + list *[]*Credential +} + +func (x *_QueryResponse_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryResponse_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryResponse_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + (*x.list)[i] = concreteValue +} + +func (x *_QueryResponse_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryResponse_8_list) AppendMutable() protoreflect.Value { + v := new(Credential) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryResponse_8_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryResponse_8_list) NewElement() protoreflect.Value { + v := new(Credential) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryResponse_8_list) IsValid() bool { + return x.list != nil +} + var ( - md_QueryAccountsResponse protoreflect.MessageDescriptor - fd_QueryAccountsResponse_exists protoreflect.FieldDescriptor + md_QueryResponse protoreflect.MessageDescriptor + fd_QueryResponse_success protoreflect.FieldDescriptor + fd_QueryResponse_subject protoreflect.FieldDescriptor + fd_QueryResponse_origin protoreflect.FieldDescriptor + fd_QueryResponse_ipfs_active protoreflect.FieldDescriptor + fd_QueryResponse_params protoreflect.FieldDescriptor + fd_QueryResponse_document protoreflect.FieldDescriptor + fd_QueryResponse_service protoreflect.FieldDescriptor + fd_QueryResponse_credentials protoreflect.FieldDescriptor + fd_QueryResponse_token protoreflect.FieldDescriptor + fd_QueryResponse_error protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryAccountsResponse = File_did_v1_query_proto.Messages().ByName("QueryAccountsResponse") - fd_QueryAccountsResponse_exists = md_QueryAccountsResponse.Fields().ByName("exists") + md_QueryResponse = File_did_v1_query_proto.Messages().ByName("QueryResponse") + fd_QueryResponse_success = md_QueryResponse.Fields().ByName("success") + fd_QueryResponse_subject = md_QueryResponse.Fields().ByName("subject") + fd_QueryResponse_origin = md_QueryResponse.Fields().ByName("origin") + fd_QueryResponse_ipfs_active = md_QueryResponse.Fields().ByName("ipfs_active") + fd_QueryResponse_params = md_QueryResponse.Fields().ByName("params") + fd_QueryResponse_document = md_QueryResponse.Fields().ByName("document") + fd_QueryResponse_service = md_QueryResponse.Fields().ByName("service") + fd_QueryResponse_credentials = md_QueryResponse.Fields().ByName("credentials") + fd_QueryResponse_token = md_QueryResponse.Fields().ByName("token") + fd_QueryResponse_error = md_QueryResponse.Fields().ByName("error") } -var _ protoreflect.Message = (*fastReflection_QueryAccountsResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryResponse)(nil) -type fastReflection_QueryAccountsResponse QueryAccountsResponse +type fastReflection_QueryResponse QueryResponse -func (x *QueryAccountsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountsResponse)(x) +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResponse)(x) } -func (x *QueryAccountsResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryResponse) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1219,43 +1161,43 @@ func (x *QueryAccountsResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryAccountsResponse_messageType fastReflection_QueryAccountsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountsResponse_messageType{} +var _fastReflection_QueryResponse_messageType fastReflection_QueryResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryResponse_messageType{} -type fastReflection_QueryAccountsResponse_messageType struct{} +type fastReflection_QueryResponse_messageType struct{} -func (x fastReflection_QueryAccountsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountsResponse)(nil) +func (x fastReflection_QueryResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResponse)(nil) } -func (x fastReflection_QueryAccountsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountsResponse) +func (x fastReflection_QueryResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResponse) } -func (x fastReflection_QueryAccountsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountsResponse +func (x fastReflection_QueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAccountsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountsResponse +func (x *fastReflection_QueryResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse } // 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_QueryAccountsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountsResponse_messageType +func (x *fastReflection_QueryResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountsResponse) New() protoreflect.Message { - return new(fastReflection_QueryAccountsResponse) +func (x *fastReflection_QueryResponse) New() protoreflect.Message { + return new(fastReflection_QueryResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAccountsResponse)(x) +func (x *fastReflection_QueryResponse) Interface() protoreflect.ProtoMessage { + return (*QueryResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1263,503 +1205,64 @@ func (x *fastReflection_QueryAccountsResponse) Interface() protoreflect.ProtoMes // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAccountsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Exists != false { - value := protoreflect.ValueOfBool(x.Exists) - if !f(fd_QueryAccountsResponse_exists, 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_QueryAccountsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - return x.Exists != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryAccountsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - x.Exists = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryAccountsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryAccountsResponse.exists": - value := x.Exists - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryAccountsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - x.Exists = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryAccountsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - panic(fmt.Errorf("field exists of message did.v1.QueryAccountsResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryAccountsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse 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_QueryAccountsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryAccountsResponse", 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_QueryAccountsResponse) 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_QueryAccountsResponse) 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_QueryAccountsResponse) 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_QueryAccountsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountsResponse) - 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 - } - 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().(*QueryAccountsResponse) - 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.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().(*QueryAccountsResponse) - 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: QueryAccountsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsResponse: 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) - 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 = (*_QueryCredentialsResponse_4_list)(nil) - -type _QueryCredentialsResponse_4_list struct { - list *[]*Credential -} - -func (x *_QueryCredentialsResponse_4_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryCredentialsResponse_4_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryCredentialsResponse_4_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Credential) - (*x.list)[i] = concreteValue -} - -func (x *_QueryCredentialsResponse_4_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Credential) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryCredentialsResponse_4_list) AppendMutable() protoreflect.Value { - v := new(Credential) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryCredentialsResponse_4_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryCredentialsResponse_4_list) NewElement() protoreflect.Value { - v := new(Credential) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryCredentialsResponse_4_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryCredentialsResponse protoreflect.MessageDescriptor - fd_QueryCredentialsResponse_success protoreflect.FieldDescriptor - fd_QueryCredentialsResponse_subject protoreflect.FieldDescriptor - fd_QueryCredentialsResponse_origin protoreflect.FieldDescriptor - fd_QueryCredentialsResponse_credentials protoreflect.FieldDescriptor - fd_QueryCredentialsResponse_error protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryCredentialsResponse = File_did_v1_query_proto.Messages().ByName("QueryCredentialsResponse") - fd_QueryCredentialsResponse_success = md_QueryCredentialsResponse.Fields().ByName("success") - fd_QueryCredentialsResponse_subject = md_QueryCredentialsResponse.Fields().ByName("subject") - fd_QueryCredentialsResponse_origin = md_QueryCredentialsResponse.Fields().ByName("origin") - fd_QueryCredentialsResponse_credentials = md_QueryCredentialsResponse.Fields().ByName("credentials") - fd_QueryCredentialsResponse_error = md_QueryCredentialsResponse.Fields().ByName("error") -} - -var _ protoreflect.Message = (*fastReflection_QueryCredentialsResponse)(nil) - -type fastReflection_QueryCredentialsResponse QueryCredentialsResponse - -func (x *QueryCredentialsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryCredentialsResponse)(x) -} - -func (x *QueryCredentialsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_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_QueryCredentialsResponse_messageType fastReflection_QueryCredentialsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryCredentialsResponse_messageType{} - -type fastReflection_QueryCredentialsResponse_messageType struct{} - -func (x fastReflection_QueryCredentialsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryCredentialsResponse)(nil) -} -func (x fastReflection_QueryCredentialsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryCredentialsResponse) -} -func (x fastReflection_QueryCredentialsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryCredentialsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryCredentialsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryCredentialsResponse -} - -// 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_QueryCredentialsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryCredentialsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryCredentialsResponse) New() protoreflect.Message { - return new(fastReflection_QueryCredentialsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryCredentialsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryCredentialsResponse)(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_QueryCredentialsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Success != false { value := protoreflect.ValueOfBool(x.Success) - if !f(fd_QueryCredentialsResponse_success, value) { + if !f(fd_QueryResponse_success, value) { return } } if x.Subject != "" { value := protoreflect.ValueOfString(x.Subject) - if !f(fd_QueryCredentialsResponse_subject, value) { + if !f(fd_QueryResponse_subject, value) { return } } if x.Origin != "" { value := protoreflect.ValueOfString(x.Origin) - if !f(fd_QueryCredentialsResponse_origin, value) { + if !f(fd_QueryResponse_origin, value) { + return + } + } + if x.IpfsActive != false { + value := protoreflect.ValueOfBool(x.IpfsActive) + if !f(fd_QueryResponse_ipfs_active, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryResponse_params, value) { + return + } + } + if x.Document != nil { + value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + if !f(fd_QueryResponse_document, value) { + return + } + } + if x.Service != nil { + value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + if !f(fd_QueryResponse_service, value) { return } } if len(x.Credentials) != 0 { - value := protoreflect.ValueOfList(&_QueryCredentialsResponse_4_list{list: &x.Credentials}) - if !f(fd_QueryCredentialsResponse_credentials, value) { + value := protoreflect.ValueOfList(&_QueryResponse_8_list{list: &x.Credentials}) + if !f(fd_QueryResponse_credentials, value) { + return + } + } + if x.Token != nil { + value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if !f(fd_QueryResponse_token, value) { return } } if x.Error != "" { value := protoreflect.ValueOfString(x.Error) - if !f(fd_QueryCredentialsResponse_error, value) { + if !f(fd_QueryResponse_error, value) { return } } @@ -1776,23 +1279,33 @@ func (x *fastReflection_QueryCredentialsResponse) Range(f func(protoreflect.Fiel // 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_QueryCredentialsResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.success": + case "did.v1.QueryResponse.success": return x.Success != false - case "did.v1.QueryCredentialsResponse.subject": + case "did.v1.QueryResponse.subject": return x.Subject != "" - case "did.v1.QueryCredentialsResponse.origin": + case "did.v1.QueryResponse.origin": return x.Origin != "" - case "did.v1.QueryCredentialsResponse.credentials": + case "did.v1.QueryResponse.ipfs_active": + return x.IpfsActive != false + case "did.v1.QueryResponse.params": + return x.Params != nil + case "did.v1.QueryResponse.document": + return x.Document != nil + case "did.v1.QueryResponse.service": + return x.Service != nil + case "did.v1.QueryResponse.credentials": return len(x.Credentials) != 0 - case "did.v1.QueryCredentialsResponse.error": + case "did.v1.QueryResponse.token": + return x.Token != nil + case "did.v1.QueryResponse.error": return x.Error != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) } } @@ -1802,23 +1315,33 @@ func (x *fastReflection_QueryCredentialsResponse) Has(fd protoreflect.FieldDescr // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryCredentialsResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.success": + case "did.v1.QueryResponse.success": x.Success = false - case "did.v1.QueryCredentialsResponse.subject": + case "did.v1.QueryResponse.subject": x.Subject = "" - case "did.v1.QueryCredentialsResponse.origin": + case "did.v1.QueryResponse.origin": x.Origin = "" - case "did.v1.QueryCredentialsResponse.credentials": + case "did.v1.QueryResponse.ipfs_active": + x.IpfsActive = false + case "did.v1.QueryResponse.params": + x.Params = nil + case "did.v1.QueryResponse.document": + x.Document = nil + case "did.v1.QueryResponse.service": + x.Service = nil + case "did.v1.QueryResponse.credentials": x.Credentials = nil - case "did.v1.QueryCredentialsResponse.error": + case "did.v1.QueryResponse.token": + x.Token = nil + case "did.v1.QueryResponse.error": x.Error = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) } } @@ -1828,31 +1351,46 @@ func (x *fastReflection_QueryCredentialsResponse) Clear(fd protoreflect.FieldDes // 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_QueryCredentialsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryCredentialsResponse.success": + case "did.v1.QueryResponse.success": value := x.Success return protoreflect.ValueOfBool(value) - case "did.v1.QueryCredentialsResponse.subject": + case "did.v1.QueryResponse.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.QueryCredentialsResponse.origin": + case "did.v1.QueryResponse.origin": value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.QueryCredentialsResponse.credentials": + case "did.v1.QueryResponse.ipfs_active": + value := x.IpfsActive + return protoreflect.ValueOfBool(value) + case "did.v1.QueryResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResponse.document": + value := x.Document + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResponse.service": + value := x.Service + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResponse.credentials": if len(x.Credentials) == 0 { - return protoreflect.ValueOfList(&_QueryCredentialsResponse_4_list{}) + return protoreflect.ValueOfList(&_QueryResponse_8_list{}) } - listValue := &_QueryCredentialsResponse_4_list{list: &x.Credentials} + listValue := &_QueryResponse_8_list{list: &x.Credentials} return protoreflect.ValueOfList(listValue) - case "did.v1.QueryCredentialsResponse.error": + case "did.v1.QueryResponse.token": + value := x.Token + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResponse.error": value := x.Error return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", descriptor.FullName())) } } @@ -1866,25 +1404,35 @@ func (x *fastReflection_QueryCredentialsResponse) Get(descriptor protoreflect.Fi // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryCredentialsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.success": + case "did.v1.QueryResponse.success": x.Success = value.Bool() - case "did.v1.QueryCredentialsResponse.subject": + case "did.v1.QueryResponse.subject": x.Subject = value.Interface().(string) - case "did.v1.QueryCredentialsResponse.origin": + case "did.v1.QueryResponse.origin": x.Origin = value.Interface().(string) - case "did.v1.QueryCredentialsResponse.credentials": + case "did.v1.QueryResponse.ipfs_active": + x.IpfsActive = value.Bool() + case "did.v1.QueryResponse.params": + x.Params = value.Message().Interface().(*Params) + case "did.v1.QueryResponse.document": + x.Document = value.Message().Interface().(*Document) + case "did.v1.QueryResponse.service": + x.Service = value.Message().Interface().(*Service) + case "did.v1.QueryResponse.credentials": lv := value.List() - clv := lv.(*_QueryCredentialsResponse_4_list) + clv := lv.(*_QueryResponse_8_list) x.Credentials = *clv.list - case "did.v1.QueryCredentialsResponse.error": + case "did.v1.QueryResponse.token": + x.Token = value.Message().Interface().(*Token) + case "did.v1.QueryResponse.error": x.Error = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryResponse does not contain field %s", fd.FullName())) } } @@ -1898,61 +1446,97 @@ func (x *fastReflection_QueryCredentialsResponse) Set(fd protoreflect.FieldDescr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryCredentialsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": + case "did.v1.QueryResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "did.v1.QueryResponse.document": + if x.Document == nil { + x.Document = new(Document) + } + return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + case "did.v1.QueryResponse.service": + if x.Service == nil { + x.Service = new(Service) + } + return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "did.v1.QueryResponse.credentials": if x.Credentials == nil { x.Credentials = []*Credential{} } - value := &_QueryCredentialsResponse_4_list{list: &x.Credentials} + value := &_QueryResponse_8_list{list: &x.Credentials} return protoreflect.ValueOfList(value) - case "did.v1.QueryCredentialsResponse.success": - panic(fmt.Errorf("field success of message did.v1.QueryCredentialsResponse is not mutable")) - case "did.v1.QueryCredentialsResponse.subject": - panic(fmt.Errorf("field subject of message did.v1.QueryCredentialsResponse is not mutable")) - case "did.v1.QueryCredentialsResponse.origin": - panic(fmt.Errorf("field origin of message did.v1.QueryCredentialsResponse is not mutable")) - case "did.v1.QueryCredentialsResponse.error": - panic(fmt.Errorf("field error of message did.v1.QueryCredentialsResponse is not mutable")) + case "did.v1.QueryResponse.token": + if x.Token == nil { + x.Token = new(Token) + } + return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + case "did.v1.QueryResponse.success": + panic(fmt.Errorf("field success of message did.v1.QueryResponse is not mutable")) + case "did.v1.QueryResponse.subject": + panic(fmt.Errorf("field subject of message did.v1.QueryResponse is not mutable")) + case "did.v1.QueryResponse.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryResponse is not mutable")) + case "did.v1.QueryResponse.ipfs_active": + panic(fmt.Errorf("field ipfs_active of message did.v1.QueryResponse is not mutable")) + case "did.v1.QueryResponse.error": + panic(fmt.Errorf("field error of message did.v1.QueryResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryCredentialsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.success": + case "did.v1.QueryResponse.success": return protoreflect.ValueOfBool(false) - case "did.v1.QueryCredentialsResponse.subject": + case "did.v1.QueryResponse.subject": return protoreflect.ValueOfString("") - case "did.v1.QueryCredentialsResponse.origin": + case "did.v1.QueryResponse.origin": return protoreflect.ValueOfString("") - case "did.v1.QueryCredentialsResponse.credentials": + case "did.v1.QueryResponse.ipfs_active": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResponse.document": + m := new(Document) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResponse.service": + m := new(Service) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResponse.credentials": list := []*Credential{} - return protoreflect.ValueOfList(&_QueryCredentialsResponse_4_list{list: &list}) - case "did.v1.QueryCredentialsResponse.error": + return protoreflect.ValueOfList(&_QueryResponse_8_list{list: &list}) + case "did.v1.QueryResponse.token": + m := new(Token) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResponse.error": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryCredentialsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryCredentialsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryResponse", d.FullName())) } panic("unreachable") } @@ -1960,7 +1544,7 @@ func (x *fastReflection_QueryCredentialsResponse) WhichOneof(d protoreflect.Oneo // 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_QueryCredentialsResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1971,7 +1555,7 @@ func (x *fastReflection_QueryCredentialsResponse) GetUnknown() protoreflect.RawF // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryCredentialsResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1983,7 +1567,7 @@ func (x *fastReflection_QueryCredentialsResponse) SetUnknown(fields protoreflect // 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_QueryCredentialsResponse) IsValid() bool { +func (x *fastReflection_QueryResponse) IsValid() bool { return x != nil } @@ -1993,9 +1577,9 @@ func (x *fastReflection_QueryCredentialsResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryCredentialsResponse) + x := input.Message.Interface().(*QueryResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2018,12 +1602,31 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.IpfsActive { + n += 2 + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Document != nil { + l = options.Size(x.Document) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Service != nil { + l = options.Size(x.Service) + n += 1 + l + runtime.Sov(uint64(l)) + } if len(x.Credentials) > 0 { for _, e := range x.Credentials { l = options.Size(e) n += 1 + l + runtime.Sov(uint64(l)) } } + if x.Token != nil { + l = options.Size(x.Token) + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.Error) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -2038,7 +1641,7 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryCredentialsResponse) + x := input.Message.Interface().(*QueryResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2062,7 +1665,21 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met copy(dAtA[i:], x.Error) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x52 + } + if x.Token != nil { + encoded, err := options.Marshal(x.Token) + 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] = 0x4a } if len(x.Credentials) > 0 { for iNdEx := len(x.Credentials) - 1; iNdEx >= 0; iNdEx-- { @@ -2077,9 +1694,61 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x42 } } + 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] = 0x3a + } + if x.Document != nil { + encoded, err := options.Marshal(x.Document) + 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] = 0x32 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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] = 0x2a + } + if x.IpfsActive { + i-- + if x.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if len(x.Origin) > 0 { i -= len(x.Origin) copy(dAtA[i:], x.Origin) @@ -2115,7 +1784,7 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryCredentialsResponse) + x := input.Message.Interface().(*QueryResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2147,10 +1816,10 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2238,6 +1907,134 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met x.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Document", 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.Document == nil { + x.Document = &Document{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Document); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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 + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) } @@ -2271,7 +2068,43 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token == nil { + x.Token = &Token{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 10: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } @@ -2338,15 +2171,80 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met } } +var _ protoreflect.List = (*_QueryResolveResponse_7_list)(nil) + +type _QueryResolveResponse_7_list struct { + list *[]*Credential +} + +func (x *_QueryResolveResponse_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryResolveResponse_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryResolveResponse_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + (*x.list)[i] = concreteValue +} + +func (x *_QueryResolveResponse_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryResolveResponse_7_list) AppendMutable() protoreflect.Value { + v := new(Credential) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryResolveResponse_7_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryResolveResponse_7_list) NewElement() protoreflect.Value { + v := new(Credential) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryResolveResponse_7_list) IsValid() bool { + return x.list != nil +} + var ( - md_QueryResolveResponse protoreflect.MessageDescriptor - fd_QueryResolveResponse_document protoreflect.FieldDescriptor + md_QueryResolveResponse protoreflect.MessageDescriptor + fd_QueryResolveResponse_success protoreflect.FieldDescriptor + fd_QueryResolveResponse_subject protoreflect.FieldDescriptor + fd_QueryResolveResponse_origin protoreflect.FieldDescriptor + fd_QueryResolveResponse_ipfs_active protoreflect.FieldDescriptor + fd_QueryResolveResponse_params protoreflect.FieldDescriptor + fd_QueryResolveResponse_document protoreflect.FieldDescriptor + fd_QueryResolveResponse_credentials protoreflect.FieldDescriptor + fd_QueryResolveResponse_token protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() md_QueryResolveResponse = File_did_v1_query_proto.Messages().ByName("QueryResolveResponse") + fd_QueryResolveResponse_success = md_QueryResolveResponse.Fields().ByName("success") + fd_QueryResolveResponse_subject = md_QueryResolveResponse.Fields().ByName("subject") + fd_QueryResolveResponse_origin = md_QueryResolveResponse.Fields().ByName("origin") + fd_QueryResolveResponse_ipfs_active = md_QueryResolveResponse.Fields().ByName("ipfs_active") + fd_QueryResolveResponse_params = md_QueryResolveResponse.Fields().ByName("params") fd_QueryResolveResponse_document = md_QueryResolveResponse.Fields().ByName("document") + fd_QueryResolveResponse_credentials = md_QueryResolveResponse.Fields().ByName("credentials") + fd_QueryResolveResponse_token = md_QueryResolveResponse.Fields().ByName("token") } var _ protoreflect.Message = (*fastReflection_QueryResolveResponse)(nil) @@ -2358,7 +2256,7 @@ func (x *QueryResolveResponse) ProtoReflect() protoreflect.Message { } func (x *QueryResolveResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[4] + mi := &file_did_v1_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2414,12 +2312,54 @@ func (x *fastReflection_QueryResolveResponse) Interface() protoreflect.ProtoMess // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryResolveResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_QueryResolveResponse_success, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_QueryResolveResponse_subject, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QueryResolveResponse_origin, value) { + return + } + } + if x.IpfsActive != false { + value := protoreflect.ValueOfBool(x.IpfsActive) + if !f(fd_QueryResolveResponse_ipfs_active, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryResolveResponse_params, value) { + return + } + } if x.Document != nil { value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) if !f(fd_QueryResolveResponse_document, value) { return } } + if len(x.Credentials) != 0 { + value := protoreflect.ValueOfList(&_QueryResolveResponse_7_list{list: &x.Credentials}) + if !f(fd_QueryResolveResponse_credentials, value) { + return + } + } + if x.Token != nil { + value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if !f(fd_QueryResolveResponse_token, value) { + return + } + } } // Has reports whether a field is populated. @@ -2435,8 +2375,22 @@ func (x *fastReflection_QueryResolveResponse) Range(f func(protoreflect.FieldDes // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryResolveResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "did.v1.QueryResolveResponse.success": + return x.Success != false + case "did.v1.QueryResolveResponse.subject": + return x.Subject != "" + case "did.v1.QueryResolveResponse.origin": + return x.Origin != "" + case "did.v1.QueryResolveResponse.ipfs_active": + return x.IpfsActive != false + case "did.v1.QueryResolveResponse.params": + return x.Params != nil case "did.v1.QueryResolveResponse.document": return x.Document != nil + case "did.v1.QueryResolveResponse.credentials": + return len(x.Credentials) != 0 + case "did.v1.QueryResolveResponse.token": + return x.Token != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2453,8 +2407,22 @@ func (x *fastReflection_QueryResolveResponse) Has(fd protoreflect.FieldDescripto // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryResolveResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "did.v1.QueryResolveResponse.success": + x.Success = false + case "did.v1.QueryResolveResponse.subject": + x.Subject = "" + case "did.v1.QueryResolveResponse.origin": + x.Origin = "" + case "did.v1.QueryResolveResponse.ipfs_active": + x.IpfsActive = false + case "did.v1.QueryResolveResponse.params": + x.Params = nil case "did.v1.QueryResolveResponse.document": x.Document = nil + case "did.v1.QueryResolveResponse.credentials": + x.Credentials = nil + case "did.v1.QueryResolveResponse.token": + x.Token = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2471,9 +2439,33 @@ func (x *fastReflection_QueryResolveResponse) Clear(fd protoreflect.FieldDescrip // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryResolveResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "did.v1.QueryResolveResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.QueryResolveResponse.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.QueryResolveResponse.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.QueryResolveResponse.ipfs_active": + value := x.IpfsActive + return protoreflect.ValueOfBool(value) + case "did.v1.QueryResolveResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.QueryResolveResponse.document": value := x.Document return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResolveResponse.credentials": + if len(x.Credentials) == 0 { + return protoreflect.ValueOfList(&_QueryResolveResponse_7_list{}) + } + listValue := &_QueryResolveResponse_7_list{list: &x.Credentials} + return protoreflect.ValueOfList(listValue) + case "did.v1.QueryResolveResponse.token": + value := x.Token + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2494,8 +2486,24 @@ func (x *fastReflection_QueryResolveResponse) Get(descriptor protoreflect.FieldD // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryResolveResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "did.v1.QueryResolveResponse.success": + x.Success = value.Bool() + case "did.v1.QueryResolveResponse.subject": + x.Subject = value.Interface().(string) + case "did.v1.QueryResolveResponse.origin": + x.Origin = value.Interface().(string) + case "did.v1.QueryResolveResponse.ipfs_active": + x.IpfsActive = value.Bool() + case "did.v1.QueryResolveResponse.params": + x.Params = value.Message().Interface().(*Params) case "did.v1.QueryResolveResponse.document": x.Document = value.Message().Interface().(*Document) + case "did.v1.QueryResolveResponse.credentials": + lv := value.List() + clv := lv.(*_QueryResolveResponse_7_list) + x.Credentials = *clv.list + case "did.v1.QueryResolveResponse.token": + x.Token = value.Message().Interface().(*Token) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2516,11 +2524,35 @@ func (x *fastReflection_QueryResolveResponse) Set(fd protoreflect.FieldDescripto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryResolveResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.QueryResolveResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) case "did.v1.QueryResolveResponse.document": if x.Document == nil { x.Document = new(Document) } return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + case "did.v1.QueryResolveResponse.credentials": + if x.Credentials == nil { + x.Credentials = []*Credential{} + } + value := &_QueryResolveResponse_7_list{list: &x.Credentials} + return protoreflect.ValueOfList(value) + case "did.v1.QueryResolveResponse.token": + if x.Token == nil { + x.Token = new(Token) + } + return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + case "did.v1.QueryResolveResponse.success": + panic(fmt.Errorf("field success of message did.v1.QueryResolveResponse is not mutable")) + case "did.v1.QueryResolveResponse.subject": + panic(fmt.Errorf("field subject of message did.v1.QueryResolveResponse is not mutable")) + case "did.v1.QueryResolveResponse.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryResolveResponse is not mutable")) + case "did.v1.QueryResolveResponse.ipfs_active": + panic(fmt.Errorf("field ipfs_active of message did.v1.QueryResolveResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2534,9 +2566,26 @@ func (x *fastReflection_QueryResolveResponse) Mutable(fd protoreflect.FieldDescr // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryResolveResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.QueryResolveResponse.success": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryResolveResponse.subject": + return protoreflect.ValueOfString("") + case "did.v1.QueryResolveResponse.origin": + return protoreflect.ValueOfString("") + case "did.v1.QueryResolveResponse.ipfs_active": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryResolveResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.QueryResolveResponse.document": m := new(Document) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResolveResponse.credentials": + list := []*Credential{} + return protoreflect.ValueOfList(&_QueryResolveResponse_7_list{list: &list}) + case "did.v1.QueryResolveResponse.token": + m := new(Token) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) @@ -2606,10 +2655,38 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l + if x.Success { + n += 2 + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.IpfsActive { + n += 2 + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.Document != nil { l = options.Size(x.Document) n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.Credentials) > 0 { + for _, e := range x.Credentials { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Token != nil { + l = options.Size(x.Token) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2639,6 +2716,36 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Token != nil { + encoded, err := options.Marshal(x.Token) + 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] = 0x42 + } + if len(x.Credentials) > 0 { + for iNdEx := len(x.Credentials) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Credentials[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-- + dAtA[i] = 0x3a + } + } if x.Document != nil { encoded, err := options.Marshal(x.Document) if err != nil { @@ -2651,7 +2758,55 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x32 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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] = 0x2a + } + if x.IpfsActive { + i-- + if x.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + 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.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x12 + } + if x.Success { + i-- + if x.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -2703,6 +2858,146 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } switch fieldNum { case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", 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.Success = 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 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 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 != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) } @@ -2738,6 +3033,76 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credentials", 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 + } + x.Credentials = append(x.Credentials, &Credential{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Credentials[len(x.Credentials)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token == nil { + x.Token = &Token{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2774,13 +3139,23 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryServiceResponse protoreflect.MessageDescriptor - fd_QueryServiceResponse_service protoreflect.FieldDescriptor + md_QueryServiceResponse protoreflect.MessageDescriptor + fd_QueryServiceResponse_success protoreflect.FieldDescriptor + fd_QueryServiceResponse_subject protoreflect.FieldDescriptor + fd_QueryServiceResponse_origin protoreflect.FieldDescriptor + fd_QueryServiceResponse_ipfs_active protoreflect.FieldDescriptor + fd_QueryServiceResponse_params protoreflect.FieldDescriptor + fd_QueryServiceResponse_service protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() md_QueryServiceResponse = File_did_v1_query_proto.Messages().ByName("QueryServiceResponse") + fd_QueryServiceResponse_success = md_QueryServiceResponse.Fields().ByName("success") + fd_QueryServiceResponse_subject = md_QueryServiceResponse.Fields().ByName("subject") + fd_QueryServiceResponse_origin = md_QueryServiceResponse.Fields().ByName("origin") + fd_QueryServiceResponse_ipfs_active = md_QueryServiceResponse.Fields().ByName("ipfs_active") + fd_QueryServiceResponse_params = md_QueryServiceResponse.Fields().ByName("params") fd_QueryServiceResponse_service = md_QueryServiceResponse.Fields().ByName("service") } @@ -2793,7 +3168,7 @@ func (x *QueryServiceResponse) ProtoReflect() protoreflect.Message { } func (x *QueryServiceResponse) 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 { @@ -2849,6 +3224,36 @@ func (x *fastReflection_QueryServiceResponse) Interface() protoreflect.ProtoMess // 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.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_QueryServiceResponse_success, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_QueryServiceResponse_subject, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QueryServiceResponse_origin, value) { + return + } + } + if x.IpfsActive != false { + value := protoreflect.ValueOfBool(x.IpfsActive) + if !f(fd_QueryServiceResponse_ipfs_active, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryServiceResponse_params, value) { + return + } + } if x.Service != nil { value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) if !f(fd_QueryServiceResponse_service, value) { @@ -2870,6 +3275,16 @@ func (x *fastReflection_QueryServiceResponse) Range(f func(protoreflect.FieldDes // 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.success": + return x.Success != false + case "did.v1.QueryServiceResponse.subject": + return x.Subject != "" + case "did.v1.QueryServiceResponse.origin": + return x.Origin != "" + case "did.v1.QueryServiceResponse.ipfs_active": + return x.IpfsActive != false + case "did.v1.QueryServiceResponse.params": + return x.Params != nil case "did.v1.QueryServiceResponse.service": return x.Service != nil default: @@ -2888,6 +3303,16 @@ func (x *fastReflection_QueryServiceResponse) Has(fd protoreflect.FieldDescripto // 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.success": + x.Success = false + case "did.v1.QueryServiceResponse.subject": + x.Subject = "" + case "did.v1.QueryServiceResponse.origin": + x.Origin = "" + case "did.v1.QueryServiceResponse.ipfs_active": + x.IpfsActive = false + case "did.v1.QueryServiceResponse.params": + x.Params = nil case "did.v1.QueryServiceResponse.service": x.Service = nil default: @@ -2906,6 +3331,21 @@ func (x *fastReflection_QueryServiceResponse) Clear(fd protoreflect.FieldDescrip // 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.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.QueryServiceResponse.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.QueryServiceResponse.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.QueryServiceResponse.ipfs_active": + value := x.IpfsActive + return protoreflect.ValueOfBool(value) + case "did.v1.QueryServiceResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.QueryServiceResponse.service": value := x.Service return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -2929,6 +3369,16 @@ func (x *fastReflection_QueryServiceResponse) Get(descriptor protoreflect.FieldD // 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.success": + x.Success = value.Bool() + case "did.v1.QueryServiceResponse.subject": + x.Subject = value.Interface().(string) + case "did.v1.QueryServiceResponse.origin": + x.Origin = value.Interface().(string) + case "did.v1.QueryServiceResponse.ipfs_active": + x.IpfsActive = value.Bool() + case "did.v1.QueryServiceResponse.params": + x.Params = value.Message().Interface().(*Params) case "did.v1.QueryServiceResponse.service": x.Service = value.Message().Interface().(*Service) default: @@ -2951,11 +3401,24 @@ func (x *fastReflection_QueryServiceResponse) Set(fd protoreflect.FieldDescripto // 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.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) case "did.v1.QueryServiceResponse.service": if x.Service == nil { x.Service = new(Service) } return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "did.v1.QueryServiceResponse.success": + panic(fmt.Errorf("field success of message did.v1.QueryServiceResponse is not mutable")) + case "did.v1.QueryServiceResponse.subject": + panic(fmt.Errorf("field subject of message did.v1.QueryServiceResponse is not mutable")) + case "did.v1.QueryServiceResponse.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryServiceResponse is not mutable")) + case "did.v1.QueryServiceResponse.ipfs_active": + panic(fmt.Errorf("field ipfs_active 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")) @@ -2969,6 +3432,17 @@ func (x *fastReflection_QueryServiceResponse) Mutable(fd protoreflect.FieldDescr // 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.success": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryServiceResponse.subject": + return protoreflect.ValueOfString("") + case "did.v1.QueryServiceResponse.origin": + return protoreflect.ValueOfString("") + case "did.v1.QueryServiceResponse.ipfs_active": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryServiceResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.QueryServiceResponse.service": m := new(Service) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -3041,6 +3515,24 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l + if x.Success { + n += 2 + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.IpfsActive { + n += 2 + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.Service != nil { l = options.Size(x.Service) n += 1 + l + runtime.Sov(uint64(l)) @@ -3086,7 +3578,55 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x32 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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] = 0x2a + } + if x.IpfsActive { + i-- + if x.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + 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.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x12 + } + if x.Success { + i-- + if x.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -3138,6 +3678,146 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods } switch fieldNum { case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", 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.Success = 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 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 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 != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } @@ -3208,559 +3888,6 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods } } -var ( - md_QueryTokenResponse protoreflect.MessageDescriptor - fd_QueryTokenResponse_success protoreflect.FieldDescriptor - fd_QueryTokenResponse_token protoreflect.FieldDescriptor - fd_QueryTokenResponse_error protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryTokenResponse = File_did_v1_query_proto.Messages().ByName("QueryTokenResponse") - fd_QueryTokenResponse_success = md_QueryTokenResponse.Fields().ByName("success") - fd_QueryTokenResponse_token = md_QueryTokenResponse.Fields().ByName("token") - fd_QueryTokenResponse_error = md_QueryTokenResponse.Fields().ByName("error") -} - -var _ protoreflect.Message = (*fastReflection_QueryTokenResponse)(nil) - -type fastReflection_QueryTokenResponse QueryTokenResponse - -func (x *QueryTokenResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryTokenResponse)(x) -} - -func (x *QueryTokenResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_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_QueryTokenResponse_messageType fastReflection_QueryTokenResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryTokenResponse_messageType{} - -type fastReflection_QueryTokenResponse_messageType struct{} - -func (x fastReflection_QueryTokenResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryTokenResponse)(nil) -} -func (x fastReflection_QueryTokenResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryTokenResponse) -} -func (x fastReflection_QueryTokenResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryTokenResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryTokenResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryTokenResponse -} - -// 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_QueryTokenResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryTokenResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryTokenResponse) New() protoreflect.Message { - return new(fastReflection_QueryTokenResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryTokenResponse) Interface() protoreflect.ProtoMessage { - return (*QueryTokenResponse)(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_QueryTokenResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Success != false { - value := protoreflect.ValueOfBool(x.Success) - if !f(fd_QueryTokenResponse_success, value) { - return - } - } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) - if !f(fd_QueryTokenResponse_token, value) { - return - } - } - if x.Error != "" { - value := protoreflect.ValueOfString(x.Error) - if !f(fd_QueryTokenResponse_error, 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_QueryTokenResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryTokenResponse.success": - return x.Success != false - case "did.v1.QueryTokenResponse.token": - return x.Token != nil - case "did.v1.QueryTokenResponse.error": - return x.Error != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryTokenResponse")) - } - panic(fmt.Errorf("message did.v1.QueryTokenResponse 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_QueryTokenResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryTokenResponse.success": - x.Success = false - case "did.v1.QueryTokenResponse.token": - x.Token = nil - case "did.v1.QueryTokenResponse.error": - x.Error = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryTokenResponse")) - } - panic(fmt.Errorf("message did.v1.QueryTokenResponse 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_QueryTokenResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryTokenResponse.success": - value := x.Success - return protoreflect.ValueOfBool(value) - case "did.v1.QueryTokenResponse.token": - value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.QueryTokenResponse.error": - value := x.Error - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryTokenResponse")) - } - panic(fmt.Errorf("message did.v1.QueryTokenResponse 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_QueryTokenResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryTokenResponse.success": - x.Success = value.Bool() - case "did.v1.QueryTokenResponse.token": - x.Token = value.Message().Interface().(*Token) - case "did.v1.QueryTokenResponse.error": - x.Error = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryTokenResponse")) - } - panic(fmt.Errorf("message did.v1.QueryTokenResponse 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_QueryTokenResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryTokenResponse.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) - case "did.v1.QueryTokenResponse.success": - panic(fmt.Errorf("field success of message did.v1.QueryTokenResponse is not mutable")) - case "did.v1.QueryTokenResponse.error": - panic(fmt.Errorf("field error of message did.v1.QueryTokenResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryTokenResponse")) - } - panic(fmt.Errorf("message did.v1.QueryTokenResponse 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_QueryTokenResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryTokenResponse.success": - return protoreflect.ValueOfBool(false) - case "did.v1.QueryTokenResponse.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.QueryTokenResponse.error": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryTokenResponse")) - } - panic(fmt.Errorf("message did.v1.QueryTokenResponse 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_QueryTokenResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryTokenResponse", 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_QueryTokenResponse) 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_QueryTokenResponse) 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_QueryTokenResponse) 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_QueryTokenResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryTokenResponse) - 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.Success { - n += 2 - } - if x.Token != nil { - l = options.Size(x.Token) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Error) - 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().(*QueryTokenResponse) - 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.Error) > 0 { - i -= len(x.Error) - copy(dAtA[i:], x.Error) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) - i-- - dAtA[i] = 0x1a - } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - 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.Success { - i-- - if x.Success { - 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().(*QueryTokenResponse) - 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: QueryTokenResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenResponse: 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 Success", 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.Success = 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 Token", 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.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); 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 Error", 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.Error = 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 @@ -3780,10 +3907,10 @@ type QueryRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - Credentials []*Credential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` + Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (x *QueryRequest) Reset() { @@ -3827,11 +3954,11 @@ func (x *QueryRequest) GetSubject() string { return "" } -func (x *QueryRequest) GetCredentials() []*Credential { +func (x *QueryRequest) GetEndpoint() string { if x != nil { - return x.Credentials + return x.Endpoint } - return nil + return "" } // QueryParamsResponse is the response type for the Query/Params RPC method. @@ -3842,8 +3969,6 @@ type QueryParamsResponse struct { // params defines the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - // ipfs_active returns true if the IPFS client is initialized - IpfsActive bool `protobuf:"varint,2,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` } func (x *QueryParamsResponse) Reset() { @@ -3873,51 +3998,8 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -func (x *QueryParamsResponse) GetIpfsActive() bool { - if x != nil { - return x.IpfsActive - } - return false -} - -// QueryAccountsResponse is the response type for the Query/Exists RPC method. -type QueryAccountsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` -} - -func (x *QueryAccountsResponse) Reset() { - *x = QueryAccountsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAccountsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAccountsResponse) ProtoMessage() {} - -// Deprecated: Use QueryAccountsResponse.ProtoReflect.Descriptor instead. -func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{2} -} - -func (x *QueryAccountsResponse) GetExists() bool { - if x != nil { - return x.Exists - } - return false -} - -// QueryCredentialsResponse is the response type for the Query/Exists RPC method. -type QueryCredentialsResponse struct { +// QueryResponse is the response type for the Query/Exists RPC method. +type QueryResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -3925,59 +4007,99 @@ type QueryCredentialsResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` - Credentials []*Credential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` - Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` + IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` + Document *Document `protobuf:"bytes,6,opt,name=document,proto3" json:"document,omitempty"` + Service *Service `protobuf:"bytes,7,opt,name=service,proto3" json:"service,omitempty"` + Credentials []*Credential `protobuf:"bytes,8,rep,name=credentials,proto3" json:"credentials,omitempty"` + Token *Token `protobuf:"bytes,9,opt,name=token,proto3" json:"token,omitempty"` + Error string `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"` } -func (x *QueryCredentialsResponse) Reset() { - *x = QueryCredentialsResponse{} +func (x *QueryResponse) Reset() { + *x = QueryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[3] + mi := &file_did_v1_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryCredentialsResponse) String() string { +func (x *QueryResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryCredentialsResponse) ProtoMessage() {} +func (*QueryResponse) ProtoMessage() {} -// Deprecated: Use QueryCredentialsResponse.ProtoReflect.Descriptor instead. -func (*QueryCredentialsResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{3} +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{2} } -func (x *QueryCredentialsResponse) GetSuccess() bool { +func (x *QueryResponse) GetSuccess() bool { if x != nil { return x.Success } return false } -func (x *QueryCredentialsResponse) GetSubject() string { +func (x *QueryResponse) GetSubject() string { if x != nil { return x.Subject } return "" } -func (x *QueryCredentialsResponse) GetOrigin() string { +func (x *QueryResponse) GetOrigin() string { if x != nil { return x.Origin } return "" } -func (x *QueryCredentialsResponse) GetCredentials() []*Credential { +func (x *QueryResponse) GetIpfsActive() bool { + if x != nil { + return x.IpfsActive + } + return false +} + +func (x *QueryResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *QueryResponse) GetDocument() *Document { + if x != nil { + return x.Document + } + return nil +} + +func (x *QueryResponse) GetService() *Service { + if x != nil { + return x.Service + } + return nil +} + +func (x *QueryResponse) GetCredentials() []*Credential { if x != nil { return x.Credentials } return nil } -func (x *QueryCredentialsResponse) GetError() string { +func (x *QueryResponse) GetToken() *Token { + if x != nil { + return x.Token + } + return nil +} + +func (x *QueryResponse) GetError() string { if x != nil { return x.Error } @@ -3990,14 +4112,20 @@ type QueryResolveResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // document is the DID document - Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` + Document *Document `protobuf:"bytes,6,opt,name=document,proto3" json:"document,omitempty"` + Credentials []*Credential `protobuf:"bytes,7,rep,name=credentials,proto3" json:"credentials,omitempty"` + Token *Token `protobuf:"bytes,8,opt,name=token,proto3" json:"token,omitempty"` } func (x *QueryResolveResponse) Reset() { *x = QueryResolveResponse{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[4] + mi := &file_did_v1_query_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4011,7 +4139,42 @@ func (*QueryResolveResponse) ProtoMessage() {} // Deprecated: Use QueryResolveResponse.ProtoReflect.Descriptor instead. func (*QueryResolveResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{4} + return file_did_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryResolveResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *QueryResolveResponse) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *QueryResolveResponse) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *QueryResolveResponse) GetIpfsActive() bool { + if x != nil { + return x.IpfsActive + } + return false +} + +func (x *QueryResolveResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil } func (x *QueryResolveResponse) GetDocument() *Document { @@ -4021,19 +4184,38 @@ func (x *QueryResolveResponse) GetDocument() *Document { return nil } +func (x *QueryResolveResponse) GetCredentials() []*Credential { + if x != nil { + return x.Credentials + } + return nil +} + +func (x *QueryResolveResponse) GetToken() *Token { + if x != nil { + return x.Token + } + 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 - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` + Service *Service `protobuf:"bytes,6,opt,name=service,proto3" json:"service,omitempty"` } func (x *QueryServiceResponse) Reset() { *x = QueryServiceResponse{} 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) } @@ -4047,7 +4229,42 @@ func (*QueryServiceResponse) ProtoMessage() {} // Deprecated: Use QueryServiceResponse.ProtoReflect.Descriptor instead. func (*QueryServiceResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{5} + return file_did_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryServiceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *QueryServiceResponse) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *QueryServiceResponse) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *QueryServiceResponse) GetIpfsActive() bool { + if x != nil { + return x.IpfsActive + } + return false +} + +func (x *QueryServiceResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil } func (x *QueryServiceResponse) GetService() *Service { @@ -4057,58 +4274,6 @@ func (x *QueryServiceResponse) GetService() *Service { return nil } -// QueryTokenResponse is the response type for the Query/LoginOptions RPC method. -type QueryTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *QueryTokenResponse) Reset() { - *x = QueryTokenResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryTokenResponse) ProtoMessage() {} - -// Deprecated: Use QueryTokenResponse.ProtoReflect.Descriptor instead. -func (*QueryTokenResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{6} -} - -func (x *QueryTokenResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *QueryTokenResponse) GetToken() *Token { - if x != nil { - return x.Token - } - return nil -} - -func (x *QueryTokenResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - var File_did_v1_query_proto protoreflect.FileDescriptor var file_did_v1_query_proto_rawDesc = []byte{ @@ -4118,70 +4283,81 @@ var file_did_v1_query_proto_rawDesc = []byte{ 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, 0x88, 0x01, 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, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 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, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, - 0x22, 0x5e, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x62, 0x6f, 0x64, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x6e, 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, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 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, 0x12, - 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x22, 0x2f, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, - 0x73, 0x22, 0xb2, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 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, 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, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 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, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 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, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0xee, 0x02, 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, 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, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 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, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x06, 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, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x07, 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, 0x12, + 0x34, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x08, + 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, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x22, 0xb4, 0x02, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 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, 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, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 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, 0x12, 0x2c, + 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, 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, 0x41, 0x0a, 0x14, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x01, 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, - 0x69, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, - 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x32, 0xa7, 0x04, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x50, 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, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x64, 0x69, 0x64, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5c, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, - 0x13, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x12, 0x76, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x7d, - 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x51, 0x0a, 0x07, + 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x07, 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, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd6, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, + 0x79, 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, 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, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 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, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x18, 0x06, 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, + 0x32, 0x86, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x50, 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, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, + 0x0b, 0x2f, 0x64, 0x69, 0x64, 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, @@ -4192,20 +4368,15 @@ var file_did_v1_query_proto_rawDesc = []byte{ 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, 0x49, 0x0a, 0x05, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x22, 0x06, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 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, + 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x7d, 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 ( @@ -4220,45 +4391,43 @@ 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, 5) var file_did_v1_query_proto_goTypes = []interface{}{ - (*QueryRequest)(nil), // 0: did.v1.QueryRequest - (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse - (*QueryAccountsResponse)(nil), // 2: did.v1.QueryAccountsResponse - (*QueryCredentialsResponse)(nil), // 3: did.v1.QueryCredentialsResponse - (*QueryResolveResponse)(nil), // 4: did.v1.QueryResolveResponse - (*QueryServiceResponse)(nil), // 5: did.v1.QueryServiceResponse - (*QueryTokenResponse)(nil), // 6: did.v1.QueryTokenResponse - (*Credential)(nil), // 7: did.v1.Credential - (*Params)(nil), // 8: did.v1.Params - (*Document)(nil), // 9: did.v1.Document - (*Service)(nil), // 10: did.v1.Service - (*Token)(nil), // 11: did.v1.Token + (*QueryRequest)(nil), // 0: did.v1.QueryRequest + (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse + (*QueryResponse)(nil), // 2: did.v1.QueryResponse + (*QueryResolveResponse)(nil), // 3: did.v1.QueryResolveResponse + (*QueryServiceResponse)(nil), // 4: did.v1.QueryServiceResponse + (*Params)(nil), // 5: did.v1.Params + (*Document)(nil), // 6: did.v1.Document + (*Service)(nil), // 7: did.v1.Service + (*Credential)(nil), // 8: did.v1.Credential + (*Token)(nil), // 9: did.v1.Token } var file_did_v1_query_proto_depIdxs = []int32{ - 7, // 0: did.v1.QueryRequest.credentials:type_name -> did.v1.Credential - 8, // 1: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params - 7, // 2: did.v1.QueryCredentialsResponse.credentials:type_name -> did.v1.Credential - 9, // 3: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document - 10, // 4: did.v1.QueryServiceResponse.service:type_name -> did.v1.Service - 11, // 5: did.v1.QueryTokenResponse.token:type_name -> did.v1.Token - 0, // 6: did.v1.Query.Params:input_type -> did.v1.QueryRequest - 0, // 7: did.v1.Query.Accounts:input_type -> did.v1.QueryRequest - 0, // 8: did.v1.Query.Credentials:input_type -> did.v1.QueryRequest - 0, // 9: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest - 0, // 10: did.v1.Query.Service:input_type -> did.v1.QueryRequest - 0, // 11: did.v1.Query.Token:input_type -> did.v1.QueryRequest - 1, // 12: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse - 2, // 13: did.v1.Query.Accounts:output_type -> did.v1.QueryAccountsResponse - 3, // 14: did.v1.Query.Credentials:output_type -> did.v1.QueryCredentialsResponse - 4, // 15: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse - 5, // 16: did.v1.Query.Service:output_type -> did.v1.QueryServiceResponse - 6, // 17: did.v1.Query.Token:output_type -> did.v1.QueryTokenResponse - 12, // [12:18] is the sub-list for method output_type - 6, // [6:12] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 5, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 5, // 1: did.v1.QueryResponse.params:type_name -> did.v1.Params + 6, // 2: did.v1.QueryResponse.document:type_name -> did.v1.Document + 7, // 3: did.v1.QueryResponse.service:type_name -> did.v1.Service + 8, // 4: did.v1.QueryResponse.credentials:type_name -> did.v1.Credential + 9, // 5: did.v1.QueryResponse.token:type_name -> did.v1.Token + 5, // 6: did.v1.QueryResolveResponse.params:type_name -> did.v1.Params + 6, // 7: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document + 8, // 8: did.v1.QueryResolveResponse.credentials:type_name -> did.v1.Credential + 9, // 9: did.v1.QueryResolveResponse.token:type_name -> did.v1.Token + 5, // 10: did.v1.QueryServiceResponse.params:type_name -> did.v1.Params + 7, // 11: did.v1.QueryServiceResponse.service:type_name -> did.v1.Service + 0, // 12: did.v1.Query.Params:input_type -> did.v1.QueryRequest + 0, // 13: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest + 0, // 14: did.v1.Query.Service:input_type -> did.v1.QueryRequest + 1, // 15: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 3, // 16: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse + 4, // 17: did.v1.Query.Service:output_type -> did.v1.QueryServiceResponse + 15, // [15:18] is the sub-list for method output_type + 12, // [12:15] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_did_v1_query_proto_init() } @@ -4294,7 +4463,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAccountsResponse); i { + switch v := v.(*QueryResponse); i { case 0: return &v.state case 1: @@ -4306,18 +4475,6 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryCredentialsResponse); 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[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryResolveResponse); i { case 0: return &v.state @@ -4329,7 +4486,7 @@ func file_did_v1_query_proto_init() { return nil } } - file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryServiceResponse); i { case 0: return &v.state @@ -4341,18 +4498,6 @@ func file_did_v1_query_proto_init() { return nil } } - file_did_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryTokenResponse); 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{ @@ -4360,7 +4505,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: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 374985a29..37cd4173b 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -19,12 +19,9 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/did.v1.Query/Params" - Query_Accounts_FullMethodName = "/did.v1.Query/Accounts" - Query_Credentials_FullMethodName = "/did.v1.Query/Credentials" - Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" - Query_Service_FullMethodName = "/did.v1.Query/Service" - Query_Token_FullMethodName = "/did.v1.Query/Token" + Query_Params_FullMethodName = "/did.v1.Query/Params" + Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" + Query_Service_FullMethodName = "/did.v1.Query/Service" ) // QueryClient is the client API for Query service. @@ -33,16 +30,10 @@ const ( type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Accounts returns associated wallet accounts with the DID. - Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) - // Credentials returns associated credentials with the DID and Service Origin. - Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, 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 Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) - // Token returns the current authentication token for the client. - Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error) } type queryClient struct { @@ -62,24 +53,6 @@ func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc return out, nil } -func (c *queryClient) Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { - out := new(QueryAccountsResponse) - err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { - out := new(QueryCredentialsResponse) - err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { out := new(QueryResolveResponse) err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...) @@ -98,31 +71,16 @@ func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error) { - out := new(QueryTokenResponse) - err := c.cc.Invoke(ctx, Query_Token_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) - // Accounts returns associated wallet accounts with the DID. - Accounts(context.Context, *QueryRequest) (*QueryAccountsResponse, error) - // Credentials returns associated credentials with the DID and Service Origin. - Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) // Service returns associated ServiceInfo for a given Origin Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) - // Token returns the current authentication token for the client. - Token(context.Context, *QueryRequest) (*QueryTokenResponse, error) mustEmbedUnimplementedQueryServer() } @@ -133,21 +91,12 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) Accounts(context.Context, *QueryRequest) (*QueryAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") -} -func (UnimplementedQueryServer) Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") -} 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) Token(context.Context, *QueryRequest) (*QueryTokenResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Token not implemented") -} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -179,42 +128,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Accounts_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).Accounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Accounts_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Accounts(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Credentials_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).Credentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Credentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Credentials(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryRequest) if err := dec(in); err != nil { @@ -251,24 +164,6 @@ func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Token_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).Token(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Token_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Token(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -280,14 +175,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "Accounts", - Handler: _Query_Accounts_Handler, - }, - { - MethodName: "Credentials", - Handler: _Query_Credentials_Handler, - }, { MethodName: "Resolve", Handler: _Query_Resolve_Handler, @@ -296,10 +183,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Service", Handler: _Query_Service_Handler, }, - { - MethodName: "Token", - Handler: _Query_Token_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/query.proto", diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index dacdc2a70..006c4f92a 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -9,6 +9,249 @@ import ( ormerrors "cosmossdk.io/orm/types/ormerrors" ) +type AuthenticationTable interface { + Insert(ctx context.Context, authentication *Authentication) error + Update(ctx context.Context, authentication *Authentication) error + Save(ctx context.Context, authentication *Authentication) error + Delete(ctx context.Context, authentication *Authentication) error + Has(ctx context.Context, id string) (found bool, err error) + // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + Get(ctx context.Context, id string) (*Authentication, 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) (*Authentication, error) + HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) + // GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Authentication, error) + HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error) + // GetByControllerCredentialLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Authentication, error) + List(ctx context.Context, prefixKey AuthenticationIndexKey, opts ...ormlist.Option) (AuthenticationIterator, error) + ListRange(ctx context.Context, from, to AuthenticationIndexKey, opts ...ormlist.Option) (AuthenticationIterator, error) + DeleteBy(ctx context.Context, prefixKey AuthenticationIndexKey) error + DeleteRange(ctx context.Context, from, to AuthenticationIndexKey) error + + doNotImplement() +} + +type AuthenticationIterator struct { + ormtable.Iterator +} + +func (i AuthenticationIterator) Value() (*Authentication, error) { + var authentication Authentication + err := i.UnmarshalMessage(&authentication) + return &authentication, err +} + +type AuthenticationIndexKey interface { + id() uint32 + values() []interface{} + authenticationIndexKey() +} + +// primary key starting index.. +type AuthenticationPrimaryKey = AuthenticationIdIndexKey + +type AuthenticationIdIndexKey struct { + vs []interface{} +} + +func (x AuthenticationIdIndexKey) id() uint32 { return 0 } +func (x AuthenticationIdIndexKey) values() []interface{} { return x.vs } +func (x AuthenticationIdIndexKey) authenticationIndexKey() {} + +func (this AuthenticationIdIndexKey) WithId(id string) AuthenticationIdIndexKey { + this.vs = []interface{}{id} + return this +} + +type AuthenticationSubjectOriginIndexKey struct { + vs []interface{} +} + +func (x AuthenticationSubjectOriginIndexKey) id() uint32 { return 1 } +func (x AuthenticationSubjectOriginIndexKey) values() []interface{} { return x.vs } +func (x AuthenticationSubjectOriginIndexKey) authenticationIndexKey() {} + +func (this AuthenticationSubjectOriginIndexKey) WithSubject(subject string) AuthenticationSubjectOriginIndexKey { + this.vs = []interface{}{subject} + return this +} + +func (this AuthenticationSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AuthenticationSubjectOriginIndexKey { + this.vs = []interface{}{subject, origin} + return this +} + +type AuthenticationControllerOriginIndexKey struct { + vs []interface{} +} + +func (x AuthenticationControllerOriginIndexKey) id() uint32 { return 2 } +func (x AuthenticationControllerOriginIndexKey) values() []interface{} { return x.vs } +func (x AuthenticationControllerOriginIndexKey) authenticationIndexKey() {} + +func (this AuthenticationControllerOriginIndexKey) WithController(controller string) AuthenticationControllerOriginIndexKey { + this.vs = []interface{}{controller} + return this +} + +func (this AuthenticationControllerOriginIndexKey) WithControllerOrigin(controller string, origin string) AuthenticationControllerOriginIndexKey { + this.vs = []interface{}{controller, origin} + return this +} + +type AuthenticationControllerCredentialLabelIndexKey struct { + vs []interface{} +} + +func (x AuthenticationControllerCredentialLabelIndexKey) id() uint32 { return 3 } +func (x AuthenticationControllerCredentialLabelIndexKey) values() []interface{} { return x.vs } +func (x AuthenticationControllerCredentialLabelIndexKey) authenticationIndexKey() {} + +func (this AuthenticationControllerCredentialLabelIndexKey) WithController(controller string) AuthenticationControllerCredentialLabelIndexKey { + this.vs = []interface{}{controller} + return this +} + +func (this AuthenticationControllerCredentialLabelIndexKey) WithControllerCredentialLabel(controller string, credential_label string) AuthenticationControllerCredentialLabelIndexKey { + this.vs = []interface{}{controller, credential_label} + return this +} + +type authenticationTable struct { + table ormtable.Table +} + +func (this authenticationTable) Insert(ctx context.Context, authentication *Authentication) error { + return this.table.Insert(ctx, authentication) +} + +func (this authenticationTable) Update(ctx context.Context, authentication *Authentication) error { + return this.table.Update(ctx, authentication) +} + +func (this authenticationTable) Save(ctx context.Context, authentication *Authentication) error { + return this.table.Save(ctx, authentication) +} + +func (this authenticationTable) Delete(ctx context.Context, authentication *Authentication) error { + return this.table.Delete(ctx, authentication) +} + +func (this authenticationTable) Has(ctx context.Context, id string) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, id) +} + +func (this authenticationTable) Get(ctx context.Context, id string) (*Authentication, error) { + var authentication Authentication + found, err := this.table.PrimaryKey().Get(ctx, &authentication, id) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &authentication, nil +} + +func (this authenticationTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + subject, + origin, + ) +} + +func (this authenticationTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Authentication, error) { + var authentication Authentication + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &authentication, + subject, + origin, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &authentication, nil +} + +func (this authenticationTable) HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + controller, + origin, + ) +} + +func (this authenticationTable) GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Authentication, error) { + var authentication Authentication + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &authentication, + controller, + origin, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &authentication, nil +} + +func (this authenticationTable) HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error) { + return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx, + controller, + credential_label, + ) +} + +func (this authenticationTable) GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Authentication, error) { + var authentication Authentication + found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &authentication, + controller, + credential_label, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &authentication, nil +} + +func (this authenticationTable) List(ctx context.Context, prefixKey AuthenticationIndexKey, opts ...ormlist.Option) (AuthenticationIterator, error) { + it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) + return AuthenticationIterator{it}, err +} + +func (this authenticationTable) ListRange(ctx context.Context, from, to AuthenticationIndexKey, opts ...ormlist.Option) (AuthenticationIterator, error) { + it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) + return AuthenticationIterator{it}, err +} + +func (this authenticationTable) DeleteBy(ctx context.Context, prefixKey AuthenticationIndexKey) error { + return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) +} + +func (this authenticationTable) DeleteRange(ctx context.Context, from, to AuthenticationIndexKey) error { + return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) +} + +func (this authenticationTable) doNotImplement() {} + +var _ AuthenticationTable = authenticationTable{} + +func NewAuthenticationTable(db ormtable.Schema) (AuthenticationTable, error) { + table := db.GetTable(&Authentication{}) + if table == nil { + return nil, ormerrors.TableNotFound.Wrap(string((&Authentication{}).ProtoReflect().Descriptor().FullName())) + } + return authenticationTable{table}, nil +} + type AssertionTable interface { Insert(ctx context.Context, assertion *Assertion) error Update(ctx context.Context, assertion *Assertion) error @@ -23,9 +266,6 @@ type AssertionTable interface { HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) // GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Assertion, error) - HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error) - // GetByControllerCredentialLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Assertion, error) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error @@ -102,24 +342,6 @@ func (this AssertionControllerOriginIndexKey) WithControllerOrigin(controller st return this } -type AssertionControllerCredentialLabelIndexKey struct { - vs []interface{} -} - -func (x AssertionControllerCredentialLabelIndexKey) id() uint32 { return 3 } -func (x AssertionControllerCredentialLabelIndexKey) values() []interface{} { return x.vs } -func (x AssertionControllerCredentialLabelIndexKey) assertionIndexKey() {} - -func (this AssertionControllerCredentialLabelIndexKey) WithController(controller string) AssertionControllerCredentialLabelIndexKey { - this.vs = []interface{}{controller} - return this -} - -func (this AssertionControllerCredentialLabelIndexKey) WithControllerCredentialLabel(controller string, credential_label string) AssertionControllerCredentialLabelIndexKey { - this.vs = []interface{}{controller, credential_label} - return this -} - type assertionTable struct { table ormtable.Table } @@ -200,28 +422,6 @@ func (this assertionTable) GetByControllerOrigin(ctx context.Context, controller return &assertion, nil } -func (this assertionTable) HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error) { - return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx, - controller, - credential_label, - ) -} - -func (this assertionTable) GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Assertion, error) { - var assertion Assertion - found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &assertion, - controller, - credential_label, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &assertion, nil -} - func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) return AssertionIterator{it}, err @@ -252,206 +452,6 @@ func NewAssertionTable(db ormtable.Schema) (AssertionTable, error) { return assertionTable{table}, nil } -type AttestationTable interface { - Insert(ctx context.Context, attestation *Attestation) error - Update(ctx context.Context, attestation *Attestation) error - Save(ctx context.Context, attestation *Attestation) error - Delete(ctx context.Context, attestation *Attestation) error - Has(ctx context.Context, id string) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id string) (*Attestation, error) - HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) - // GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error) - HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) - // GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Attestation, error) - List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) - ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) - DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error - DeleteRange(ctx context.Context, from, to AttestationIndexKey) error - - doNotImplement() -} - -type AttestationIterator struct { - ormtable.Iterator -} - -func (i AttestationIterator) Value() (*Attestation, error) { - var attestation Attestation - err := i.UnmarshalMessage(&attestation) - return &attestation, err -} - -type AttestationIndexKey interface { - id() uint32 - values() []interface{} - attestationIndexKey() -} - -// primary key starting index.. -type AttestationPrimaryKey = AttestationIdIndexKey - -type AttestationIdIndexKey struct { - vs []interface{} -} - -func (x AttestationIdIndexKey) id() uint32 { return 0 } -func (x AttestationIdIndexKey) values() []interface{} { return x.vs } -func (x AttestationIdIndexKey) attestationIndexKey() {} - -func (this AttestationIdIndexKey) WithId(id string) AttestationIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type AttestationSubjectOriginIndexKey struct { - vs []interface{} -} - -func (x AttestationSubjectOriginIndexKey) id() uint32 { return 1 } -func (x AttestationSubjectOriginIndexKey) values() []interface{} { return x.vs } -func (x AttestationSubjectOriginIndexKey) attestationIndexKey() {} - -func (this AttestationSubjectOriginIndexKey) WithSubject(subject string) AttestationSubjectOriginIndexKey { - this.vs = []interface{}{subject} - return this -} - -func (this AttestationSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AttestationSubjectOriginIndexKey { - this.vs = []interface{}{subject, origin} - return this -} - -type AttestationControllerOriginIndexKey struct { - vs []interface{} -} - -func (x AttestationControllerOriginIndexKey) id() uint32 { return 2 } -func (x AttestationControllerOriginIndexKey) values() []interface{} { return x.vs } -func (x AttestationControllerOriginIndexKey) attestationIndexKey() {} - -func (this AttestationControllerOriginIndexKey) WithController(controller string) AttestationControllerOriginIndexKey { - this.vs = []interface{}{controller} - return this -} - -func (this AttestationControllerOriginIndexKey) WithControllerOrigin(controller string, origin string) AttestationControllerOriginIndexKey { - this.vs = []interface{}{controller, origin} - return this -} - -type attestationTable struct { - table ormtable.Table -} - -func (this attestationTable) Insert(ctx context.Context, attestation *Attestation) error { - return this.table.Insert(ctx, attestation) -} - -func (this attestationTable) Update(ctx context.Context, attestation *Attestation) error { - return this.table.Update(ctx, attestation) -} - -func (this attestationTable) Save(ctx context.Context, attestation *Attestation) error { - return this.table.Save(ctx, attestation) -} - -func (this attestationTable) Delete(ctx context.Context, attestation *Attestation) error { - return this.table.Delete(ctx, attestation) -} - -func (this attestationTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this attestationTable) Get(ctx context.Context, id string) (*Attestation, error) { - var attestation Attestation - found, err := this.table.PrimaryKey().Get(ctx, &attestation, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &attestation, nil -} - -func (this attestationTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - subject, - origin, - ) -} - -func (this attestationTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error) { - var attestation Attestation - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &attestation, - subject, - origin, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &attestation, nil -} - -func (this attestationTable) HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) { - return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, - controller, - origin, - ) -} - -func (this attestationTable) GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Attestation, error) { - var attestation Attestation - found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &attestation, - controller, - origin, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &attestation, nil -} - -func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return AttestationIterator{it}, err -} - -func (this attestationTable) ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return AttestationIterator{it}, err -} - -func (this attestationTable) DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this attestationTable) DeleteRange(ctx context.Context, from, to AttestationIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this attestationTable) doNotImplement() {} - -var _ AttestationTable = attestationTable{} - -func NewAttestationTable(db ormtable.Schema) (AttestationTable, error) { - table := db.GetTable(&Attestation{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Attestation{}).ProtoReflect().Descriptor().FullName())) - } - return attestationTable{table}, nil -} - type ControllerTable interface { Insert(ctx context.Context, controller *Controller) error Update(ctx context.Context, controller *Controller) error @@ -1050,8 +1050,8 @@ func NewServiceRecordTable(db ormtable.Schema) (ServiceRecordTable, error) { } type StateStore interface { + AuthenticationTable() AuthenticationTable AssertionTable() AssertionTable - AttestationTable() AttestationTable ControllerTable() ControllerTable DelegationTable() DelegationTable ServiceRecordTable() ServiceRecordTable @@ -1060,21 +1060,21 @@ type StateStore interface { } type stateStore struct { - assertion AssertionTable - attestation AttestationTable - controller ControllerTable - delegation DelegationTable - serviceRecord ServiceRecordTable + authentication AuthenticationTable + assertion AssertionTable + controller ControllerTable + delegation DelegationTable + serviceRecord ServiceRecordTable +} + +func (x stateStore) AuthenticationTable() AuthenticationTable { + return x.authentication } func (x stateStore) AssertionTable() AssertionTable { return x.assertion } -func (x stateStore) AttestationTable() AttestationTable { - return x.attestation -} - func (x stateStore) ControllerTable() ControllerTable { return x.controller } @@ -1092,12 +1092,12 @@ func (stateStore) doNotImplement() {} var _ StateStore = stateStore{} func NewStateStore(db ormtable.Schema) (StateStore, error) { - assertionTable, err := NewAssertionTable(db) + authenticationTable, err := NewAuthenticationTable(db) if err != nil { return nil, err } - attestationTable, err := NewAttestationTable(db) + assertionTable, err := NewAssertionTable(db) if err != nil { return nil, err } @@ -1118,8 +1118,8 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { } return stateStore{ + authenticationTable, assertionTable, - attestationTable, controllerTable, delegationTable, serviceRecordTable, diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 069e8f3bc..2e5d48abf 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -14,40 +14,90 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Authentication_8_list)(nil) + +type _Authentication_8_list struct { + list *[]string +} + +func (x *_Authentication_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Authentication_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Authentication_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Authentication_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Authentication_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Authentication at list field CredentialTransport as it is not of Message kind")) +} + +func (x *_Authentication_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Authentication_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Authentication_8_list) IsValid() bool { + return x.list != nil +} + var ( - md_Assertion protoreflect.MessageDescriptor - fd_Assertion_id protoreflect.FieldDescriptor - fd_Assertion_controller protoreflect.FieldDescriptor - fd_Assertion_public_key protoreflect.FieldDescriptor - fd_Assertion_credential_id protoreflect.FieldDescriptor - fd_Assertion_credential_label protoreflect.FieldDescriptor - fd_Assertion_origin protoreflect.FieldDescriptor - fd_Assertion_subject protoreflect.FieldDescriptor - fd_Assertion_metadata protoreflect.FieldDescriptor + md_Authentication protoreflect.MessageDescriptor + fd_Authentication_id protoreflect.FieldDescriptor + fd_Authentication_controller protoreflect.FieldDescriptor + fd_Authentication_public_key protoreflect.FieldDescriptor + fd_Authentication_origin protoreflect.FieldDescriptor + fd_Authentication_subject protoreflect.FieldDescriptor + fd_Authentication_credential_id protoreflect.FieldDescriptor + fd_Authentication_credential_label protoreflect.FieldDescriptor + fd_Authentication_credential_transport protoreflect.FieldDescriptor + fd_Authentication_attestation_type protoreflect.FieldDescriptor + fd_Authentication_metadata protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Assertion = File_did_v1_state_proto.Messages().ByName("Assertion") - fd_Assertion_id = md_Assertion.Fields().ByName("id") - fd_Assertion_controller = md_Assertion.Fields().ByName("controller") - fd_Assertion_public_key = md_Assertion.Fields().ByName("public_key") - fd_Assertion_credential_id = md_Assertion.Fields().ByName("credential_id") - fd_Assertion_credential_label = md_Assertion.Fields().ByName("credential_label") - fd_Assertion_origin = md_Assertion.Fields().ByName("origin") - fd_Assertion_subject = md_Assertion.Fields().ByName("subject") - fd_Assertion_metadata = md_Assertion.Fields().ByName("metadata") + md_Authentication = File_did_v1_state_proto.Messages().ByName("Authentication") + fd_Authentication_id = md_Authentication.Fields().ByName("id") + fd_Authentication_controller = md_Authentication.Fields().ByName("controller") + fd_Authentication_public_key = md_Authentication.Fields().ByName("public_key") + fd_Authentication_origin = md_Authentication.Fields().ByName("origin") + fd_Authentication_subject = md_Authentication.Fields().ByName("subject") + fd_Authentication_credential_id = md_Authentication.Fields().ByName("credential_id") + fd_Authentication_credential_label = md_Authentication.Fields().ByName("credential_label") + fd_Authentication_credential_transport = md_Authentication.Fields().ByName("credential_transport") + fd_Authentication_attestation_type = md_Authentication.Fields().ByName("attestation_type") + fd_Authentication_metadata = md_Authentication.Fields().ByName("metadata") } -var _ protoreflect.Message = (*fastReflection_Assertion)(nil) +var _ protoreflect.Message = (*fastReflection_Authentication)(nil) -type fastReflection_Assertion Assertion +type fastReflection_Authentication Authentication -func (x *Assertion) ProtoReflect() protoreflect.Message { - return (*fastReflection_Assertion)(x) +func (x *Authentication) ProtoReflect() protoreflect.Message { + return (*fastReflection_Authentication)(x) } -func (x *Assertion) slowProtoReflect() protoreflect.Message { +func (x *Authentication) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -59,43 +109,43 @@ func (x *Assertion) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Assertion_messageType fastReflection_Assertion_messageType -var _ protoreflect.MessageType = fastReflection_Assertion_messageType{} +var _fastReflection_Authentication_messageType fastReflection_Authentication_messageType +var _ protoreflect.MessageType = fastReflection_Authentication_messageType{} -type fastReflection_Assertion_messageType struct{} +type fastReflection_Authentication_messageType struct{} -func (x fastReflection_Assertion_messageType) Zero() protoreflect.Message { - return (*fastReflection_Assertion)(nil) +func (x fastReflection_Authentication_messageType) Zero() protoreflect.Message { + return (*fastReflection_Authentication)(nil) } -func (x fastReflection_Assertion_messageType) New() protoreflect.Message { - return new(fastReflection_Assertion) +func (x fastReflection_Authentication_messageType) New() protoreflect.Message { + return new(fastReflection_Authentication) } -func (x fastReflection_Assertion_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Assertion +func (x fastReflection_Authentication_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Authentication } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Assertion) Descriptor() protoreflect.MessageDescriptor { - return md_Assertion +func (x *fastReflection_Authentication) Descriptor() protoreflect.MessageDescriptor { + return md_Authentication } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_Assertion) Type() protoreflect.MessageType { - return _fastReflection_Assertion_messageType +func (x *fastReflection_Authentication) Type() protoreflect.MessageType { + return _fastReflection_Authentication_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Assertion) New() protoreflect.Message { - return new(fastReflection_Assertion) +func (x *fastReflection_Authentication) New() protoreflect.Message { + return new(fastReflection_Authentication) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Assertion) Interface() protoreflect.ProtoMessage { - return (*Assertion)(x) +func (x *fastReflection_Authentication) Interface() protoreflect.ProtoMessage { + return (*Authentication)(x) } // Range iterates over every populated field in an undefined order, @@ -103,52 +153,64 @@ func (x *fastReflection_Assertion) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_Assertion) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Authentication) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_Assertion_id, value) { + if !f(fd_Authentication_id, value) { return } } if x.Controller != "" { value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Assertion_controller, value) { + if !f(fd_Authentication_controller, value) { return } } if x.PublicKey != nil { value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Assertion_public_key, value) { - return - } - } - if len(x.CredentialId) != 0 { - value := protoreflect.ValueOfBytes(x.CredentialId) - if !f(fd_Assertion_credential_id, value) { - return - } - } - if x.CredentialLabel != "" { - value := protoreflect.ValueOfString(x.CredentialLabel) - if !f(fd_Assertion_credential_label, value) { + if !f(fd_Authentication_public_key, value) { return } } if x.Origin != "" { value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Assertion_origin, value) { + if !f(fd_Authentication_origin, value) { return } } if x.Subject != "" { value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Assertion_subject, value) { + if !f(fd_Authentication_subject, value) { + return + } + } + if len(x.CredentialId) != 0 { + value := protoreflect.ValueOfBytes(x.CredentialId) + if !f(fd_Authentication_credential_id, value) { + return + } + } + if x.CredentialLabel != "" { + value := protoreflect.ValueOfString(x.CredentialLabel) + if !f(fd_Authentication_credential_label, value) { + return + } + } + if len(x.CredentialTransport) != 0 { + value := protoreflect.ValueOfList(&_Authentication_8_list{list: &x.CredentialTransport}) + if !f(fd_Authentication_credential_transport, value) { + return + } + } + if x.AttestationType != "" { + value := protoreflect.ValueOfString(x.AttestationType) + if !f(fd_Authentication_attestation_type, value) { return } } if x.Metadata != nil { value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) - if !f(fd_Assertion_metadata, value) { + if !f(fd_Authentication_metadata, value) { return } } @@ -165,29 +227,33 @@ func (x *fastReflection_Assertion) Range(f func(protoreflect.FieldDescriptor, pr // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_Assertion) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Authentication) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Assertion.id": + case "did.v1.Authentication.id": return x.Id != "" - case "did.v1.Assertion.controller": + case "did.v1.Authentication.controller": return x.Controller != "" - case "did.v1.Assertion.public_key": + case "did.v1.Authentication.public_key": return x.PublicKey != nil - case "did.v1.Assertion.credential_id": - return len(x.CredentialId) != 0 - case "did.v1.Assertion.credential_label": - return x.CredentialLabel != "" - case "did.v1.Assertion.origin": + case "did.v1.Authentication.origin": return x.Origin != "" - case "did.v1.Assertion.subject": + case "did.v1.Authentication.subject": return x.Subject != "" - case "did.v1.Assertion.metadata": + case "did.v1.Authentication.credential_id": + return len(x.CredentialId) != 0 + case "did.v1.Authentication.credential_label": + return x.CredentialLabel != "" + case "did.v1.Authentication.credential_transport": + return len(x.CredentialTransport) != 0 + case "did.v1.Authentication.attestation_type": + return x.AttestationType != "" + case "did.v1.Authentication.metadata": return x.Metadata != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) } - panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Authentication does not contain field %s", fd.FullName())) } } @@ -197,29 +263,33 @@ func (x *fastReflection_Assertion) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Assertion) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Authentication) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Assertion.id": + case "did.v1.Authentication.id": x.Id = "" - case "did.v1.Assertion.controller": + case "did.v1.Authentication.controller": x.Controller = "" - case "did.v1.Assertion.public_key": + case "did.v1.Authentication.public_key": x.PublicKey = nil - case "did.v1.Assertion.credential_id": - x.CredentialId = nil - case "did.v1.Assertion.credential_label": - x.CredentialLabel = "" - case "did.v1.Assertion.origin": + case "did.v1.Authentication.origin": x.Origin = "" - case "did.v1.Assertion.subject": + case "did.v1.Authentication.subject": x.Subject = "" - case "did.v1.Assertion.metadata": + case "did.v1.Authentication.credential_id": + x.CredentialId = nil + case "did.v1.Authentication.credential_label": + x.CredentialLabel = "" + case "did.v1.Authentication.credential_transport": + x.CredentialTransport = nil + case "did.v1.Authentication.attestation_type": + x.AttestationType = "" + case "did.v1.Authentication.metadata": x.Metadata = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) } - panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Authentication does not contain field %s", fd.FullName())) } } @@ -229,37 +299,46 @@ func (x *fastReflection_Assertion) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Assertion) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Authentication) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Assertion.id": + case "did.v1.Authentication.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Assertion.controller": + case "did.v1.Authentication.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Assertion.public_key": + case "did.v1.Authentication.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.Assertion.credential_id": - value := x.CredentialId - return protoreflect.ValueOfBytes(value) - case "did.v1.Assertion.credential_label": - value := x.CredentialLabel - return protoreflect.ValueOfString(value) - case "did.v1.Assertion.origin": + case "did.v1.Authentication.origin": value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.Assertion.subject": + case "did.v1.Authentication.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.Assertion.metadata": + case "did.v1.Authentication.credential_id": + value := x.CredentialId + return protoreflect.ValueOfBytes(value) + case "did.v1.Authentication.credential_label": + value := x.CredentialLabel + return protoreflect.ValueOfString(value) + case "did.v1.Authentication.credential_transport": + if len(x.CredentialTransport) == 0 { + return protoreflect.ValueOfList(&_Authentication_8_list{}) + } + listValue := &_Authentication_8_list{list: &x.CredentialTransport} + return protoreflect.ValueOfList(listValue) + case "did.v1.Authentication.attestation_type": + value := x.AttestationType + return protoreflect.ValueOfString(value) + case "did.v1.Authentication.metadata": value := x.Metadata return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) } - panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Authentication does not contain field %s", descriptor.FullName())) } } @@ -273,29 +352,35 @@ func (x *fastReflection_Assertion) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Assertion) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Authentication) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Assertion.id": + case "did.v1.Authentication.id": x.Id = value.Interface().(string) - case "did.v1.Assertion.controller": + case "did.v1.Authentication.controller": x.Controller = value.Interface().(string) - case "did.v1.Assertion.public_key": + case "did.v1.Authentication.public_key": x.PublicKey = value.Message().Interface().(*PubKey) - case "did.v1.Assertion.credential_id": - x.CredentialId = value.Bytes() - case "did.v1.Assertion.credential_label": - x.CredentialLabel = value.Interface().(string) - case "did.v1.Assertion.origin": + case "did.v1.Authentication.origin": x.Origin = value.Interface().(string) - case "did.v1.Assertion.subject": + case "did.v1.Authentication.subject": x.Subject = value.Interface().(string) - case "did.v1.Assertion.metadata": + case "did.v1.Authentication.credential_id": + x.CredentialId = value.Bytes() + case "did.v1.Authentication.credential_label": + x.CredentialLabel = value.Interface().(string) + case "did.v1.Authentication.credential_transport": + lv := value.List() + clv := lv.(*_Authentication_8_list) + x.CredentialTransport = *clv.list + case "did.v1.Authentication.attestation_type": + x.AttestationType = value.Interface().(string) + case "did.v1.Authentication.metadata": x.Metadata = value.Message().Interface().(*Metadata) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) } - panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Authentication does not contain field %s", fd.FullName())) } } @@ -309,76 +394,89 @@ func (x *fastReflection_Assertion) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Assertion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Authentication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Assertion.public_key": + case "did.v1.Authentication.public_key": if x.PublicKey == nil { x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.Assertion.metadata": + case "did.v1.Authentication.credential_transport": + if x.CredentialTransport == nil { + x.CredentialTransport = []string{} + } + value := &_Authentication_8_list{list: &x.CredentialTransport} + return protoreflect.ValueOfList(value) + case "did.v1.Authentication.metadata": if x.Metadata == nil { x.Metadata = new(Metadata) } return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) - case "did.v1.Assertion.id": - panic(fmt.Errorf("field id of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.controller": - panic(fmt.Errorf("field controller of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.credential_id": - panic(fmt.Errorf("field credential_id of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.credential_label": - panic(fmt.Errorf("field credential_label of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.origin": - panic(fmt.Errorf("field origin of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.subject": - panic(fmt.Errorf("field subject of message did.v1.Assertion is not mutable")) + case "did.v1.Authentication.id": + panic(fmt.Errorf("field id of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.controller": + panic(fmt.Errorf("field controller of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.origin": + panic(fmt.Errorf("field origin of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.subject": + panic(fmt.Errorf("field subject of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.credential_id": + panic(fmt.Errorf("field credential_id of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.credential_label": + panic(fmt.Errorf("field credential_label of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.attestation_type": + panic(fmt.Errorf("field attestation_type of message did.v1.Authentication is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) } - panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Authentication does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Assertion) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Authentication) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Assertion.id": + case "did.v1.Authentication.id": return protoreflect.ValueOfString("") - case "did.v1.Assertion.controller": + case "did.v1.Authentication.controller": return protoreflect.ValueOfString("") - case "did.v1.Assertion.public_key": + case "did.v1.Authentication.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.Assertion.credential_id": + case "did.v1.Authentication.origin": + return protoreflect.ValueOfString("") + case "did.v1.Authentication.subject": + return protoreflect.ValueOfString("") + case "did.v1.Authentication.credential_id": return protoreflect.ValueOfBytes(nil) - case "did.v1.Assertion.credential_label": + case "did.v1.Authentication.credential_label": return protoreflect.ValueOfString("") - case "did.v1.Assertion.origin": + case "did.v1.Authentication.credential_transport": + list := []string{} + return protoreflect.ValueOfList(&_Authentication_8_list{list: &list}) + case "did.v1.Authentication.attestation_type": return protoreflect.ValueOfString("") - case "did.v1.Assertion.subject": - return protoreflect.ValueOfString("") - case "did.v1.Assertion.metadata": + case "did.v1.Authentication.metadata": m := new(Metadata) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) } - panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Authentication does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Assertion) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Authentication) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Assertion", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Authentication", d.FullName())) } panic("unreachable") } @@ -386,7 +484,7 @@ func (x *fastReflection_Assertion) WhichOneof(d protoreflect.OneofDescriptor) pr // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Assertion) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Authentication) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -397,7 +495,7 @@ func (x *fastReflection_Assertion) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Assertion) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Authentication) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -409,7 +507,7 @@ func (x *fastReflection_Assertion) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_Assertion) IsValid() bool { +func (x *fastReflection_Authentication) IsValid() bool { return x != nil } @@ -419,9 +517,9 @@ func (x *fastReflection_Assertion) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Assertion) + x := input.Message.Interface().(*Authentication) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -445,6 +543,14 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { l = options.Size(x.PublicKey) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.CredentialId) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -453,11 +559,13 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.CredentialTransport) > 0 { + for _, s := range x.CredentialTransport { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } } - l = len(x.Subject) + l = len(x.AttestationType) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -475,7 +583,7 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Assertion) + x := input.Message.Interface().(*Authentication) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -506,34 +614,50 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x52 } - if len(x.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + 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] = 0x3a + dAtA[i] = 0x4a } - 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] = 0x32 + if len(x.CredentialTransport) > 0 { + for iNdEx := len(x.CredentialTransport) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CredentialTransport[iNdEx]) + copy(dAtA[i:], x.CredentialTransport[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialTransport[iNdEx]))) + i-- + dAtA[i] = 0x42 + } } if len(x.CredentialLabel) > 0 { i -= len(x.CredentialLabel) copy(dAtA[i:], x.CredentialLabel) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialLabel))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } 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] = 0x32 + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x2a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- dAtA[i] = 0x22 } if x.PublicKey != nil { @@ -575,7 +699,7 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Assertion) + x := input.Message.Interface().(*Authentication) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -607,10 +731,10 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assertion: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Authentication: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Authentication: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -714,6 +838,70 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { } iNdEx = postIndex case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) } @@ -747,7 +935,7 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { x.CredentialId = []byte{} } 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 CredentialLabel", wireType) } @@ -779,71 +967,71 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { } x.CredentialLabel = 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 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 7: - 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 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialTransport", 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.CredentialTransport = append(x.CredentialTransport, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + 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 10: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -915,35 +1103,35 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { } var ( - md_Attestation protoreflect.MessageDescriptor - fd_Attestation_id protoreflect.FieldDescriptor - fd_Attestation_controller protoreflect.FieldDescriptor - fd_Attestation_public_key protoreflect.FieldDescriptor - fd_Attestation_origin protoreflect.FieldDescriptor - fd_Attestation_subject protoreflect.FieldDescriptor - fd_Attestation_metadata protoreflect.FieldDescriptor + md_Assertion protoreflect.MessageDescriptor + fd_Assertion_id protoreflect.FieldDescriptor + fd_Assertion_controller protoreflect.FieldDescriptor + fd_Assertion_public_key protoreflect.FieldDescriptor + fd_Assertion_origin protoreflect.FieldDescriptor + fd_Assertion_subject protoreflect.FieldDescriptor + fd_Assertion_metadata protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Attestation = File_did_v1_state_proto.Messages().ByName("Attestation") - fd_Attestation_id = md_Attestation.Fields().ByName("id") - fd_Attestation_controller = md_Attestation.Fields().ByName("controller") - fd_Attestation_public_key = md_Attestation.Fields().ByName("public_key") - fd_Attestation_origin = md_Attestation.Fields().ByName("origin") - fd_Attestation_subject = md_Attestation.Fields().ByName("subject") - fd_Attestation_metadata = md_Attestation.Fields().ByName("metadata") + md_Assertion = File_did_v1_state_proto.Messages().ByName("Assertion") + fd_Assertion_id = md_Assertion.Fields().ByName("id") + fd_Assertion_controller = md_Assertion.Fields().ByName("controller") + fd_Assertion_public_key = md_Assertion.Fields().ByName("public_key") + fd_Assertion_origin = md_Assertion.Fields().ByName("origin") + fd_Assertion_subject = md_Assertion.Fields().ByName("subject") + fd_Assertion_metadata = md_Assertion.Fields().ByName("metadata") } -var _ protoreflect.Message = (*fastReflection_Attestation)(nil) +var _ protoreflect.Message = (*fastReflection_Assertion)(nil) -type fastReflection_Attestation Attestation +type fastReflection_Assertion Assertion -func (x *Attestation) ProtoReflect() protoreflect.Message { - return (*fastReflection_Attestation)(x) +func (x *Assertion) ProtoReflect() protoreflect.Message { + return (*fastReflection_Assertion)(x) } -func (x *Attestation) slowProtoReflect() protoreflect.Message { +func (x *Assertion) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -955,43 +1143,43 @@ func (x *Attestation) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Attestation_messageType fastReflection_Attestation_messageType -var _ protoreflect.MessageType = fastReflection_Attestation_messageType{} +var _fastReflection_Assertion_messageType fastReflection_Assertion_messageType +var _ protoreflect.MessageType = fastReflection_Assertion_messageType{} -type fastReflection_Attestation_messageType struct{} +type fastReflection_Assertion_messageType struct{} -func (x fastReflection_Attestation_messageType) Zero() protoreflect.Message { - return (*fastReflection_Attestation)(nil) +func (x fastReflection_Assertion_messageType) Zero() protoreflect.Message { + return (*fastReflection_Assertion)(nil) } -func (x fastReflection_Attestation_messageType) New() protoreflect.Message { - return new(fastReflection_Attestation) +func (x fastReflection_Assertion_messageType) New() protoreflect.Message { + return new(fastReflection_Assertion) } -func (x fastReflection_Attestation_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Attestation +func (x fastReflection_Assertion_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Assertion } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Attestation) Descriptor() protoreflect.MessageDescriptor { - return md_Attestation +func (x *fastReflection_Assertion) Descriptor() protoreflect.MessageDescriptor { + return md_Assertion } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_Attestation) Type() protoreflect.MessageType { - return _fastReflection_Attestation_messageType +func (x *fastReflection_Assertion) Type() protoreflect.MessageType { + return _fastReflection_Assertion_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Attestation) New() protoreflect.Message { - return new(fastReflection_Attestation) +func (x *fastReflection_Assertion) New() protoreflect.Message { + return new(fastReflection_Assertion) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Attestation) Interface() protoreflect.ProtoMessage { - return (*Attestation)(x) +func (x *fastReflection_Assertion) Interface() protoreflect.ProtoMessage { + return (*Assertion)(x) } // Range iterates over every populated field in an undefined order, @@ -999,40 +1187,40 @@ func (x *fastReflection_Attestation) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_Attestation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Assertion) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_Attestation_id, value) { + if !f(fd_Assertion_id, value) { return } } if x.Controller != "" { value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Attestation_controller, value) { + if !f(fd_Assertion_controller, value) { return } } if x.PublicKey != nil { value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Attestation_public_key, value) { + if !f(fd_Assertion_public_key, value) { return } } if x.Origin != "" { value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Attestation_origin, value) { + if !f(fd_Assertion_origin, value) { return } } if x.Subject != "" { value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Attestation_subject, value) { + if !f(fd_Assertion_subject, value) { return } } if x.Metadata != nil { value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) - if !f(fd_Attestation_metadata, value) { + if !f(fd_Assertion_metadata, value) { return } } @@ -1049,25 +1237,25 @@ func (x *fastReflection_Attestation) Range(f func(protoreflect.FieldDescriptor, // 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_Attestation) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Assertion) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Attestation.id": + case "did.v1.Assertion.id": return x.Id != "" - case "did.v1.Attestation.controller": + case "did.v1.Assertion.controller": return x.Controller != "" - case "did.v1.Attestation.public_key": + case "did.v1.Assertion.public_key": return x.PublicKey != nil - case "did.v1.Attestation.origin": + case "did.v1.Assertion.origin": return x.Origin != "" - case "did.v1.Attestation.subject": + case "did.v1.Assertion.subject": return x.Subject != "" - case "did.v1.Attestation.metadata": + case "did.v1.Assertion.metadata": return x.Metadata != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) } - panic(fmt.Errorf("message did.v1.Attestation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) } } @@ -1077,25 +1265,25 @@ func (x *fastReflection_Attestation) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Attestation) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Assertion) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Attestation.id": + case "did.v1.Assertion.id": x.Id = "" - case "did.v1.Attestation.controller": + case "did.v1.Assertion.controller": x.Controller = "" - case "did.v1.Attestation.public_key": + case "did.v1.Assertion.public_key": x.PublicKey = nil - case "did.v1.Attestation.origin": + case "did.v1.Assertion.origin": x.Origin = "" - case "did.v1.Attestation.subject": + case "did.v1.Assertion.subject": x.Subject = "" - case "did.v1.Attestation.metadata": + case "did.v1.Assertion.metadata": x.Metadata = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) } - panic(fmt.Errorf("message did.v1.Attestation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) } } @@ -1105,31 +1293,31 @@ func (x *fastReflection_Attestation) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Attestation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Assertion) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Attestation.id": + case "did.v1.Assertion.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Attestation.controller": + case "did.v1.Assertion.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Attestation.public_key": + case "did.v1.Assertion.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.Attestation.origin": + case "did.v1.Assertion.origin": value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.Attestation.subject": + case "did.v1.Assertion.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.Attestation.metadata": + case "did.v1.Assertion.metadata": value := x.Metadata return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) } - panic(fmt.Errorf("message did.v1.Attestation does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", descriptor.FullName())) } } @@ -1143,25 +1331,25 @@ func (x *fastReflection_Attestation) Get(descriptor protoreflect.FieldDescriptor // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Attestation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Assertion) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Attestation.id": + case "did.v1.Assertion.id": x.Id = value.Interface().(string) - case "did.v1.Attestation.controller": + case "did.v1.Assertion.controller": x.Controller = value.Interface().(string) - case "did.v1.Attestation.public_key": + case "did.v1.Assertion.public_key": x.PublicKey = value.Message().Interface().(*PubKey) - case "did.v1.Attestation.origin": + case "did.v1.Assertion.origin": x.Origin = value.Interface().(string) - case "did.v1.Attestation.subject": + case "did.v1.Assertion.subject": x.Subject = value.Interface().(string) - case "did.v1.Attestation.metadata": + case "did.v1.Assertion.metadata": x.Metadata = value.Message().Interface().(*Metadata) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) } - panic(fmt.Errorf("message did.v1.Attestation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) } } @@ -1175,68 +1363,68 @@ func (x *fastReflection_Attestation) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Attestation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Assertion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Attestation.public_key": + case "did.v1.Assertion.public_key": if x.PublicKey == nil { x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.Attestation.metadata": + case "did.v1.Assertion.metadata": if x.Metadata == nil { x.Metadata = new(Metadata) } return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) - case "did.v1.Attestation.id": - panic(fmt.Errorf("field id of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.controller": - panic(fmt.Errorf("field controller of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.origin": - panic(fmt.Errorf("field origin of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.subject": - panic(fmt.Errorf("field subject of message did.v1.Attestation is not mutable")) + case "did.v1.Assertion.id": + panic(fmt.Errorf("field id of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.controller": + panic(fmt.Errorf("field controller of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.origin": + panic(fmt.Errorf("field origin of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.subject": + panic(fmt.Errorf("field subject of message did.v1.Assertion is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) } - panic(fmt.Errorf("message did.v1.Attestation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Attestation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Assertion) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Attestation.id": + case "did.v1.Assertion.id": return protoreflect.ValueOfString("") - case "did.v1.Attestation.controller": + case "did.v1.Assertion.controller": return protoreflect.ValueOfString("") - case "did.v1.Attestation.public_key": + case "did.v1.Assertion.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.Attestation.origin": + case "did.v1.Assertion.origin": return protoreflect.ValueOfString("") - case "did.v1.Attestation.subject": + case "did.v1.Assertion.subject": return protoreflect.ValueOfString("") - case "did.v1.Attestation.metadata": + case "did.v1.Assertion.metadata": m := new(Metadata) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) } - panic(fmt.Errorf("message did.v1.Attestation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Assertion does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Attestation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Assertion) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Attestation", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Assertion", d.FullName())) } panic("unreachable") } @@ -1244,7 +1432,7 @@ func (x *fastReflection_Attestation) WhichOneof(d protoreflect.OneofDescriptor) // 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_Attestation) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Assertion) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1255,7 +1443,7 @@ func (x *fastReflection_Attestation) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Attestation) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Assertion) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1267,7 +1455,7 @@ func (x *fastReflection_Attestation) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_Attestation) IsValid() bool { +func (x *fastReflection_Assertion) IsValid() bool { return x != nil } @@ -1277,9 +1465,9 @@ func (x *fastReflection_Attestation) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Attestation) + x := input.Message.Interface().(*Assertion) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1325,7 +1513,7 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Attestation) + x := input.Message.Interface().(*Assertion) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1411,7 +1599,7 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Attestation) + x := input.Message.Interface().(*Assertion) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1443,10 +1631,10 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Attestation: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assertion: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Attestation: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4405,8 +4593,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) -type Assertion struct { +// Authentication represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) +type Authentication struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -4417,22 +4605,136 @@ type Assertion struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The value of the linked identifier - CredentialId []byte `protobuf:"bytes,4,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` - // The display label of the attestation - CredentialLabel string `protobuf:"bytes,5,opt,name=credential_label,json=credentialLabel,proto3" json:"credential_label,omitempty"` // The origin of the attestation - Origin string `protobuf:"bytes,6,opt,name=origin,proto3" json:"origin,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` // The subject of the attestation - Subject string `protobuf:"bytes,7,opt,name=subject,proto3" json:"subject,omitempty"` + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // The value of the linked identifier + CredentialId []byte `protobuf:"bytes,6,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + // The credential label + CredentialLabel string `protobuf:"bytes,7,opt,name=credential_label,json=credentialLabel,proto3" json:"credential_label,omitempty"` + // The display label of the attestation + CredentialTransport []string `protobuf:"bytes,8,rep,name=credential_transport,json=credentialTransport,proto3" json:"credential_transport,omitempty"` + // The attestationtype of the attestation + AttestationType string `protobuf:"bytes,9,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` // Metadata is optional additional information about the assertion - Metadata *Metadata `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *Metadata `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Authentication) Reset() { + *x = Authentication{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_state_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Authentication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Authentication) ProtoMessage() {} + +// Deprecated: Use Authentication.ProtoReflect.Descriptor instead. +func (*Authentication) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{0} +} + +func (x *Authentication) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Authentication) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *Authentication) GetPublicKey() *PubKey { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *Authentication) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Authentication) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *Authentication) GetCredentialId() []byte { + if x != nil { + return x.CredentialId + } + return nil +} + +func (x *Authentication) GetCredentialLabel() string { + if x != nil { + return x.CredentialLabel + } + return "" +} + +func (x *Authentication) GetCredentialTransport() []string { + if x != nil { + return x.CredentialTransport + } + return nil +} + +func (x *Authentication) GetAttestationType() string { + if x != nil { + return x.AttestationType + } + return "" +} + +func (x *Authentication) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// Assertion represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) +type Assertion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of the attestation + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The value of the linked identifier + PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The origin of the attestation + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // The subject of the attestation + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // The controller of the attestation + Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *Assertion) Reset() { *x = Assertion{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[0] + mi := &file_did_v1_state_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4446,7 +4748,7 @@ func (*Assertion) ProtoMessage() {} // Deprecated: Use Assertion.ProtoReflect.Descriptor instead. func (*Assertion) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{0} + return file_did_v1_state_proto_rawDescGZIP(), []int{1} } func (x *Assertion) GetId() string { @@ -4470,20 +4772,6 @@ func (x *Assertion) GetPublicKey() *PubKey { return nil } -func (x *Assertion) GetCredentialId() []byte { - if x != nil { - return x.CredentialId - } - return nil -} - -func (x *Assertion) GetCredentialLabel() string { - if x != nil { - return x.CredentialLabel - } - return "" -} - func (x *Assertion) GetOrigin() string { if x != nil { return x.Origin @@ -4505,88 +4793,6 @@ func (x *Assertion) GetMetadata() *Metadata { return nil } -// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) -type Attestation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The unique identifier of the attestation - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // The value of the linked identifier - PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The origin of the attestation - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // The subject of the attestation - Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` - // The controller of the attestation - Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *Attestation) Reset() { - *x = Attestation{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Attestation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Attestation) ProtoMessage() {} - -// Deprecated: Use Attestation.ProtoReflect.Descriptor instead. -func (*Attestation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{1} -} - -func (x *Attestation) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Attestation) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *Attestation) GetPublicKey() *PubKey { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Attestation) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *Attestation) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -func (x *Attestation) GetMetadata() *Metadata { - if x != nil { - return x.Metadata - } - return nil -} - // Controller represents a Sonr DWN Vault type Controller struct { state protoimpl.MessageState @@ -4860,121 +5066,127 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xfc, 0x02, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2d, - 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, - 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x60, 0xf2, - 0x9e, 0xd3, 0x8e, 0x03, 0x5a, 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, 0x12, 0x17, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x02, 0x18, 0x01, 0x12, 0x21, 0x0a, 0x1b, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x10, 0x03, 0x18, 0x01, 0x18, 0x01, 0x22, - 0x8b, 0x02, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, - 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, - 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x16, - 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x3d, - 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x37, 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, 0x12, 0x17, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x02, 0x18, 0x01, 0x18, 0x02, 0x22, 0xcc, 0x01, - 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, - 0x73, 0x18, 0x03, 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, 0x04, + 0x22, 0xdf, 0x03, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 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, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x14, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x13, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x3a, 0x60, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x5a, 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, 0x12, 0x17, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x02, 0x18, 0x01, 0x12, 0x21, 0x0a, + 0x1b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x63, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x10, 0x03, 0x18, 0x01, + 0x18, 0x01, 0x22, 0x89, 0x02, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, - 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x3a, 0x2e, 0xf2, 0x9e, - 0xd3, 0x8e, 0x03, 0x28, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x76, 0x61, 0x75, - 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x10, 0x02, 0x18, 0x01, 0x18, 0x03, 0x22, 0xde, 0x02, 0x0a, - 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 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, 0x27, 0x0a, 0x0f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x49, 0x64, 0x3a, 0x67, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x61, 0x0a, 0x04, 0x0a, 0x02, - 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x18, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x2c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x10, 0x01, - 0x18, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x10, 0x02, - 0x18, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x10, 0x03, 0x18, 0x04, 0x22, 0xe6, 0x03, - 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x69, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, 0x72, - 0x69, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x35, 0x0a, - 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x3d, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x37, 0x0a, - 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, - 0x75, 0x72, 0x69, 0x10, 0x01, 0x18, 0x01, 0x12, 0x1b, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x69, - 0x10, 0x02, 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, + 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, + 0x3d, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x37, 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, 0x12, 0x17, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x02, 0x18, 0x01, 0x18, 0x02, 0x22, 0xcc, + 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x65, 0x73, 0x18, 0x03, 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, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x3a, 0x2e, 0xf2, + 0x9e, 0xd3, 0x8e, 0x03, 0x28, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x10, 0x02, 0x18, 0x01, 0x18, 0x03, 0x22, 0xde, 0x02, + 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 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, 0x27, 0x0a, 0x0f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x3a, 0x67, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x61, 0x0a, 0x04, 0x0a, + 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x18, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x10, + 0x01, 0x18, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x10, + 0x02, 0x18, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x10, 0x03, 0x18, 0x04, 0x22, 0xe6, + 0x03, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, + 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, + 0x72, 0x69, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x35, + 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x3d, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x37, + 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x5f, 0x75, 0x72, 0x69, 0x10, 0x01, 0x18, 0x01, 0x12, 0x1b, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, + 0x69, 0x10, 0x02, 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 ( @@ -4991,21 +5203,21 @@ func file_did_v1_state_proto_rawDescGZIP() []byte { var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_did_v1_state_proto_goTypes = []interface{}{ - (*Assertion)(nil), // 0: did.v1.Assertion - (*Attestation)(nil), // 1: did.v1.Attestation - (*Controller)(nil), // 2: did.v1.Controller - (*Delegation)(nil), // 3: did.v1.Delegation - (*ServiceRecord)(nil), // 4: did.v1.ServiceRecord - nil, // 5: did.v1.ServiceRecord.ServiceEndpointsEntry - (*PubKey)(nil), // 6: did.v1.PubKey - (*Metadata)(nil), // 7: did.v1.Metadata - (*Permissions)(nil), // 8: did.v1.Permissions + (*Authentication)(nil), // 0: did.v1.Authentication + (*Assertion)(nil), // 1: did.v1.Assertion + (*Controller)(nil), // 2: did.v1.Controller + (*Delegation)(nil), // 3: did.v1.Delegation + (*ServiceRecord)(nil), // 4: did.v1.ServiceRecord + nil, // 5: did.v1.ServiceRecord.ServiceEndpointsEntry + (*PubKey)(nil), // 6: did.v1.PubKey + (*Metadata)(nil), // 7: did.v1.Metadata + (*Permissions)(nil), // 8: did.v1.Permissions } var file_did_v1_state_proto_depIdxs = []int32{ - 6, // 0: did.v1.Assertion.public_key:type_name -> did.v1.PubKey - 7, // 1: did.v1.Assertion.metadata:type_name -> did.v1.Metadata - 6, // 2: did.v1.Attestation.public_key:type_name -> did.v1.PubKey - 7, // 3: did.v1.Attestation.metadata:type_name -> did.v1.Metadata + 6, // 0: did.v1.Authentication.public_key:type_name -> did.v1.PubKey + 7, // 1: did.v1.Authentication.metadata:type_name -> did.v1.Metadata + 6, // 2: did.v1.Assertion.public_key:type_name -> did.v1.PubKey + 7, // 3: did.v1.Assertion.metadata:type_name -> did.v1.Metadata 6, // 4: did.v1.Controller.public_key:type_name -> did.v1.PubKey 6, // 5: did.v1.Delegation.public_key:type_name -> did.v1.PubKey 5, // 6: did.v1.ServiceRecord.service_endpoints:type_name -> did.v1.ServiceRecord.ServiceEndpointsEntry @@ -5027,7 +5239,7 @@ func file_did_v1_state_proto_init() { file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Assertion); i { + switch v := v.(*Authentication); i { case 0: return &v.state case 1: @@ -5039,7 +5251,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Attestation); i { + switch v := v.(*Assertion); i { case 0: return &v.state case 1: diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index 932a8e88c..18eadecba 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -954,7 +954,7 @@ var ( md_MsgAllocateVault protoreflect.MessageDescriptor fd_MsgAllocateVault_authority protoreflect.FieldDescriptor fd_MsgAllocateVault_subject protoreflect.FieldDescriptor - fd_MsgAllocateVault_token protoreflect.FieldDescriptor + fd_MsgAllocateVault_origin protoreflect.FieldDescriptor ) func init() { @@ -962,7 +962,7 @@ func init() { md_MsgAllocateVault = File_did_v1_tx_proto.Messages().ByName("MsgAllocateVault") fd_MsgAllocateVault_authority = md_MsgAllocateVault.Fields().ByName("authority") fd_MsgAllocateVault_subject = md_MsgAllocateVault.Fields().ByName("subject") - fd_MsgAllocateVault_token = md_MsgAllocateVault.Fields().ByName("token") + fd_MsgAllocateVault_origin = md_MsgAllocateVault.Fields().ByName("origin") } var _ protoreflect.Message = (*fastReflection_MsgAllocateVault)(nil) @@ -1042,9 +1042,9 @@ func (x *fastReflection_MsgAllocateVault) Range(f func(protoreflect.FieldDescrip return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) - if !f(fd_MsgAllocateVault_token, value) { + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_MsgAllocateVault_origin, value) { return } } @@ -1067,8 +1067,8 @@ func (x *fastReflection_MsgAllocateVault) Has(fd protoreflect.FieldDescriptor) b return x.Authority != "" case "did.v1.MsgAllocateVault.subject": return x.Subject != "" - case "did.v1.MsgAllocateVault.token": - return x.Token != nil + case "did.v1.MsgAllocateVault.origin": + return x.Origin != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) @@ -1089,8 +1089,8 @@ func (x *fastReflection_MsgAllocateVault) Clear(fd protoreflect.FieldDescriptor) x.Authority = "" case "did.v1.MsgAllocateVault.subject": x.Subject = "" - case "did.v1.MsgAllocateVault.token": - x.Token = nil + case "did.v1.MsgAllocateVault.origin": + x.Origin = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) @@ -1113,9 +1113,9 @@ func (x *fastReflection_MsgAllocateVault) Get(descriptor protoreflect.FieldDescr case "did.v1.MsgAllocateVault.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.MsgAllocateVault.token": - value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.MsgAllocateVault.origin": + value := x.Origin + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) @@ -1140,8 +1140,8 @@ func (x *fastReflection_MsgAllocateVault) Set(fd protoreflect.FieldDescriptor, v x.Authority = value.Interface().(string) case "did.v1.MsgAllocateVault.subject": x.Subject = value.Interface().(string) - case "did.v1.MsgAllocateVault.token": - x.Token = value.Message().Interface().(*Token) + case "did.v1.MsgAllocateVault.origin": + x.Origin = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) @@ -1162,15 +1162,12 @@ func (x *fastReflection_MsgAllocateVault) Set(fd protoreflect.FieldDescriptor, v // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAllocateVault) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgAllocateVault.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgAllocateVault.authority": panic(fmt.Errorf("field authority of message did.v1.MsgAllocateVault is not mutable")) case "did.v1.MsgAllocateVault.subject": panic(fmt.Errorf("field subject of message did.v1.MsgAllocateVault is not mutable")) + case "did.v1.MsgAllocateVault.origin": + panic(fmt.Errorf("field origin of message did.v1.MsgAllocateVault is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) @@ -1188,9 +1185,8 @@ func (x *fastReflection_MsgAllocateVault) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfString("") case "did.v1.MsgAllocateVault.subject": return protoreflect.ValueOfString("") - case "did.v1.MsgAllocateVault.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.MsgAllocateVault.origin": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) @@ -1268,8 +1264,8 @@ func (x *fastReflection_MsgAllocateVault) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Origin) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1301,17 +1297,10 @@ func (x *fastReflection_MsgAllocateVault) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - 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))) + 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 } @@ -1444,9 +1433,9 @@ func (x *fastReflection_MsgAllocateVault) 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 Token", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", 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 @@ -1456,27 +1445,23 @@ func (x *fastReflection_MsgAllocateVault) 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1514,9 +1499,10 @@ func (x *fastReflection_MsgAllocateVault) ProtoMethods() *protoiface.Methods { } var ( - md_MsgAllocateVaultResponse protoreflect.MessageDescriptor - fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor - fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor + md_MsgAllocateVaultResponse protoreflect.MessageDescriptor + fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_registration_options protoreflect.FieldDescriptor ) func init() { @@ -1524,6 +1510,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") } var _ protoreflect.Message = (*fastReflection_MsgAllocateVaultResponse)(nil) @@ -1603,6 +1590,12 @@ 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) { + return + } + } } // Has reports whether a field is populated. @@ -1622,6 +1615,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 != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) @@ -1642,6 +1637,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 = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) @@ -1664,6 +1661,9 @@ 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 + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) @@ -1688,6 +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) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) @@ -1712,6 +1714,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")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) @@ -1729,6 +1733,8 @@ 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": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) @@ -1805,6 +1811,10 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met if x.ExpiryBlock != 0 { n += 1 + runtime.Sov(uint64(x.ExpiryBlock)) } + l = len(x.RegistrationOptions) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1834,6 +1844,13 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.RegistrationOptions) > 0 { + i -= len(x.RegistrationOptions) + copy(dAtA[i:], x.RegistrationOptions) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RegistrationOptions))) + i-- + dAtA[i] = 0x1a + } if x.ExpiryBlock != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryBlock)) i-- @@ -1946,6 +1963,38 @@ func (x *fastReflection_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Met break } } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", 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.RegistrationOptions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -8389,8 +8438,8 @@ type MsgAllocateVault struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // subject is a unique human-defined identifier to associate with the vault. Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` - // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + // origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` } func (x *MsgAllocateVault) Reset() { @@ -8427,11 +8476,11 @@ func (x *MsgAllocateVault) GetSubject() string { return "" } -func (x *MsgAllocateVault) GetToken() *Token { +func (x *MsgAllocateVault) GetOrigin() string { if x != nil { - return x.Token + return x.Origin } - return nil + return "" } // MsgAllocateVaultResponse is the response type for the AllocateVault RPC. @@ -8444,6 +8493,8 @@ type MsgAllocateVaultResponse struct { Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` // 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"` } func (x *MsgAllocateVaultResponse) Reset() { @@ -8480,6 +8531,13 @@ func (x *MsgAllocateVaultResponse) GetExpiryBlock() int64 { return 0 } +func (x *MsgAllocateVaultResponse) GetRegistrationOptions() string { + if x != nil { + return x.RegistrationOptions + } + return "" +} + // MsgProveWitness is the message type for the ProveWitness RPC. type MsgProveWitness struct { state protoimpl.MessageState @@ -9057,191 +9115,192 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 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, 0x16, 0x64, - 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 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, 0xac, 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, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x99, 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, + 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, 0xac, + 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, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x82, 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, 0x22, 0xb4, 0x01, 0x0a, + 0x0f, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 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, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x23, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x4f, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, + 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 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, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x22, 0x7e, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x56, + 0x61, 0x75, 0x6c, 0x74, 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, 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, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, - 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x4f, 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, 0x22, 0xb4, 0x01, - 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, - 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, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, - 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x22, 0x4f, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, - 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 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, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0x7e, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, - 0x56, 0x61, 0x75, 0x6c, 0x74, 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, - 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x30, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, - 0x56, 0x61, 0x75, 0x6c, 0x74, 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, 0x22, 0xea, 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, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 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, 0x3a, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, - 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 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, + 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x23, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x30, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x56, + 0x61, 0x75, 0x6c, 0x74, 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, 0x22, 0xea, 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, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 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, 0x3a, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, 0x23, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 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, 0x81, 0x02, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 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, 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, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 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, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x55, 0x0a, 0x14, 0x4d, + 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 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, 0x23, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0xc4, 0x03, 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, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x72, + 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x55, + 0x72, 0x69, 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, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x5d, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 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, + 0x72, 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, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 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, 0x81, 0x02, 0x0a, 0x0c, 0x4d, 0x73, 0x67, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 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, 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, 0x32, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 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, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, - 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x55, 0x0a, 0x14, - 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 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, 0x23, - 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0xc4, 0x03, 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, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x75, - 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x55, 0x72, 0x69, 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, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x5d, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, - 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 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, 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, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 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, 0xd4, 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, 0x3f, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 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, 0x3f, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63, 0x56, 0x61, 0x75, 0x6c, - 0x74, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, - 0x6e, 0x63, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 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, + 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, 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, 0xd4, 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, 0x3f, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x7a, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 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, 0x3f, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63, 0x56, 0x61, 0x75, 0x6c, 0x74, + 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, + 0x63, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 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, 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, + 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 ( @@ -9283,35 +9342,34 @@ var file_did_v1_tx_proto_goTypes = []interface{}{ var file_did_v1_tx_proto_depIdxs = []int32{ 16, // 0: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params 17, // 1: did.v1.MsgUpdateParams.token:type_name -> did.v1.Token - 17, // 2: did.v1.MsgAllocateVault.token:type_name -> did.v1.Token - 17, // 3: did.v1.MsgProveWitness.token:type_name -> did.v1.Token - 17, // 4: did.v1.MsgSyncVault.token:type_name -> did.v1.Token - 18, // 5: did.v1.MsgRegisterController.authentication:type_name -> did.v1.Credential - 17, // 6: did.v1.MsgRegisterController.token:type_name -> did.v1.Token - 14, // 7: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry - 17, // 8: did.v1.MsgAuthorize.token:type_name -> did.v1.Token - 17, // 9: did.v1.MsgAuthorizeResponse.token:type_name -> did.v1.Token - 19, // 10: did.v1.MsgRegisterService.scopes:type_name -> did.v1.Permissions - 15, // 11: did.v1.MsgRegisterService.service_endpoints:type_name -> did.v1.MsgRegisterService.ServiceEndpointsEntry - 20, // 12: did.v1.MsgRegisterService.metadata:type_name -> did.v1.Metadata - 17, // 13: did.v1.MsgRegisterService.token:type_name -> did.v1.Token - 0, // 14: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams - 10, // 15: did.v1.Msg.Authorize:input_type -> did.v1.MsgAuthorize - 2, // 16: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault - 6, // 17: did.v1.Msg.SyncVault:input_type -> did.v1.MsgSyncVault - 8, // 18: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController - 12, // 19: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService - 1, // 20: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse - 11, // 21: did.v1.Msg.Authorize:output_type -> did.v1.MsgAuthorizeResponse - 3, // 22: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse - 7, // 23: did.v1.Msg.SyncVault:output_type -> did.v1.MsgSyncVaultResponse - 9, // 24: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse - 13, // 25: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse - 20, // [20:26] is the sub-list for method output_type - 14, // [14:20] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 17, // 2: did.v1.MsgProveWitness.token:type_name -> did.v1.Token + 17, // 3: did.v1.MsgSyncVault.token:type_name -> did.v1.Token + 18, // 4: did.v1.MsgRegisterController.authentication:type_name -> did.v1.Credential + 17, // 5: did.v1.MsgRegisterController.token:type_name -> did.v1.Token + 14, // 6: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry + 17, // 7: did.v1.MsgAuthorize.token:type_name -> did.v1.Token + 17, // 8: did.v1.MsgAuthorizeResponse.token:type_name -> did.v1.Token + 19, // 9: did.v1.MsgRegisterService.scopes:type_name -> did.v1.Permissions + 15, // 10: did.v1.MsgRegisterService.service_endpoints:type_name -> did.v1.MsgRegisterService.ServiceEndpointsEntry + 20, // 11: did.v1.MsgRegisterService.metadata:type_name -> did.v1.Metadata + 17, // 12: did.v1.MsgRegisterService.token:type_name -> did.v1.Token + 0, // 13: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams + 10, // 14: did.v1.Msg.Authorize:input_type -> did.v1.MsgAuthorize + 2, // 15: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault + 6, // 16: did.v1.Msg.SyncVault:input_type -> did.v1.MsgSyncVault + 8, // 17: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController + 12, // 18: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService + 1, // 19: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse + 11, // 20: did.v1.Msg.Authorize:output_type -> did.v1.MsgAuthorizeResponse + 3, // 21: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse + 7, // 22: did.v1.Msg.SyncVault:output_type -> did.v1.MsgSyncVaultResponse + 9, // 23: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse + 13, // 24: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse + 19, // [19:25] is the sub-list for method output_type + 13, // [13:19] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_did_v1_tx_proto_init() } @@ -9319,7 +9377,6 @@ func file_did_v1_tx_proto_init() { if File_did_v1_tx_proto != nil { return } - file_did_v1_constants_proto_init() file_did_v1_genesis_proto_init() file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { diff --git a/app/app.go b/app/app.go index 92be31c31..4b869ce18 100644 --- a/app/app.go +++ b/app/app.go @@ -1123,6 +1123,9 @@ func NewChainApp( _ = ctx } + + // Start the frontend + // go app.ServeFrontend() return app } diff --git a/cmd/dwn/index.templ b/cmd/dwn/index.templ new file mode 100644 index 000000000..39ad31172 --- /dev/null +++ b/cmd/dwn/index.templ @@ -0,0 +1,28 @@ +package main + +templ VaultIndex() { + + + + + + Sonr Vault + + + +

Sonr Vault

+ + +} diff --git a/cmd/dwn/index_templ.go b/cmd/dwn/index_templ.go new file mode 100644 index 000000000..f9f127038 --- /dev/null +++ b/cmd/dwn/index_templ.go @@ -0,0 +1,37 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package main + +//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" + +func VaultIndex() 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_Err = templ_7745c5c3_Buffer.WriteString("Sonr Vault

Sonr Vault

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/cmd/dwn/main.go b/cmd/dwn/main.go new file mode 100644 index 000000000..4f6f9d31c --- /dev/null +++ b/cmd/dwn/main.go @@ -0,0 +1,43 @@ +//go:build js && wasm +// +build js,wasm + +package main + +import ( + "errors" + + "github.com/labstack/echo/v4" + wasmhttp "github.com/nlepage/go-wasm-http-server" + + "github.com/onsonr/sonr/internal/db" +) + +var edb *db.DB + +func main() { + // Initialize the database + initDB() + + e := echo.New() + e.POST("/api/insert/:account/:address", itemsHandler) + wasmhttp.Serve(e) +} + +func initDB() { + var err error + edb, err = db.Open(db.New()) + if err != nil { + panic(err.Error()) + } +} + +func itemsHandler(e echo.Context) error { + switch e.Request().Method { + case "GET": + case "POST": + edb.AddAccount(e.Param("account"), e.Param("address")) + default: + e.Error(errors.New("Method not allowed")) + } + return e.JSON(200, "OK") +} diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 8b78410a0..4f418fe0d 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -13,7 +13,7 @@ import ( func main() { rootCmd := NewRootCmd() - rootCmd.AddCommand(tui.NewBuildProtoMsgCmd()) + rootCmd.AddCommand(tui.NewTUIDashboardCmd()) // rootCmd.AddCommand(tui.NewExplorerCmd()) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { diff --git a/cmd/sonrd/root.go b/cmd/sonrd/root.go index fa5fffa5f..9c0d5af24 100644 --- a/cmd/sonrd/root.go +++ b/cmd/sonrd/root.go @@ -3,11 +3,8 @@ package main import ( "os" - dbm "github.com/cosmos/cosmos-db" - "github.com/spf13/cobra" - "cosmossdk.io/log" - + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -19,11 +16,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/spf13/cobra" "github.com/onsonr/sonr/app" "github.com/onsonr/sonr/app/params" - // NewRootCmd creates a new root command for chain app. It is called once in the - // main function. ) func NewRootCmd() *cobra.Command { @@ -34,14 +30,14 @@ func NewRootCmd() *cobra.Command { cfg.Seal() // we "pre"-instantiate the application for getting the injected/configured encoding configuration // note, this is not necessary when using app wiring, as depinject can be directly used (see root_v2.go) - tempApp := app.NewChainApp( + preApp := app.NewChainApp( log.NewNopLogger(), dbm.NewMemDB(), nil, false, simtestutil.NewAppOptionsWithFlagHome(tempDir()), ) encodingConfig := params.EncodingConfig{ - InterfaceRegistry: tempApp.InterfaceRegistry(), - Codec: tempApp.AppCodec(), - TxConfig: tempApp.TxConfig(), - Amino: tempApp.LegacyAmino(), + InterfaceRegistry: preApp.InterfaceRegistry(), + Codec: preApp.AppCodec(), + TxConfig: preApp.TxConfig(), + Amino: preApp.LegacyAmino(), } initClientCtx := client.Context{}. @@ -109,10 +105,10 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, tempApp.BasicModuleManager) + initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, preApp.BasicModuleManager) // add keyring to autocli opts - autoCliOpts := tempApp.AutoCliOpts() + autoCliOpts := preApp.AutoCliOpts() initClientCtx, _ = config.ReadFromClientConfig(initClientCtx) autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring) autoCliOpts.ClientCtx = initClientCtx diff --git a/cmd/vault/main.go b/cmd/vault/main.go deleted file mode 100644 index 8b990aa4a..000000000 --- a/cmd/vault/main.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package main - -import ( - "database/sql" - "encoding/json" - "fmt" - "net/http" - - wasmhttp "github.com/nlepage/go-wasm-http-server" -) - -var db *sql.DB - -func main() { - // Initialize the database - initDB() - - // Define your handlers - http.HandleFunc("/", homeHandler) - http.HandleFunc("/api/items", itemsHandler) - - // Use wasmhttp.Serve to start the server - wasmhttp.Serve(nil) -} - -func initDB() { - _, err := db.Exec(` - CREATE TABLE IF NOT EXISTS items ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - name TEXT NOT NULL - ) - `) - if err != nil { - panic(err) - } -} - -func homeHandler(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Welcome to the WASM SQLite Server!") -} - -func itemsHandler(w http.ResponseWriter, r *http.Request) { - switch r.Method { - case "GET": - getItems(w, r) - case "POST": - addItem(w, r) - default: - http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) - } -} - -func getItems(w http.ResponseWriter, _ *http.Request) { - rows, err := db.Query("SELECT id, name FROM items") - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - defer rows.Close() - - var items []map[string]interface{} - for rows.Next() { - var id int - var name string - if err := rows.Scan(&id, &name); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - items = append(items, map[string]interface{}{"id": id, "name": name}) - } - - json.NewEncoder(w).Encode(items) -} - -func addItem(w http.ResponseWriter, r *http.Request) { - var item struct { - Name string `json:"name"` - } - if err := json.NewDecoder(r.Body).Decode(&item); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - result, err := db.Exec("INSERT INTO items (name) VALUES (?)", item.Name) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - id, _ := result.LastInsertId() - json.NewEncoder(w).Encode(map[string]interface{}{"id": id, "name": item.Name}) -} diff --git a/devbox.json b/devbox.json index d47054649..ddf90b9b0 100644 --- a/devbox.json +++ b/devbox.json @@ -6,7 +6,8 @@ "commitizen@latest", "goreleaser@latest", "go-task@latest", - "bun@latest" + "bun@latest", + "ipfs-cluster@latest" ], "env": { "GOPATH": "$HOME/go", @@ -19,12 +20,26 @@ }, "shell": { "scripts": { - "init": ["make install", "sh ./scripts/test_node.sh"], - "gen": ["make proto-gen", "make vault", "make templ"], - "build": ["make build", "make local-image"], - "testnet": ["make install", "make sh-testnet"], - "explorer": ["make explorer"], - "pkl-eval": ["bunx pkl eval ./pkl/msgs.pkl"] + "init": [ + "make install", + "sh ./scripts/test_node.sh" + ], + "gen": [ + "make proto-gen", + "make templ", + "make dwn" + ], + "build": [ + "make build", + "make local-image" + ], + "testnet": [ + "make install", + "devbox services up" + ], + "pkl-eval": [ + "bunx pkl eval ./pkl/msgs.pkl" + ] } } } diff --git a/docker-compose.yaml b/docker-compose.yaml index 5f60f669c..1fc1bfe15 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,8 +23,8 @@ services: command: "start --pruning=nothing" restart: always networks: - - dokploy-network + - sonr-network networks: - dokploy-network: - external: true + sonr-network: + name: sonr-network diff --git a/gen/vault/Account.pkl.go b/gen/vault/Account.pkl.go new file mode 100644 index 000000000..f893ef200 --- /dev/null +++ b/gen/vault/Account.pkl.go @@ -0,0 +1,58 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import "github.com/apple/pkl-go/pkl" + +type Account interface { + Model + + GetId() uint + + GetName() string + + GetAddress() string + + GetPublicKey() *pkl.Object + + GetCreatedAt() *string +} + +var _ Account = (*AccountImpl)(nil) + +type AccountImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Name string `pkl:"name" json:"name,omitempty"` + + Address string `pkl:"address" json:"address,omitempty"` + + PublicKey *pkl.Object `pkl:"publicKey" json:"publicKey,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` +} + +func (rcv *AccountImpl) GetTable() string { + return rcv.Table +} + +func (rcv *AccountImpl) GetId() uint { + return rcv.Id +} + +func (rcv *AccountImpl) GetName() string { + return rcv.Name +} + +func (rcv *AccountImpl) GetAddress() string { + return rcv.Address +} + +func (rcv *AccountImpl) GetPublicKey() *pkl.Object { + return rcv.PublicKey +} + +func (rcv *AccountImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} diff --git a/gen/vault/Asset.pkl.go b/gen/vault/Asset.pkl.go new file mode 100644 index 000000000..cc2571131 --- /dev/null +++ b/gen/vault/Asset.pkl.go @@ -0,0 +1,64 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Asset interface { + Model + + GetId() uint + + GetName() string + + GetSymbol() string + + GetDecimals() int + + GetChainId() *int + + GetCreatedAt() *string +} + +var _ Asset = (*AssetImpl)(nil) + +type AssetImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Name string `pkl:"name" json:"name,omitempty"` + + Symbol string `pkl:"symbol" json:"symbol,omitempty"` + + Decimals int `pkl:"decimals" json:"decimals,omitempty"` + + ChainId *int `pkl:"chainId" json:"chainId,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` +} + +func (rcv *AssetImpl) GetTable() string { + return rcv.Table +} + +func (rcv *AssetImpl) GetId() uint { + return rcv.Id +} + +func (rcv *AssetImpl) GetName() string { + return rcv.Name +} + +func (rcv *AssetImpl) GetSymbol() string { + return rcv.Symbol +} + +func (rcv *AssetImpl) GetDecimals() int { + return rcv.Decimals +} + +func (rcv *AssetImpl) GetChainId() *int { + return rcv.ChainId +} + +func (rcv *AssetImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} diff --git a/gen/vault/Chain.pkl.go b/gen/vault/Chain.pkl.go new file mode 100644 index 000000000..fe4ce4bc3 --- /dev/null +++ b/gen/vault/Chain.pkl.go @@ -0,0 +1,48 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Chain interface { + Model + + GetId() uint + + GetName() string + + GetNetworkId() string + + GetCreatedAt() *string +} + +var _ Chain = (*ChainImpl)(nil) + +type ChainImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Name string `pkl:"name" json:"name,omitempty"` + + NetworkId string `pkl:"networkId" json:"networkId,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` +} + +func (rcv *ChainImpl) GetTable() string { + return rcv.Table +} + +func (rcv *ChainImpl) GetId() uint { + return rcv.Id +} + +func (rcv *ChainImpl) GetName() string { + return rcv.Name +} + +func (rcv *ChainImpl) GetNetworkId() string { + return rcv.NetworkId +} + +func (rcv *ChainImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} diff --git a/gen/vault/Client.pkl.go b/gen/vault/Client.pkl.go new file mode 100644 index 000000000..1ed8f886e --- /dev/null +++ b/gen/vault/Client.pkl.go @@ -0,0 +1,18 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Client interface { + GetChainId() string + + GetKeyringBackend() string + + GetOutput() string + + GetNode() string + + GetBroadcastMode() string + + GetApiUrl() string + + GetAddressPrefix() string +} diff --git a/gen/vault/Credential.pkl.go b/gen/vault/Credential.pkl.go new file mode 100644 index 000000000..8570c89e9 --- /dev/null +++ b/gen/vault/Credential.pkl.go @@ -0,0 +1,146 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import "github.com/apple/pkl-go/pkl" + +type Credential interface { + Model + + GetId() uint + + GetSubject() string + + GetController() string + + GetAttestationType() string + + GetOrigin() string + + GetCredentialId() *pkl.Object + + GetPublicKey() *pkl.Object + + GetTransport() string + + GetSignCount() uint + + GetUserPresent() bool + + GetUserVerified() bool + + GetBackupEligible() bool + + GetBackupState() bool + + GetCloneWarning() bool + + GetCreatedAt() *string + + GetUpdatedAt() *string +} + +var _ Credential = (*CredentialImpl)(nil) + +type CredentialImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Subject string `pkl:"subject" json:"subject,omitempty"` + + Controller string `pkl:"controller" json:"controller,omitempty"` + + AttestationType string `pkl:"attestationType" json:"attestationType,omitempty"` + + Origin string `pkl:"origin" json:"origin,omitempty"` + + CredentialId *pkl.Object `pkl:"credentialId" json:"credentialId,omitempty"` + + PublicKey *pkl.Object `pkl:"publicKey" json:"publicKey,omitempty"` + + Transport string `pkl:"transport" json:"transport,omitempty"` + + SignCount uint `pkl:"signCount" json:"signCount,omitempty"` + + UserPresent bool `pkl:"userPresent" json:"userPresent,omitempty"` + + UserVerified bool `pkl:"userVerified" json:"userVerified,omitempty"` + + BackupEligible bool `pkl:"backupEligible" json:"backupEligible,omitempty"` + + BackupState bool `pkl:"backupState" json:"backupState,omitempty"` + + CloneWarning bool `pkl:"cloneWarning" json:"cloneWarning,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` + + UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty"` +} + +func (rcv *CredentialImpl) GetTable() string { + return rcv.Table +} + +func (rcv *CredentialImpl) GetId() uint { + return rcv.Id +} + +func (rcv *CredentialImpl) GetSubject() string { + return rcv.Subject +} + +func (rcv *CredentialImpl) GetController() string { + return rcv.Controller +} + +func (rcv *CredentialImpl) GetAttestationType() string { + return rcv.AttestationType +} + +func (rcv *CredentialImpl) GetOrigin() string { + return rcv.Origin +} + +func (rcv *CredentialImpl) GetCredentialId() *pkl.Object { + return rcv.CredentialId +} + +func (rcv *CredentialImpl) GetPublicKey() *pkl.Object { + return rcv.PublicKey +} + +func (rcv *CredentialImpl) GetTransport() string { + return rcv.Transport +} + +func (rcv *CredentialImpl) GetSignCount() uint { + return rcv.SignCount +} + +func (rcv *CredentialImpl) GetUserPresent() bool { + return rcv.UserPresent +} + +func (rcv *CredentialImpl) GetUserVerified() bool { + return rcv.UserVerified +} + +func (rcv *CredentialImpl) GetBackupEligible() bool { + return rcv.BackupEligible +} + +func (rcv *CredentialImpl) GetBackupState() bool { + return rcv.BackupState +} + +func (rcv *CredentialImpl) GetCloneWarning() bool { + return rcv.CloneWarning +} + +func (rcv *CredentialImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} + +func (rcv *CredentialImpl) GetUpdatedAt() *string { + return rcv.UpdatedAt +} diff --git a/gen/vault/DB.pkl.go b/gen/vault/DB.pkl.go new file mode 100644 index 000000000..41e93d601 --- /dev/null +++ b/gen/vault/DB.pkl.go @@ -0,0 +1,6 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type DB interface { + GetFilename() string +} diff --git a/gen/vault/Ipfs.pkl.go b/gen/vault/Ipfs.pkl.go new file mode 100644 index 000000000..00339ca55 --- /dev/null +++ b/gen/vault/Ipfs.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Ipfs struct { + ResolverUrl string `pkl:"resolverUrl"` + + IpfsMountPath string `pkl:"ipfsMountPath"` + + IpnsMountPath string `pkl:"ipnsMountPath"` +} diff --git a/gen/vault/Keyshare.pkl.go b/gen/vault/Keyshare.pkl.go new file mode 100644 index 000000000..c134fffa3 --- /dev/null +++ b/gen/vault/Keyshare.pkl.go @@ -0,0 +1,82 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import "github.com/apple/pkl-go/pkl" + +type Keyshare interface { + Model + + GetId() uint + + GetMetadata() string + + GetPayloads() string + + GetProtocol() string + + GetPublicKey() *pkl.Object + + GetRole() int + + GetVersion() int + + GetCreatedAt() *string +} + +var _ Keyshare = (*KeyshareImpl)(nil) + +type KeyshareImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Metadata string `pkl:"metadata" json:"metadata,omitempty"` + + Payloads string `pkl:"payloads" json:"payloads,omitempty"` + + Protocol string `pkl:"protocol" json:"protocol,omitempty"` + + PublicKey *pkl.Object `pkl:"publicKey" json:"publicKey,omitempty"` + + Role int `pkl:"role" json:"role,omitempty"` + + Version int `pkl:"version" json:"version,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` +} + +func (rcv *KeyshareImpl) GetTable() string { + return rcv.Table +} + +func (rcv *KeyshareImpl) GetId() uint { + return rcv.Id +} + +func (rcv *KeyshareImpl) GetMetadata() string { + return rcv.Metadata +} + +func (rcv *KeyshareImpl) GetPayloads() string { + return rcv.Payloads +} + +func (rcv *KeyshareImpl) GetProtocol() string { + return rcv.Protocol +} + +func (rcv *KeyshareImpl) GetPublicKey() *pkl.Object { + return rcv.PublicKey +} + +func (rcv *KeyshareImpl) GetRole() int { + return rcv.Role +} + +func (rcv *KeyshareImpl) GetVersion() int { + return rcv.Version +} + +func (rcv *KeyshareImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} diff --git a/gen/vault/Model.pkl.go b/gen/vault/Model.pkl.go new file mode 100644 index 000000000..6f57ffe7d --- /dev/null +++ b/gen/vault/Model.pkl.go @@ -0,0 +1,6 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Model interface { + GetTable() string +} diff --git a/gen/vault/Permission.pkl.go b/gen/vault/Permission.pkl.go new file mode 100644 index 000000000..a72127f1e --- /dev/null +++ b/gen/vault/Permission.pkl.go @@ -0,0 +1,64 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Permission interface { + Model + + GetId() uint + + GetServiceId() string + + GetGrants() string + + GetScopes() string + + GetCreatedAt() *string + + GetUpdatedAt() *string +} + +var _ Permission = (*PermissionImpl)(nil) + +type PermissionImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + ServiceId string `pkl:"serviceId" json:"serviceId,omitempty"` + + Grants string `pkl:"grants" json:"grants,omitempty"` + + Scopes string `pkl:"scopes" json:"scopes,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` + + UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty"` +} + +func (rcv *PermissionImpl) GetTable() string { + return rcv.Table +} + +func (rcv *PermissionImpl) GetId() uint { + return rcv.Id +} + +func (rcv *PermissionImpl) GetServiceId() string { + return rcv.ServiceId +} + +func (rcv *PermissionImpl) GetGrants() string { + return rcv.Grants +} + +func (rcv *PermissionImpl) GetScopes() string { + return rcv.Scopes +} + +func (rcv *PermissionImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} + +func (rcv *PermissionImpl) GetUpdatedAt() *string { + return rcv.UpdatedAt +} diff --git a/gen/vault/Profile.pkl.go b/gen/vault/Profile.pkl.go new file mode 100644 index 000000000..215274846 --- /dev/null +++ b/gen/vault/Profile.pkl.go @@ -0,0 +1,80 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Profile interface { + Model + + GetId() string + + GetSubject() string + + GetController() string + + GetOriginUri() *string + + GetPublicMetadata() *string + + GetPrivateMetadata() *string + + GetCreatedAt() *string + + GetUpdatedAt() *string +} + +var _ Profile = (*ProfileImpl)(nil) + +type ProfileImpl struct { + Table string `pkl:"table"` + + Id string `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Subject string `pkl:"subject" json:"subject,omitempty"` + + Controller string `pkl:"controller" json:"controller,omitempty"` + + OriginUri *string `pkl:"originUri" json:"originUri,omitempty"` + + PublicMetadata *string `pkl:"publicMetadata" json:"publicMetadata,omitempty"` + + PrivateMetadata *string `pkl:"privateMetadata" json:"privateMetadata,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` + + UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty"` +} + +func (rcv *ProfileImpl) GetTable() string { + return rcv.Table +} + +func (rcv *ProfileImpl) GetId() string { + return rcv.Id +} + +func (rcv *ProfileImpl) GetSubject() string { + return rcv.Subject +} + +func (rcv *ProfileImpl) GetController() string { + return rcv.Controller +} + +func (rcv *ProfileImpl) GetOriginUri() *string { + return rcv.OriginUri +} + +func (rcv *ProfileImpl) GetPublicMetadata() *string { + return rcv.PublicMetadata +} + +func (rcv *ProfileImpl) GetPrivateMetadata() *string { + return rcv.PrivateMetadata +} + +func (rcv *ProfileImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} + +func (rcv *ProfileImpl) GetUpdatedAt() *string { + return rcv.UpdatedAt +} diff --git a/gen/vault/Property.pkl.go b/gen/vault/Property.pkl.go new file mode 100644 index 000000000..9b2b7f948 --- /dev/null +++ b/gen/vault/Property.pkl.go @@ -0,0 +1,58 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import "github.com/apple/pkl-go/pkl" + +type Property interface { + Model + + GetId() uint + + GetProfileId() string + + GetKey() string + + GetAccumulator() *pkl.Object + + GetPropertyKey() *pkl.Object +} + +var _ Property = (*PropertyImpl)(nil) + +type PropertyImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + ProfileId string `pkl:"profileId" json:"profileId,omitempty"` + + Key string `pkl:"key" json:"key,omitempty"` + + Accumulator *pkl.Object `pkl:"accumulator" json:"accumulator,omitempty"` + + PropertyKey *pkl.Object `pkl:"propertyKey" json:"propertyKey,omitempty"` +} + +func (rcv *PropertyImpl) GetTable() string { + return rcv.Table +} + +func (rcv *PropertyImpl) GetId() uint { + return rcv.Id +} + +func (rcv *PropertyImpl) GetProfileId() string { + return rcv.ProfileId +} + +func (rcv *PropertyImpl) GetKey() string { + return rcv.Key +} + +func (rcv *PropertyImpl) GetAccumulator() *pkl.Object { + return rcv.Accumulator +} + +func (rcv *PropertyImpl) GetPropertyKey() *pkl.Object { + return rcv.PropertyKey +} diff --git a/gen/vault/PublicKey.pkl.go b/gen/vault/PublicKey.pkl.go new file mode 100644 index 000000000..a8afeae52 --- /dev/null +++ b/gen/vault/PublicKey.pkl.go @@ -0,0 +1,90 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import "github.com/apple/pkl-go/pkl" + +type PublicKey interface { + Model + + GetId() uint + + GetRole() int + + GetAlgorithm() int + + GetEncoding() int + + GetRaw() *pkl.Object + + GetHex() string + + GetMultibase() string + + GetJwk() *pkl.Object + + GetCreatedAt() *string +} + +var _ PublicKey = (*PublicKeyImpl)(nil) + +type PublicKeyImpl struct { + Table string `pkl:"table"` + + Id uint `pkl:"id" gorm:"primaryKey" json:"id,omitempty"` + + Role int `pkl:"role" json:"role,omitempty"` + + Algorithm int `pkl:"algorithm" json:"algorithm,omitempty"` + + Encoding int `pkl:"encoding" json:"encoding,omitempty"` + + Raw *pkl.Object `pkl:"raw" json:"raw,omitempty"` + + Hex string `pkl:"hex" json:"hex,omitempty"` + + Multibase string `pkl:"multibase" json:"multibase,omitempty"` + + Jwk *pkl.Object `pkl:"jwk" json:"jwk,omitempty"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"` +} + +func (rcv *PublicKeyImpl) GetTable() string { + return rcv.Table +} + +func (rcv *PublicKeyImpl) GetId() uint { + return rcv.Id +} + +func (rcv *PublicKeyImpl) GetRole() int { + return rcv.Role +} + +func (rcv *PublicKeyImpl) GetAlgorithm() int { + return rcv.Algorithm +} + +func (rcv *PublicKeyImpl) GetEncoding() int { + return rcv.Encoding +} + +func (rcv *PublicKeyImpl) GetRaw() *pkl.Object { + return rcv.Raw +} + +func (rcv *PublicKeyImpl) GetHex() string { + return rcv.Hex +} + +func (rcv *PublicKeyImpl) GetMultibase() string { + return rcv.Multibase +} + +func (rcv *PublicKeyImpl) GetJwk() *pkl.Object { + return rcv.Jwk +} + +func (rcv *PublicKeyImpl) GetCreatedAt() *string { + return rcv.CreatedAt +} diff --git a/gen/vault/Sonr.pkl.go b/gen/vault/Sonr.pkl.go new file mode 100644 index 000000000..7b850f809 --- /dev/null +++ b/gen/vault/Sonr.pkl.go @@ -0,0 +1,60 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Sonr interface { + Client + + GetRpcUrl() any +} + +var _ Sonr = (*SonrImpl)(nil) + +type SonrImpl struct { + ChainId string `pkl:"chainId"` + + KeyringBackend string `pkl:"keyringBackend"` + + Output string `pkl:"output"` + + RpcUrl any `pkl:"rpcUrl"` + + BroadcastMode string `pkl:"broadcastMode"` + + ApiUrl string `pkl:"apiUrl"` + + AddressPrefix string `pkl:"addressPrefix"` + + Node string `pkl:"node"` +} + +func (rcv *SonrImpl) GetChainId() string { + return rcv.ChainId +} + +func (rcv *SonrImpl) GetKeyringBackend() string { + return rcv.KeyringBackend +} + +func (rcv *SonrImpl) GetOutput() string { + return rcv.Output +} + +func (rcv *SonrImpl) GetRpcUrl() any { + return rcv.RpcUrl +} + +func (rcv *SonrImpl) GetBroadcastMode() string { + return rcv.BroadcastMode +} + +func (rcv *SonrImpl) GetApiUrl() string { + return rcv.ApiUrl +} + +func (rcv *SonrImpl) GetAddressPrefix() string { + return rcv.AddressPrefix +} + +func (rcv *SonrImpl) GetNode() string { + return rcv.Node +} diff --git a/gen/vault/Sqlite.pkl.go b/gen/vault/Sqlite.pkl.go new file mode 100644 index 000000000..9b52b5b23 --- /dev/null +++ b/gen/vault/Sqlite.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +type Sqlite interface { + DB +} + +var _ Sqlite = (*SqliteImpl)(nil) + +type SqliteImpl struct { + Filename string `pkl:"filename"` +} + +func (rcv *SqliteImpl) GetFilename() string { + return rcv.Filename +} diff --git a/gen/vault/Vault.pkl.go b/gen/vault/Vault.pkl.go new file mode 100644 index 000000000..5e92f3753 --- /dev/null +++ b/gen/vault/Vault.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import ( + "context" + + "github.com/apple/pkl-go/pkl" +) + +type Vault struct { +} + +// LoadFromPath loads the pkl module at the given path and evaluates it into a Vault +func LoadFromPath(ctx context.Context, path string) (ret *Vault, 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 Vault +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Vault, error) { + var ret Vault + if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { + return nil, err + } + return &ret, nil +} diff --git a/gen/vault/init.pkl.go b/gen/vault/init.pkl.go new file mode 100644 index 000000000..92544b815 --- /dev/null +++ b/gen/vault/init.pkl.go @@ -0,0 +1,19 @@ +// Code generated from Pkl module `vault`. DO NOT EDIT. +package vault + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("vault", Vault{}) + pkl.RegisterMapping("vault#Sonr", SonrImpl{}) + pkl.RegisterMapping("vault#Sqlite", SqliteImpl{}) + pkl.RegisterMapping("vault#Account", AccountImpl{}) + pkl.RegisterMapping("vault#Asset", AssetImpl{}) + pkl.RegisterMapping("vault#Chain", ChainImpl{}) + pkl.RegisterMapping("vault#Credential", CredentialImpl{}) + pkl.RegisterMapping("vault#Profile", ProfileImpl{}) + pkl.RegisterMapping("vault#Property", PropertyImpl{}) + pkl.RegisterMapping("vault#Keyshare", KeyshareImpl{}) + pkl.RegisterMapping("vault#PublicKey", PublicKeyImpl{}) + pkl.RegisterMapping("vault#Permission", PermissionImpl{}) +} diff --git a/go.mod b/go.mod index c987300a7..6b19a4844 100644 --- a/go.mod +++ b/go.mod @@ -56,6 +56,7 @@ 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 @@ -70,6 +71,7 @@ require ( github.com/ipfs/boxo v0.21.0 github.com/ipfs/kubo v0.29.0 github.com/joho/godotenv v1.5.1 + github.com/labstack/echo/v4 v4.10.0 github.com/mr-tron/base58 v1.2.0 github.com/ncruces/go-sqlite3 v0.18.2 github.com/ncruces/go-sqlite3/gormlite v0.18.0 @@ -134,7 +136,6 @@ 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 @@ -236,6 +237,7 @@ require ( github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect + github.com/labstack/gommon v0.4.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect @@ -312,6 +314,8 @@ require ( github.com/tetratelabs/wazero v1.8.0 // indirect github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect diff --git a/go.sum b/go.sum index c76eb2de0..baa751493 100644 --- a/go.sum +++ b/go.sum @@ -1639,6 +1639,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/labstack/echo/v4 v4.10.0 h1:5CiyngihEO4HXsz3vVsJn7f8xAlWwRr3aY6Ih280ZKA= +github.com/labstack/echo/v4 v4.10.0/go.mod h1:S/T/5fy/GigaXnHTkh0ZGe4LpkkQysvRjFMSUTkDRNQ= +github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= +github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= 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= @@ -1704,6 +1708,7 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -2075,6 +2080,11 @@ github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -2502,6 +2512,7 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/internal/files/assemble.go b/internal/files/assemble.go deleted file mode 100644 index edd2f1c27..000000000 --- a/internal/files/assemble.go +++ /dev/null @@ -1,61 +0,0 @@ -package files - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/onsonr/sonr/internal/db" -) - -var ( - kServiceWorkerFileName = "sw.js" - kVaultFileName = "vault.wasm" - kIndexFileName = "index.html" -) - -func Assemble(dir string) error { - err := os.MkdirAll(dir, 0o755) - if err != nil { - return err - } - - // Write the vault file - if err := writeVaultWASM(filepath.Join(dir, kVaultFileName)); err != nil { - return err - } - - // Write the service worker file - if err := writeServiceWorkerJS(filepath.Join(dir, kServiceWorkerFileName)); err != nil { - return err - } - - // Write the index file - if err := writeIndexHTML(filepath.Join(dir, kIndexFileName)); err != nil { - return err - } - - // Initialize the database - if err := initializeDatabase(dir); err != nil { - return err - } - - return nil -} - -func initializeDatabase(dir string) error { - db, err := db.Open(db.New(db.WithDir(dir))) - if err != nil { - return fmt.Errorf("failed to open database: %w", err) - } - defer db.Close() - - // You can add some initial data here if needed - // For example: - // err = db.AddChain("Ethereum", "1") - // if err != nil { - // return fmt.Errorf("failed to add initial chain: %w", err) - // } - - return nil -} diff --git a/internal/files/embed.go b/internal/files/embed.go deleted file mode 100644 index d319469ef..000000000 --- a/internal/files/embed.go +++ /dev/null @@ -1,58 +0,0 @@ -package files - -import ( - "context" - _ "embed" - "os" -) - -//go:embed vault.wasm -var vaultWasmData []byte - -func writeServiceWorkerJS(path string) error { - // Create the service worker file - file, err := os.Create(path) - if err != nil { - return err - } - defer file.Close() - - // Write the service worker file to the specified path - err = VaultServiceWorker(kVaultFileName).Render(context.Background(), file) - if err != nil { - return err - } - return nil -} - -func writeVaultWASM(path string) error { - // Create the vault file - file, err := os.Create(path) - if err != nil { - return err - } - defer file.Close() - - // Write the embedded vault file to the specified path - err = os.WriteFile(file.Name(), vaultWasmData, 0o644) - if err != nil { - return err - } - return nil -} - -func writeIndexHTML(path string) error { - // create the index file - file, err := os.Create(path) - if err != nil { - return err - } - defer file.Close() - - // write the index file to the specified path - err = IndexHTML().Render(context.Background(), file) - if err != nil { - return err - } - return nil -} diff --git a/internal/files/sw.templ b/internal/files/sw.templ deleted file mode 100644 index 88acdebd5..000000000 --- a/internal/files/sw.templ +++ /dev/null @@ -1,32 +0,0 @@ -package files - -templ VaultServiceWorker(path string) { - @serviceWorkerJS(path) -} - -script serviceWorkerJS(path string) { - importScripts('https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js') - importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js') -} - -templ IndexHTML() { - - - Sonr ID - - - -} diff --git a/internal/files/sw_templ.go b/internal/files/sw_templ.go deleted file mode 100644 index 47f0d9543..000000000 --- a/internal/files/sw_templ.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.771 -package files - -//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" - -func VaultServiceWorker(path string) 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_Err = serviceWorkerJS(path).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func serviceWorkerJS(path string) templ.ComponentScript { - return templ.ComponentScript{ - Name: `__templ_serviceWorkerJS_2501`, - Function: `function __templ_serviceWorkerJS_2501(path){importScripts('https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js') - importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js') -}`, - Call: templ.SafeScript(`__templ_serviceWorkerJS_2501`, path), - CallInline: templ.SafeScriptInline(`__templ_serviceWorkerJS_2501`, path), - } -} - -func IndexHTML() 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Sonr ID") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/internal/files/vault.wasm b/internal/files/vault.wasm deleted file mode 100755 index 6a1bd9972..000000000 Binary files a/internal/files/vault.wasm and /dev/null differ diff --git a/internal/front/command.go b/internal/front/command.go new file mode 100644 index 000000000..12a03e509 --- /dev/null +++ b/internal/front/command.go @@ -0,0 +1,22 @@ +package front + +import ( + "log" + "net/http" + + "github.com/labstack/echo/v4" + "github.com/spf13/cobra" +) + +func NewServeFrontendCmd() *cobra.Command { + return &cobra.Command{ + Use: "serve-web", + Short: "TUI for managing the local Sonr validator node", + Run: func(cmd *cobra.Command, args []string) { + e := echo.New() + if err := e.Start(":42069"); err != http.ErrServerClosed { + log.Fatal(err) + } + }, + } +} diff --git a/internal/front/handlers/authorize_handler.go b/internal/front/handlers/authorize_handler.go new file mode 100644 index 000000000..5ac8282f4 --- /dev/null +++ b/internal/front/handlers/authorize_handler.go @@ -0,0 +1 @@ +package handlers diff --git a/internal/front/handlers/current_handler.go b/internal/front/handlers/current_handler.go new file mode 100644 index 000000000..5ac8282f4 --- /dev/null +++ b/internal/front/handlers/current_handler.go @@ -0,0 +1 @@ +package handlers diff --git a/internal/front/handlers/login_handler.go b/internal/front/handlers/login_handler.go new file mode 100644 index 000000000..5ac8282f4 --- /dev/null +++ b/internal/front/handlers/login_handler.go @@ -0,0 +1 @@ +package handlers diff --git a/internal/front/handlers/register_handler.go b/internal/front/handlers/register_handler.go new file mode 100644 index 000000000..5ac8282f4 --- /dev/null +++ b/internal/front/handlers/register_handler.go @@ -0,0 +1 @@ +package handlers diff --git a/internal/front/routes/api.go b/internal/front/routes/api.go new file mode 100644 index 000000000..0db51ae52 --- /dev/null +++ b/internal/front/routes/api.go @@ -0,0 +1 @@ +package routes diff --git a/internal/front/routes/htmx.go b/internal/front/routes/htmx.go new file mode 100644 index 000000000..0db51ae52 --- /dev/null +++ b/internal/front/routes/htmx.go @@ -0,0 +1 @@ +package routes diff --git a/internal/tui/forms.go b/internal/tui/forms.go index 8e0408b66..c772e7625 100644 --- a/internal/tui/forms.go +++ b/internal/tui/forms.go @@ -322,7 +322,7 @@ func RunTUIForm() (*tx.TxBody, error) { return finalM.message, nil } -func NewBuildProtoMsgCmd() *cobra.Command { +func NewTUIDashboardCmd() *cobra.Command { return &cobra.Command{ Use: "dash", Short: "TUI for managing the local Sonr validator node", diff --git a/internal/vfs/assemble.go b/internal/vfs/assemble.go new file mode 100644 index 000000000..e8928c287 --- /dev/null +++ b/internal/vfs/assemble.go @@ -0,0 +1,21 @@ +package vfs + +import ( + "github.com/ipfs/boxo/files" +) + +var ( + kServiceWorkerFileName = "sw.js" + kVaultFileName = "vault.wasm" + kIndexFileName = "index.html" +) + +func AssembleDirectory() files.Directory { + fileMap := map[string]files.Node{ + kVaultFileName: DWNWasmFile(), + kServiceWorkerFileName: SWJSFile(), + kIndexFileName: IndexHTMLFile(), + } + + return files.NewMapDirectory(fileMap) +} diff --git a/internal/vfs/dwn.wasm b/internal/vfs/dwn.wasm new file mode 100755 index 000000000..633e13130 Binary files /dev/null and b/internal/vfs/dwn.wasm differ diff --git a/internal/vfs/embed.go b/internal/vfs/embed.go new file mode 100644 index 000000000..12e246511 --- /dev/null +++ b/internal/vfs/embed.go @@ -0,0 +1,28 @@ +package vfs + +import ( + _ "embed" + + "github.com/ipfs/boxo/files" +) + +//go:embed dwn.wasm +var dwnWasmData []byte + +func DWNWasmFile() files.Node { + return files.NewBytesFile(dwnWasmData) +} + +//go:embed sw.js +var swJSData []byte + +func SWJSFile() files.Node { + return files.NewBytesFile(swJSData) +} + +//go:embed index.html +var indexHTMLData []byte + +func IndexHTMLFile() files.Node { + return files.NewBytesFile(indexHTMLData) +} diff --git a/internal/vfs/index.html b/internal/vfs/index.html new file mode 100644 index 000000000..6950d5bcf --- /dev/null +++ b/internal/vfs/index.html @@ -0,0 +1,21 @@ + + + + + + Sonr Vault + + + diff --git a/internal/vfs/sw.js b/internal/vfs/sw.js new file mode 100644 index 000000000..990e2d399 --- /dev/null +++ b/internal/vfs/sw.js @@ -0,0 +1,9 @@ +importScripts( + "https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js", +); + +importScripts( + "https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js", +); + +registerWasmHTTPListener("dwn.wasm"); diff --git a/pkg/builder/bip32.go b/pkg/builder/bip32.go deleted file mode 100644 index e647fb226..000000000 --- a/pkg/builder/bip32.go +++ /dev/null @@ -1 +0,0 @@ -package builder diff --git a/pkg/builder/builder.go b/pkg/builder/builder.go deleted file mode 100644 index dc4c5e9d5..000000000 --- a/pkg/builder/builder.go +++ /dev/null @@ -1,8 +0,0 @@ -package builder - -type Builder interface { - Build() error -} - -func New() { -} diff --git a/pkg/builder/cbor.go b/pkg/builder/cbor.go deleted file mode 100644 index e647fb226..000000000 --- a/pkg/builder/cbor.go +++ /dev/null @@ -1 +0,0 @@ -package builder diff --git a/pkg/builder/did.go b/pkg/builder/did.go deleted file mode 100644 index e647fb226..000000000 --- a/pkg/builder/did.go +++ /dev/null @@ -1 +0,0 @@ -package builder diff --git a/pkg/builder/jwks.go b/pkg/builder/jwks.go deleted file mode 100644 index e647fb226..000000000 --- a/pkg/builder/jwks.go +++ /dev/null @@ -1 +0,0 @@ -package builder diff --git a/pkg/controller/chainexec.go b/pkg/controller/chainexec.go new file mode 100644 index 000000000..b0b429f89 --- /dev/null +++ b/pkg/controller/chainexec.go @@ -0,0 +1 @@ +package controller diff --git a/pkg/controller/didauth.go b/pkg/controller/didauth.go new file mode 100644 index 000000000..b0b429f89 --- /dev/null +++ b/pkg/controller/didauth.go @@ -0,0 +1 @@ +package controller diff --git a/pkg/controller/signer.go b/pkg/controller/signer.go new file mode 100644 index 000000000..b0b429f89 --- /dev/null +++ b/pkg/controller/signer.go @@ -0,0 +1 @@ +package controller diff --git a/pkg/resolver/ipfs.go b/pkg/resolver/ipfs.go new file mode 100644 index 000000000..d356a7b72 --- /dev/null +++ b/pkg/resolver/ipfs.go @@ -0,0 +1 @@ +package resolver diff --git a/pkg/resolver/sonr.go b/pkg/resolver/sonr.go new file mode 100644 index 000000000..d356a7b72 --- /dev/null +++ b/pkg/resolver/sonr.go @@ -0,0 +1 @@ +package resolver diff --git a/pkl/vault.pkl b/pkl/vault.pkl new file mode 100644 index 000000000..26da3c29f --- /dev/null +++ b/pkl/vault.pkl @@ -0,0 +1,322 @@ +@go.Package { name = "github.com/onsonr/sonr/gen/vault" } + +module vault + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + + +abstract class Client { + chainId: String + keyringBackend: String + output: String + node: String + broadcastMode: String + apiUrl: String + addressPrefix: String +} + +class Sonr extends Client { + chainId = "sonr-testnet-1" + keyringBackend = "test" + output = "json" + rpcUrl = "tcp://localhost:26657" + broadcastMode = "async" + apiUrl = "http://localhost:1317" + addressPrefix = "idx" +} + +abstract class DB { + filename: String +} + +class Sqlite extends DB { + filename = "vault.db" +} + +class PrimaryKey extends go.Field { + structTags { + ["gorm"] = "primaryKey" + ["json"] = "%{name},omitempty" + } +} + +class Unique extends go.Field { + structTags { + ["gorm"] = "unique" + ["json"] = "%{name},omitempty" + } +} + +class Default extends go.Field { + defaultValue: String + structTags { + ["gorm"] = "default:%{defaultValue}" + ["json"] = "%{name},omitempty" + } +} + +class NotNull extends go.Field { + structTags { + ["gorm"] = "not null" + } +} + +class AutoIncrement extends go.Field { + structTags { + ["gorm"] = "autoIncrement" + } +} + +class ForeignKey extends go.Field { + references: String + structTags { + ["gorm"] = "foreignKey:%{references}" + } +} + +abstract class Model { + table: String +} + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + } +} + +class Account extends Model { + table = "accounts" + + @PrimaryKey + id: UInt + + @JsonField + name: String + + @JsonField + address: String + + @JsonField + publicKey: Dynamic + + @JsonField + createdAt: String? +} + +class Asset extends Model { + table = "assets" + + @PrimaryKey + id: UInt + + @JsonField + name: String + + @JsonField + symbol: String + + @JsonField + decimals: Int + + @JsonField + chainId: Int? + + @JsonField + createdAt: String? +} + +class Chain extends Model { + table = "chains" + + @PrimaryKey + id: UInt + + @JsonField + name: String + + @JsonField + networkId: String + + @JsonField + createdAt: String? +} + +class Credential extends Model { + table = "credentials" + + @PrimaryKey + id: UInt + + @JsonField + subject: String + + @JsonField + controller: String + + @JsonField + attestationType: String + + @JsonField + origin: String + + @JsonField + credentialId: Dynamic + + @JsonField + publicKey: Dynamic + + @JsonField + transport: String + + @JsonField + signCount: UInt + + @JsonField + userPresent: Boolean + + @JsonField + userVerified: Boolean + + @JsonField + backupEligible: Boolean + + @JsonField + backupState: Boolean + + @JsonField + cloneWarning: Boolean + + @JsonField + createdAt: String? + + @JsonField + updatedAt: String? +} + +class Profile extends Model { + table = "profiles" + + @PrimaryKey + id: String + + @JsonField + subject: String + + @JsonField + controller: String + + @JsonField + originUri: String? + + @JsonField + publicMetadata: String? + + @JsonField + privateMetadata: String? + + @JsonField + createdAt: String? + + @JsonField + updatedAt: String? +} + +class Property extends Model { + table = "properties" + + @PrimaryKey + id: UInt + + @JsonField + profileId: String + + @JsonField + key: String + + @JsonField + accumulator: Dynamic + + @JsonField + propertyKey: Dynamic +} + +class Keyshare extends Model { + table = "keyshares" + + @PrimaryKey + id: UInt + + @JsonField + metadata: String + + @JsonField + payloads: String + + @JsonField + protocol: String + + @JsonField + publicKey: Dynamic + + @JsonField + role: Int + + @JsonField + version: Int + + @JsonField + createdAt: String? +} + +class PublicKey extends Model { + table = "public_keys" + + @PrimaryKey + id: UInt + + @JsonField + role: Int + + @JsonField + algorithm: Int + + @JsonField + encoding: Int + + @JsonField + raw: Dynamic + + @JsonField + hex: String + + @JsonField + multibase: String + + @JsonField + jwk: Dynamic + + @JsonField + createdAt: String? +} + +class Permission extends Model { + table = "permissions" + + @PrimaryKey + id: UInt + + @JsonField + serviceId: String + + @JsonField + grants: String + + @JsonField + scopes: String + + @JsonField + createdAt: String? + + @JsonField + updatedAt: String? +} diff --git a/pkl/webauth.pkl b/pkl/webauth.pkl new file mode 100644 index 000000000..850ce6934 --- /dev/null +++ b/pkl/webauth.pkl @@ -0,0 +1,101 @@ +@go.Package { name = "github.com/onsonr/sonr/gen/protocol" } + +module protocol + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class CredentialCreation { + response: PublicKeyCredentialCreationOptions = new JsonField { name = "publicKey"; type = "PublicKeyCredentialCreationOptions" } +} + +class CredentialAssertion { + response: PublicKeyCredentialRequestOptions = new JsonField { name = "publicKey"; type = "PublicKeyCredentialRequestOptions" } +} + +class PublicKeyCredentialCreationOptions { + relyingParty: RelyingPartyEntity = new JsonField { name = "rp"; type = "RelyingPartyEntity" } + user: UserEntity = new JsonField { name = "user"; type = "UserEntity" } + challenge: URLEncodedBase64 = new JsonField { name = "challenge"; type = "URLEncodedBase64" } + parameters: Listing[CredentialParameter]? = new JsonField { name = "pubKeyCredParams"; type = "[]CredentialParameter" } + timeout: Int? = new JsonField { name = "timeout"; type = "int" } + credentialExcludeList: Listing[CredentialDescriptor]? = new JsonField { name = "excludeCredentials"; type = "[]CredentialDescriptor" } + authenticatorSelection: AuthenticatorSelection? = new JsonField { name = "authenticatorSelection"; type = "AuthenticatorSelection" } + hints: Listing[PublicKeyCredentialHints]? = new JsonField { name = "hints"; type = "[]PublicKeyCredentialHints" } + attestation: ConveyancePreference? = new JsonField { name = "attestation"; type = "ConveyancePreference" } + attestationFormats: Listing[AttestationFormat]? = new JsonField { name = "attestationFormats"; type = "[]AttestationFormat" } + extensions: AuthenticationExtensions? = new JsonField { name = "extensions"; type = "AuthenticationExtensions" } +} + +class PublicKeyCredentialRequestOptions { + challenge: URLEncodedBase64 = new JsonField { name = "challenge"; type = "URLEncodedBase64" } + timeout: Int? = new JsonField { name = "timeout"; type = "int" } + relyingPartyID: String? = new JsonField { name = "rpId"; type = "string" } + allowedCredentials: Listing[CredentialDescriptor]? = new JsonField { name = "allowCredentials"; type = "[]CredentialDescriptor" } + userVerification: UserVerificationRequirement? = new JsonField { name = "userVerification"; type = "UserVerificationRequirement" } + hints: Listing[PublicKeyCredentialHints]? = new JsonField { name = "hints"; type = "[]PublicKeyCredentialHints" } + extensions: AuthenticationExtensions? = new JsonField { name = "extensions"; type = "AuthenticationExtensions" } + + function getAllowedCredentialIDs(): Listing[Listing[Int8]] { + this.allowedCredentials?.map((credential) -> credential.credentialID) ?? Listing() + } +} + +class CredentialDescriptor { + type: CredentialType = new JsonField { name = "type"; type = "CredentialType" } + credentialID: URLEncodedBase64 = new JsonField { name = "id"; type = "URLEncodedBase64" } + transport: Listing[AuthenticatorTransport]? = new JsonField { name = "transports"; type = "[]AuthenticatorTransport" } + attestationType: String? = new JsonField { name = "-"; type = "string" } +} + +class CredentialParameter { + type: CredentialType = new JsonField { name = "type"; type = "CredentialType" } + algorithm: Int = new JsonField { name = "alg"; type = "int" } +} + +typealias CredentialType = String + +const PublicKeyCredentialType: CredentialType = "public-key" + +typealias AuthenticationExtensions = Mapping[String, Dynamic] + +class AuthenticatorSelection { + authenticatorAttachment: AuthenticatorAttachment? = new JsonField { name = "authenticatorAttachment"; type = "AuthenticatorAttachment" } + requireResidentKey: Boolean? = new JsonField { name = "requireResidentKey"; type = "bool" } + residentKey: ResidentKeyRequirement? = new JsonField { name = "residentKey"; type = "ResidentKeyRequirement" } + userVerification: UserVerificationRequirement? = new JsonField { name = "userVerification"; type = "UserVerificationRequirement" } +} + +typealias ConveyancePreference = String + +const PreferNoAttestation: ConveyancePreference = "none" +const PreferIndirectAttestation: ConveyancePreference = "indirect" +const PreferDirectAttestation: ConveyancePreference = "direct" +const PreferEnterpriseAttestation: ConveyancePreference = "enterprise" + +typealias AttestationFormat = String + +const AttestationFormatPacked: AttestationFormat = "packed" +const AttestationFormatTPM: AttestationFormat = "tpm" +const AttestationFormatAndroidKey: AttestationFormat = "android-key" +const AttestationFormatAndroidSafetyNet: AttestationFormat = "android-safetynet" +const AttestationFormatFIDOUniversalSecondFactor: AttestationFormat = "fido-u2f" +const AttestationFormatApple: AttestationFormat = "apple" +const AttestationFormatNone: AttestationFormat = "none" + +typealias PublicKeyCredentialHints = String + +const PublicKeyCredentialHintSecurityKey: PublicKeyCredentialHints = "security-key" +const PublicKeyCredentialHintClientDevice: PublicKeyCredentialHints = "client-device" +const PublicKeyCredentialHintHybrid: PublicKeyCredentialHints = "hybrid" + +typealias Extensions = Dynamic + +class ServerResponse { + status: ServerResponseStatus = new JsonField { name = "status"; type = "ServerResponseStatus" } + message: String = new JsonField { name = "errorMessage"; type = "string" } +} + +typealias ServerResponseStatus = String + +const StatusOk: ServerResponseStatus = "ok" +const StatusFailed= ServerResponseStatus = "failed" diff --git a/process-compose.yaml b/process-compose.yaml new file mode 100644 index 000000000..62f947ffe --- /dev/null +++ b/process-compose.yaml @@ -0,0 +1,18 @@ +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 diff --git a/proto/did/v1/constants.proto b/proto/did/v1/constants.proto deleted file mode 100644 index 0ed85d061..000000000 --- a/proto/did/v1/constants.proto +++ /dev/null @@ -1,101 +0,0 @@ -syntax = "proto3"; -package did.v1; - -option go_package = "github.com/onsonr/sonr/x/did/types"; - -// 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; -} - -// 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_BLS12377 = 6; - KEY_ALGORITHM_KECCAK256 = 7; -} - -// KeyCurve defines the key curve -enum KeyCurve { - 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; -} - -// KeyEncoding defines the key encoding -enum KeyEncoding { - KEY_ENCODING_UNSPECIFIED = 0; - KEY_ENCODING_RAW = 1; - KEY_ENCODING_HEX = 2; - KEY_ENCODING_MULTIBASE = 3; - KEY_ENCODING_JWK = 4; -} - -// KeyRole defines the kind of key -enum KeyRole { - KEY_ROLE_UNSPECIFIED = 0; - - // Blockchain key types - 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; -} - -// PermissionScope define the Capabilities Controllers can grant for Services -enum PermissionScope { - PERMISSION_SCOPE_UNSPECIFIED = 0; - PERMISSION_SCOPE_BASIC_INFO = 1; - PERMISSION_SCOPE_RECORDS_READ = 2; - PERMISSION_SCOPE_RECORDS_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; -} diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index c87e3280c..d38a457b3 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package did.v1; import "amino/amino.proto"; -import "did/v1/constants.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -30,6 +29,18 @@ message Params { // OpenIDConfig defines the base openid configuration across all did services OpenIDConfig openid_config = 4; + + // IpfsActive is a flag to enable/disable ipfs + bool ipfs_active = 5; + + // Localhost Registration Enabled + bool localhost_registration_enabled = 6; + + // ConveyancePreference defines the conveyance preference + string conveyance_preference = 7; + + // AttestationFormats defines the attestation formats + repeated string attestation_formats = 8; } // AssetInfo defines the asset info @@ -124,3 +135,106 @@ message ValidatorInfo { string port = 2; } } + +// +// [Constant Enumerations] +// + +// 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; +} + +// 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; +} + +// 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; +} diff --git a/proto/did/v1/models.proto b/proto/did/v1/models.proto index 16879f704..c4c9cc2c2 100644 --- a/proto/did/v1/models.proto +++ b/proto/did/v1/models.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package did.v1; -import "did/v1/constants.proto"; import "did/v1/genesis.proto"; import "gogoproto/gogo.proto"; @@ -43,6 +42,16 @@ message Document { repeated string service = 9; } +// 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) +} + // Metadata defines additional information provided to a did message Metadata { string origin_uri = 1; @@ -77,10 +86,10 @@ message PubKey { KeyRole role = 1; KeyAlgorithm algorithm = 2; KeyEncoding encoding = 3; - bytes raw = 4; - string hex = 5; - string multibase = 6; - map jwk = 7; + KeyCurve curve = 4; + KeyType key_type = 5; + bytes raw = 6; + JWK jwk = 7; } // Service defines a Decentralized Service on the Sonr Blockchain @@ -102,11 +111,11 @@ message Token { // VerificationMethod defines a verification method message VerificationMethod { - string id = 1; - string controller = 2; - DIDNamespace method = 3; - PubKey public_key = 4; - Service service = 7; + DIDNamespace method = 1; + string id = 2; + string controller = 3; + string issuer = 4; + PubKey public_key = 5; } // Witness defines a BLS witness diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 0b2bcc718..0e4f35669 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -4,6 +4,7 @@ package did.v1; import "did/v1/genesis.proto"; import "did/v1/models.proto"; import "google/api/annotations.proto"; +import "google/api/httpbody.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -14,16 +15,6 @@ service Query { option (google.api.http).get = "/did/params"; } - // Accounts returns associated wallet accounts with the DID. - rpc Accounts(QueryRequest) returns (QueryAccountsResponse) { - option (google.api.http).get = "/did/{did}/accounts"; - } - - // Credentials returns associated credentials with the DID and Service Origin. - rpc Credentials(QueryRequest) returns (QueryCredentialsResponse) { - option (google.api.http).get = "/service/{origin}/{subject}/credentials"; - } - // Resolve queries the DID document by its id. rpc Resolve(QueryRequest) returns (QueryResolveResponse) { option (google.api.http).get = "/did/{did}"; @@ -33,11 +24,6 @@ service Query { rpc Service(QueryRequest) returns (QueryServiceResponse) { option (google.api.http).get = "/service/{origin}"; } - - // Token returns the current authentication token for the client. - rpc Token(QueryRequest) returns (QueryTokenResponse) { - option (google.api.http).post = "/token"; - } } // Queryequest is the request type for the Query/Params RPC method. @@ -45,46 +31,47 @@ message QueryRequest { string did = 1; string origin = 2; string subject = 3; - repeated Credential credentials = 4; + string endpoint = 4; } // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. Params params = 1; - - // ipfs_active returns true if the IPFS client is initialized - bool ipfs_active = 2; } -// QueryAccountsResponse is the response type for the Query/Exists RPC method. -message QueryAccountsResponse { - bool exists = 1; -} - -// QueryCredentialsResponse is the response type for the Query/Exists RPC method. -message QueryCredentialsResponse { +// QueryResponse is the response type for the Query/Exists RPC method. +message QueryResponse { bool success = 1; string subject = 2; string origin = 3; - repeated Credential credentials = 4; - string error = 5; + bool ipfs_active = 4; + Params params = 5; + Document document = 6; + Service service = 7; + repeated Credential credentials = 8; + Token token = 9; + string error = 10; } // QueryResolveResponse is the response type for the Query/Resolve RPC method. message QueryResolveResponse { - // document is the DID document - Document document = 1; + bool success = 1; + string subject = 2; + string origin = 3; + bool ipfs_active = 4; + Params params = 5; + Document document = 6; + repeated Credential credentials = 7; + Token token = 8; } // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. message QueryServiceResponse { - Service service = 1; -} - -// QueryTokenResponse is the response type for the Query/LoginOptions RPC method. -message QueryTokenResponse { bool success = 1; - Token token = 2; - string error = 3; + string subject = 2; + string origin = 3; + bool ipfs_active = 4; + Params params = 5; + Service service = 6; } diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 6a00cb6cb..7dc18fb4d 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -8,8 +8,8 @@ import "did/v1/models.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; -// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) -message Assertion { +// Authentication represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) +message Authentication { option (cosmos.orm.v1.table) = { id: 1 primary_key: {fields: "id"} @@ -39,24 +39,30 @@ message Assertion { // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") PubKey public_key = 3; - // The value of the linked identifier - bytes credential_id = 4; - - // The display label of the attestation - string credential_label = 5; - // The origin of the attestation - string origin = 6; + string origin = 4; // The subject of the attestation - string subject = 7; + string subject = 5; + + // The value of the linked identifier + bytes credential_id = 6; + + // The credential label + string credential_label = 7; + + // The display label of the attestation + repeated string credential_transport = 8; + + // The attestationtype of the attestation + string attestation_type = 9; // Metadata is optional additional information about the assertion - Metadata metadata = 8; + Metadata metadata = 10; } -// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) -message Attestation { +// Assertion represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) +message Assertion { option (cosmos.orm.v1.table) = { id: 2 primary_key: {fields: "id"} diff --git a/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index c69f20c3c..03f346cbb 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -4,7 +4,6 @@ package did.v1; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "did/v1/constants.proto"; import "did/v1/genesis.proto"; import "did/v1/models.proto"; import "gogoproto/gogo.proto"; @@ -68,8 +67,8 @@ message MsgAllocateVault { // subject is a unique human-defined identifier to associate with the vault. string subject = 2; - // token is the macron token to authenticate the operation. - Token token = 3; + // origin is the origin of the request in wildcard form. + string origin = 3; } // MsgAllocateVaultResponse is the response type for the AllocateVault RPC. @@ -79,6 +78,9 @@ message MsgAllocateVaultResponse { // ExpiryBlock is the block number at which the vault will expire. int64 expiry_block = 2; + + // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn + string registration_options = 3; } // MsgProveWitness is the message type for the ProveWitness RPC. diff --git a/scripts/test_node.sh b/scripts/test_node.sh index efb2d27dd..45ad8f58c 100644 --- a/scripts/test_node.sh +++ b/scripts/test_node.sh @@ -12,7 +12,7 @@ export CHAIN_ID=${CHAIN_ID:-"sonr-testnet-1"} export MONIKER="florence" export KEYALGO="secp256k1" export KEYRING=${KEYRING:-"test"} -export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.core"}") +export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.sonr"}") export BINARY=${BINARY:-sonrd} export DENOM=${DENOM:-usnr} diff --git a/x/did/builder/api.go b/x/did/builder/api.go new file mode 100644 index 000000000..063d24646 --- /dev/null +++ b/x/did/builder/api.go @@ -0,0 +1,176 @@ +package builder + +import ( + "encoding/base64" + "fmt" + + "github.com/go-webauthn/webauthn/protocol/webauthncose" + didv1 "github.com/onsonr/sonr/api/did/v1" + "github.com/onsonr/sonr/x/did/types" +) + +func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*types.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.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.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.JWK, error) { + jwk := &types.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) + } +} + +func ModulePubKeyToAPI(pk *types.PubKey) *didv1.PubKey { + return &didv1.PubKey{ + Role: ModuleKeyRoleToAPI(pk.GetRole()), + Algorithm: ModuleKeyAlgorithmToAPI(pk.GetAlgorithm()), + Encoding: ModuleKeyEncodingToAPI(pk.GetEncoding()), + Curve: ModuleKeyCurveToAPI(pk.GetCurve()), + KeyType: ModuleKeyTypeToAPI(pk.GetKeyType()), + Raw: pk.GetRaw(), + } +} + +func ModuleKeyRoleToAPI(role types.KeyRole) didv1.KeyRole { + switch role { + case types.KeyRole_KEY_ROLE_INVOCATION: + return didv1.KeyRole_KEY_ROLE_INVOCATION + case types.KeyRole_KEY_ROLE_ASSERTION: + return didv1.KeyRole_KEY_ROLE_ASSERTION + case types.KeyRole_KEY_ROLE_DELEGATION: + return didv1.KeyRole_KEY_ROLE_DELEGATION + default: + return didv1.KeyRole_KEY_ROLE_INVOCATION + } +} + +func ModuleKeyAlgorithmToAPI(algorithm types.KeyAlgorithm) didv1.KeyAlgorithm { + switch algorithm { + case types.KeyAlgorithm_KEY_ALGORITHM_ES256K: + return didv1.KeyAlgorithm_KEY_ALGORITHM_ES256K + case types.KeyAlgorithm_KEY_ALGORITHM_ES256: + return didv1.KeyAlgorithm_KEY_ALGORITHM_ES256 + case types.KeyAlgorithm_KEY_ALGORITHM_ES384: + return didv1.KeyAlgorithm_KEY_ALGORITHM_ES384 + case types.KeyAlgorithm_KEY_ALGORITHM_ES512: + return didv1.KeyAlgorithm_KEY_ALGORITHM_ES512 + case types.KeyAlgorithm_KEY_ALGORITHM_EDDSA: + return didv1.KeyAlgorithm_KEY_ALGORITHM_EDDSA + default: + return didv1.KeyAlgorithm_KEY_ALGORITHM_ES256K + } +} + +func ModuleKeyCurveToAPI(curve types.KeyCurve) didv1.KeyCurve { + switch curve { + case types.KeyCurve_KEY_CURVE_P256: + return didv1.KeyCurve_KEY_CURVE_P256 + case types.KeyCurve_KEY_CURVE_SECP256K1: + return didv1.KeyCurve_KEY_CURVE_SECP256K1 + case types.KeyCurve_KEY_CURVE_BLS12381: + return didv1.KeyCurve_KEY_CURVE_BLS12381 + case types.KeyCurve_KEY_CURVE_KECCAK256: + return didv1.KeyCurve_KEY_CURVE_KECCAK256 + default: + return didv1.KeyCurve_KEY_CURVE_P256 + } +} + +func ModuleKeyEncodingToAPI(encoding types.KeyEncoding) didv1.KeyEncoding { + switch encoding { + case types.KeyEncoding_KEY_ENCODING_RAW: + return didv1.KeyEncoding_KEY_ENCODING_RAW + case types.KeyEncoding_KEY_ENCODING_HEX: + return didv1.KeyEncoding_KEY_ENCODING_HEX + case types.KeyEncoding_KEY_ENCODING_MULTIBASE: + return didv1.KeyEncoding_KEY_ENCODING_MULTIBASE + default: + return didv1.KeyEncoding_KEY_ENCODING_RAW + } +} + +func ModuleKeyTypeToAPI(keyType types.KeyType) didv1.KeyType { + switch keyType { + case types.KeyType_KEY_TYPE_BIP32: + return didv1.KeyType_KEY_TYPE_BIP32 + case types.KeyType_KEY_TYPE_ZK: + return didv1.KeyType_KEY_TYPE_ZK + case types.KeyType_KEY_TYPE_WEBAUTHN: + return didv1.KeyType_KEY_TYPE_WEBAUTHN + default: + return didv1.KeyType_KEY_TYPE_BIP32 + } +} diff --git a/x/did/builder/chains.go b/x/did/builder/chains.go new file mode 100644 index 000000000..eb3cf805a --- /dev/null +++ b/x/did/builder/chains.go @@ -0,0 +1,70 @@ +package builder + +import ( + "crypto/hmac" + "crypto/sha512" + "encoding/binary" + "errors" + "math/big" + + "github.com/btcsuite/btcd/btcec/v2" + "github.com/onsonr/sonr/x/did/types" +) + +// 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) { + // Check if the index is a hardened child key + if chainCode&0x80000000 != 0 && index < 0 { + return nil, errors.New("invalid index") + } + + // Serialize the public key + pubKey, err := btcec.ParsePubKey(extPubKey.GetRaw()) + if err != nil { + return nil, err + } + pubKeyBytes := pubKey.SerializeCompressed() + + // Serialize the index + indexBytes := make([]byte, 4) + binary.BigEndian.PutUint32(indexBytes, uint32(index)) + + // Compute the HMAC-SHA512 + mac := hmac.New(sha512.New, []byte{byte(chainCode)}) + mac.Write(pubKeyBytes) + mac.Write(indexBytes) + I := mac.Sum(nil) + + // Split I into two 32-byte sequences + IL := I[:32] + + // Convert IL to a big integer + ilNum := new(big.Int).SetBytes(IL) + + // Check if parse256(IL) >= n + curve := btcec.S256() + if ilNum.Cmp(curve.N) >= 0 { + return nil, errors.New("invalid child key") + } + + // Compute the child public key + ilx, ily := curve.ScalarBaseMult(IL) + childX, childY := curve.Add(ilx, ily, pubKey.X(), pubKey.Y()) + lx := newBigIntFieldVal(childX) + 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 +} + +// newBigIntFieldVal creates a new field value from a big integer. +func newBigIntFieldVal(val *big.Int) *btcec.FieldVal { + lx := new(btcec.FieldVal) + lx.SetByteSlice(val.Bytes()) + return lx +} diff --git a/x/did/builder/constants.go b/x/did/builder/constants.go new file mode 100644 index 000000000..be06402c8 --- /dev/null +++ b/x/did/builder/constants.go @@ -0,0 +1,334 @@ +package builder + +import ( + "github.com/onsonr/sonr/x/did/types" +) + +type ( + AuthenticatorAttachment string + AuthenticatorTransport string +) + +const ( + // Platform represents a platform authenticator is attached using a client device-specific transport, called + // platform attachment, and is usually not removable from the client device. A public key credential bound to a + // platform authenticator is called a platform credential. + Platform AuthenticatorAttachment = "platform" + + // CrossPlatform represents a roaming authenticator is attached using cross-platform transports, called + // cross-platform attachment. Authenticators of this class are removable from, and can "roam" among, client devices. + // A public key credential bound to a roaming authenticator is called a roaming credential. + CrossPlatform AuthenticatorAttachment = "cross-platform" +) + +func ParseAuthenticatorAttachment(s string) AuthenticatorAttachment { + switch s { + case "platform": + return Platform + default: + return CrossPlatform + } +} + +const ( + // USB indicates the respective authenticator can be contacted over removable USB. + USB AuthenticatorTransport = "usb" + + // NFC indicates the respective authenticator can be contacted over Near Field Communication (NFC). + NFC AuthenticatorTransport = "nfc" + + // BLE indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE). + BLE AuthenticatorTransport = "ble" + + // SmartCard indicates the respective authenticator can be contacted over ISO/IEC 7816 smart card with contacts. + // + // WebAuthn Level 3. + SmartCard AuthenticatorTransport = "smart-card" + + // Hybrid indicates the respective authenticator can be contacted using a combination of (often separate) + // data-transport and proximity mechanisms. This supports, for example, authentication on a desktop computer using + // a smartphone. + // + // WebAuthn Level 3. + Hybrid AuthenticatorTransport = "hybrid" + + // Internal indicates the respective authenticator is contacted using a client device-specific transport, i.e., it + // is a platform authenticator. These authenticators are not removable from the client device. + Internal AuthenticatorTransport = "internal" +) + +func ParseAuthenticatorTransport(s string) AuthenticatorTransport { + switch s { + case "usb": + return USB + case "nfc": + return NFC + case "ble": + return BLE + case "smart-card": + return SmartCard + case "hybrid": + return Hybrid + default: + return Internal + } +} + +type AuthenticatorFlags byte + +const ( + // FlagUserPresent Bit 00000001 in the byte sequence. Tells us if user is present. Also referred to as the UP flag. + FlagUserPresent AuthenticatorFlags = 1 << iota // Referred to as UP + + // FlagRFU1 is a reserved for future use flag. + FlagRFU1 + + // FlagUserVerified Bit 00000100 in the byte sequence. Tells us if user is verified + // by the authenticator using a biometric or PIN. Also referred to as the UV flag. + FlagUserVerified + + // FlagBackupEligible Bit 00001000 in the byte sequence. Tells us if a backup is eligible for device. Also referred + // to as the BE flag. + FlagBackupEligible // Referred to as BE + + // FlagBackupState Bit 00010000 in the byte sequence. Tells us if a backup state for device. Also referred to as the + // BS flag. + FlagBackupState + + // FlagRFU2 is a reserved for future use flag. + FlagRFU2 + + // FlagAttestedCredentialData Bit 01000000 in the byte sequence. Indicates whether + // the authenticator added attested credential data. Also referred to as the AT flag. + FlagAttestedCredentialData + + // FlagHasExtensions Bit 10000000 in the byte sequence. Indicates if the authenticator data has extensions. Also + // referred to as the ED flag. + FlagHasExtensions +) + +type AttestationFormat string + +const ( + // AttestationFormatPacked is the "packed" attestation statement format is a WebAuthn-optimized format for + // attestation. It uses a very compact but still extensible encoding method. This format is implementable by + // authenticators with limited resources (e.g., secure elements). + AttestationFormatPacked AttestationFormat = "packed" + + // AttestationFormatTPM is the TPM attestation statement format returns an attestation statement in the same format + // as the packed attestation statement format, although the rawData and signature fields are computed differently. + AttestationFormatTPM AttestationFormat = "tpm" + + // AttestationFormatAndroidKey is the attestation statement format for platform authenticators on versions "N", and + // later, which may provide this proprietary "hardware attestation" statement. + AttestationFormatAndroidKey AttestationFormat = "android-key" + + // AttestationFormatAndroidSafetyNet is the attestation statement format that Android-based platform authenticators + // MAY produce an attestation statement based on the Android SafetyNet API. + AttestationFormatAndroidSafetyNet AttestationFormat = "android-safetynet" + + // AttestationFormatFIDOUniversalSecondFactor is the attestation statement format that is used with FIDO U2F + // authenticators. + AttestationFormatFIDOUniversalSecondFactor AttestationFormat = "fido-u2f" + + // AttestationFormatApple is the attestation statement format that is used with Apple devices' platform + // authenticators. + AttestationFormatApple AttestationFormat = "apple" + + // AttestationFormatNone is the attestation statement format that is used to replace any authenticator-provided + // attestation statement when a WebAuthn Relying Party indicates it does not wish to receive attestation information. + AttestationFormatNone AttestationFormat = "none" +) + +func ExtractAttestationFormats(p *types.Params) []AttestationFormat { + var formats []AttestationFormat + for _, v := range p.AttestationFormats { + formats = append(formats, parseAttestationFormat(v)) + } + return formats +} + +func parseAttestationFormat(s string) AttestationFormat { + switch s { + case "packed": + return AttestationFormatPacked + case "tpm": + return AttestationFormatTPM + case "android-key": + return AttestationFormatAndroidKey + case "android-safetynet": + return AttestationFormatAndroidSafetyNet + case "fido-u2f": + return AttestationFormatFIDOUniversalSecondFactor + case "apple": + return AttestationFormatApple + case "none": + return AttestationFormatNone + default: + return AttestationFormatPacked + } +} + +type CredentialType string + +const ( + CredentialTypePublicKeyCredential CredentialType = "public-key" +) + +type ConveyancePreference string + +const ( + // PreferNoAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party is not interested in authenticator attestation. For example, in order + // to potentially avoid having to obtain user consent to relay identifying information to the Relying Party, or to + // save a round trip to an Attestation CA or Anonymization CA. + // + // This is the default value. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-none) + PreferNoAttestation ConveyancePreference = "none" + + // PreferIndirectAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation + // statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the + // authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in + // order to protect the user’s privacy, or to assist Relying Parties with attestation verification in a + // heterogeneous ecosystem. + // + // Note: There is no guarantee that the Relying Party will obtain a verifiable attestation statement in this case. + // For example, in the case that the authenticator employs self attestation. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-indirect) + PreferIndirectAttestation ConveyancePreference = "indirect" + + // PreferDirectAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party wants to receive the attestation statement as generated by the + // authenticator. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-direct) + PreferDirectAttestation ConveyancePreference = "direct" + + // PreferEnterpriseAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party wants to receive an attestation statement that may include uniquely + // identifying information. This is intended for controlled deployments within an enterprise where the organization + // wishes to tie registrations to specific authenticators. User agents MUST NOT provide such an attestation unless + // the user agent or authenticator configuration permits it for the requested RP ID. + // + // If permitted, the user agent SHOULD signal to the authenticator (at invocation time) that enterprise + // attestation is requested, and convey the resulting AAGUID and attestation statement, unaltered, to the Relying + // Party. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-enterprise) + PreferEnterpriseAttestation ConveyancePreference = "enterprise" +) + +func ExtractConveyancePreference(p *types.Params) ConveyancePreference { + switch p.ConveyancePreference { + case "none": + return PreferNoAttestation + case "indirect": + return PreferIndirectAttestation + case "direct": + return PreferDirectAttestation + case "enterprise": + return PreferEnterpriseAttestation + default: + return PreferNoAttestation + } +} + +type PublicKeyCredentialHints string + +const ( + // PublicKeyCredentialHintSecurityKey is a PublicKeyCredentialHint that indicates that the Relying Party believes + // that users will satisfy this request with a physical security key. For example, an enterprise Relying Party may + // set this hint if they have issued security keys to their employees and will only accept those authenticators for + // registration and authentication. + // + // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the + // authenticatorAttachment SHOULD be set to cross-platform. + PublicKeyCredentialHintSecurityKey PublicKeyCredentialHints = "security-key" + + // PublicKeyCredentialHintClientDevice is a PublicKeyCredentialHint that indicates that the Relying Party believes + // that users will satisfy this request with a platform authenticator attached to the client device. + // + // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the + // authenticatorAttachment SHOULD be set to platform. + PublicKeyCredentialHintClientDevice PublicKeyCredentialHints = "client-device" + + // PublicKeyCredentialHintHybrid is a PublicKeyCredentialHint that indicates that the Relying Party believes that + // users will satisfy this request with general-purpose authenticators such as smartphones. For example, a consumer + // Relying Party may believe that only a small fraction of their customers possesses dedicated security keys. This + // option also implies that the local platform authenticator should not be promoted in the UI. + // + // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the + // authenticatorAttachment SHOULD be set to cross-platform. + PublicKeyCredentialHintHybrid PublicKeyCredentialHints = "hybrid" +) + +func ParsePublicKeyCredentialHints(s string) PublicKeyCredentialHints { + switch s { + case "security-key": + return PublicKeyCredentialHintSecurityKey + case "client-device": + return PublicKeyCredentialHintClientDevice + case "hybrid": + return PublicKeyCredentialHintHybrid + default: + return "" + } +} + +type AttestedCredentialData struct { + AAGUID []byte `json:"aaguid"` + CredentialID []byte `json:"credential_id"` + + // The raw credential public key bytes received from the attestation data. + CredentialPublicKey []byte `json:"public_key"` +} + +type ResidentKeyRequirement string + +const ( + // ResidentKeyRequirementDiscouraged indicates the Relying Party prefers creating a server-side credential, but will + // accept a client-side discoverable credential. This is the default. + ResidentKeyRequirementDiscouraged ResidentKeyRequirement = "discouraged" + + // ResidentKeyRequirementPreferred indicates to the client we would prefer a discoverable credential. + ResidentKeyRequirementPreferred ResidentKeyRequirement = "preferred" + + // ResidentKeyRequirementRequired indicates the Relying Party requires a client-side discoverable credential, and is + // prepared to receive an error if a client-side discoverable credential cannot be created. + ResidentKeyRequirementRequired ResidentKeyRequirement = "required" +) + +func ParseResidentKeyRequirement(s string) ResidentKeyRequirement { + switch s { + case "discouraged": + return ResidentKeyRequirementDiscouraged + case "preferred": + return ResidentKeyRequirementPreferred + default: + return ResidentKeyRequirementRequired + } +} + +type ( + AuthenticationExtensions map[string]any + UserVerificationRequirement string +) + +const ( + // VerificationRequired User verification is required to create/release a credential + VerificationRequired UserVerificationRequirement = "required" + + // VerificationPreferred User verification is preferred to create/release a credential + VerificationPreferred UserVerificationRequirement = "preferred" // This is the default + + // VerificationDiscouraged The authenticator should not verify the user for the credential + VerificationDiscouraged UserVerificationRequirement = "discouraged" +) diff --git a/x/did/builder/options.go b/x/did/builder/options.go new file mode 100644 index 000000000..b068ac7f6 --- /dev/null +++ b/x/did/builder/options.go @@ -0,0 +1,82 @@ +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 NewRegistrationOptions(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 new file mode 100644 index 000000000..d23331e3d --- /dev/null +++ b/x/did/builder/pubkey.go @@ -0,0 +1,80 @@ +package builder + +import ( + "fmt" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "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.VerificationMethod { + return &types.VerificationMethod{ + 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) *types.VerificationMethod { + return &types.VerificationMethod{ + Method: namespace, + Controller: controller, + PublicKey: pubkey, + Id: identifier, + } +} + +// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation +func ExtractWebAuthnPublicKey(keyBytes []byte) (*types.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) ([]*types.VerificationMethod, error) { + var verificationMethods []*types.VerificationMethod + 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/service.go b/x/did/builder/service.go new file mode 100644 index 000000000..d7114f727 --- /dev/null +++ b/x/did/builder/service.go @@ -0,0 +1,102 @@ +package builder + +import ( + "crypto/rand" + + "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 _, v := range p.AllowedPublicKeys { + if v.Role == types.KeyRole_KEY_ROLE_AUTHENTICATION { + 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/webauthn.go b/x/did/builder/webauthn.go new file mode 100644 index 000000000..b32d118d8 --- /dev/null +++ b/x/did/builder/webauthn.go @@ -0,0 +1,114 @@ +package builder + +import ( + "bytes" + "encoding/base64" + "reflect" +) + +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/genesis.go b/x/did/keeper/genesis.go index 85e5dbfc6..e0a25ddc7 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -2,8 +2,11 @@ package keeper import ( "context" + "time" "cosmossdk.io/log" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onsonr/sonr/x/did/types" ) @@ -35,3 +38,38 @@ func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { Params: params, } } + +// CheckValidatorExists checks if a validator exists +func (k Keeper) CheckValidatorExists(ctx sdk.Context, addr string) bool { + address, err := sdk.ValAddressFromBech32(addr) + if err != nil { + return false + } + ok, err := k.StakingKeeper.Validator(ctx, address) + if err != nil { + return false + } + if ok != nil { + return true + } + 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) + if err != nil { + p = types.DefaultParams() + } + return &p +} + +// 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)) +} diff --git a/x/did/keeper/ipfs.go b/x/did/keeper/ipfs.go index ec606b418..44aa8f420 100644 --- a/x/did/keeper/ipfs.go +++ b/x/did/keeper/ipfs.go @@ -1,32 +1,82 @@ 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" ) -// AddToLocalIPFS adds a file to the local IPFS node -func (k Keeper) AddToLocalIPFS(ctx sdk.Context, data files.Node) (string, error) { - cid, err := k.ipfsClient.Unixfs().Add(ctx, data) +// assembleInitialVault assembles the initial vault +func (k Keeper) assembleInitialVault(ctx sdk.Context) (string, int64, error) { + cid, err := k.ipfsClient.Unixfs().Add(context.Background(), vfs.AssembleDirectory()) if err != nil { - return "", err + return "", 0, err } - return cid.String(), nil + return cid.String(), k.GetExpirationBlockHeight(ctx, time.Second*15), nil } -// GetFromLocalIPFS gets a file from the local IPFS node -func (k Keeper) GetFromLocalIPFS(ctx sdk.Context, cid string) (files.Node, error) { +// pinInitialVault pins the initial vault to the local IPFS node +func (k Keeper) pinInitialVault(_ sdk.Context, cid string, address string) error { + // Resolve the path + path, err := path.NewPath(cid) + if err != nil { + return 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 err + } + + // 4. Insert the accounts into x/auth + + // 5. Insert the controller into state + return 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 } - return k.ipfsClient.Unixfs().Get(ctx, path) + 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 } -// HasPathInLocalIPFS checks if a file is in the local IPFS node -func (k Keeper) HasPathInLocalIPFS(ctx sdk.Context, cid string) (bool, error) { +// 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 @@ -42,8 +92,8 @@ func (k Keeper) HasPathInLocalIPFS(ctx sdk.Context, cid string) (bool, error) { return true, nil } -// PinToLocalIPFS pins a file to the local IPFS node -func (k Keeper) PinToLocalIPFS(ctx sdk.Context, cid string, name string) error { +// 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 diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index 67b982666..fa9fe0ded 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/log" "cosmossdk.io/orm/model/ormdb" "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -13,6 +14,7 @@ import ( "github.com/ipfs/kubo/client/rpc" apiv1 "github.com/onsonr/sonr/api/did/v1" + middleware "github.com/onsonr/sonr/x/did/middleware" "github.com/onsonr/sonr/x/did/types" ) @@ -35,13 +37,23 @@ type Keeper struct { } // NewKeeper creates a new poa Keeper instance -func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, stkKeeper *stakkeeper.Keeper, logger log.Logger, authority string) Keeper { +func NewKeeper( + cdc codec.BinaryCodec, + storeService storetypes.KVStoreService, + accKeeper authkeeper.AccountKeeper, + stkKeeper *stakkeeper.Keeper, + logger log.Logger, + authority string, +) Keeper { logger = logger.With(log.ModuleKey, "x/"+types.ModuleName) sb := collections.NewSchemaBuilder(storeService) if authority == "" { authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() } - db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService}) + db, err := ormdb.NewModuleDB( + &types.ORMModuleSchema, + ormdb.ModuleDBOptions{KVStoreService: storeService}, + ) if err != nil { panic(err) } @@ -53,10 +65,15 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, ac // Initialize IPFS client ipfsClient, _ := rpc.NewLocalApi() k := Keeper{ - ipfsClient: ipfsClient, - cdc: cdc, - logger: logger, - Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + ipfsClient: ipfsClient, + cdc: cdc, + logger: logger, + Params: collections.NewItem( + sb, + types.ParamsKey, + "params", + codec.CollValue[types.Params](cdc), + ), authority: authority, OrmDB: store, AccountKeeper: accKeeper, @@ -71,7 +88,53 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, ac return k } -// HasIPFSConnection returns true if the IPFS client is initialized -func (k *Keeper) HasIPFSConnection() bool { - return k.ipfsClient != nil +// IsClaimedServiceOrigin checks if a service origin is unclaimed +func (k Keeper) IsUnclaimedServiceOrigin(ctx sdk.Context, origin string) bool { + rec, _ := k.OrmDB.ServiceRecordTable().GetByOriginUri(ctx, origin) + return rec == nil +} + +// IsValidServiceOrigin checks if a service origin is valid +func (k Keeper) IsValidServiceOrigin(ctx sdk.Context, origin string, clientInfo *middleware.ClientInfo) bool { + if origin != clientInfo.Hostname { + return false + } + rec, err := k.OrmDB.ServiceRecordTable().GetByOriginUri(ctx, origin) + if err != nil { + return false + } + if rec == nil { + return false + } + return true +} + +// VerifyMinimumStake checks if a validator has a minimum stake +func (k Keeper) VerifyMinimumStake(ctx sdk.Context, addr string) bool { + address, err := sdk.AccAddressFromBech32(addr) + 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, + addr string, + service string, + permissions string, +) bool { + return false } diff --git a/x/did/keeper/models.go b/x/did/keeper/models.go new file mode 100644 index 000000000..0f8b89ac0 --- /dev/null +++ b/x/did/keeper/models.go @@ -0,0 +1,12 @@ +package keeper + +import ( + didv1 "github.com/onsonr/sonr/api/did/v1" + "github.com/onsonr/sonr/x/did/types" +) + +func convertServiceRecord(rec *didv1.ServiceRecord) *types.Service { + return &types.Service{ + Origin: rec.OriginUri, + } +} diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index f6d26a00f..2d1c7472b 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -2,8 +2,11 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/genproto/googleapis/api/httpbody" + "google.golang.org/grpc/peer" "github.com/onsonr/sonr/x/did/types" ) @@ -19,43 +22,53 @@ func NewQuerier(keeper Keeper) Querier { } // Params returns the total set of did parameters. -func (k Querier) Params(c context.Context, req *types.QueryRequest) (*types.QueryParamsResponse, error) { +func (k Querier) Params( + c context.Context, + req *types.QueryRequest, +) (*types.QueryParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) p, err := k.Keeper.Params.Get(ctx) if err != nil { return nil, err } - - return &types.QueryParamsResponse{Params: &p, IpfsActive: k.HasIPFSConnection()}, nil -} - -// Accounts implements types.QueryServer. -func (k Querier) Accounts(goCtx context.Context, req *types.QueryRequest) (*types.QueryAccountsResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - return &types.QueryAccountsResponse{}, nil -} - -// Credentials implements types.QueryServer. -func (k Querier) Credentials(goCtx context.Context, req *types.QueryRequest) (*types.QueryCredentialsResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - return &types.QueryCredentialsResponse{}, nil + params := p.ActiveParams(k.HasIPFSConnection()) + return &types.QueryParamsResponse{Params: ¶ms}, nil } // Resolve implements types.QueryServer. -func (k Querier) Resolve(goCtx context.Context, req *types.QueryRequest) (*types.QueryResolveResponse, error) { +func (k Querier) Resolve( + goCtx context.Context, + req *types.QueryRequest, +) (*types.QueryResolveResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) return &types.QueryResolveResponse{}, nil } // Service implements types.QueryServer. -func (k Querier) Service(goCtx context.Context, req *types.QueryRequest) (*types.QueryServiceResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - return &types.QueryServiceResponse{}, nil +func (k Querier) Service( + goCtx context.Context, + req *types.QueryRequest, +) (*types.QueryServiceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + _, ok := peer.FromContext(goCtx) + if !ok { + return nil, fmt.Errorf("failed to get peer from context") + } + + rec, err := k.OrmDB.ServiceRecordTable().GetByOriginUri(ctx, req.Origin) + if err != nil { + return nil, err + } + return &types.QueryServiceResponse{Service: convertServiceRecord(rec)}, nil } -// Token implements types.QueryServer. -func (k Querier) Token(goCtx context.Context, req *types.QueryRequest) (*types.QueryTokenResponse, error) { +// HTMX implements types.QueryServer. +func (k Querier) HTMX(goCtx context.Context, req *types.QueryRequest) (*httpbody.HttpBody, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - return &types.QueryTokenResponse{}, nil + return &httpbody.HttpBody{ + ContentType: "text/html", + Data: []byte("HTMX"), + }, nil } diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index 03176b242..dda5cdab6 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -2,13 +2,14 @@ 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" - "cosmossdk.io/errors" - didv1 "github.com/onsonr/sonr/api/did/v1" - "github.com/onsonr/sonr/internal/files" + "github.com/onsonr/sonr/x/did/builder" + "github.com/onsonr/sonr/x/did/middleware" "github.com/onsonr/sonr/x/did/types" ) @@ -24,62 +25,111 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { } // UpdateParams updates the x/did module parameters. -func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { +func (ms msgServer) UpdateParams( + ctx context.Context, + msg *types.MsgUpdateParams, +) (*types.MsgUpdateParamsResponse, error) { if ms.k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) + return nil, errors.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority; expected %s, got %s", + ms.k.authority, + msg.Authority, + ) } return nil, ms.k.Params.Set(ctx, msg.Params) } // Authorize implements types.MsgServer. -func (ms msgServer) Authorize(ctx context.Context, msg *types.MsgAuthorize) (*types.MsgAuthorizeResponse, error) { +func (ms msgServer) Authorize( + ctx context.Context, + msg *types.MsgAuthorize, +) (*types.MsgAuthorizeResponse, error) { if ms.k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) + return nil, errors.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority; expected %s, got %s", + ms.k.authority, + msg.Authority, + ) } // ctx := sdk.UnwrapSDKContext(goCtx) return &types.MsgAuthorizeResponse{}, nil } // AllocateVault implements types.MsgServer. -func (ms msgServer) AllocateVault(goCtx context.Context, msg *types.MsgAllocateVault) (*types.MsgAllocateVaultResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - err := files.Assemble("/tmp/sonr-testnet-1/vaults/0") +func (ms msgServer) AllocateVault( + goCtx context.Context, + msg *types.MsgAllocateVault, +) (*types.MsgAllocateVaultResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + clientInfo, err := middleware.ExtractClientInfo(goCtx) if err != nil { return nil, err } - return &types.MsgAllocateVaultResponse{}, nil + + // 1.Check if the service origin is valid + if ms.k.IsValidServiceOrigin(ctx, msg.Origin, clientInfo) { + return nil, types.ErrInvalidServiceOrigin + } + + cid, expiryBlock, err := ms.k.assembleInitialVault(ctx) + if err != nil { + return nil, err + } + + regOpts, err := builder.NewRegistrationOptions(msg.Origin, msg.Subject, cid, ms.k.GetParams(ctx)) + if err != nil { + return nil, err + } + + // Convert to string + regOptsJSON, err := json.Marshal(regOpts) + if err != nil { + return nil, err + } + + return &types.MsgAllocateVaultResponse{ + ExpiryBlock: expiryBlock, + Cid: cid, + RegistrationOptions: string(regOptsJSON), + }, nil } // RegisterController implements types.MsgServer. -func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegisterController) (*types.MsgRegisterControllerResponse, error) { - if ms.k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) - } - ctx := sdk.UnwrapSDKContext(goCtx) - svc := didv1.ServiceRecord{ - Controller: msg.Authority, - } - ms.k.OrmDB.ServiceRecordTable().Insert(ctx, &svc) +func (ms msgServer) RegisterController( + goCtx context.Context, + msg *types.MsgRegisterController, +) (*types.MsgRegisterControllerResponse, error) { + _ = sdk.UnwrapSDKContext(goCtx) return &types.MsgRegisterControllerResponse{}, nil } // RegisterService implements types.MsgServer. -func (ms msgServer) RegisterService(ctx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) { - if ms.k.authority != msg.Controller { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Controller) +func (ms msgServer) RegisterService( + goCtx context.Context, + msg *types.MsgRegisterService, +) (*types.MsgRegisterServiceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + clientInfo, err := middleware.ExtractClientInfo(goCtx) + if err != nil { + return nil, err } - // ctx := sdk.UnwrapSDKContext(goCtx) - svc := didv1.ServiceRecord{ - Controller: msg.Controller, + // 1.Check if the service origin is valid + if !ms.k.IsValidServiceOrigin(ctx, msg.OriginUri, clientInfo) { + return nil, types.ErrInvalidServiceOrigin } - ms.k.OrmDB.ServiceRecordTable().Insert(ctx, &svc) - return &types.MsgRegisterServiceResponse{}, nil + return ms.k.insertService(ctx, msg) } // SyncVault implements types.MsgServer. -func (ms msgServer) SyncVault(ctx context.Context, msg *types.MsgSyncVault) (*types.MsgSyncVaultResponse, error) { +func (ms msgServer) SyncVault( + ctx context.Context, + msg *types.MsgSyncVault, +) (*types.MsgSyncVaultResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) return &types.MsgSyncVaultResponse{}, nil } diff --git a/x/did/keeper/state.go b/x/did/keeper/state.go new file mode 100644 index 000000000..1f35e1188 --- /dev/null +++ b/x/did/keeper/state.go @@ -0,0 +1,26 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + didv1 "github.com/onsonr/sonr/api/did/v1" + "github.com/onsonr/sonr/x/did/types" +) + +// insertService inserts a service record into the database +func (k Keeper) insertService( + ctx sdk.Context, + svc *types.MsgRegisterService, +) (*types.MsgRegisterServiceResponse, error) { + record := didv1.ServiceRecord{ + Id: svc.OriginUri, + } + err := k.OrmDB.ServiceRecordTable().Insert(ctx, &record) + if err != nil { + return nil, err + } + return &types.MsgRegisterServiceResponse{ + Success: true, + Did: record.Id, + }, nil +} diff --git a/x/did/keeper/validate.go b/x/did/keeper/validate.go deleted file mode 100644 index 6c4ac1848..000000000 --- a/x/did/keeper/validate.go +++ /dev/null @@ -1,70 +0,0 @@ -package keeper - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// CheckValidatorExists checks if a validator exists -func (k Keeper) CheckValidatorExists(ctx sdk.Context, addr string) bool { - address, err := sdk.ValAddressFromBech32(addr) - if err != nil { - return false - } - ok, err := k.StakingKeeper.Validator(ctx, address) - if err != nil { - return false - } - if ok != nil { - return true - } - 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()) -} - -// 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)) -} - -// ValidServiceOrigin checks if a service origin is valid -func (k Keeper) ValidServiceOrigin(ctx sdk.Context, origin string) bool { - rec, err := k.OrmDB.ServiceRecordTable().GetByOriginUri(ctx, origin) - if err != nil { - return false - } - if rec == nil { - return false - } - return true -} - -// VerifyMinimumStake checks if a validator has a minimum stake -func (k Keeper) VerifyMinimumStake(ctx sdk.Context, addr string) bool { - address, err := sdk.AccAddressFromBech32(addr) - 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, addr string, service string, permissions string) bool { - return false -} diff --git a/x/did/middleware/grpc.go b/x/did/middleware/grpc.go new file mode 100644 index 000000000..745cc1c8b --- /dev/null +++ b/x/did/middleware/grpc.go @@ -0,0 +1,55 @@ +package middleware + +import ( + "context" + "fmt" + "net" + "strings" + + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" +) + +type ClientInfo struct { + Authority string + ContentType string + UserAgent string + Hostname string + IPAddress string +} + +func ExtractClientInfo(ctx context.Context) (*ClientInfo, error) { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return nil, fmt.Errorf("failed to get metadata from context") + } + + info := &ClientInfo{} + + // Extract authority, content-type, and user-agent + if authority := md.Get("authority"); len(authority) > 0 { + info.Authority = authority[0] + } + if contentType := md.Get("content-type"); len(contentType) > 0 { + info.ContentType = contentType[0] + } + if userAgent := md.Get("user-agent"); len(userAgent) > 0 { + info.UserAgent = userAgent[0] + } + + // Extract hostname and IP address + p, ok := peer.FromContext(ctx) + if ok { + if tcpAddr, ok := p.Addr.(*net.TCPAddr); ok { + info.IPAddress = tcpAddr.IP.String() + + // Try to get hostname + names, err := net.LookupAddr(info.IPAddress) + if err == nil && len(names) > 0 { + info.Hostname = strings.TrimSuffix(names[0], ".") + } + } + } + + return info, nil +} diff --git a/x/did/types/constants.go b/x/did/types/coins.go similarity index 100% rename from x/did/types/constants.go rename to x/did/types/coins.go diff --git a/x/did/types/constants.pb.go b/x/did/types/constants.pb.go deleted file mode 100644 index 99f16378e..000000000 --- a/x/did/types/constants.pb.go +++ /dev/null @@ -1,445 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: did/v1/constants.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - math "math" -) - -// 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 - -// 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_7cc61ab03a01b9c8, []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_7cc61ab03a01b9c8, []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_BLS12377 KeyAlgorithm = 6 - KeyAlgorithm_KEY_ALGORITHM_KECCAK256 KeyAlgorithm = 7 -) - -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_BLS12377", - 7: "KEY_ALGORITHM_KECCAK256", -} - -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_BLS12377": 6, - "KEY_ALGORITHM_KECCAK256": 7, -} - -func (x KeyAlgorithm) String() string { - return proto.EnumName(KeyAlgorithm_name, int32(x)) -} - -func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7cc61ab03a01b9c8, []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 -) - -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", -} - -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, -} - -func (x KeyCurve) String() string { - return proto.EnumName(KeyCurve_name, int32(x)) -} - -func (KeyCurve) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7cc61ab03a01b9c8, []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 - KeyEncoding_KEY_ENCODING_JWK KeyEncoding = 4 -) - -var KeyEncoding_name = map[int32]string{ - 0: "KEY_ENCODING_UNSPECIFIED", - 1: "KEY_ENCODING_RAW", - 2: "KEY_ENCODING_HEX", - 3: "KEY_ENCODING_MULTIBASE", - 4: "KEY_ENCODING_JWK", -} - -var KeyEncoding_value = map[string]int32{ - "KEY_ENCODING_UNSPECIFIED": 0, - "KEY_ENCODING_RAW": 1, - "KEY_ENCODING_HEX": 2, - "KEY_ENCODING_MULTIBASE": 3, - "KEY_ENCODING_JWK": 4, -} - -func (x KeyEncoding) String() string { - return proto.EnumName(KeyEncoding_name, int32(x)) -} - -func (KeyEncoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7cc61ab03a01b9c8, []int{4} -} - -// KeyRole defines the kind of key -type KeyRole int32 - -const ( - KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0 - // Blockchain key types - 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_7cc61ab03a01b9c8, []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 -) - -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", -} - -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, -} - -func (x KeyType) String() string { - return proto.EnumName(KeyType_name, int32(x)) -} - -func (KeyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7cc61ab03a01b9c8, []int{6} -} - -// 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_RECORDS_READ PermissionScope = 2 - PermissionScope_PERMISSION_SCOPE_RECORDS_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_RECORDS_READ", - 3: "PERMISSION_SCOPE_RECORDS_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_RECORDS_READ": 2, - "PERMISSION_SCOPE_RECORDS_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_7cc61ab03a01b9c8, []int{7} -} - -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.PermissionScope", PermissionScope_name, PermissionScope_value) -} - -func init() { proto.RegisterFile("did/v1/constants.proto", fileDescriptor_7cc61ab03a01b9c8) } - -var fileDescriptor_7cc61ab03a01b9c8 = []byte{ - // 902 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x95, 0xdf, 0x72, 0xda, 0x46, - 0x14, 0xc6, 0x2d, 0x83, 0xb1, 0xb3, 0x71, 0x92, 0x93, 0x4d, 0xe2, 0x24, 0x4d, 0x42, 0xd2, 0x24, - 0xd3, 0x74, 0xe8, 0x8c, 0x29, 0xd8, 0x34, 0xe9, 0x4c, 0x6f, 0x56, 0xab, 0x63, 0xb3, 0x95, 0x90, - 0x34, 0xbb, 0x0b, 0xc4, 0xbd, 0x61, 0x1c, 0xd0, 0x38, 0xcc, 0xc4, 0x88, 0x01, 0xe2, 0x29, 0x8f, - 0xd0, 0xf6, 0xa6, 0x6f, 0xd0, 0x17, 0xe8, 0x83, 0xf4, 0xd2, 0x97, 0xbd, 0xec, 0xd8, 0x7d, 0x89, - 0xde, 0x75, 0x84, 0xf8, 0x27, 0xc0, 0xbe, 0xe1, 0xe2, 0xf7, 0x7d, 0x3a, 0xfa, 0xce, 0x39, 0xcb, - 0x8a, 0xec, 0xb4, 0xda, 0xad, 0xfc, 0x59, 0x21, 0xdf, 0x0c, 0x3b, 0xfd, 0xc1, 0x71, 0x67, 0xd0, - 0xdf, 0xed, 0xf6, 0xc2, 0x41, 0x48, 0x33, 0xad, 0x76, 0x6b, 0xf7, 0xac, 0x90, 0xfb, 0xd3, 0x20, - 0x37, 0x58, 0xbf, 0x1f, 0x0c, 0xf4, 0xb0, 0x1b, 0xd0, 0x2f, 0xc8, 0x0e, 0x53, 0x0a, 0x75, 0x43, - 0x1f, 0xf9, 0xd8, 0xa8, 0xba, 0xca, 0x47, 0x2e, 0x0e, 0x04, 0x5a, 0xb0, 0x46, 0x1f, 0x90, 0xbb, - 0x73, 0x9a, 0xcb, 0xb4, 0xa8, 0x21, 0x18, 0x74, 0x87, 0xd0, 0x39, 0x5c, 0x97, 0xcc, 0xf7, 0xd1, - 0x82, 0xf5, 0x05, 0xae, 0x34, 0xb3, 0x85, 0x7b, 0x08, 0x29, 0x7a, 0x8f, 0xdc, 0x99, 0xe3, 0xbe, - 0xe7, 0x39, 0x90, 0xa6, 0x94, 0xdc, 0x9e, 0x83, 0xc2, 0xe4, 0xb0, 0xb1, 0x60, 0xe4, 0xf5, 0xe2, - 0xb7, 0x90, 0xc9, 0xfd, 0x67, 0x90, 0x6d, 0x4b, 0x58, 0xee, 0xf1, 0x69, 0xd0, 0xef, 0x1e, 0x37, - 0x03, 0xfa, 0x8c, 0x3c, 0xb6, 0x84, 0xd5, 0x70, 0x59, 0x05, 0x95, 0xcf, 0xf8, 0x62, 0xe8, 0x1d, - 0x42, 0x93, 0xb2, 0xf0, 0x0f, 0x54, 0x9c, 0x3a, 0xc9, 0x95, 0xe7, 0x4a, 0x58, 0xa7, 0x8f, 0xc9, - 0x83, 0x24, 0x37, 0x85, 0xe6, 0x9e, 0x70, 0x21, 0x15, 0xcd, 0x26, 0x29, 0xa1, 0x2e, 0xa3, 0xc4, - 0x6a, 0x05, 0xd2, 0xd1, 0x6c, 0x16, 0x5e, 0x33, 0x6a, 0x61, 0xe9, 0x91, 0x3a, 0x9a, 0xac, 0xaa, - 0xcb, 0x2e, 0x64, 0x96, 0x1f, 0xb1, 0xea, 0x2e, 0x6c, 0x2e, 0x07, 0x50, 0x28, 0x6b, 0x82, 0x23, - 0x6c, 0xe5, 0xfe, 0x35, 0xc8, 0xb6, 0x1d, 0x0c, 0xd9, 0xa7, 0x93, 0xb0, 0xd7, 0x1e, 0x7c, 0x3c, - 0x8d, 0x7a, 0xb7, 0xf1, 0xa8, 0xc1, 0x9c, 0x43, 0x4f, 0x0a, 0x5d, 0xae, 0x2c, 0xf4, 0xfe, 0x90, - 0xdc, 0x4b, 0xca, 0xa8, 0x8a, 0xa5, 0xef, 0xc0, 0x58, 0x25, 0xec, 0xbd, 0xdb, 0x87, 0xf5, 0x55, - 0x42, 0xa9, 0x50, 0x84, 0xd4, 0x0a, 0xc1, 0xb2, 0x14, 0x83, 0x34, 0x7d, 0x44, 0xee, 0xaf, 0x78, - 0x87, 0x1d, 0xf7, 0x9e, 0x54, 0x4c, 0x47, 0x15, 0x8a, 0x7b, 0x6f, 0xdf, 0x42, 0x86, 0x3e, 0x21, - 0x0f, 0x93, 0x9a, 0x8d, 0x9c, 0x33, 0x3b, 0x4a, 0xb7, 0x99, 0x3b, 0x37, 0xc8, 0x96, 0x1d, 0x0c, - 0xf9, 0xe7, 0xde, 0x59, 0x10, 0x8d, 0x23, 0x72, 0xf2, 0xaa, 0xac, 0x2d, 0xae, 0x96, 0x92, 0xdb, - 0x33, 0xc9, 0x8f, 0x3b, 0x4b, 0xb2, 0xb8, 0xa9, 0x24, 0x2b, 0x15, 0x0b, 0x90, 0xa2, 0xf7, 0x09, - 0xcc, 0xd8, 0xfb, 0x62, 0xa9, 0x54, 0xf8, 0x3e, 0x3e, 0x85, 0x73, 0x74, 0x7f, 0xff, 0x1d, 0x6c, - 0x44, 0x6b, 0x9a, 0x31, 0xb4, 0x62, 0x6b, 0x26, 0x3a, 0x9c, 0xf3, 0x38, 0xf2, 0x6e, 0x4e, 0xa6, - 0x14, 0x43, 0x85, 0x3c, 0x0a, 0x65, 0x17, 0x60, 0x2b, 0xf7, 0x8b, 0x41, 0x6e, 0xda, 0xc1, 0x10, - 0x3b, 0xcd, 0xb0, 0xd5, 0xee, 0x9c, 0xd0, 0xa7, 0xe4, 0x51, 0x64, 0x44, 0x97, 0x7b, 0x96, 0x70, - 0x0f, 0x17, 0x1a, 0x1b, 0x87, 0x9b, 0xaa, 0x92, 0xd5, 0xc1, 0x58, 0xa2, 0x65, 0x7c, 0x0f, 0xeb, - 0x93, 0x29, 0x4f, 0x69, 0xa5, 0xea, 0x68, 0x61, 0x32, 0x85, 0xb3, 0x26, 0xa7, 0xda, 0x8f, 0x75, - 0x1b, 0xd2, 0xb9, 0x5f, 0x0d, 0xb2, 0x69, 0x07, 0x43, 0x19, 0x7e, 0x0a, 0x26, 0xdb, 0x93, 0x9e, - 0xb3, 0x38, 0xdc, 0xf1, 0x86, 0x46, 0x4a, 0x74, 0x62, 0xd1, 0xd5, 0x82, 0x33, 0x2d, 0x3c, 0x37, - 0xfe, 0xf3, 0xcc, 0x44, 0xa5, 0x50, 0x8e, 0xf8, 0xf4, 0xf8, 0x8c, 0xb8, 0x85, 0x0e, 0x1e, 0xc6, - 0x0f, 0xa4, 0x12, 0x82, 0x70, 0x6b, 0xde, 0xb8, 0x52, 0x3a, 0xf7, 0x5b, 0x1c, 0x66, 0x74, 0xf7, - 0x8c, 0xc3, 0xac, 0xb8, 0x79, 0xc6, 0x7b, 0x19, 0x29, 0x1e, 0xd7, 0xa8, 0xc1, 0x98, 0xec, 0x65, - 0xc4, 0xd0, 0x71, 0x84, 0xaf, 0x05, 0x87, 0x75, 0x0a, 0x64, 0x7b, 0x8a, 0xa5, 0x62, 0x90, 0x9a, - 0x84, 0x8d, 0x6f, 0xa1, 0xa3, 0x4a, 0x05, 0xb5, 0x14, 0x1c, 0xd2, 0xf4, 0x2e, 0xb9, 0x35, 0xe5, - 0xe5, 0x0a, 0xe3, 0xb0, 0x91, 0xfb, 0x23, 0x4d, 0xee, 0xf8, 0x41, 0xef, 0xb4, 0xdd, 0xef, 0xb7, - 0xc3, 0x8e, 0x6a, 0x86, 0xdd, 0x80, 0xbe, 0x20, 0x4f, 0x7d, 0x94, 0x15, 0xa1, 0x94, 0xf0, 0xdc, - 0x86, 0xe2, 0xde, 0x52, 0xba, 0xe7, 0xe4, 0xc9, 0x92, 0xc3, 0x64, 0x4a, 0xf0, 0x86, 0x70, 0x0f, - 0x3c, 0x30, 0xe8, 0x97, 0xe4, 0xd9, 0x92, 0x41, 0x22, 0xf7, 0xa4, 0xa5, 0x1a, 0x12, 0x59, 0x74, - 0x59, 0xbe, 0x24, 0xd9, 0x2b, 0x2d, 0x75, 0x29, 0x74, 0xb4, 0xce, 0xaf, 0xc8, 0xcb, 0x25, 0x8f, - 0x96, 0xcc, 0x55, 0x8c, 0x47, 0xd3, 0x1c, 0xd7, 0x4a, 0xd3, 0x37, 0xe4, 0xd5, 0xf5, 0xbe, 0xb8, - 0xe0, 0xc6, 0xca, 0x5c, 0x75, 0xe6, 0x38, 0xa8, 0xc7, 0xb5, 0x32, 0xf4, 0x15, 0x79, 0x7e, 0xa5, - 0x85, 0x4b, 0x64, 0x1a, 0x61, 0x73, 0x65, 0xb0, 0x89, 0x49, 0x55, 0x4d, 0xc5, 0xa5, 0x30, 0x11, - 0xb6, 0xae, 0x2d, 0x56, 0xf5, 0xad, 0xa8, 0xd8, 0x0d, 0xfa, 0x35, 0x79, 0x7d, 0x7d, 0xfa, 0x1a, - 0x4a, 0x71, 0x70, 0x04, 0x84, 0x7e, 0x43, 0xde, 0x5c, 0xef, 0x34, 0xa5, 0xc7, 0x2c, 0xce, 0x94, - 0x86, 0x9b, 0x2b, 0x97, 0xc4, 0xac, 0x8a, 0x70, 0x1b, 0x55, 0x85, 0x12, 0xb6, 0xe9, 0x6b, 0xf2, - 0xe2, 0x0a, 0x43, 0x8d, 0x39, 0xc2, 0x62, 0xda, 0x93, 0x70, 0xcb, 0xfc, 0xe1, 0xaf, 0x8b, 0xac, - 0x71, 0x7e, 0x91, 0x35, 0xfe, 0xb9, 0xc8, 0x1a, 0xbf, 0x5f, 0x66, 0xd7, 0xce, 0x2f, 0xb3, 0x6b, - 0x7f, 0x5f, 0x66, 0xd7, 0x7e, 0x7a, 0x79, 0xd2, 0x1e, 0x7c, 0xfc, 0xfc, 0x61, 0xb7, 0x19, 0x9e, - 0xe6, 0xc3, 0x4e, 0x3f, 0xec, 0xf4, 0xf2, 0xa3, 0x9f, 0x9f, 0xf3, 0xd1, 0x07, 0x78, 0x30, 0xec, - 0x06, 0xfd, 0x0f, 0x99, 0xd1, 0xa7, 0x77, 0xef, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0x58, - 0x91, 0x1e, 0x94, 0x07, 0x00, 0x00, -} diff --git a/x/did/types/defaults.go b/x/did/types/defaults.go deleted file mode 100644 index d1fa53027..000000000 --- a/x/did/types/defaults.go +++ /dev/null @@ -1,109 +0,0 @@ -package types - -// DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC -func DefaultAssets() []*AssetInfo { - return []*AssetInfo{ - { - Name: "Bitcoin", - Symbol: "BTC", - Hrp: "bc", - Index: 0, - AssetType: AssetType_ASSET_TYPE_NATIVE, - IconUrl: "https://cdn.sonr.land/BTC.svg", - }, - { - Name: "Ethereum", - Symbol: "ETH", - Hrp: "eth", - Index: 64, - AssetType: AssetType_ASSET_TYPE_NATIVE, - IconUrl: "https://cdn.sonr.land/ETH.svg", - }, - { - Name: "Sonr", - Symbol: "SNR", - Hrp: "idx", - Index: 703, - AssetType: AssetType_ASSET_TYPE_NATIVE, - IconUrl: "https://cdn.sonr.land/SNR.svg", - }, - } -} - -// DefaultChains returns the default chain infos: Bitcoin, Ethereum, and Sonr. -func DefaultChains() []*ChainInfo { - return []*ChainInfo{} -} - -// DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12377. -func DefaultKeyInfos() []*KeyInfo { - return []*KeyInfo{ - // - // Identity Key Info - // - // Sonr Controller Key Info - { - Role: KeyRole_KEY_ROLE_INVOCATION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256K, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - }, - { - Role: KeyRole_KEY_ROLE_ASSERTION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_BLS12377, - Encoding: KeyEncoding_KEY_ENCODING_MULTIBASE, - }, - - // - // Blockchain Key Info - // - // Ethereum Key Info - { - Role: KeyRole_KEY_ROLE_DELEGATION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_KECCAK256, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - }, - // Bitcoin Key Info - { - Role: KeyRole_KEY_ROLE_DELEGATION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256K, - Encoding: KeyEncoding_KEY_ENCODING_HEX, - }, - - // - // Authentication Key Info - // - // Browser based WebAuthn - { - Role: KeyRole_KEY_ROLE_AUTHENTICATION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, - Encoding: KeyEncoding_KEY_ENCODING_RAW, - }, - // FIDO U2F - { - Role: KeyRole_KEY_ROLE_AUTHENTICATION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256K, - Encoding: KeyEncoding_KEY_ENCODING_RAW, - }, - // Cross-Platform Passkeys - { - Role: KeyRole_KEY_ROLE_AUTHENTICATION, - Algorithm: KeyAlgorithm_KEY_ALGORITHM_EDDSA, - Encoding: KeyEncoding_KEY_ENCODING_RAW, - }, - } -} - -func DefaultOpenIDConfig() *OpenIDConfig { - return &OpenIDConfig{ - Issuer: "https://sonr.id", - AuthorizationEndpoint: "https://api.sonr.id/auth", - TokenEndpoint: "https://api.sonr.id/token", - UserinfoEndpoint: "https://api.sonr.id/userinfo", - 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"}, - } -} diff --git a/x/did/types/ec_point.go b/x/did/types/ec_point.go deleted file mode 100644 index 8ede36958..000000000 --- a/x/did/types/ec_point.go +++ /dev/null @@ -1,41 +0,0 @@ -package types - -import ( - fmt "fmt" - "math/big" - - "github.com/onsonr/crypto/core/curves" - "github.com/onsonr/crypto/signatures/ecdsa" - "golang.org/x/crypto/sha3" -) - -// VerifySignature verifies the signature of a message -func VerifySignature(key []byte, msg []byte, sig []byte) bool { - pp, err := buildEcPoint(key) - if err != nil { - return false - } - sigEd, err := ecdsa.DeserializeSecp256k1Signature(sig) - if err != nil { - return false - } - hash := sha3.New256() - _, err = hash.Write(msg) - if err != nil { - return false - } - digest := hash.Sum(nil) - return curves.VerifyEcdsa(pp, digest[:], sigEd) -} - -// BuildEcPoint builds an elliptic curve point from a compressed byte slice -func buildEcPoint(pubKey []byte) (*curves.EcPoint, error) { - crv := curves.K256() - x := new(big.Int).SetBytes(pubKey[1:33]) - y := new(big.Int).SetBytes(pubKey[33:]) - ecCurve, err := crv.ToEllipticCurve() - if err != nil { - return nil, fmt.Errorf("error converting curve: %v", err) - } - return &curves.EcPoint{X: x, Y: y, Curve: ecCurve}, nil -} diff --git a/x/did/types/encoding.go b/x/did/types/encoding.go new file mode 100644 index 000000000..e4ced1989 --- /dev/null +++ b/x/did/types/encoding.go @@ -0,0 +1,136 @@ +package types + +import ( + "encoding/hex" + fmt "fmt" + + "github.com/cosmos/btcutil/bech32" + "github.com/mr-tron/base58/base58" +) + +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: + return bech32.Encode("eth", pubKey.Bytes()) + + 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 +} diff --git a/x/did/types/errors.go b/x/did/types/errors.go index e6ebdfcbb..bbc7b4365 100644 --- a/x/did/types/errors.go +++ b/x/did/types/errors.go @@ -7,10 +7,9 @@ var ( ErrInvalidETHAddressFormat = sdkerrors.Register(ModuleName, 200, "invalid ETH address format") ErrInvalidBTCAddressFormat = sdkerrors.Register(ModuleName, 201, "invalid BTC address format") ErrInvalidIDXAddressFormat = sdkerrors.Register(ModuleName, 202, "invalid IDX address format") - ErrInvalidEmailFormat = sdkerrors.Register(ModuleName, 203, "invalid email format") - ErrInvalidPhoneFormat = sdkerrors.Register(ModuleName, 204, "invalid phone format") - ErrMinimumAssertions = sdkerrors.Register(ModuleName, 300, "at least one assertion is required for account initialization") - ErrInvalidControllers = sdkerrors.Register(ModuleName, 301, "no more than one controller can be used for account initialization") - ErrMaximumAuthenticators = sdkerrors.Register(ModuleName, 302, "more authenticators provided than the total accepted count") + ErrInvalidServiceOrigin = sdkerrors.Register(ModuleName, 300, "invalid service origin") + ErrUnrecognizedService = sdkerrors.Register(ModuleName, 301, "unrecognized service") ErrUnsupportedKeyEncoding = sdkerrors.Register(ModuleName, 400, "unsupported key encoding") + ErrUnsopportedChainCode = sdkerrors.Register(ModuleName, 401, "unsupported chain code") + ErrUnsupportedKeyCurve = sdkerrors.Register(ModuleName, 402, "unsupported key curve") ) diff --git a/x/did/types/genesis.go b/x/did/types/genesis.go index 1541cd439..56cb7a54a 100644 --- a/x/did/types/genesis.go +++ b/x/did/types/genesis.go @@ -1,6 +1,30 @@ package types -import "encoding/json" +import ( + "encoding/json" + + "cosmossdk.io/collections" + + ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" +) + +// ParamsKey saves the current module params. +var ParamsKey = collections.NewPrefix(0) + +const ( + ModuleName = "did" + + StoreKey = ModuleName + + QuerierRoute = ModuleName +) + +var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{ + SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ + {Id: 1, ProtoFileName: "did/v1/state.proto"}, + }, + Prefix: []byte{0}, +} // this line is used by starport scaffolding # genesis/types/import @@ -26,13 +50,139 @@ func (gs GenesisState) Validate() error { // DefaultParams returns default module parameters. func DefaultParams() Params { return Params{ - WhitelistedAssets: DefaultAssets(), - WhitelistedChains: DefaultChains(), - AllowedPublicKeys: DefaultKeyInfos(), - OpenidConfig: DefaultOpenIDConfig(), + WhitelistedAssets: DefaultAssets(), + WhitelistedChains: DefaultChains(), + AllowedPublicKeys: DefaultKeyInfos(), + OpenidConfig: DefaultOpenIDConfig(), + LocalhostRegistrationEnabled: true, + ConveyancePreference: "direct", + AttestationFormats: []string{"packed", "android-key", "fido-u2f", "apple"}, } } +// DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC +func DefaultAssets() []*AssetInfo { + return []*AssetInfo{ + { + Name: "Bitcoin", + Symbol: "BTC", + Hrp: "bc", + Index: 0, + AssetType: AssetType_ASSET_TYPE_NATIVE, + IconUrl: "https://cdn.sonr.land/BTC.svg", + }, + { + Name: "Ethereum", + Symbol: "ETH", + Hrp: "eth", + Index: 64, + AssetType: AssetType_ASSET_TYPE_NATIVE, + IconUrl: "https://cdn.sonr.land/ETH.svg", + }, + { + Name: "Sonr", + Symbol: "SNR", + Hrp: "idx", + Index: 703, + AssetType: AssetType_ASSET_TYPE_NATIVE, + IconUrl: "https://cdn.sonr.land/SNR.svg", + }, + } +} + +// DefaultChains returns the default chain infos: Bitcoin, Ethereum, and Sonr. +func DefaultChains() []*ChainInfo { + return []*ChainInfo{} +} + +// DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12381. +func DefaultKeyInfos() []*KeyInfo { + return []*KeyInfo{ + // Identity Key Info + // Sonr Controller Key Info - From MPC + { + 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, + }, + + // Sonr Vault Shared Key Info - From Registration + { + 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, + }, + + // Blockchain Key Info + // Ethereum Key Info + { + 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, + }, + // Bitcoin/IBC Key Info + { + 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, + }, + + // Authentication Key Info + // Browser based WebAuthn + { + 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, + }, + // FIDO U2F + { + 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, + }, + // Cross-Platform Passkeys + { + 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, + }, + } +} + +func DefaultOpenIDConfig() *OpenIDConfig { + return &OpenIDConfig{ + Issuer: "https://sonr.id", + AuthorizationEndpoint: "https://api.sonr.id/auth", + TokenEndpoint: "https://api.sonr.id/token", + UserinfoEndpoint: "https://api.sonr.id/userinfo", + 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"}, + } +} + +func (p Params) ActiveParams(ipfsActive bool) Params { + p.IpfsActive = ipfsActive + return p +} + // Stringer method for Params. func (p Params) String() string { bz, err := json.Marshal(p) diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index a903a9f70..bb7852c89 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -25,6 +25,367 @@ 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} +} + +// 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{7} +} + // GenesisState defines the module genesis state type GenesisState struct { // Params defines all the parameters of the module. @@ -81,6 +442,14 @@ type Params struct { AllowedPublicKeys []*KeyInfo `protobuf:"bytes,3,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty"` // OpenIDConfig defines the base openid configuration across all did services OpenidConfig *OpenIDConfig `protobuf:"bytes,4,opt,name=openid_config,json=openidConfig,proto3" json:"openid_config,omitempty"` + // IpfsActive is a flag to enable/disable ipfs + IpfsActive bool `protobuf:"varint,5,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + // Localhost Registration Enabled + LocalhostRegistrationEnabled bool `protobuf:"varint,6,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` + // ConveyancePreference defines the conveyance preference + ConveyancePreference string `protobuf:"bytes,7,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + // AttestationFormats defines the attestation formats + AttestationFormats []string `protobuf:"bytes,8,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -143,6 +512,34 @@ func (m *Params) GetOpenidConfig() *OpenIDConfig { return nil } +func (m *Params) GetIpfsActive() bool { + if m != nil { + return m.IpfsActive + } + return false +} + +func (m *Params) GetLocalhostRegistrationEnabled() bool { + if m != nil { + return m.LocalhostRegistrationEnabled + } + return false +} + +func (m *Params) GetConveyancePreference() string { + if m != nil { + return m.ConveyancePreference + } + return "" +} + +func (m *Params) GetAttestationFormats() []string { + if m != nil { + return m.AttestationFormats + } + return nil +} + // AssetInfo defines the asset info type AssetInfo struct { // The coin type index for bip44 path @@ -836,6 +1233,14 @@ func (m *ValidatorInfo_IBCChannel) GetPort() string { } 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.PermissionScope", PermissionScope_name, PermissionScope_value) proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") proto.RegisterType((*Params)(nil), "did.v1.Params") proto.RegisterType((*AssetInfo)(nil), "did.v1.AssetInfo") @@ -852,78 +1257,132 @@ func init() { func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 1122 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcb, 0x8e, 0x1b, 0x45, - 0x14, 0x9d, 0xf6, 0xbb, 0xaf, 0x3d, 0xce, 0x4c, 0x65, 0x66, 0xd2, 0x18, 0xc5, 0x09, 0xe6, 0xa1, - 0xf0, 0x90, 0x9d, 0x18, 0x82, 0x02, 0x44, 0x40, 0x32, 0x09, 0xd1, 0x28, 0x44, 0x44, 0x1d, 0xc8, - 0x82, 0x4d, 0xab, 0xdc, 0x5d, 0x63, 0x17, 0xe9, 0xae, 0x6a, 0x55, 0x75, 0x4f, 0x62, 0x3e, 0x81, - 0x15, 0x4b, 0xd8, 0x85, 0x3f, 0x80, 0x7f, 0x60, 0x91, 0x0d, 0x52, 0x96, 0xac, 0x50, 0x94, 0x59, - 0xc0, 0x8a, 0x6f, 0x40, 0x75, 0xfb, 0x61, 0x3b, 0x9e, 0x48, 0x6c, 0xac, 0xfb, 0x3a, 0xa7, 0xea, - 0xde, 0x53, 0x55, 0x6d, 0xd8, 0x09, 0x78, 0x30, 0x3a, 0xba, 0x34, 0x9a, 0x32, 0xc1, 0x34, 0xd7, - 0xc3, 0x58, 0xc9, 0x44, 0x92, 0x46, 0xc0, 0x83, 0xe1, 0xd1, 0xa5, 0xde, 0x36, 0x8d, 0xb8, 0x90, - 0x23, 0xfc, 0xcd, 0x52, 0xbd, 0xbd, 0x1c, 0xe0, 0x4b, 0xa1, 0x13, 0x2a, 0x92, 0x1c, 0xd2, 0xdb, - 0x99, 0xca, 0xa9, 0x44, 0x73, 0x64, 0xac, 0x2c, 0x3a, 0xb8, 0x0a, 0x9d, 0x5b, 0x19, 0xf3, 0xbd, - 0x84, 0x26, 0x8c, 0xbc, 0x07, 0x8d, 0x98, 0x2a, 0x1a, 0x69, 0xc7, 0x3a, 0x6f, 0x5d, 0x68, 0x8f, - 0xbb, 0xc3, 0x6c, 0xa5, 0xe1, 0x5d, 0x8c, 0x5e, 0xaf, 0x3d, 0xf9, 0xeb, 0xdc, 0x86, 0x9b, 0xd7, - 0x0c, 0x7e, 0xa9, 0x40, 0x23, 0x4b, 0x90, 0xcf, 0x81, 0x3c, 0x9c, 0xf1, 0x84, 0x85, 0x5c, 0x27, - 0x2c, 0xf0, 0xa8, 0xd6, 0x2c, 0x31, 0x24, 0xd5, 0x0b, 0xed, 0xf1, 0x76, 0x41, 0x72, 0xcd, 0x44, - 0x0f, 0xc4, 0xa1, 0x74, 0xb7, 0x97, 0x8a, 0x31, 0xba, 0xc6, 0xe0, 0xcf, 0x28, 0x17, 0xda, 0xa9, - 0xac, 0x32, 0xec, 0x9b, 0xe8, 0x1a, 0x03, 0x46, 0x35, 0xf9, 0x0c, 0x4e, 0xd3, 0x30, 0x94, 0x0f, - 0x59, 0xe0, 0xc5, 0xe9, 0x24, 0xe4, 0xbe, 0xf7, 0x80, 0xcd, 0xb5, 0x53, 0x45, 0x8a, 0x53, 0x05, - 0xc5, 0x6d, 0x36, 0xcf, 0x08, 0xf2, 0xda, 0xbb, 0x58, 0x7a, 0x9b, 0xcd, 0x35, 0xf9, 0x08, 0x36, - 0x65, 0xcc, 0x04, 0x0f, 0x3c, 0x5f, 0x8a, 0x43, 0x3e, 0x75, 0x6a, 0x38, 0x84, 0x9d, 0x02, 0xfa, - 0x55, 0xcc, 0xc4, 0xc1, 0x8d, 0x7d, 0xcc, 0xb9, 0x9d, 0xac, 0x34, 0xf3, 0x3e, 0x3e, 0xf3, 0xd3, - 0xe3, 0x73, 0x1b, 0xff, 0x3c, 0x3e, 0x67, 0xfd, 0xf0, 0xf7, 0xaf, 0xef, 0x80, 0xd1, 0x20, 0x9f, - 0xd1, 0xef, 0x16, 0xd8, 0x65, 0xdf, 0x64, 0x07, 0xea, 0x5c, 0x04, 0xec, 0x11, 0x8e, 0xb7, 0xea, - 0x66, 0x0e, 0xd9, 0x82, 0xea, 0x4c, 0xc5, 0x4e, 0xe5, 0xbc, 0x75, 0xc1, 0x76, 0x8d, 0x49, 0xf6, - 0xa0, 0xa1, 0xe7, 0xd1, 0x44, 0x86, 0x4e, 0x15, 0x83, 0xb9, 0x47, 0x2e, 0x02, 0xe0, 0x68, 0xbd, - 0x64, 0x1e, 0x33, 0xdc, 0x5e, 0xf7, 0x85, 0xf1, 0x7e, 0x3d, 0x8f, 0x99, 0x6b, 0xd3, 0xc2, 0x24, - 0x04, 0x6a, 0x82, 0x46, 0xcc, 0xa9, 0x23, 0x0f, 0xda, 0x86, 0x3d, 0x62, 0xc9, 0x4c, 0x06, 0x4e, - 0x23, 0x63, 0xcf, 0x3c, 0xf2, 0x0a, 0xb4, 0xb8, 0x2f, 0x85, 0x97, 0xaa, 0xd0, 0x69, 0x62, 0xa6, - 0x69, 0xfc, 0x6f, 0x54, 0x38, 0xf8, 0xd9, 0x02, 0xbb, 0x1c, 0x3e, 0xe9, 0x42, 0x85, 0x07, 0xd8, - 0x83, 0xed, 0x56, 0x38, 0x02, 0x51, 0x2f, 0x8f, 0x07, 0x79, 0x17, 0x4d, 0xf4, 0x0f, 0x82, 0x72, - 0xfd, 0xea, 0xea, 0xfa, 0x79, 0x77, 0xb5, 0x95, 0xee, 0x2e, 0x03, 0x1c, 0xd1, 0x90, 0x07, 0x34, - 0x91, 0x4a, 0x3b, 0x75, 0xd4, 0x6d, 0xb7, 0xe8, 0xee, 0x7e, 0x91, 0x41, 0xf5, 0x96, 0x0a, 0x07, - 0xcf, 0x2c, 0x68, 0xe6, 0xaa, 0x92, 0xd7, 0xa1, 0xa6, 0x64, 0xc8, 0x70, 0x6f, 0xdd, 0x15, 0xd1, - 0x5d, 0x19, 0x32, 0x17, 0x93, 0x64, 0x0c, 0x36, 0x0d, 0xa7, 0x52, 0xf1, 0x64, 0x16, 0xe1, 0x7e, - 0xbb, 0x0b, 0x8d, 0x6f, 0xb3, 0xf9, 0xb5, 0x22, 0xe7, 0x2e, 0xca, 0xc8, 0x08, 0x5a, 0x4c, 0xf8, - 0x32, 0xe0, 0x62, 0x8a, 0xbd, 0x74, 0xc7, 0xa7, 0x97, 0x20, 0x37, 0xf3, 0x94, 0x5b, 0x16, 0x91, - 0xb7, 0xa0, 0xee, 0xa7, 0xea, 0xa8, 0x50, 0x69, 0x6b, 0xa9, 0x7a, 0xdf, 0xc4, 0xdd, 0x2c, 0x6d, - 0x76, 0x8c, 0x62, 0xd6, 0xd7, 0x76, 0x8c, 0x52, 0x62, 0x72, 0xf0, 0x6f, 0x15, 0x3a, 0xcb, 0xa7, - 0xcf, 0x8c, 0x90, 0x6b, 0x9d, 0x32, 0x95, 0xab, 0x90, 0x7b, 0xe4, 0x32, 0xec, 0xd1, 0x34, 0x99, - 0x49, 0xc5, 0xbf, 0xa7, 0x09, 0x97, 0xc2, 0x63, 0x22, 0x88, 0x25, 0x17, 0x49, 0xae, 0xcb, 0xee, - 0x4a, 0xf6, 0x66, 0x9e, 0x24, 0x6f, 0x42, 0x37, 0x91, 0x0f, 0xd8, 0x52, 0x79, 0xa6, 0xd7, 0x26, - 0x46, 0xcb, 0xb2, 0x77, 0x61, 0x3b, 0xd5, 0x4c, 0x71, 0x71, 0x28, 0x17, 0x95, 0x99, 0x86, 0x5b, - 0x45, 0xa2, 0x2c, 0x7e, 0x1b, 0xb6, 0xb4, 0x2f, 0x63, 0xa6, 0x3d, 0x9d, 0xc6, 0xb1, 0x54, 0x09, - 0x0b, 0x50, 0x53, 0xdb, 0x3d, 0x95, 0xc5, 0xef, 0x15, 0x61, 0x72, 0x05, 0x1c, 0xc5, 0x74, 0x2c, - 0x85, 0x66, 0x78, 0xb2, 0x97, 0x21, 0x0d, 0x84, 0xec, 0x15, 0x79, 0x33, 0x94, 0x97, 0x20, 0x23, - 0x19, 0xac, 0x20, 0x9b, 0xab, 0xc8, 0x3b, 0x26, 0xbd, 0x40, 0x8e, 0x61, 0x77, 0xaa, 0xa8, 0x48, - 0xd6, 0x16, 0x6c, 0x21, 0xec, 0x34, 0x26, 0x5f, 0x58, 0xed, 0x22, 0xec, 0x50, 0x5f, 0x79, 0x47, - 0x34, 0x4c, 0x57, 0x20, 0x36, 0x42, 0x08, 0xf5, 0xd5, 0x7d, 0x4c, 0x2d, 0x10, 0x1f, 0xc2, 0x19, - 0x9d, 0x4e, 0xbe, 0x63, 0xfe, 0xfa, 0x3a, 0x80, 0xa0, 0xdd, 0x3c, 0xbd, 0xba, 0xd2, 0xe0, 0x8f, - 0x3a, 0x6c, 0xae, 0x9c, 0x78, 0xe2, 0x40, 0x33, 0x92, 0x82, 0x3f, 0x28, 0x25, 0x2f, 0x5c, 0x72, - 0x13, 0xba, 0x53, 0x15, 0xfb, 0xa5, 0x22, 0xc5, 0xab, 0xd9, 0x3f, 0xf1, 0xea, 0x0c, 0x0b, 0x81, - 0xdc, 0x4d, 0x83, 0x2a, 0x3c, 0x6d, 0x68, 0x14, 0xd3, 0xc9, 0x12, 0x4d, 0xf5, 0xff, 0xd1, 0x18, - 0xd4, 0x82, 0xe6, 0x53, 0x68, 0xb1, 0x47, 0x71, 0x28, 0x15, 0x53, 0xf9, 0xfb, 0x39, 0x78, 0x09, - 0x41, 0x5e, 0x85, 0xf7, 0xb9, 0xc4, 0x90, 0x2b, 0xd0, 0x3a, 0x64, 0xcc, 0x33, 0x47, 0x09, 0xef, - 0x44, 0x7b, 0x7c, 0xf6, 0x64, 0xfc, 0x17, 0x8c, 0x21, 0xb4, 0x79, 0x98, 0x19, 0xe4, 0x1a, 0xb4, - 0xf9, 0xc4, 0x37, 0x5f, 0x0e, 0x21, 0x58, 0x88, 0x6f, 0x5b, 0x7b, 0x7c, 0xfe, 0x64, 0xf0, 0xc1, - 0xf5, 0xfd, 0xfd, 0xac, 0xce, 0x05, 0x3e, 0xf1, 0x73, 0xbb, 0xf7, 0x09, 0xb4, 0xca, 0xf3, 0xbb, - 0x05, 0x55, 0xf3, 0x10, 0x66, 0xc3, 0x36, 0x26, 0x39, 0x0b, 0xc0, 0xb5, 0x17, 0x2b, 0x1e, 0x51, - 0x35, 0xc7, 0x0b, 0xd5, 0x72, 0x6d, 0xae, 0xef, 0x66, 0x81, 0xde, 0x07, 0xd0, 0x59, 0xee, 0xa9, - 0x7c, 0xfa, 0xac, 0xa5, 0xa7, 0x2f, 0x27, 0xad, 0x94, 0xa4, 0xbd, 0xdf, 0x2c, 0x68, 0xe6, 0xad, - 0x98, 0x05, 0x26, 0x54, 0x33, 0x2f, 0x60, 0x42, 0x46, 0x39, 0xce, 0x36, 0x91, 0x1b, 0x26, 0x40, - 0x5e, 0x05, 0xdb, 0x8c, 0x46, 0xd1, 0x84, 0x65, 0x1a, 0xdb, 0xae, 0x99, 0x95, 0x6b, 0x7c, 0xf2, - 0x06, 0x74, 0xb9, 0xe0, 0x89, 0x37, 0xa5, 0xda, 0x0b, 0x79, 0xc4, 0xb3, 0x2b, 0x5c, 0x77, 0x3b, - 0x26, 0x7a, 0x8b, 0xea, 0x2f, 0x4d, 0x8c, 0xbc, 0x06, 0x1d, 0xae, 0x3d, 0xcd, 0xa3, 0x34, 0xa4, - 0x93, 0x30, 0x7b, 0x9c, 0x5a, 0x6e, 0x9b, 0xeb, 0x7b, 0x45, 0xc8, 0x94, 0x18, 0x8e, 0x28, 0x0d, - 0x13, 0x1e, 0x87, 0x73, 0x14, 0xc1, 0x72, 0xdb, 0x53, 0xaa, 0xef, 0xe4, 0xa1, 0xde, 0x45, 0x80, - 0xc5, 0x00, 0xd7, 0xbe, 0x06, 0x04, 0x6a, 0xe6, 0x14, 0xe7, 0x4d, 0xa2, 0x7d, 0xfd, 0xea, 0x93, - 0xe7, 0x7d, 0xeb, 0xe9, 0xf3, 0xbe, 0xf5, 0xec, 0x79, 0xdf, 0xfa, 0xf1, 0xb8, 0xbf, 0xf1, 0xf4, - 0xb8, 0xbf, 0xf1, 0xe7, 0x71, 0x7f, 0xe3, 0xdb, 0xc1, 0x94, 0x27, 0xb3, 0x74, 0x32, 0xf4, 0x65, - 0x34, 0x92, 0x42, 0x4b, 0xa1, 0x46, 0xf8, 0xf3, 0x68, 0x64, 0xbe, 0xa2, 0x78, 0x69, 0x26, 0x0d, - 0xfc, 0xb7, 0xf2, 0xfe, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x10, 0x30, 0xf0, 0x0e, 0x09, - 0x00, 0x00, + // 1995 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xbd, 0x73, 0x1b, 0xc7, + 0x15, 0x27, 0x88, 0xef, 0x07, 0x12, 0x5a, 0x2e, 0x3f, 0x04, 0x51, 0x12, 0x49, 0x51, 0xb2, 0xcd, + 0xd0, 0x19, 0x52, 0x84, 0x44, 0x8f, 0x9c, 0x78, 0x92, 0x1c, 0x0e, 0x47, 0xea, 0x86, 0xf8, 0x9a, + 0xbd, 0x23, 0x69, 0xb9, 0xb9, 0x39, 0x02, 0x4b, 0x70, 0x23, 0xe0, 0x0e, 0x73, 0x7b, 0xa0, 0xc5, + 0x74, 0x69, 0x5d, 0xa5, 0x4c, 0x3a, 0x77, 0x69, 0x52, 0x24, 0xff, 0x83, 0x0b, 0x37, 0x99, 0x71, + 0x99, 0x34, 0x19, 0x8f, 0x54, 0x24, 0x55, 0xfa, 0x74, 0x99, 0xdd, 0xbb, 0x03, 0x70, 0x04, 0xa4, + 0x71, 0x83, 0xd9, 0xfd, 0xfd, 0x7e, 0xef, 0xed, 0x7b, 0xfb, 0xde, 0xee, 0x1e, 0x09, 0x2b, 0x1d, + 0xd6, 0xd9, 0xbf, 0x3e, 0xd8, 0xef, 0x52, 0x87, 0x72, 0xc6, 0xf7, 0x06, 0x9e, 0xeb, 0xbb, 0x38, + 0xd3, 0x61, 0x9d, 0xbd, 0xeb, 0x83, 0xf5, 0x25, 0xbb, 0xcf, 0x1c, 0x77, 0x5f, 0xfe, 0x06, 0xd4, + 0xfa, 0x4a, 0xd7, 0xed, 0xba, 0x72, 0xb8, 0x2f, 0x46, 0x01, 0xba, 0xfd, 0x05, 0x2c, 0x1c, 0x07, + 0x1e, 0x0c, 0xdf, 0xf6, 0x29, 0xfe, 0x39, 0x64, 0x06, 0xb6, 0x67, 0xf7, 0x79, 0x29, 0xb1, 0x95, + 0xd8, 0x29, 0x94, 0x8b, 0x7b, 0x81, 0xc7, 0xbd, 0x96, 0x44, 0x2b, 0xa9, 0xef, 0xff, 0xb5, 0x39, + 0x47, 0x42, 0xcd, 0xf6, 0x7f, 0x93, 0x90, 0x09, 0x08, 0xfc, 0x1b, 0xc0, 0x5f, 0x5f, 0x31, 0x9f, + 0xf6, 0x18, 0xf7, 0x69, 0xc7, 0xb2, 0x39, 0xa7, 0xbe, 0x70, 0x92, 0xdc, 0x29, 0x94, 0x97, 0x22, + 0x27, 0x8a, 0x40, 0x75, 0xe7, 0xd2, 0x25, 0x4b, 0x13, 0x62, 0x89, 0x4e, 0x79, 0x68, 0x5f, 0xd9, + 0xcc, 0xe1, 0xa5, 0xf9, 0xb8, 0x07, 0x55, 0xa0, 0x53, 0x1e, 0x24, 0xca, 0xf1, 0xaf, 0x61, 0xd9, + 0xee, 0xf5, 0xdc, 0xaf, 0x69, 0xc7, 0x1a, 0x0c, 0x2f, 0x7a, 0xac, 0x6d, 0xbd, 0xa6, 0x37, 0xbc, + 0x94, 0x94, 0x2e, 0xee, 0x44, 0x2e, 0x4e, 0xe8, 0x4d, 0xe0, 0x20, 0xd4, 0xb6, 0xa4, 0xf4, 0x84, + 0xde, 0x70, 0xfc, 0x39, 0x2c, 0xba, 0x03, 0xea, 0xb0, 0x8e, 0xd5, 0x76, 0x9d, 0x4b, 0xd6, 0x2d, + 0xa5, 0xe4, 0x26, 0xac, 0x44, 0xa6, 0xcd, 0x01, 0x75, 0xf4, 0xaa, 0x2a, 0x39, 0xb2, 0x10, 0x48, + 0x83, 0x19, 0xde, 0x84, 0x02, 0x1b, 0x5c, 0x72, 0xcb, 0x6e, 0xfb, 0xec, 0x9a, 0x96, 0xd2, 0x5b, + 0x89, 0x9d, 0x1c, 0x01, 0x01, 0x29, 0x12, 0xc1, 0x55, 0xd8, 0xe8, 0xb9, 0x6d, 0xbb, 0x77, 0xe5, + 0x72, 0xdf, 0xf2, 0x68, 0x97, 0x71, 0xdf, 0xb3, 0x7d, 0xe6, 0x3a, 0x16, 0x75, 0xec, 0x8b, 0x1e, + 0xed, 0x94, 0x32, 0xd2, 0xe6, 0xc1, 0x48, 0x45, 0x26, 0x44, 0x5a, 0xa0, 0xc1, 0xcf, 0x60, 0xb5, + 0xed, 0x3a, 0xd7, 0xf4, 0xc6, 0x76, 0xda, 0xd4, 0x1a, 0x78, 0xf4, 0x92, 0x7a, 0xd4, 0x69, 0xd3, + 0x52, 0x76, 0x2b, 0xb1, 0x93, 0x27, 0x2b, 0x63, 0xb2, 0x35, 0xe2, 0xf0, 0x3e, 0x2c, 0xdb, 0xbe, + 0x4f, 0xb9, 0x1f, 0xac, 0x77, 0xe9, 0x7a, 0x7d, 0xdb, 0xe7, 0xa5, 0xdc, 0x56, 0x72, 0x27, 0x4f, + 0xf0, 0x04, 0x75, 0x14, 0x30, 0xbf, 0xb8, 0xfb, 0xc7, 0x6f, 0x37, 0xe7, 0xfe, 0xf3, 0xed, 0x66, + 0xe2, 0x9b, 0x7f, 0xff, 0x75, 0x17, 0x44, 0xa7, 0x85, 0x05, 0xff, 0x2e, 0x01, 0xf9, 0x51, 0x11, + 0xf1, 0x0a, 0xa4, 0x99, 0xd3, 0xa1, 0x6f, 0x64, 0xaf, 0x24, 0x49, 0x30, 0xc1, 0x08, 0x92, 0x57, + 0xde, 0xa0, 0x34, 0x2f, 0x03, 0x12, 0x43, 0xbc, 0x06, 0x19, 0x7e, 0xd3, 0xbf, 0x70, 0x7b, 0xa5, + 0xa4, 0x04, 0xc3, 0x19, 0x7e, 0x0a, 0x20, 0xfb, 0xc4, 0xf2, 0x6f, 0x06, 0x54, 0xee, 0x75, 0xf1, + 0x56, 0xaf, 0x98, 0x37, 0x03, 0x4a, 0xf2, 0x76, 0x34, 0xc4, 0x18, 0x52, 0x8e, 0xdd, 0x0f, 0xb6, + 0x37, 0x4f, 0xe4, 0x58, 0x78, 0xef, 0x53, 0xff, 0xca, 0x0d, 0x36, 0x30, 0x4f, 0xc2, 0x19, 0xbe, + 0x07, 0x39, 0xd6, 0x76, 0x1d, 0x6b, 0xe8, 0xf5, 0xc2, 0xdd, 0xc9, 0x8a, 0xf9, 0xa9, 0xd7, 0xdb, + 0xfe, 0x53, 0x02, 0xf2, 0xa3, 0x4e, 0xc2, 0x45, 0x98, 0x67, 0x1d, 0x99, 0x43, 0x9e, 0xcc, 0x33, + 0x69, 0x28, 0x9b, 0xcf, 0x62, 0x9d, 0x30, 0x8b, 0xac, 0x9c, 0xeb, 0x9d, 0xd1, 0xfa, 0xc9, 0xf8, + 0xfa, 0x61, 0x76, 0xa9, 0x58, 0x76, 0x87, 0x00, 0xd7, 0x76, 0x8f, 0x75, 0x6c, 0xdf, 0xf5, 0x78, + 0x29, 0x2d, 0x9b, 0x70, 0x35, 0xca, 0xee, 0x2c, 0x62, 0x64, 0x2b, 0x4e, 0x08, 0xb7, 0x7f, 0x4c, + 0x40, 0x36, 0x6c, 0x51, 0xfc, 0x18, 0x52, 0x9e, 0xdb, 0xa3, 0x32, 0xb6, 0x62, 0xac, 0x83, 0x89, + 0xdb, 0xa3, 0x44, 0x92, 0xb8, 0x0c, 0x79, 0xbb, 0xd7, 0x75, 0x3d, 0xe6, 0x5f, 0xf5, 0x65, 0xbc, + 0xc5, 0x71, 0xc3, 0x9e, 0xd0, 0x1b, 0x25, 0xe2, 0xc8, 0x58, 0x86, 0xf7, 0x21, 0x47, 0x9d, 0xb6, + 0xdb, 0x61, 0x4e, 0x57, 0xe6, 0x52, 0x2c, 0x2f, 0x4f, 0x98, 0x68, 0x21, 0x45, 0x46, 0x22, 0xfc, + 0x31, 0xa4, 0xdb, 0x43, 0xef, 0x3a, 0xaa, 0x12, 0x9a, 0x50, 0xab, 0x02, 0x27, 0x01, 0x2d, 0x22, + 0x96, 0xc5, 0x4c, 0x4f, 0x45, 0x2c, 0x4b, 0x29, 0x49, 0x71, 0x6d, 0x2c, 0x4c, 0x1e, 0x25, 0xb1, + 0x85, 0x8c, 0xf3, 0x21, 0xf5, 0xc2, 0x2a, 0x84, 0x33, 0x7c, 0x08, 0x6b, 0xf6, 0xd0, 0xbf, 0x72, + 0x3d, 0xf6, 0xbb, 0xe8, 0xa8, 0x74, 0x06, 0x2e, 0x73, 0xfc, 0xb0, 0x2e, 0xab, 0x31, 0x56, 0x0b, + 0x49, 0xfc, 0x11, 0x14, 0x7d, 0xf7, 0x35, 0x9d, 0x90, 0x07, 0xf5, 0x5a, 0x94, 0xe8, 0x48, 0xf6, + 0x29, 0x2c, 0x0d, 0x39, 0xf5, 0x98, 0x73, 0xe9, 0x8e, 0x95, 0x41, 0x0d, 0x51, 0x44, 0x8c, 0xc4, + 0x3f, 0x03, 0xc4, 0xdb, 0xee, 0x80, 0x72, 0x8b, 0x0f, 0x07, 0x03, 0xd7, 0xf3, 0x69, 0x47, 0xd6, + 0x34, 0x4f, 0xee, 0x04, 0xb8, 0x11, 0xc1, 0xf8, 0x05, 0x94, 0x3c, 0xca, 0x07, 0xae, 0xc3, 0xa9, + 0xec, 0xec, 0x49, 0x93, 0x8c, 0x34, 0x59, 0x8b, 0x78, 0xb1, 0x29, 0xef, 0xb1, 0xec, 0xbb, 0x9d, + 0x98, 0x65, 0x36, 0x6e, 0x59, 0x17, 0xf4, 0xd8, 0xb2, 0x0c, 0xab, 0x5d, 0xcf, 0x76, 0xfc, 0xa9, + 0x05, 0x83, 0x43, 0xbe, 0x2c, 0xc9, 0x5b, 0xab, 0x3d, 0x85, 0x15, 0xbb, 0xed, 0x59, 0xd7, 0x76, + 0x6f, 0x18, 0x33, 0xc9, 0x87, 0xf7, 0x42, 0xdb, 0x3b, 0x93, 0xd4, 0xd8, 0xe2, 0x33, 0xb8, 0xcb, + 0x87, 0x17, 0xbf, 0xa5, 0xed, 0xe9, 0x75, 0x40, 0x1a, 0xad, 0x86, 0x74, 0x7c, 0xa5, 0xed, 0xbf, + 0xa7, 0x61, 0x31, 0xd6, 0xf1, 0xb8, 0x04, 0xd9, 0xbe, 0xeb, 0xb0, 0xd7, 0xa3, 0x92, 0x47, 0x53, + 0xac, 0x41, 0xb1, 0xeb, 0x0d, 0xda, 0xa3, 0x8a, 0x44, 0x4f, 0xc0, 0xc6, 0xcc, 0xa3, 0xb3, 0x17, + 0x15, 0x88, 0x2c, 0x0a, 0xab, 0x68, 0xc6, 0x85, 0x1b, 0x8f, 0x72, 0x7f, 0xc2, 0x4d, 0xf2, 0xa7, + 0xb9, 0x11, 0x56, 0x63, 0x37, 0xbf, 0x82, 0x1c, 0x7d, 0x33, 0xe8, 0xb9, 0x1e, 0xf5, 0xc2, 0xc7, + 0x60, 0xfb, 0x3d, 0x0e, 0x42, 0x95, 0x3c, 0xcf, 0x23, 0x1b, 0xfc, 0x02, 0x72, 0x97, 0x94, 0x5a, + 0xa2, 0x95, 0xe4, 0x99, 0x28, 0x94, 0x1f, 0xce, 0xb6, 0x3f, 0xa2, 0x54, 0x9a, 0x66, 0x2f, 0x83, + 0x01, 0x56, 0xa0, 0xc0, 0x2e, 0xda, 0xe2, 0x19, 0x74, 0x1c, 0xda, 0x93, 0x77, 0x5b, 0xa1, 0xbc, + 0x35, 0xdb, 0x58, 0xaf, 0xa8, 0x6a, 0xa0, 0x23, 0xc0, 0x2e, 0xda, 0xe1, 0x78, 0xfd, 0x97, 0x90, + 0x1b, 0xf5, 0x2f, 0x82, 0xa4, 0xb8, 0x08, 0x83, 0xcd, 0x16, 0x43, 0xfc, 0x10, 0x80, 0x71, 0x6b, + 0xe0, 0xb1, 0xbe, 0xed, 0xdd, 0xc8, 0x03, 0x95, 0x23, 0x79, 0xc6, 0x5b, 0x01, 0xb0, 0xfe, 0x1c, + 0x16, 0x26, 0x73, 0x1a, 0x5d, 0x7d, 0x89, 0x89, 0xab, 0x2f, 0x74, 0x3a, 0x3f, 0x72, 0xba, 0xfe, + 0xb7, 0x04, 0x64, 0xc3, 0x54, 0xc4, 0x02, 0x17, 0x36, 0xa7, 0x56, 0x87, 0x3a, 0x6e, 0x3f, 0xb4, + 0xcb, 0x0b, 0xa4, 0x2a, 0x00, 0x7c, 0x1f, 0xf2, 0x62, 0x6b, 0x3c, 0xdb, 0xa7, 0x41, 0x8d, 0xf3, + 0x44, 0xec, 0x15, 0x11, 0x73, 0xfc, 0x04, 0x8a, 0xcc, 0x61, 0xbe, 0xd5, 0xb5, 0xb9, 0xd5, 0x63, + 0x7d, 0x16, 0x1c, 0xe1, 0x34, 0x59, 0x10, 0xe8, 0xb1, 0xcd, 0x6b, 0x02, 0xc3, 0x8f, 0x60, 0x81, + 0x71, 0x8b, 0xb3, 0xfe, 0xb0, 0x27, 0x9e, 0x47, 0x59, 0xa1, 0x1c, 0x29, 0x30, 0x6e, 0x44, 0x90, + 0x90, 0x08, 0x1f, 0xfd, 0x61, 0xcf, 0x67, 0x83, 0xde, 0x8d, 0x2c, 0x42, 0x82, 0x14, 0xba, 0x36, + 0xaf, 0x87, 0xd0, 0xfa, 0x53, 0x80, 0xf1, 0x06, 0x4e, 0xbd, 0x06, 0x18, 0x52, 0xa2, 0x8b, 0xc3, + 0x24, 0xe5, 0x78, 0xf7, 0x2f, 0xd1, 0x33, 0x28, 0x1f, 0xa5, 0x75, 0x58, 0x53, 0x0c, 0x43, 0x33, + 0x2d, 0xf3, 0x55, 0x4b, 0xb3, 0x4e, 0x1b, 0x46, 0x4b, 0x53, 0xf5, 0x23, 0x5d, 0xab, 0xa2, 0x39, + 0xbc, 0x0a, 0x4b, 0x13, 0x5c, 0x43, 0x31, 0xf5, 0x33, 0x0d, 0x25, 0xf0, 0x1a, 0xe0, 0x09, 0xf8, + 0x9c, 0x28, 0xad, 0x96, 0x56, 0x45, 0xf3, 0xb7, 0x70, 0xc3, 0x54, 0x4e, 0xf4, 0xc6, 0x31, 0x4a, + 0xe2, 0x65, 0xb8, 0x33, 0x81, 0xb7, 0x9a, 0xcd, 0x1a, 0x4a, 0x61, 0x0c, 0xc5, 0x09, 0x50, 0xaf, + 0xa8, 0x28, 0x7d, 0x4b, 0xa8, 0x9e, 0x97, 0x9f, 0xa2, 0xcc, 0xee, 0xff, 0x12, 0xb0, 0x50, 0xd5, + 0xab, 0x0d, 0xbb, 0x4f, 0xf9, 0xc0, 0x6e, 0x53, 0xfc, 0x10, 0xee, 0x55, 0xf5, 0xaa, 0xd5, 0x50, + 0xea, 0x9a, 0xd1, 0x52, 0xd4, 0xdb, 0x41, 0xaf, 0x01, 0x8e, 0xd3, 0x7a, 0xeb, 0xc8, 0x08, 0xa2, + 0x8e, 0xe3, 0x46, 0xb3, 0x41, 0xd0, 0x3c, 0xbe, 0x07, 0xab, 0x71, 0xbc, 0xa2, 0x9b, 0x6a, 0x53, + 0x6f, 0xa0, 0xa4, 0xd8, 0x9b, 0x38, 0xa5, 0x99, 0x2f, 0x35, 0xa2, 0x9d, 0xd6, 0x51, 0x4a, 0xec, + 0xcd, 0xad, 0x65, 0x64, 0x0a, 0x53, 0x26, 0xe7, 0x5a, 0x45, 0x39, 0x35, 0x5f, 0x36, 0x50, 0x66, + 0xda, 0xa4, 0x7a, 0xde, 0x40, 0xd9, 0xe9, 0x00, 0x0c, 0x8d, 0x9c, 0xe9, 0xaa, 0x86, 0x72, 0xbb, + 0xdf, 0x25, 0x60, 0x61, 0xf2, 0x15, 0x14, 0xb9, 0x9f, 0x68, 0xaf, 0x2c, 0xa5, 0x76, 0xdc, 0x24, + 0xba, 0xf9, 0xb2, 0x7e, 0x2b, 0xf7, 0xbb, 0xb0, 0x1c, 0xa7, 0x35, 0xa3, 0x7c, 0xf8, 0x19, 0x4a, + 0xcc, 0x22, 0x9e, 0xbd, 0x78, 0x8e, 0xe6, 0x67, 0x11, 0x87, 0x07, 0x65, 0x94, 0x9c, 0x41, 0x54, + 0xab, 0x86, 0x82, 0x52, 0xb8, 0x04, 0x2b, 0x33, 0xd6, 0x38, 0x41, 0xe9, 0x19, 0x26, 0xaa, 0x30, + 0xc9, 0xec, 0xfe, 0x7e, 0x1e, 0x72, 0xd1, 0x5b, 0x2b, 0xd2, 0x15, 0x2a, 0xf5, 0x94, 0x9c, 0xdd, + 0x2e, 0x1d, 0x86, 0xe2, 0x98, 0x6a, 0x05, 0x91, 0xc7, 0xb1, 0x20, 0xe8, 0x38, 0x76, 0x58, 0x3e, + 0x40, 0x49, 0xbc, 0x02, 0x68, 0x8c, 0x7d, 0x59, 0x3e, 0x3c, 0x3c, 0xf8, 0x3c, 0xe8, 0xb2, 0x09, + 0xf4, 0xf9, 0xf3, 0x17, 0x28, 0x2d, 0xca, 0x30, 0xc6, 0xb4, 0x6a, 0x20, 0xcd, 0x88, 0xe6, 0x9b, + 0x84, 0x85, 0x36, 0x1b, 0xa5, 0x14, 0x80, 0x86, 0xa6, 0x8a, 0xa0, 0x4e, 0x0e, 0x50, 0x4e, 0x74, + 0xd3, 0x98, 0xa8, 0xd4, 0x8c, 0x83, 0xf2, 0xb3, 0x17, 0x07, 0x28, 0x1f, 0x37, 0x38, 0xd1, 0x54, + 0x55, 0x39, 0x11, 0x79, 0xc0, 0x2e, 0x87, 0xc2, 0xc4, 0xc7, 0x09, 0x7e, 0x00, 0x25, 0xa1, 0xd3, + 0x1a, 0x6a, 0xb3, 0xaa, 0x37, 0x8e, 0x6f, 0x6d, 0x44, 0x98, 0xcc, 0x88, 0x25, 0xca, 0x39, 0x4a, + 0x4c, 0xa1, 0x2f, 0xb5, 0x2f, 0xd1, 0xbc, 0xe8, 0xb8, 0x18, 0x5a, 0x3f, 0xad, 0x99, 0x7a, 0x45, + 0x31, 0x34, 0x94, 0xdc, 0xfd, 0x26, 0xf8, 0x1c, 0x13, 0xdf, 0x5b, 0x51, 0xdd, 0x48, 0xb3, 0x76, + 0x7b, 0xdb, 0xef, 0xc3, 0xdd, 0x11, 0x23, 0x7a, 0x55, 0x6b, 0x98, 0xba, 0xaa, 0x98, 0x7a, 0xb3, + 0x11, 0x1c, 0x9b, 0x31, 0x69, 0x18, 0x1a, 0x91, 0xf8, 0xa8, 0x71, 0x24, 0x5e, 0xd5, 0x6a, 0xda, + 0x71, 0x60, 0x90, 0x8c, 0x11, 0x7a, 0xe3, 0xac, 0x19, 0x7a, 0x4a, 0xed, 0xfe, 0x33, 0x08, 0x46, + 0xde, 0x3a, 0x61, 0x30, 0x33, 0xee, 0x9c, 0xb0, 0x62, 0x92, 0x69, 0xaa, 0xa6, 0x66, 0xa2, 0x44, + 0x54, 0x31, 0x89, 0x69, 0xb5, 0x9a, 0xde, 0x32, 0x75, 0x15, 0xcd, 0x63, 0x04, 0x0b, 0x23, 0x98, + 0x18, 0x0a, 0x4a, 0x46, 0xc1, 0x06, 0xf7, 0xcf, 0xab, 0x7a, 0x5d, 0x33, 0x89, 0xae, 0xa2, 0x14, + 0x5e, 0x82, 0xc5, 0x11, 0xfe, 0xb2, 0xae, 0x88, 0x83, 0x3a, 0x69, 0x5c, 0x6f, 0xa9, 0x28, 0x83, + 0xef, 0x40, 0x61, 0x84, 0x7c, 0x75, 0x82, 0xb2, 0xb1, 0x65, 0x47, 0xc7, 0x38, 0x17, 0x8b, 0xb0, + 0xa2, 0xb7, 0x9e, 0x95, 0x51, 0x7e, 0xf7, 0xcf, 0x29, 0xb8, 0xd3, 0xa2, 0x5e, 0x9f, 0x71, 0xce, + 0x5c, 0xc7, 0x10, 0xdf, 0x54, 0x78, 0x0b, 0x1e, 0xb4, 0x34, 0x52, 0xd7, 0x0d, 0x43, 0x6f, 0x36, + 0x2c, 0x43, 0x6d, 0x4e, 0xe5, 0xba, 0x09, 0xf7, 0xa7, 0x14, 0x15, 0xc5, 0xd0, 0x55, 0x4b, 0x6f, + 0x1c, 0x35, 0x51, 0x02, 0x7f, 0x04, 0x8f, 0xa6, 0x04, 0x63, 0xc0, 0xb0, 0x88, 0xa6, 0x88, 0x8b, + 0xf7, 0x63, 0xd8, 0xfe, 0xa0, 0xec, 0x9c, 0xe8, 0xa6, 0x86, 0x92, 0x33, 0x75, 0x26, 0x51, 0x1a, + 0x86, 0xa2, 0x9a, 0x63, 0x7f, 0x29, 0xfc, 0x09, 0x3c, 0xfe, 0xb0, 0x2e, 0x70, 0x98, 0xc6, 0x8f, + 0xe0, 0xe1, 0x94, 0xf0, 0x5c, 0xa9, 0xd5, 0x34, 0x33, 0xf4, 0x95, 0xc1, 0x8f, 0x61, 0xf3, 0xbd, + 0x12, 0x95, 0x68, 0x8a, 0xa9, 0xa1, 0xec, 0xcc, 0xc0, 0x22, 0x91, 0x71, 0x5a, 0x31, 0x54, 0xa2, + 0x57, 0x34, 0x94, 0xfb, 0xa0, 0xb3, 0xd3, 0x56, 0x55, 0x38, 0xcb, 0xe3, 0x1d, 0x78, 0xf2, 0xe1, + 0xe8, 0xcf, 0x34, 0xa2, 0x1f, 0xbd, 0x42, 0x80, 0x3f, 0x85, 0x4f, 0x3e, 0xac, 0xac, 0x90, 0xa6, + 0x52, 0x55, 0x15, 0xc3, 0x44, 0x85, 0x99, 0xc5, 0x52, 0xaa, 0x75, 0xbd, 0x61, 0x9d, 0x1a, 0x1a, + 0x41, 0x0b, 0xf8, 0x09, 0x6c, 0xbd, 0x47, 0x70, 0xa6, 0xd4, 0xf4, 0xaa, 0x62, 0x36, 0x09, 0x5a, + 0xac, 0x7c, 0xf1, 0xfd, 0xdb, 0x8d, 0xc4, 0x0f, 0x6f, 0x37, 0x12, 0x3f, 0xbe, 0xdd, 0x48, 0xfc, + 0xe1, 0xdd, 0xc6, 0xdc, 0x0f, 0xef, 0x36, 0xe6, 0xfe, 0xf1, 0x6e, 0x63, 0xee, 0xab, 0xed, 0x2e, + 0xf3, 0xaf, 0x86, 0x17, 0x7b, 0x6d, 0xb7, 0xbf, 0xef, 0x3a, 0xdc, 0x75, 0xbc, 0x7d, 0xf9, 0xf3, + 0x66, 0x5f, 0xfc, 0x0d, 0x2b, 0x3f, 0x59, 0x2f, 0x32, 0xf2, 0x1f, 0x1f, 0xcf, 0xfe, 0x1f, 0x00, + 0x00, 0xff, 0xff, 0xf7, 0xde, 0xdb, 0x8f, 0x41, 0x11, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -972,6 +1431,23 @@ func (this *Params) Equal(that interface{}) bool { if !this.OpenidConfig.Equal(that1.OpenidConfig) { return false } + if this.IpfsActive != that1.IpfsActive { + return false + } + if this.LocalhostRegistrationEnabled != that1.LocalhostRegistrationEnabled { + return false + } + if this.ConveyancePreference != that1.ConveyancePreference { + return false + } + if len(this.AttestationFormats) != len(that1.AttestationFormats) { + return false + } + for i := range this.AttestationFormats { + if this.AttestationFormats[i] != that1.AttestationFormats[i] { + return false + } + } return true } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -1027,6 +1503,42 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AttestationFormats) > 0 { + for iNdEx := len(m.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AttestationFormats[iNdEx]) + copy(dAtA[i:], m.AttestationFormats[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AttestationFormats[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.ConveyancePreference) > 0 { + i -= len(m.ConveyancePreference) + copy(dAtA[i:], m.ConveyancePreference) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ConveyancePreference))) + i-- + dAtA[i] = 0x3a + } + if m.LocalhostRegistrationEnabled { + i-- + if m.LocalhostRegistrationEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.IpfsActive { + i-- + if m.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } if m.OpenidConfig != nil { { size, err := m.OpenidConfig.MarshalToSizedBuffer(dAtA[:i]) @@ -1688,6 +2200,22 @@ func (m *Params) Size() (n int) { l = m.OpenidConfig.Size() n += 1 + l + sovGenesis(uint64(l)) } + if m.IpfsActive { + n += 2 + } + if m.LocalhostRegistrationEnabled { + n += 2 + } + l = len(m.ConveyancePreference) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.AttestationFormats) > 0 { + for _, s := range m.AttestationFormats { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -2213,6 +2741,110 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IpfsActive = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LocalhostRegistrationEnabled = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", 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.ConveyancePreference = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", 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.AttestationFormats = append(m.AttestationFormats, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/did/types/info.go b/x/did/types/info.go index aaac70c52..84c7a3a5f 100644 --- a/x/did/types/info.go +++ b/x/did/types/info.go @@ -87,3 +87,51 @@ func (k *KeyInfo) EncodePublicKey(data []byte) (string, error) { } return "", ErrUnsupportedKeyEncoding } + +// DiscoveryDocument represents the OIDC discovery document. +type DiscoveryDocument struct { + Issuer string `json:"issuer"` + AuthorizationEndpoint string `json:"authorization_endpoint"` + TokenEndpoint string `json:"token_endpoint"` + UserinfoEndpoint string `json:"userinfo_endpoint"` + JwksURI string `json:"jwks_uri"` + RegistrationEndpoint string `json:"registration_endpoint"` + ScopesSupported []string `json:"scopes_supported"` + ResponseTypesSupported []string `json:"response_types_supported"` + SubjectTypesSupported []string `json:"subject_types_supported"` + IDTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"` + ClaimsSupported []string `json:"claims_supported"` + GrantTypesSupported []string `json:"grant_types_supported"` + TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"` +} + +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, +} diff --git a/x/did/types/keys.go b/x/did/types/keys.go deleted file mode 100644 index 024209038..000000000 --- a/x/did/types/keys.go +++ /dev/null @@ -1,25 +0,0 @@ -package types - -import ( - "cosmossdk.io/collections" - - ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" -) - -// ParamsKey saves the current module params. -var ParamsKey = collections.NewPrefix(0) - -const ( - ModuleName = "did" - - StoreKey = ModuleName - - QuerierRoute = ModuleName -) - -var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - {Id: 1, ProtoFileName: "did/v1/state.proto"}, - }, - Prefix: []byte{0}, -} diff --git a/x/did/types/verifier.go b/x/did/types/macroon.go similarity index 100% rename from x/did/types/verifier.go rename to x/did/types/macroon.go diff --git a/x/did/types/models.pb.go b/x/did/types/models.pb.go index e07b961f8..0f55ded00 100644 --- a/x/did/types/models.pb.go +++ b/x/did/types/models.pb.go @@ -323,6 +323,91 @@ func (m *Document) GetService() []string { return nil } +// JWK represents a JSON Web Key +type 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 *JWK) Reset() { *m = JWK{} } +func (m *JWK) String() string { return proto.CompactTextString(m) } +func (*JWK) ProtoMessage() {} +func (*JWK) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{4} +} +func (m *JWK) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JWK) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_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 *JWK) XXX_Merge(src proto.Message) { + xxx_messageInfo_JWK.Merge(m, src) +} +func (m *JWK) XXX_Size() int { + return m.Size() +} +func (m *JWK) XXX_DiscardUnknown() { + xxx_messageInfo_JWK.DiscardUnknown(m) +} + +var xxx_messageInfo_JWK proto.InternalMessageInfo + +func (m *JWK) GetKty() string { + if m != nil { + return m.Kty + } + return "" +} + +func (m *JWK) GetCrv() string { + if m != nil { + return m.Crv + } + return "" +} + +func (m *JWK) GetX() string { + if m != nil { + return m.X + } + return "" +} + +func (m *JWK) GetY() string { + if m != nil { + return m.Y + } + return "" +} + +func (m *JWK) GetN() string { + if m != nil { + return m.N + } + return "" +} + +func (m *JWK) GetE() string { + if m != nil { + return m.E + } + return "" +} + // Metadata defines additional information provided to a did type Metadata struct { OriginUri string `protobuf:"bytes,1,opt,name=origin_uri,json=originUri,proto3" json:"origin_uri,omitempty"` @@ -334,7 +419,7 @@ func (m *Metadata) Reset() { *m = Metadata{} } func (m *Metadata) String() string { return proto.CompactTextString(m) } func (*Metadata) ProtoMessage() {} func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{4} + return fileDescriptor_739bb5ab5cb60751, []int{5} } func (m *Metadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -395,7 +480,7 @@ func (m *Permissions) Reset() { *m = Permissions{} } func (m *Permissions) String() string { return proto.CompactTextString(m) } func (*Permissions) ProtoMessage() {} func (*Permissions) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{5} + return fileDescriptor_739bb5ab5cb60751, []int{6} } func (m *Permissions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,7 +535,7 @@ func (m *Profile) Reset() { *m = Profile{} } func (m *Profile) String() string { return proto.CompactTextString(m) } func (*Profile) ProtoMessage() {} func (*Profile) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{6} + return fileDescriptor_739bb5ab5cb60751, []int{7} } func (m *Profile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -518,7 +603,7 @@ func (m *Property) Reset() { *m = Property{} } func (m *Property) String() string { return proto.CompactTextString(m) } func (*Property) ProtoMessage() {} func (*Property) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{7} + return fileDescriptor_739bb5ab5cb60751, []int{8} } func (m *Property) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,20 +648,20 @@ func (m *Property) GetKey() []byte { // 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"` - Raw []byte `protobuf:"bytes,4,opt,name=raw,proto3" json:"raw,omitempty"` - Hex string `protobuf:"bytes,5,opt,name=hex,proto3" json:"hex,omitempty"` - Multibase string `protobuf:"bytes,6,opt,name=multibase,proto3" json:"multibase,omitempty"` - Jwk map[string]string `protobuf:"bytes,7,rep,name=jwk,proto3" json:"jwk,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + 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 *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{8} + return fileDescriptor_739bb5ab5cb60751, []int{9} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,6 +711,20 @@ func (m *PubKey) GetEncoding() KeyEncoding { 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 @@ -633,21 +732,7 @@ func (m *PubKey) GetRaw() []byte { return nil } -func (m *PubKey) GetHex() string { - if m != nil { - return m.Hex - } - return "" -} - -func (m *PubKey) GetMultibase() string { - if m != nil { - return m.Multibase - } - return "" -} - -func (m *PubKey) GetJwk() map[string]string { +func (m *PubKey) GetJwk() *JWK { if m != nil { return m.Jwk } @@ -668,7 +753,7 @@ func (m *Service) Reset() { *m = Service{} } func (m *Service) String() string { return proto.CompactTextString(m) } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{9} + return fileDescriptor_739bb5ab5cb60751, []int{10} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -750,7 +835,7 @@ func (m *Token) Reset() { *m = Token{} } func (m *Token) String() string { return proto.CompactTextString(m) } func (*Token) ProtoMessage() {} func (*Token) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{10} + return fileDescriptor_739bb5ab5cb60751, []int{11} } func (m *Token) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -802,18 +887,18 @@ func (m *Token) GetMacron() []byte { // VerificationMethod defines a verification method type VerificationMethod struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Service *Service `protobuf:"bytes,7,opt,name=service,proto3" json:"service,omitempty"` + Method DIDNamespace `protobuf:"varint,1,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` + Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` + PublicKey *PubKey `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` } func (m *VerificationMethod) Reset() { *m = VerificationMethod{} } func (m *VerificationMethod) String() string { return proto.CompactTextString(m) } func (*VerificationMethod) ProtoMessage() {} func (*VerificationMethod) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{11} + return fileDescriptor_739bb5ab5cb60751, []int{12} } func (m *VerificationMethod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -842,6 +927,13 @@ func (m *VerificationMethod) XXX_DiscardUnknown() { var xxx_messageInfo_VerificationMethod proto.InternalMessageInfo +func (m *VerificationMethod) GetMethod() DIDNamespace { + if m != nil { + return m.Method + } + return DIDNamespace_DID_NAMESPACE_UNSPECIFIED +} + func (m *VerificationMethod) GetId() string { if m != nil { return m.Id @@ -856,11 +948,11 @@ func (m *VerificationMethod) GetController() string { return "" } -func (m *VerificationMethod) GetMethod() DIDNamespace { +func (m *VerificationMethod) GetIssuer() string { if m != nil { - return m.Method + return m.Issuer } - return DIDNamespace_DID_NAMESPACE_UNSPECIFIED + return "" } func (m *VerificationMethod) GetPublicKey() *PubKey { @@ -870,13 +962,6 @@ func (m *VerificationMethod) GetPublicKey() *PubKey { return nil } -func (m *VerificationMethod) GetService() *Service { - if m != nil { - return m.Service - } - return nil -} - // Witness defines a BLS witness type Witness struct { Witness []byte `protobuf:"bytes,1,opt,name=witness,proto3" json:"witness,omitempty"` @@ -886,7 +971,7 @@ func (m *Witness) Reset() { *m = Witness{} } func (m *Witness) String() string { return proto.CompactTextString(m) } func (*Witness) ProtoMessage() {} func (*Witness) Descriptor() ([]byte, []int) { - return fileDescriptor_739bb5ab5cb60751, []int{12} + return fileDescriptor_739bb5ab5cb60751, []int{13} } func (m *Witness) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -927,6 +1012,7 @@ func init() { proto.RegisterType((*Credential)(nil), "did.v1.Credential") proto.RegisterType((*DID)(nil), "did.v1.DID") proto.RegisterType((*Document)(nil), "did.v1.Document") + proto.RegisterType((*JWK)(nil), "did.v1.JWK") proto.RegisterType((*Metadata)(nil), "did.v1.Metadata") proto.RegisterMapType((map[string]*Property)(nil), "did.v1.Metadata.PrivateEntry") proto.RegisterMapType((map[string]string)(nil), "did.v1.Metadata.PublicEntry") @@ -934,7 +1020,6 @@ func init() { proto.RegisterType((*Profile)(nil), "did.v1.Profile") proto.RegisterType((*Property)(nil), "did.v1.Property") proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") - proto.RegisterMapType((map[string]string)(nil), "did.v1.PubKey.JwkEntry") proto.RegisterType((*Service)(nil), "did.v1.Service") proto.RegisterType((*Token)(nil), "did.v1.Token") proto.RegisterType((*VerificationMethod)(nil), "did.v1.VerificationMethod") @@ -944,72 +1029,74 @@ func init() { func init() { proto.RegisterFile("did/v1/models.proto", fileDescriptor_739bb5ab5cb60751) } var fileDescriptor_739bb5ab5cb60751 = []byte{ - // 1026 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xef, 0xee, 0x36, 0xfe, 0xf3, 0x1c, 0xdc, 0x68, 0x12, 0xca, 0xca, 0x6a, 0xad, 0x68, 0x23, - 0x95, 0x44, 0x2a, 0xb6, 0xea, 0xf2, 0x5f, 0x08, 0xa9, 0xd4, 0x3d, 0x84, 0x10, 0x1a, 0x6d, 0x0b, - 0x48, 0x5c, 0xa2, 0xf1, 0xee, 0xc4, 0x9e, 0x66, 0x77, 0x66, 0x35, 0x33, 0xeb, 0xc4, 0x47, 0xbe, - 0x01, 0x5f, 0x80, 0x03, 0x9f, 0x82, 0x2b, 0xe2, 0xc4, 0x81, 0x43, 0x8f, 0x1c, 0x51, 0xc2, 0x07, - 0x41, 0x3b, 0x33, 0xeb, 0xdd, 0xc4, 0x40, 0x29, 0x17, 0x6b, 0xde, 0xfb, 0xfd, 0xe6, 0xcd, 0xfb, - 0xef, 0x85, 0xcd, 0x98, 0xc6, 0xc3, 0xf9, 0x83, 0x61, 0xca, 0x63, 0x92, 0xc8, 0x41, 0x26, 0xb8, - 0xe2, 0xa8, 0x11, 0xd3, 0x78, 0x30, 0x7f, 0xd0, 0xbb, 0x6d, 0xc1, 0x88, 0x33, 0xa9, 0x30, 0x53, - 0x16, 0xef, 0x6d, 0x59, 0xfd, 0x94, 0x30, 0x22, 0xe9, 0x52, 0x3b, 0xe5, 0x53, 0xae, 0x8f, 0xc3, - 0xe2, 0x64, 0xb4, 0xc1, 0x10, 0x3a, 0x8f, 0xa2, 0x28, 0x4f, 0xf3, 0x04, 0x2b, 0x2e, 0xd0, 0x36, - 0x74, 0x70, 0x25, 0xfa, 0xce, 0xb6, 0xb3, 0xbb, 0x1e, 0xd6, 0x55, 0xc1, 0x2f, 0x0e, 0xc0, 0x63, - 0x41, 0x62, 0xc2, 0x14, 0xc5, 0x09, 0xea, 0x82, 0x4b, 0x63, 0xcd, 0x6b, 0x87, 0x2e, 0x8d, 0xd1, - 0xdb, 0x70, 0x2b, 0x5a, 0xa2, 0xc7, 0x6a, 0x91, 0x11, 0xdf, 0xd5, 0x60, 0xb7, 0x52, 0x3f, 0x5f, - 0x64, 0x04, 0xed, 0xc0, 0x1b, 0x35, 0x22, 0x8d, 0x7d, 0x4f, 0xbf, 0xb5, 0x5e, 0x29, 0xf7, 0x63, - 0x74, 0x07, 0xda, 0x4a, 0x60, 0x26, 0x33, 0x2e, 0x94, 0x7f, 0x73, 0xdb, 0xdb, 0x6d, 0x87, 0x95, - 0x02, 0xf9, 0xd0, 0x94, 0xf9, 0xe4, 0x05, 0x89, 0x94, 0xdf, 0xd0, 0x6f, 0x94, 0x22, 0xea, 0x03, - 0x44, 0x9c, 0x29, 0xc1, 0x93, 0x84, 0x08, 0xbf, 0xa9, 0xc1, 0x9a, 0x26, 0xf8, 0xc1, 0x01, 0x6f, - 0xbc, 0x3f, 0x46, 0xf7, 0xa1, 0x91, 0x12, 0x35, 0xe3, 0x26, 0x82, 0xee, 0x68, 0x6b, 0x60, 0x52, - 0x3b, 0x18, 0xef, 0x8f, 0xbf, 0xc4, 0x29, 0x91, 0x19, 0x8e, 0x48, 0x68, 0x39, 0xc5, 0x7b, 0x8c, - 0xa8, 0x33, 0x2e, 0x4e, 0x6d, 0x4c, 0xa5, 0x58, 0xf7, 0xc4, 0x5b, 0xf1, 0x84, 0xea, 0x78, 0x4e, - 0x28, 0x11, 0xfe, 0x4d, 0xe3, 0x49, 0xa5, 0x41, 0x5b, 0xb0, 0x96, 0x61, 0x35, 0x93, 0xfe, 0x9a, - 0x8e, 0xce, 0x08, 0xc1, 0xcf, 0x2e, 0xb4, 0xc6, 0x3c, 0xca, 0x53, 0xc2, 0xd4, 0x4a, 0x8a, 0x0f, - 0x61, 0x6b, 0x4e, 0x04, 0x3d, 0xa1, 0x11, 0x56, 0x94, 0xb3, 0x63, 0xe3, 0x9d, 0xf4, 0xdd, 0x6d, - 0x6f, 0xb7, 0x33, 0xea, 0x95, 0x21, 0x7c, 0x5d, 0xe3, 0x1c, 0x6a, 0x4a, 0xb8, 0x39, 0x5f, 0xd1, - 0x49, 0x74, 0x0f, 0xba, 0x38, 0x57, 0xb3, 0xc2, 0x23, 0x03, 0xd8, 0x44, 0x5f, 0xd3, 0xa2, 0x3d, - 0xd8, 0xc0, 0x52, 0x12, 0x51, 0x7b, 0xd3, 0x3a, 0x7d, 0x6b, 0xa9, 0x37, 0x36, 0xd1, 0x43, 0x78, - 0x33, 0xc2, 0x19, 0x9e, 0xd0, 0x84, 0xaa, 0xc5, 0x71, 0x4c, 0x12, 0x32, 0x35, 0x96, 0x9b, 0x9a, - 0xbf, 0x55, 0x81, 0xe3, 0x25, 0x76, 0xed, 0x12, 0x65, 0x73, 0x6e, 0xdd, 0x69, 0x5d, 0xbf, 0xb4, - 0xbf, 0xc4, 0x74, 0xe2, 0x89, 0x98, 0xd3, 0x88, 0xf8, 0x6d, 0x4d, 0x2b, 0xc5, 0xe0, 0x47, 0x17, - 0x5a, 0x87, 0x44, 0xe1, 0x18, 0x2b, 0x8c, 0xee, 0x02, 0x70, 0x41, 0xa7, 0x94, 0x1d, 0xe7, 0x82, - 0xda, 0x54, 0xb6, 0x8d, 0xe6, 0x2b, 0x41, 0xd1, 0xbb, 0xd0, 0xc8, 0xf2, 0x49, 0x42, 0x23, 0x9b, - 0xc3, 0x3b, 0x65, 0x0e, 0x4b, 0x03, 0x83, 0x23, 0x0d, 0x3f, 0x61, 0x4a, 0x2c, 0x42, 0xcb, 0x45, - 0x1f, 0x40, 0x33, 0x13, 0x74, 0x8e, 0x15, 0xf1, 0x3d, 0x7d, 0xed, 0xee, 0xea, 0x35, 0x83, 0x9b, - 0x7b, 0x25, 0xbb, 0xf7, 0x11, 0x74, 0x6a, 0xf6, 0xd0, 0x06, 0x78, 0xa7, 0x64, 0x61, 0xbd, 0x2a, - 0x8e, 0x45, 0x53, 0xcc, 0x71, 0x92, 0x97, 0xa3, 0x63, 0x84, 0x8f, 0xdd, 0x0f, 0x9d, 0xde, 0x17, - 0xb0, 0x5e, 0xb7, 0xf9, 0x37, 0x77, 0xef, 0xd5, 0xef, 0x76, 0x46, 0x1b, 0xa5, 0x4f, 0x47, 0x82, - 0x67, 0x44, 0xa8, 0x45, 0xcd, 0x5a, 0x90, 0x40, 0xe7, 0x88, 0x88, 0x94, 0x4a, 0x49, 0x39, 0x93, - 0xc5, 0x34, 0x4c, 0x45, 0xb1, 0x47, 0x7c, 0x67, 0xdb, 0xfb, 0xe7, 0x69, 0x30, 0x1c, 0x34, 0x84, - 0x86, 0x8c, 0x78, 0x46, 0x4c, 0xe3, 0x75, 0x47, 0x6f, 0x2d, 0x5f, 0x5a, 0x9a, 0x7c, 0x56, 0xe0, - 0xa1, 0xa5, 0x05, 0xdf, 0x39, 0xd0, 0x3c, 0x12, 0xfc, 0x84, 0x26, 0x64, 0xa5, 0xa7, 0x6b, 0x03, - 0xe4, 0xfe, 0xdb, 0x28, 0x7b, 0xd7, 0x47, 0x19, 0xdd, 0x87, 0x56, 0x6a, 0xd3, 0xad, 0xc7, 0xab, - 0x16, 0x72, 0x59, 0x86, 0x70, 0xc9, 0x08, 0x3e, 0x85, 0x56, 0x99, 0x88, 0x57, 0xef, 0xba, 0x32, - 0xbb, 0xae, 0x46, 0x8a, 0x63, 0xf0, 0x93, 0x0b, 0x8d, 0xa3, 0x7c, 0x72, 0x40, 0x16, 0x68, 0x07, - 0x6e, 0x0a, 0x9e, 0x10, 0xbb, 0x39, 0x6e, 0x95, 0x8f, 0x1e, 0x90, 0x45, 0xc8, 0x13, 0x12, 0x6a, - 0x10, 0x8d, 0xa0, 0x8d, 0x93, 0x29, 0x17, 0x54, 0xcd, 0x52, 0x6d, 0xa7, 0x96, 0xd5, 0x03, 0xb2, - 0x78, 0x54, 0x62, 0x61, 0x45, 0x43, 0x43, 0x68, 0x11, 0x16, 0xf1, 0x98, 0xb2, 0xa9, 0x8e, 0xb7, - 0x3b, 0xda, 0xac, 0x5d, 0x79, 0x62, 0xa1, 0x70, 0x49, 0x2a, 0xdc, 0x14, 0xf8, 0x4c, 0x47, 0xbf, - 0x1e, 0x16, 0xc7, 0x42, 0x33, 0x23, 0xe7, 0xfe, 0x9a, 0x69, 0x8b, 0x19, 0x39, 0x2f, 0x36, 0x69, - 0x9a, 0x27, 0x8a, 0x4e, 0xb0, 0x24, 0x76, 0x5b, 0x56, 0x0a, 0xb4, 0x07, 0xde, 0x8b, 0xb3, 0x53, - 0x3d, 0x9e, 0x9d, 0x5a, 0x21, 0x75, 0xa0, 0x83, 0xcf, 0xcf, 0x4e, 0x4d, 0x03, 0x17, 0x9c, 0xde, - 0xfb, 0xd0, 0x2a, 0x15, 0xaf, 0xd3, 0xb9, 0xc1, 0x9f, 0x0e, 0x34, 0x9f, 0x99, 0xd9, 0x5c, 0xa9, - 0xfe, 0xd5, 0x1a, 0xbb, 0x2b, 0x35, 0xbe, 0x0d, 0x0d, 0x33, 0xac, 0xb6, 0xfe, 0x56, 0x42, 0xef, - 0x41, 0x27, 0xab, 0xfa, 0xd7, 0x96, 0x7f, 0x73, 0xb5, 0x0f, 0x65, 0x58, 0xe7, 0x15, 0x7d, 0xce, - 0x33, 0xc2, 0x68, 0xac, 0x13, 0xd4, 0xa9, 0x2a, 0xf2, 0x34, 0x23, 0x6c, 0x7f, 0xfc, 0x98, 0xb3, - 0x13, 0x3a, 0x0d, 0x2d, 0xe7, 0x4a, 0x83, 0x35, 0x5e, 0xd9, 0x60, 0x4f, 0x61, 0xed, 0x39, 0x3f, - 0x25, 0xec, 0xff, 0xc4, 0x98, 0xe2, 0x48, 0x70, 0x66, 0xff, 0x08, 0xad, 0x14, 0xfc, 0xe6, 0x00, - 0x5a, 0x5d, 0xe5, 0xaf, 0x6d, 0xbe, 0xfa, 0xa7, 0xf3, 0xfe, 0xc3, 0x3f, 0xdd, 0x3b, 0x00, 0x66, - 0xc9, 0x1d, 0x17, 0xf5, 0x35, 0x79, 0xed, 0x5e, 0x6d, 0x8b, 0xb0, 0x6d, 0x18, 0xc5, 0x28, 0xec, - 0x55, 0x5b, 0xb8, 0xa9, 0xb9, 0xcb, 0x69, 0xb0, 0x15, 0xaf, 0xd6, 0xf2, 0x0e, 0x34, 0xbf, 0xa1, - 0x8a, 0x11, 0x29, 0x8b, 0x99, 0x3f, 0x33, 0x47, 0x3b, 0x7b, 0xa5, 0xf8, 0xd9, 0x27, 0xbf, 0x5e, - 0xf4, 0x9d, 0x97, 0x17, 0x7d, 0xe7, 0x8f, 0x8b, 0xbe, 0xf3, 0xfd, 0x65, 0xff, 0xc6, 0xcb, 0xcb, - 0xfe, 0x8d, 0xdf, 0x2f, 0xfb, 0x37, 0xbe, 0x0d, 0xa6, 0x54, 0xcd, 0xf2, 0xc9, 0x20, 0xe2, 0xe9, - 0x90, 0x33, 0xc9, 0x99, 0x18, 0xea, 0x9f, 0xf3, 0x61, 0xf1, 0xcd, 0x53, 0x7c, 0x6e, 0xc8, 0x49, - 0x43, 0x7f, 0xd9, 0x3c, 0xfc, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x95, 0xda, 0x01, 0x93, 0x3c, 0x09, - 0x00, 0x00, + // 1063 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xef, 0xee, 0x36, 0xfe, 0x78, 0x0e, 0x4e, 0x34, 0x31, 0xb0, 0x8a, 0x1a, 0x2b, 0xda, 0x48, + 0x25, 0xa0, 0x62, 0xab, 0x2e, 0x88, 0x0f, 0x21, 0xa4, 0x12, 0xf7, 0x90, 0x9a, 0xd0, 0x68, 0x5b, + 0x88, 0xc4, 0x25, 0x5a, 0xef, 0x4e, 0x9c, 0xa9, 0xd7, 0x33, 0xab, 0x99, 0x59, 0x27, 0x7b, 0xe4, + 0x3f, 0xe0, 0xc6, 0x89, 0x03, 0x7f, 0x06, 0x37, 0xc4, 0x89, 0x63, 0x8f, 0x1c, 0x51, 0xc2, 0x1f, + 0x82, 0xe6, 0x63, 0xed, 0x6d, 0xdc, 0x52, 0xc1, 0xc5, 0x9a, 0xf7, 0x7e, 0xbf, 0x37, 0xf3, 0xbe, + 0xd7, 0xb0, 0x95, 0x90, 0xa4, 0x3f, 0xbf, 0xdf, 0x9f, 0xb1, 0x04, 0xa7, 0xa2, 0x97, 0x71, 0x26, + 0x19, 0xaa, 0x25, 0x24, 0xe9, 0xcd, 0xef, 0x6f, 0x77, 0x2c, 0x38, 0xc1, 0x14, 0x0b, 0x62, 0xd1, + 0xed, 0xce, 0x84, 0x4d, 0x98, 0x3e, 0xf6, 0xd5, 0xc9, 0x68, 0x83, 0x3e, 0xb4, 0x1e, 0xc6, 0x71, + 0x3e, 0xcb, 0xd3, 0x48, 0x32, 0x8e, 0x76, 0xa1, 0x15, 0x2d, 0x45, 0xdf, 0xd9, 0x75, 0xf6, 0xd7, + 0xc3, 0xaa, 0x2a, 0xf8, 0xdd, 0x01, 0x38, 0xe0, 0x38, 0xc1, 0x54, 0x92, 0x28, 0x45, 0x6d, 0x70, + 0x49, 0xa2, 0x79, 0xcd, 0xd0, 0x25, 0x09, 0x7a, 0x0f, 0x36, 0xe2, 0x05, 0x7a, 0x2a, 0x8b, 0x0c, + 0xfb, 0xae, 0x06, 0xdb, 0x4b, 0xf5, 0xb3, 0x22, 0xc3, 0x68, 0x0f, 0xde, 0xaa, 0x10, 0x49, 0xe2, + 0x7b, 0xfa, 0xad, 0xf5, 0xa5, 0xf2, 0x30, 0x41, 0x77, 0xa0, 0x29, 0x79, 0x44, 0x45, 0xc6, 0xb8, + 0xf4, 0x6f, 0xef, 0x7a, 0xfb, 0xcd, 0x70, 0xa9, 0x40, 0x3e, 0xd4, 0x45, 0x3e, 0x7e, 0x8e, 0x63, + 0xe9, 0xd7, 0xf4, 0x1b, 0xa5, 0x88, 0xba, 0x00, 0x31, 0xa3, 0x92, 0xb3, 0x34, 0xc5, 0xdc, 0xaf, + 0x6b, 0xb0, 0xa2, 0x09, 0x7e, 0x76, 0xc0, 0x1b, 0x1e, 0x0e, 0xd1, 0x3d, 0xa8, 0xcd, 0xb0, 0x3c, + 0x67, 0x26, 0x82, 0xf6, 0xa0, 0xd3, 0x33, 0x29, 0xec, 0x0d, 0x0f, 0x87, 0xdf, 0x44, 0x33, 0x2c, + 0xb2, 0x28, 0xc6, 0xa1, 0xe5, 0xa8, 0xf7, 0x28, 0x96, 0x17, 0x8c, 0x4f, 0x6d, 0x4c, 0xa5, 0x58, + 0xf5, 0xc4, 0x5b, 0xf1, 0x84, 0xe8, 0x78, 0xce, 0x08, 0xe6, 0xfe, 0x6d, 0xe3, 0xc9, 0x52, 0x83, + 0x3a, 0xb0, 0x96, 0x45, 0xf2, 0x5c, 0xf8, 0x6b, 0x3a, 0x3a, 0x23, 0x04, 0xbf, 0xb9, 0xd0, 0x18, + 0xb2, 0x38, 0x9f, 0x61, 0x2a, 0x57, 0x52, 0x7c, 0x04, 0x9d, 0x39, 0xe6, 0xe4, 0x8c, 0xc4, 0x91, + 0x24, 0x8c, 0x9e, 0x1a, 0xef, 0x84, 0xef, 0xee, 0x7a, 0xfb, 0xad, 0xc1, 0x76, 0x19, 0xc2, 0x77, + 0x15, 0xce, 0x91, 0xa6, 0x84, 0x5b, 0xf3, 0x15, 0x9d, 0x40, 0x77, 0xa1, 0x1d, 0xe5, 0xf2, 0x5c, + 0x79, 0x64, 0x00, 0x9b, 0xe8, 0x1b, 0x5a, 0xf4, 0x3e, 0x6c, 0x46, 0x42, 0x60, 0x5e, 0x79, 0xd3, + 0x3a, 0xbd, 0xb1, 0xd0, 0x9b, 0x3b, 0xd1, 0x03, 0x78, 0x3b, 0x8e, 0xb2, 0x68, 0x4c, 0x52, 0x22, + 0x8b, 0xd3, 0x04, 0xa7, 0x78, 0x62, 0x6e, 0xae, 0x6b, 0x7e, 0x67, 0x09, 0x0e, 0x17, 0xd8, 0x0d, + 0x23, 0x42, 0xe7, 0xcc, 0xba, 0xd3, 0xb8, 0x69, 0x74, 0xb8, 0xc0, 0x74, 0xe2, 0x31, 0x9f, 0x93, + 0x18, 0xfb, 0x4d, 0x4d, 0x2b, 0xc5, 0x20, 0x02, 0xef, 0xf1, 0xc9, 0x08, 0x6d, 0x82, 0x37, 0x95, + 0x85, 0xcd, 0x9e, 0x3a, 0x2a, 0x4d, 0xcc, 0xe7, 0xb6, 0x82, 0xea, 0x88, 0xd6, 0xc1, 0xb9, 0xb4, + 0x75, 0x73, 0x2e, 0x95, 0x54, 0xd8, 0x42, 0x39, 0x85, 0x92, 0xa8, 0xbf, 0x66, 0x24, 0xaa, 0x24, + 0x6c, 0x7b, 0xcd, 0xc1, 0xc1, 0x2f, 0x2e, 0x34, 0x8e, 0xb0, 0x8c, 0x92, 0x48, 0x46, 0x68, 0x07, + 0x80, 0x71, 0x32, 0x21, 0xf4, 0x34, 0xe7, 0xc4, 0xbe, 0xd7, 0x34, 0x9a, 0x6f, 0x39, 0x41, 0x1f, + 0x41, 0x2d, 0xcb, 0xc7, 0x29, 0x89, 0x6d, 0x99, 0xee, 0x94, 0x65, 0x2a, 0x2f, 0xe8, 0x1d, 0x6b, + 0xf8, 0x11, 0x95, 0xbc, 0x08, 0x2d, 0x17, 0x7d, 0x02, 0xf5, 0x8c, 0x93, 0x79, 0x24, 0xb1, 0xef, + 0x69, 0xb3, 0x9d, 0x55, 0x33, 0x83, 0x1b, 0xbb, 0x92, 0xbd, 0xfd, 0x19, 0xb4, 0x2a, 0xf7, 0xe9, + 0x2c, 0xe0, 0x65, 0x16, 0x70, 0xa1, 0xfa, 0x6e, 0x1e, 0xa5, 0x79, 0x39, 0x9d, 0x46, 0xf8, 0xdc, + 0xfd, 0xd4, 0xd9, 0xfe, 0x1a, 0xd6, 0xab, 0x77, 0xbe, 0xc2, 0xf6, 0x6e, 0xd5, 0xb6, 0x35, 0xd8, + 0x2c, 0x7d, 0x3a, 0xe6, 0x2c, 0xc3, 0x5c, 0x16, 0x95, 0xdb, 0x82, 0x14, 0x5a, 0xc7, 0x98, 0xcf, + 0x88, 0x10, 0x84, 0x51, 0xa1, 0x06, 0x6e, 0xc2, 0x23, 0x2a, 0x85, 0xef, 0xec, 0x7a, 0xaf, 0x1f, + 0x38, 0xc3, 0x41, 0x7d, 0xa8, 0x89, 0x98, 0x65, 0xd8, 0xf4, 0x76, 0x7b, 0xf0, 0xee, 0xe2, 0xa5, + 0xc5, 0x95, 0x4f, 0x15, 0x1e, 0x5a, 0x5a, 0xf0, 0x83, 0x03, 0xf5, 0x63, 0xce, 0xce, 0x48, 0x8a, + 0x57, 0xc6, 0xa6, 0x32, 0xa3, 0xee, 0xbf, 0x6d, 0x0b, 0xef, 0xe6, 0xb6, 0x40, 0xf7, 0xa0, 0x31, + 0xb3, 0xe9, 0xd6, 0x8d, 0x51, 0x09, 0xb9, 0x2c, 0x43, 0xb8, 0x60, 0x04, 0x5f, 0x42, 0xa3, 0x4c, + 0xc4, 0x9b, 0xd7, 0x69, 0x99, 0x5d, 0x57, 0x23, 0xea, 0x18, 0xfc, 0xe4, 0x42, 0xed, 0x38, 0x1f, + 0x8f, 0x70, 0x81, 0xf6, 0xe0, 0x36, 0x67, 0x29, 0xb6, 0xcb, 0x69, 0xa3, 0x7c, 0x74, 0x84, 0x8b, + 0x90, 0xa5, 0x38, 0xd4, 0x20, 0x1a, 0x40, 0x33, 0x4a, 0x27, 0x8c, 0x13, 0x79, 0x3e, 0xd3, 0xf7, + 0x54, 0xb2, 0x3a, 0xc2, 0xc5, 0xc3, 0x12, 0x0b, 0x97, 0x34, 0xd4, 0x87, 0x06, 0xa6, 0x31, 0x4b, + 0x08, 0x9d, 0xe8, 0x78, 0xdb, 0x83, 0xad, 0x8a, 0xc9, 0x23, 0x0b, 0x85, 0x0b, 0x92, 0x2a, 0x79, + 0x9c, 0xf3, 0x39, 0xd6, 0xf1, 0xb7, 0x97, 0xf1, 0x8f, 0x70, 0x71, 0xa0, 0xf4, 0xa1, 0x81, 0xd1, + 0x07, 0xd0, 0x98, 0xe2, 0xc2, 0xec, 0xfd, 0xb5, 0x15, 0xaf, 0xd5, 0xe2, 0x0f, 0xeb, 0x53, 0x73, + 0x50, 0xa1, 0xf3, 0xe8, 0x42, 0x8f, 0xd3, 0x7a, 0xa8, 0x8e, 0x68, 0x07, 0xbc, 0xe7, 0x17, 0x53, + 0xbd, 0xaf, 0x5b, 0x83, 0x56, 0x69, 0xf8, 0xf8, 0x64, 0x14, 0x2a, 0x7d, 0xf0, 0xb7, 0x03, 0xf5, + 0xa7, 0x66, 0xbc, 0x57, 0xaa, 0xfb, 0x72, 0x0d, 0xdd, 0x95, 0x1a, 0xbe, 0x03, 0x35, 0x33, 0x8c, + 0xb6, 0xbe, 0x56, 0x42, 0x1f, 0x43, 0x2b, 0x5b, 0xf6, 0xa7, 0x2d, 0xef, 0xd6, 0x6a, 0x9f, 0x89, + 0xb0, 0xca, 0x53, 0x7d, 0xcc, 0x32, 0x4c, 0x49, 0xa2, 0xa3, 0x6c, 0x2d, 0x33, 0xfe, 0x24, 0xc3, + 0xf4, 0x70, 0x78, 0xc0, 0xe8, 0x19, 0x99, 0x84, 0x96, 0xf3, 0x52, 0x03, 0xd5, 0xde, 0xd8, 0x40, + 0x4f, 0x60, 0xed, 0x19, 0x9b, 0x62, 0xfa, 0x7f, 0x62, 0x9c, 0x45, 0x31, 0x67, 0xd4, 0x7e, 0x4b, + 0xad, 0x14, 0xfc, 0xea, 0x00, 0x5a, 0xfd, 0x1a, 0xfc, 0xc7, 0x8f, 0x9f, 0x71, 0xc6, 0x7d, 0x8d, + 0x33, 0xde, 0xab, 0x9c, 0x21, 0x42, 0xe4, 0x8b, 0x8f, 0x9e, 0x95, 0xd0, 0x87, 0x00, 0x66, 0xb9, + 0x9d, 0xaa, 0xbe, 0x37, 0xd9, 0x6b, 0x2f, 0xf2, 0xad, 0xfb, 0x3e, 0x6c, 0x1a, 0xc6, 0x08, 0x17, + 0xc1, 0x1e, 0xd4, 0x4f, 0x88, 0xa4, 0x58, 0x08, 0x35, 0xc0, 0x17, 0xe6, 0x68, 0x07, 0xa9, 0x14, + 0xbf, 0xfa, 0xe2, 0x8f, 0xab, 0xae, 0xf3, 0xe2, 0xaa, 0xeb, 0xfc, 0x75, 0xd5, 0x75, 0x7e, 0xbc, + 0xee, 0xde, 0x7a, 0x71, 0xdd, 0xbd, 0xf5, 0xe7, 0x75, 0xf7, 0xd6, 0xf7, 0xc1, 0x84, 0xc8, 0xf3, + 0x7c, 0xdc, 0x8b, 0xd9, 0xac, 0xcf, 0xa8, 0x60, 0x94, 0xf7, 0xf5, 0xcf, 0x65, 0x5f, 0xfd, 0x47, + 0x52, 0x6d, 0x2a, 0xc6, 0x35, 0xfd, 0x4f, 0xe8, 0xc1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5d, + 0xdb, 0xed, 0x81, 0x54, 0x09, 0x00, 0x00, } func (m *Accumulator) Marshal() (dAtA []byte, err error) { @@ -1256,6 +1343,71 @@ func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *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 *JWK) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *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 *Metadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1503,45 +1655,34 @@ func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Jwk) > 0 { - for k := range m.Jwk { - v := m.Jwk[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] = 0x3a + 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)) } - } - if len(m.Multibase) > 0 { - i -= len(m.Multibase) - copy(dAtA[i:], m.Multibase) - i = encodeVarintModels(dAtA, i, uint64(len(m.Multibase))) i-- - dAtA[i] = 0x32 - } - if len(m.Hex) > 0 { - i -= len(m.Hex) - copy(dAtA[i:], m.Hex) - i = encodeVarintModels(dAtA, i, uint64(len(m.Hex))) - i-- - dAtA[i] = 0x2a + 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] = 0x22 + 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)) @@ -1705,18 +1846,6 @@ func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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] = 0x3a - } if m.PublicKey != nil { { size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) @@ -1727,26 +1856,33 @@ func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintModels(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } - if m.Method != 0 { - i = encodeVarintModels(dAtA, i, uint64(m.Method)) + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintModels(dAtA, i, uint64(len(m.Issuer))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x22 } 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 + dAtA[i] = 0x1a } 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 + dAtA[i] = 0x12 + } + if m.Method != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Method)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -1919,6 +2055,39 @@ func (m *Document) Size() (n int) { return n } +func (m *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 *Metadata) Size() (n int) { if m == nil { return 0 @@ -2033,26 +2202,20 @@ func (m *PubKey) Size() (n int) { 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)) } - l = len(m.Hex) - if l > 0 { + if m.Jwk != nil { + l = m.Jwk.Size() n += 1 + l + sovModels(uint64(l)) } - l = len(m.Multibase) - if l > 0 { - n += 1 + l + sovModels(uint64(l)) - } - if len(m.Jwk) > 0 { - for k, v := range m.Jwk { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + 1 + len(v) + sovModels(uint64(len(v))) - n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) - } - } return n } @@ -2116,6 +2279,9 @@ func (m *VerificationMethod) Size() (n int) { } var l int _ = l + if m.Method != 0 { + n += 1 + sovModels(uint64(m.Method)) + } l = len(m.Id) if l > 0 { n += 1 + l + sovModels(uint64(l)) @@ -2124,17 +2290,14 @@ func (m *VerificationMethod) Size() (n int) { if l > 0 { n += 1 + l + sovModels(uint64(l)) } - if m.Method != 0 { - n += 1 + sovModels(uint64(m.Method)) + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) } if m.PublicKey != nil { l = m.PublicKey.Size() n += 1 + l + sovModels(uint64(l)) } - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovModels(uint64(l)) - } return n } @@ -2958,6 +3121,248 @@ func (m *Document) Unmarshal(dAtA []byte) error { } return nil } +func (m *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 *Metadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3871,6 +4276,44 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { } } 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) } @@ -3904,70 +4347,6 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { m.Raw = []byte{} } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hex", 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.Hex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Multibase", 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.Multibase = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) @@ -3998,102 +4377,11 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Jwk == nil { - m.Jwk = make(map[string]string) + m.Jwk = &JWK{} } - 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 - } + if err := m.Jwk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Jwk[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -4548,6 +4836,25 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + m.Method = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Method |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } @@ -4579,7 +4886,7 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } @@ -4611,11 +4918,11 @@ func (m *VerificationMethod) 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) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) } - m.Method = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -4625,12 +4932,25 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Method |= DIDNamespace(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } @@ -4666,42 +4986,6 @@ func (m *VerificationMethod) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field 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:]) diff --git a/x/did/types/msgs.go b/x/did/types/msgs.go index f5b91d206..acf6290e0 100644 --- a/x/did/types/msgs.go +++ b/x/did/types/msgs.go @@ -48,41 +48,6 @@ func (msg *MsgUpdateParams) Validate() error { return msg.Params.Validate() } -// -// [RegisterController] -// - -// NewMsgRegisterController creates a new instance of MsgRegisterController -func NewMsgRegisterController( - sender sdk.Address, -) (*MsgRegisterController, error) { - return &MsgRegisterController{ - Authority: sender.String(), - }, nil -} - -// Route returns the name of the module -func (msg MsgRegisterController) Route() string { return ModuleName } - -// Type returns the the action -func (msg MsgRegisterController) Type() string { return "register_controller" } - -// GetSignBytes implements the LegacyMsg interface. -func (msg MsgRegisterController) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg *MsgRegisterController) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} - -// ValidateBasic does a sanity check on the provided data. -func (msg *MsgRegisterController) Validate() error { - return nil -} - // // [RegisterService] // @@ -152,3 +117,38 @@ func (msg *MsgAllocateVault) GetSigners() []sdk.AccAddress { func (msg *MsgAllocateVault) Validate() error { return nil } + +// +// [RegisterController] +// + +// NewMsgRegisterController creates a new instance of MsgRegisterController +func NewMsgRegisterController( + sender sdk.Address, +) (*MsgRegisterController, error) { + return &MsgRegisterController{ + Authority: sender.String(), + }, nil +} + +// Route returns the name of the module +func (msg MsgRegisterController) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgRegisterController) Type() string { return "register_controller" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgRegisterController) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgRegisterController) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (msg *MsgRegisterController) Validate() error { + return nil +} diff --git a/x/did/types/openid.go b/x/did/types/openid.go deleted file mode 100644 index 11beb94c1..000000000 --- a/x/did/types/openid.go +++ /dev/null @@ -1,27 +0,0 @@ -package types - -// DiscoveryDocument represents the OIDC discovery document. -type DiscoveryDocument struct { - Issuer string `json:"issuer"` - AuthorizationEndpoint string `json:"authorization_endpoint"` - TokenEndpoint string `json:"token_endpoint"` - UserinfoEndpoint string `json:"userinfo_endpoint"` - JwksURI string `json:"jwks_uri"` - RegistrationEndpoint string `json:"registration_endpoint"` - ScopesSupported []string `json:"scopes_supported"` - ResponseTypesSupported []string `json:"response_types_supported"` - SubjectTypesSupported []string `json:"subject_types_supported"` - IDTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"` - ClaimsSupported []string `json:"claims_supported"` - GrantTypesSupported []string `json:"grant_types_supported"` - TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"` -} - -// UserInfo represents the user information. -type UserInfo struct { - DID string `json:"did"` - Sub string `json:"sub"` - Name string `json:"name"` - Email string `json:"email"` - // Add other claims as needed -} diff --git a/x/did/types/pubkey.go b/x/did/types/pubkey.go index 3a5f8a546..442ad7dd0 100644 --- a/x/did/types/pubkey.go +++ b/x/did/types/pubkey.go @@ -1,13 +1,29 @@ package types import ( + fmt "fmt" + "math/big" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/onsonr/crypto/core/curves" + "github.com/onsonr/crypto/signatures/ecdsa" + "golang.org/x/crypto/sha3" ) // 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{ - Role: keyInfo.Role, + Raw: encKey, + Role: keyInfo.Role, + Encoding: keyInfo.Encoding, + Algorithm: keyInfo.Algorithm, + Curve: keyInfo.Curve, + KeyType: keyInfo.Type, }, nil } @@ -18,12 +34,39 @@ func (k *PubKey) Address() cryptotypes.Address { // Bytes returns the raw bytes of the public key func (k *PubKey) Bytes() []byte { - return k.GetRaw() + 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(), + } } // VerifySignature verifies a signature over the given message func (k *PubKey) VerifySignature(msg []byte, sig []byte) bool { - return false + pp, err := buildEcPoint(k.Bytes()) + if err != nil { + return false + } + sigEd, err := ecdsa.DeserializeSecp256k1Signature(sig) + if err != nil { + return false + } + hash := sha3.New256() + _, err = hash.Write(msg) + if err != nil { + return false + } + digest := hash.Sum(nil) + return curves.VerifyEcdsa(pp, digest[:], sigEd) } // Equals returns true if two public keys are equal @@ -38,3 +81,34 @@ func (k *PubKey) Equals(k2 cryptotypes.PubKey) bool { func (k *PubKey) Type() string { return "" } + +// VerifySignature verifies the signature of a message +func VerifySignature(key []byte, msg []byte, sig []byte) bool { + pp, err := buildEcPoint(key) + if err != nil { + return false + } + sigEd, err := ecdsa.DeserializeSecp256k1Signature(sig) + if err != nil { + return false + } + hash := sha3.New256() + _, err = hash.Write(msg) + if err != nil { + return false + } + digest := hash.Sum(nil) + return curves.VerifyEcdsa(pp, digest[:], sigEd) +} + +// BuildEcPoint builds an elliptic curve point from a compressed byte slice +func buildEcPoint(pubKey []byte) (*curves.EcPoint, error) { + crv := curves.K256() + x := new(big.Int).SetBytes(pubKey[1:33]) + y := new(big.Int).SetBytes(pubKey[33:]) + ecCurve, err := crv.ToEllipticCurve() + if err != nil { + return nil, fmt.Errorf("error converting curve: %v", err) + } + return &curves.EcPoint{X: x, Y: y, Curve: ecCurve}, nil +} diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index b9f5c2cb3..7ca49dac0 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -9,6 +9,7 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" + _ "google.golang.org/genproto/googleapis/api/httpbody" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -30,10 +31,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Queryequest is the request type for the Query/Params RPC method. type QueryRequest struct { - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` - Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - Credentials []*Credential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` + Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` } func (m *QueryRequest) Reset() { *m = QueryRequest{} } @@ -90,19 +91,17 @@ func (m *QueryRequest) GetSubject() string { return "" } -func (m *QueryRequest) GetCredentials() []*Credential { +func (m *QueryRequest) GetEndpoint() string { if m != nil { - return m.Credentials + return m.Endpoint } - return nil + return "" } // QueryParamsResponse is the response type for the Query/Params RPC method. type QueryParamsResponse struct { // params defines the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - // ipfs_active returns true if the IPFS client is initialized - IpfsActive bool `protobuf:"varint,2,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -145,79 +144,32 @@ func (m *QueryParamsResponse) GetParams() *Params { return nil } -func (m *QueryParamsResponse) GetIpfsActive() bool { - if m != nil { - return m.IpfsActive - } - return false -} - -// QueryAccountsResponse is the response type for the Query/Exists RPC method. -type QueryAccountsResponse struct { - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` -} - -func (m *QueryAccountsResponse) Reset() { *m = QueryAccountsResponse{} } -func (m *QueryAccountsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountsResponse) ProtoMessage() {} -func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{2} -} -func (m *QueryAccountsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountsResponse.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 *QueryAccountsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountsResponse.Merge(m, src) -} -func (m *QueryAccountsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo - -func (m *QueryAccountsResponse) GetExists() bool { - if m != nil { - return m.Exists - } - return false -} - -// QueryCredentialsResponse is the response type for the Query/Exists RPC method. -type QueryCredentialsResponse struct { +// QueryResponse is the response type for the Query/Exists RPC method. +type QueryResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` - Credentials []*Credential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` - Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` + IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` + Document *Document `protobuf:"bytes,6,opt,name=document,proto3" json:"document,omitempty"` + Service *Service `protobuf:"bytes,7,opt,name=service,proto3" json:"service,omitempty"` + Credentials []*Credential `protobuf:"bytes,8,rep,name=credentials,proto3" json:"credentials,omitempty"` + Token *Token `protobuf:"bytes,9,opt,name=token,proto3" json:"token,omitempty"` + Error string `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"` } -func (m *QueryCredentialsResponse) Reset() { *m = QueryCredentialsResponse{} } -func (m *QueryCredentialsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryCredentialsResponse) ProtoMessage() {} -func (*QueryCredentialsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{3} +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{2} } -func (m *QueryCredentialsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryCredentialsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryCredentialsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -227,47 +179,82 @@ func (m *QueryCredentialsResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *QueryCredentialsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCredentialsResponse.Merge(m, src) +func (m *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) } -func (m *QueryCredentialsResponse) XXX_Size() int { +func (m *QueryResponse) XXX_Size() int { return m.Size() } -func (m *QueryCredentialsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCredentialsResponse.DiscardUnknown(m) +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryCredentialsResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo -func (m *QueryCredentialsResponse) GetSuccess() bool { +func (m *QueryResponse) GetSuccess() bool { if m != nil { return m.Success } return false } -func (m *QueryCredentialsResponse) GetSubject() string { +func (m *QueryResponse) GetSubject() string { if m != nil { return m.Subject } return "" } -func (m *QueryCredentialsResponse) GetOrigin() string { +func (m *QueryResponse) GetOrigin() string { if m != nil { return m.Origin } return "" } -func (m *QueryCredentialsResponse) GetCredentials() []*Credential { +func (m *QueryResponse) GetIpfsActive() bool { + if m != nil { + return m.IpfsActive + } + return false +} + +func (m *QueryResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func (m *QueryResponse) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *QueryResponse) GetService() *Service { + if m != nil { + return m.Service + } + return nil +} + +func (m *QueryResponse) GetCredentials() []*Credential { if m != nil { return m.Credentials } return nil } -func (m *QueryCredentialsResponse) GetError() string { +func (m *QueryResponse) GetToken() *Token { + if m != nil { + return m.Token + } + return nil +} + +func (m *QueryResponse) GetError() string { if m != nil { return m.Error } @@ -276,15 +263,21 @@ func (m *QueryCredentialsResponse) GetError() string { // QueryResolveResponse is the response type for the Query/Resolve RPC method. type QueryResolveResponse struct { - // document is the DID document - Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` + Document *Document `protobuf:"bytes,6,opt,name=document,proto3" json:"document,omitempty"` + Credentials []*Credential `protobuf:"bytes,7,rep,name=credentials,proto3" json:"credentials,omitempty"` + Token *Token `protobuf:"bytes,8,opt,name=token,proto3" json:"token,omitempty"` } func (m *QueryResolveResponse) Reset() { *m = QueryResolveResponse{} } func (m *QueryResolveResponse) String() string { return proto.CompactTextString(m) } func (*QueryResolveResponse) ProtoMessage() {} func (*QueryResolveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{4} + return fileDescriptor_ae1fa9bb626e2869, []int{3} } func (m *QueryResolveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,6 +306,41 @@ func (m *QueryResolveResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryResolveResponse proto.InternalMessageInfo +func (m *QueryResolveResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *QueryResolveResponse) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *QueryResolveResponse) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *QueryResolveResponse) GetIpfsActive() bool { + if m != nil { + return m.IpfsActive + } + return false +} + +func (m *QueryResolveResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + func (m *QueryResolveResponse) GetDocument() *Document { if m != nil { return m.Document @@ -320,16 +348,35 @@ func (m *QueryResolveResponse) GetDocument() *Document { return nil } +func (m *QueryResolveResponse) GetCredentials() []*Credential { + if m != nil { + return m.Credentials + } + return nil +} + +func (m *QueryResolveResponse) GetToken() *Token { + if m != nil { + return m.Token + } + return nil +} + // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. type QueryServiceResponse struct { - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` + Service *Service `protobuf:"bytes,6,opt,name=service,proto3" json:"service,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{5} + return fileDescriptor_ae1fa9bb626e2869, []int{4} } func (m *QueryServiceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -358,6 +405,41 @@ func (m *QueryServiceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryServiceResponse proto.InternalMessageInfo +func (m *QueryServiceResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *QueryServiceResponse) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *QueryServiceResponse) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *QueryServiceResponse) GetIpfsActive() bool { + if m != nil { + return m.IpfsActive + } + return false +} + +func (m *QueryServiceResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + func (m *QueryServiceResponse) GetService() *Service { if m != nil { return m.Service @@ -365,122 +447,54 @@ func (m *QueryServiceResponse) GetService() *Service { return nil } -// QueryTokenResponse is the response type for the Query/LoginOptions RPC method. -type QueryTokenResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *QueryTokenResponse) Reset() { *m = QueryTokenResponse{} } -func (m *QueryTokenResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTokenResponse) ProtoMessage() {} -func (*QueryTokenResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{6} -} -func (m *QueryTokenResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTokenResponse.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 *QueryTokenResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTokenResponse.Merge(m, src) -} -func (m *QueryTokenResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTokenResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTokenResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTokenResponse proto.InternalMessageInfo - -func (m *QueryTokenResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *QueryTokenResponse) GetToken() *Token { - if m != nil { - return m.Token - } - return nil -} - -func (m *QueryTokenResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - func init() { proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") - proto.RegisterType((*QueryAccountsResponse)(nil), "did.v1.QueryAccountsResponse") - proto.RegisterType((*QueryCredentialsResponse)(nil), "did.v1.QueryCredentialsResponse") + proto.RegisterType((*QueryResponse)(nil), "did.v1.QueryResponse") proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse") proto.RegisterType((*QueryServiceResponse)(nil), "did.v1.QueryServiceResponse") - proto.RegisterType((*QueryTokenResponse)(nil), "did.v1.QueryTokenResponse") } func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 641 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x4f, 0x13, 0x4f, - 0x14, 0x66, 0x29, 0xdd, 0xf6, 0xf7, 0x16, 0xf8, 0xe1, 0xb4, 0x90, 0xb5, 0x60, 0x25, 0x63, 0xa2, - 0x90, 0x98, 0x4e, 0xa8, 0x1e, 0xbd, 0x20, 0x5c, 0xbc, 0xc1, 0xca, 0xc1, 0x18, 0xa3, 0x59, 0x76, - 0xc7, 0x3a, 0xda, 0xee, 0x94, 0x9d, 0x69, 0x03, 0x21, 0x5c, 0x3c, 0x79, 0x34, 0xf1, 0x8f, 0xf0, - 0xee, 0x5f, 0xe1, 0x91, 0xc4, 0x8b, 0x47, 0x03, 0xfe, 0x21, 0xa6, 0x6f, 0x67, 0xd8, 0x5d, 0x84, - 0x84, 0x78, 0x69, 0xfa, 0xbe, 0xf7, 0xde, 0xf7, 0xde, 0xfb, 0xe6, 0x6b, 0x81, 0xc4, 0x22, 0x66, - 0xe3, 0x0d, 0x76, 0x30, 0xe2, 0xe9, 0x51, 0x67, 0x98, 0x4a, 0x2d, 0x89, 0x1b, 0x8b, 0xb8, 0x33, - 0xde, 0x68, 0x35, 0x4d, 0xae, 0xc7, 0x13, 0xae, 0x84, 0xca, 0xb2, 0xad, 0x86, 0x41, 0x07, 0x32, - 0xe6, 0x7d, 0x0b, 0xae, 0xf4, 0xa4, 0xec, 0xf5, 0x39, 0x0b, 0x87, 0x82, 0x85, 0x49, 0x22, 0x75, - 0xa8, 0x85, 0x4c, 0x4c, 0x96, 0x7e, 0x72, 0x60, 0x76, 0x77, 0x32, 0x20, 0xe0, 0x07, 0x23, 0xae, - 0x34, 0x59, 0x80, 0x4a, 0x2c, 0x62, 0xdf, 0x59, 0x75, 0xd6, 0xfe, 0x0b, 0x26, 0x5f, 0xc9, 0x12, - 0xb8, 0x32, 0x15, 0x3d, 0x91, 0xf8, 0xd3, 0x08, 0x9a, 0x88, 0xf8, 0x50, 0x53, 0xa3, 0xfd, 0xf7, - 0x3c, 0xd2, 0x7e, 0x05, 0x13, 0x36, 0x24, 0x8f, 0xc1, 0x8b, 0x52, 0x1e, 0xf3, 0x44, 0x8b, 0xb0, - 0xaf, 0xfc, 0x99, 0xd5, 0xca, 0x9a, 0xd7, 0x25, 0x9d, 0x6c, 0xf7, 0xce, 0xd6, 0x45, 0x2a, 0x28, - 0x96, 0xd1, 0xd7, 0xd0, 0xc0, 0x4d, 0x76, 0xc2, 0x34, 0x1c, 0xa8, 0x80, 0xab, 0xa1, 0x4c, 0x14, - 0x27, 0xf7, 0xc1, 0x1d, 0x22, 0x82, 0x3b, 0x79, 0xdd, 0x79, 0xcb, 0x63, 0xea, 0x4c, 0x96, 0xdc, - 0x05, 0x4f, 0x0c, 0xdf, 0xaa, 0x37, 0x61, 0xa4, 0xc5, 0x98, 0xe3, 0xae, 0xf5, 0x00, 0x26, 0xd0, - 0x26, 0x22, 0x94, 0xc1, 0x22, 0xf2, 0x6f, 0x46, 0x91, 0x1c, 0x25, 0x3a, 0x9f, 0xb0, 0x04, 0x2e, - 0x3f, 0x14, 0x4a, 0x67, 0x13, 0xea, 0x81, 0x89, 0xe8, 0x37, 0x07, 0x7c, 0xec, 0xc8, 0x37, 0xce, - 0x9b, 0xf0, 0xfa, 0x28, 0xe2, 0xca, 0x76, 0xd9, 0xb0, 0xa8, 0xcb, 0x74, 0x59, 0x97, 0x5c, 0xc9, - 0x4a, 0x49, 0xc9, 0x7f, 0xd2, 0x8b, 0x34, 0xa1, 0xca, 0xd3, 0x54, 0xa6, 0x7e, 0x15, 0xc9, 0xb2, - 0x80, 0x6e, 0x43, 0xd3, 0xbc, 0xa7, 0x92, 0xfd, 0x31, 0xbf, 0xd8, 0xf7, 0x21, 0xd4, 0x63, 0x19, - 0x8d, 0x06, 0x3c, 0xd1, 0x46, 0xc8, 0x05, 0x3b, 0x60, 0xdb, 0xe0, 0xc1, 0x45, 0x05, 0xdd, 0x34, - 0x2c, 0xcf, 0x79, 0x3a, 0x16, 0x51, 0xce, 0xb2, 0x0e, 0x35, 0x95, 0x41, 0x86, 0xe4, 0x7f, 0x4b, - 0x62, 0x2b, 0x6d, 0x9e, 0x0a, 0x20, 0x48, 0xb1, 0x27, 0x3f, 0xf0, 0xe4, 0x06, 0xb2, 0xdd, 0x83, - 0xaa, 0x9e, 0x94, 0xa2, 0x68, 0x5e, 0x77, 0xce, 0x12, 0x67, 0xfd, 0x59, 0x2e, 0xbf, 0xb9, 0x52, - 0xb8, 0xb9, 0xfb, 0x75, 0x06, 0xaa, 0x38, 0x8b, 0xec, 0x80, 0x9b, 0xd9, 0x82, 0x34, 0x6d, 0x7f, - 0xd1, 0xdd, 0xad, 0xe5, 0x12, 0x5a, 0x76, 0x1a, 0x6d, 0x7c, 0xfc, 0xf1, 0xfb, 0xcb, 0xf4, 0x1c, - 0xf1, 0xd8, 0xe4, 0x77, 0x64, 0x6c, 0xf5, 0x0a, 0xea, 0xd6, 0x30, 0xd7, 0x70, 0xde, 0x29, 0xa1, - 0x97, 0xdd, 0x45, 0x97, 0x91, 0x75, 0x91, 0x34, 0x90, 0xf5, 0x38, 0x16, 0xf1, 0x09, 0x0b, 0x2d, - 0xe3, 0x18, 0xbc, 0xad, 0xe2, 0x93, 0x5e, 0x39, 0x60, 0xb5, 0x84, 0x5e, 0x61, 0x46, 0xca, 0x70, - 0xc6, 0x3a, 0x79, 0xc0, 0x8c, 0xfa, 0xec, 0x38, 0xb3, 0xd6, 0x09, 0x3b, 0x36, 0xe6, 0x3b, 0x61, - 0x45, 0xef, 0xec, 0x42, 0xcd, 0x18, 0xe4, 0x9a, 0x99, 0x2b, 0x97, 0xd0, 0x92, 0x99, 0x28, 0xc1, - 0x79, 0xb3, 0x04, 0xf2, 0x9b, 0xc8, 0x0b, 0xa8, 0x19, 0x0f, 0xdc, 0x88, 0xf2, 0x92, 0xb3, 0xe8, - 0x6d, 0xa4, 0x6c, 0x90, 0x5b, 0x7f, 0x9d, 0x40, 0x9e, 0x41, 0x75, 0x2f, 0x7b, 0xfd, 0x2b, 0x79, - 0x5b, 0x25, 0xb4, 0x64, 0x37, 0x3a, 0x8f, 0xac, 0x75, 0xea, 0x32, 0xf4, 0xcf, 0xd3, 0x27, 0xdf, - 0xcf, 0xda, 0xce, 0xe9, 0x59, 0xdb, 0xf9, 0x75, 0xd6, 0x76, 0x3e, 0x9f, 0xb7, 0xa7, 0x4e, 0xcf, - 0xdb, 0x53, 0x3f, 0xcf, 0xdb, 0x53, 0x2f, 0x69, 0x4f, 0xe8, 0x77, 0xa3, 0xfd, 0x4e, 0x24, 0x07, - 0x4c, 0x26, 0x4a, 0x26, 0x29, 0xc3, 0x8f, 0x43, 0x3c, 0x51, 0x1f, 0x0d, 0xb9, 0xda, 0x77, 0xf1, - 0x3f, 0xf3, 0xd1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0xd1, 0xf9, 0x55, 0x9a, 0x05, 0x00, - 0x00, + // 576 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x54, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xad, 0x1d, 0x62, 0xbb, 0x93, 0x16, 0xca, 0x26, 0x42, 0x6e, 0xa8, 0x4c, 0x65, 0x24, 0x54, + 0x24, 0x14, 0xab, 0x85, 0x23, 0x1c, 0xf8, 0xf8, 0x01, 0xad, 0xe1, 0x80, 0xb8, 0x20, 0xc7, 0x3b, + 0xa4, 0x0b, 0xc9, 0xae, 0xeb, 0xdd, 0x44, 0x54, 0x55, 0x2f, 0x1c, 0x38, 0x23, 0xf1, 0x57, 0xf8, + 0x11, 0x1c, 0x2b, 0x21, 0x21, 0x8e, 0xa8, 0xe5, 0xcc, 0x6f, 0x40, 0x59, 0xef, 0x06, 0x27, 0x52, + 0x2b, 0xb8, 0x21, 0x2e, 0x51, 0xe6, 0xbd, 0xe7, 0xd9, 0x37, 0xcf, 0xe3, 0x05, 0x42, 0x19, 0x4d, + 0x26, 0xdb, 0xc9, 0xc1, 0x18, 0xcb, 0xc3, 0x5e, 0x51, 0x0a, 0x25, 0x88, 0x47, 0x19, 0xed, 0x4d, + 0xb6, 0xbb, 0x1d, 0xc3, 0x0d, 0x90, 0xa3, 0x64, 0xb2, 0x62, 0xbb, 0x6d, 0x83, 0x8e, 0x04, 0xc5, + 0xa1, 0x05, 0x37, 0x06, 0x42, 0x0c, 0x86, 0x98, 0x64, 0x05, 0x4b, 0x32, 0xce, 0x85, 0xca, 0x14, + 0x13, 0xdc, 0xb2, 0xeb, 0x35, 0x76, 0x5f, 0xa9, 0xa2, 0x2f, 0xa8, 0x39, 0x2b, 0xe6, 0xb0, 0xb2, + 0x37, 0x3d, 0x3a, 0xc5, 0x83, 0x31, 0x4a, 0x45, 0xd6, 0xa0, 0x41, 0x19, 0x0d, 0x9d, 0x4d, 0x67, + 0x6b, 0x39, 0x9d, 0xfe, 0x25, 0xd7, 0xc0, 0x13, 0x25, 0x1b, 0x30, 0x1e, 0xba, 0x1a, 0x34, 0x15, + 0x09, 0xc1, 0x97, 0xe3, 0xfe, 0x6b, 0xcc, 0x55, 0xd8, 0xd0, 0x84, 0x2d, 0x49, 0x17, 0x02, 0xe4, + 0xb4, 0x10, 0x8c, 0xab, 0xf0, 0x92, 0xa6, 0x66, 0x75, 0xfc, 0x00, 0xda, 0xfa, 0xbc, 0xdd, 0xac, + 0xcc, 0x46, 0x32, 0x45, 0x59, 0x08, 0x2e, 0x91, 0xdc, 0x02, 0xaf, 0xd0, 0x88, 0x3e, 0xb9, 0xb5, + 0x73, 0xb9, 0x57, 0x65, 0xd0, 0x33, 0x3a, 0xc3, 0xc6, 0x3f, 0x5d, 0x58, 0x35, 0x7e, 0xcd, 0x93, + 0xda, 0x46, 0x9e, 0xa3, 0xac, 0x1e, 0x0d, 0x52, 0x5b, 0xd6, 0x0d, 0xba, 0xf3, 0x06, 0x7f, 0x8f, + 0xd4, 0x98, 0x1b, 0xe9, 0x06, 0xb4, 0x58, 0xf1, 0x4a, 0xbe, 0xcc, 0x72, 0xc5, 0x26, 0xa8, 0xbd, + 0x07, 0x29, 0x4c, 0xa1, 0x87, 0x1a, 0xa9, 0xd9, 0x6c, 0x5e, 0x64, 0x93, 0xdc, 0x81, 0x80, 0x8a, + 0x7c, 0x3c, 0x42, 0xae, 0x42, 0x4f, 0x2b, 0xd7, 0xac, 0xf2, 0x89, 0xc1, 0xd3, 0x99, 0x82, 0xdc, + 0x06, 0x5f, 0x62, 0x39, 0x61, 0x39, 0x86, 0xbe, 0x16, 0x5f, 0xb1, 0xe2, 0xa7, 0x15, 0x9c, 0x5a, + 0x9e, 0xdc, 0x83, 0x56, 0x5e, 0x22, 0x45, 0xae, 0x58, 0x36, 0x94, 0x61, 0xb0, 0xd9, 0xd8, 0x6a, + 0xed, 0x10, 0x2b, 0x7f, 0x3c, 0xa3, 0xd2, 0xba, 0x8c, 0xdc, 0x84, 0xa6, 0x12, 0x6f, 0x90, 0x87, + 0xcb, 0xba, 0xfd, 0xaa, 0xd5, 0x3f, 0x9b, 0x82, 0x69, 0xc5, 0x91, 0x0e, 0x34, 0xb1, 0x2c, 0x45, + 0x19, 0x82, 0xce, 0xa4, 0x2a, 0xe2, 0x4f, 0x2e, 0x74, 0x6c, 0xe0, 0x62, 0x38, 0xc1, 0xff, 0x29, + 0xf7, 0x85, 0x30, 0xfd, 0xbf, 0x0c, 0x33, 0x38, 0x3f, 0xcc, 0xf8, 0xab, 0x63, 0x62, 0xb3, 0x6f, + 0xf0, 0x9f, 0x8e, 0xad, 0xb6, 0x80, 0xde, 0xc5, 0x0b, 0xb8, 0xf3, 0xde, 0x85, 0xa6, 0x1e, 0x8c, + 0xec, 0x82, 0x57, 0xb5, 0x21, 0x1d, 0xab, 0xae, 0xdf, 0x24, 0xdd, 0xeb, 0x73, 0xe8, 0xfc, 0xf7, + 0x1e, 0xb7, 0xdf, 0x7d, 0xf9, 0xf1, 0xd1, 0x5d, 0x25, 0xad, 0x64, 0x7a, 0x9b, 0x19, 0x1b, 0x7b, + 0xe0, 0x9b, 0x2d, 0x3b, 0xa7, 0xe5, 0xc6, 0x02, 0x3a, 0xb7, 0x91, 0x31, 0xd1, 0x3d, 0x57, 0x08, + 0xe8, 0x9e, 0x47, 0x94, 0xd1, 0x63, 0xf2, 0x1c, 0x7c, 0x33, 0xc2, 0x1f, 0xb5, 0x5c, 0x78, 0x5b, + 0xf1, 0xba, 0x6e, 0xd9, 0x26, 0x57, 0x13, 0x33, 0x7f, 0x72, 0x54, 0x65, 0x7f, 0xfc, 0xe8, 0xfe, + 0xe7, 0xd3, 0xc8, 0x39, 0x39, 0x8d, 0x9c, 0xef, 0xa7, 0x91, 0xf3, 0xe1, 0x2c, 0x5a, 0x3a, 0x39, + 0x8b, 0x96, 0xbe, 0x9d, 0x45, 0x4b, 0x2f, 0xe2, 0x01, 0x53, 0xfb, 0xe3, 0x7e, 0x2f, 0x17, 0xa3, + 0x44, 0x70, 0x29, 0x78, 0x99, 0xe8, 0x9f, 0xb7, 0xda, 0x97, 0x3a, 0x2c, 0x50, 0xf6, 0x3d, 0x7d, + 0xfb, 0xde, 0xfd, 0x15, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xf3, 0x66, 0xb2, 0xff, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -497,16 +511,10 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Accounts returns associated wallet accounts with the DID. - Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) - // Credentials returns associated credentials with the DID and Service Origin. - Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, 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 Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) - // Token returns the current authentication token for the client. - Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error) } type queryClient struct { @@ -526,24 +534,6 @@ func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc return out, nil } -func (c *queryClient) Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { - out := new(QueryAccountsResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/Accounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { - out := new(QueryCredentialsResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/Credentials", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { out := new(QueryResolveResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Resolve", in, out, opts...) @@ -562,29 +552,14 @@ func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error) { - out := new(QueryTokenResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/Token", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) - // Accounts returns associated wallet accounts with the DID. - Accounts(context.Context, *QueryRequest) (*QueryAccountsResponse, error) - // Credentials returns associated credentials with the DID and Service Origin. - Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) // Service returns associated ServiceInfo for a given Origin Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) - // Token returns the current authentication token for the client. - Token(context.Context, *QueryRequest) (*QueryTokenResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -594,21 +569,12 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryRequest) (*QueryAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") -} -func (*UnimplementedQueryServer) Credentials(ctx context.Context, req *QueryRequest) (*QueryCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") -} 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) Token(ctx context.Context, req *QueryRequest) (*QueryTokenResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Token not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -632,42 +598,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Accounts_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).Accounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Query/Accounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Accounts(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Credentials_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).Credentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Query/Credentials", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Credentials(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryRequest) if err := dec(in); err != nil { @@ -704,24 +634,6 @@ func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Token_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).Token(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Query/Token", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Token(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.Query", HandlerType: (*QueryServer)(nil), @@ -730,14 +642,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "Accounts", - Handler: _Query_Accounts_Handler, - }, - { - MethodName: "Credentials", - Handler: _Query_Credentials_Handler, - }, { MethodName: "Resolve", Handler: _Query_Resolve_Handler, @@ -746,10 +650,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Service", Handler: _Query_Service_Handler, }, - { - MethodName: "Token", - Handler: _Query_Token_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/query.proto", @@ -775,19 +675,12 @@ func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Credentials) > 0 { - for iNdEx := len(m.Credentials) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Credentials[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } + if len(m.Endpoint) > 0 { + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x22 } if len(m.Subject) > 0 { i -= len(m.Subject) @@ -833,16 +726,6 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.IpfsActive { - i-- - if m.IpfsActive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } if m.Params != nil { { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) @@ -858,7 +741,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAccountsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -868,45 +751,12 @@ func (m *QueryAccountsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAccountsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 *QueryCredentialsResponse) 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 *QueryCredentialsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCredentialsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -916,7 +766,19 @@ func (m *QueryCredentialsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error copy(dAtA[i:], m.Error) i = encodeVarintQuery(dAtA, i, uint64(len(m.Error))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x52 + } + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a } if len(m.Credentials) > 0 { for iNdEx := len(m.Credentials) - 1; iNdEx >= 0; iNdEx-- { @@ -929,9 +791,55 @@ func (m *QueryCredentialsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x42 } } + 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] = 0x3a + } + if m.Document != nil { + { + size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.IpfsActive { + i-- + if m.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if len(m.Origin) > 0 { i -= len(m.Origin) copy(dAtA[i:], m.Origin) @@ -979,6 +887,32 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Credentials) > 0 { + for iNdEx := len(m.Credentials) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Credentials[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if m.Document != nil { { size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) @@ -989,7 +923,53 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x32 + } + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.IpfsActive { + i-- + if m.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + } + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -1024,41 +1004,11 @@ func (m *QueryServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x32 } - return len(dAtA) - i, nil -} - -func (m *QueryTokenResponse) 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 *QueryTokenResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTokenResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x1a - } - if m.Token != nil { + if m.Params != nil { { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1066,6 +1016,30 @@ func (m *QueryTokenResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x2a + } + if m.IpfsActive { + i-- + if m.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subject))) + i-- dAtA[i] = 0x12 } if m.Success { @@ -1110,11 +1084,9 @@ func (m *QueryRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if len(m.Credentials) > 0 { - for _, e := range m.Credentials { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = len(m.Endpoint) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } return n } @@ -1129,25 +1101,10 @@ func (m *QueryParamsResponse) Size() (n int) { l = m.Params.Size() n += 1 + l + sovQuery(uint64(l)) } - if m.IpfsActive { - n += 2 - } return n } -func (m *QueryAccountsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Exists { - n += 2 - } - return n -} - -func (m *QueryCredentialsResponse) Size() (n int) { +func (m *QueryResponse) Size() (n int) { if m == nil { return 0 } @@ -1164,12 +1121,31 @@ func (m *QueryCredentialsResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.IpfsActive { + n += 2 + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Document != nil { + l = m.Document.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovQuery(uint64(l)) + } if len(m.Credentials) > 0 { for _, e := range m.Credentials { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } } + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.Error) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -1183,27 +1159,42 @@ func (m *QueryResolveResponse) Size() (n int) { } var l int _ = l + if m.Success { + n += 2 + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.IpfsActive { + n += 2 + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } if m.Document != nil { l = m.Document.Size() n += 1 + l + sovQuery(uint64(l)) } + if len(m.Credentials) > 0 { + for _, e := range m.Credentials { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } func (m *QueryServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryTokenResponse) Size() (n int) { if m == nil { return 0 } @@ -1212,14 +1203,25 @@ func (m *QueryTokenResponse) Size() (n int) { if m.Success { n += 2 } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Subject) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.Error) + l = len(m.Origin) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.IpfsActive { + n += 2 + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -1356,9 +1358,9 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1368,25 +1370,23 @@ func (m *QueryRequest) 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 ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Credentials = append(m.Credentials, &Credential{}) - if err := m.Credentials[len(m.Credentials)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1474,26 +1474,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1515,7 +1495,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1538,80 +1518,10 @@ func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAccountsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountsResponse: 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 ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Exists = bool(v != 0) - 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 *QueryCredentialsResponse) 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: QueryCredentialsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCredentialsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1699,6 +1609,134 @@ func (m *QueryCredentialsResponse) Unmarshal(dAtA []byte) error { m.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", 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.Document == nil { + m.Document = &Document{} + } + if err := m.Document.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + 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 = &Service{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) } @@ -1732,7 +1770,43 @@ func (m *QueryCredentialsResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token == nil { + m.Token = &Token{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } @@ -1815,6 +1889,146 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", 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.Success = bool(v != 0) + case 2: + 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 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.Subject = 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 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.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) } @@ -1850,6 +2064,76 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credentials", 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 + } + m.Credentials = append(m.Credentials, &Credential{}) + if err := m.Credentials[len(m.Credentials)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token == nil { + m.Token = &Token{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1901,6 +2185,146 @@ func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", 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.Success = bool(v != 0) + case 2: + 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 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.Subject = 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 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.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } @@ -1957,144 +2381,6 @@ func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTokenResponse) 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: QueryTokenResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTokenResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", 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.Success = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", 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.Error = 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 skipQuery(dAtA []byte) (n int, err 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 f3a697dd7..fe7437c9c 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -69,172 +69,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -var ( - filter_Query_Accounts_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Accounts_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["did"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") - } - - protoReq.Did, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", 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_Accounts_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Accounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Accounts_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["did"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") - } - - protoReq.Did, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", 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_Accounts_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Accounts(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Credentials_0 = &utilities.DoubleArray{Encoding: map[string]int{"origin": 0, "subject": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_Query_Credentials_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) - } - - val, ok = pathParams["subject"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subject") - } - - protoReq.Subject, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subject", 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_Credentials_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Credentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Credentials_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) - } - - val, ok = pathParams["subject"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subject") - } - - protoReq.Subject, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subject", 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_Credentials_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Credentials(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_Resolve_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -379,42 +213,6 @@ func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marsha } -var ( - filter_Query_Token_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Token_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 - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Token_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Token(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Token_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 - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Token_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Token(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -444,52 +242,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Accounts_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_Accounts_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_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Credentials_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_Credentials_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_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -536,29 +288,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("POST", pattern_Query_Token_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_Token_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_Token_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -620,46 +349,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Accounts_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_Accounts_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_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Credentials_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_Credentials_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_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -700,53 +389,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("POST", pattern_Query_Token_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_Token_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_Token_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"did", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Accounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "accounts"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Credentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"service", "origin", "subject", "credentials"}, "", runtime.AssumeColonVerbOpt(false))) - 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_Token_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"token"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_Accounts_0 = runtime.ForwardResponseMessage - - forward_Query_Credentials_0 = runtime.ForwardResponseMessage - forward_Query_Resolve_0 = runtime.ForwardResponseMessage forward_Query_Service_0 = runtime.ForwardResponseMessage - - forward_Query_Token_0 = runtime.ForwardResponseMessage ) diff --git a/x/did/types/perms.go b/x/did/types/scopes.go similarity index 97% rename from x/did/types/perms.go rename to x/did/types/scopes.go index fd10719b3..c64c97922 100644 --- a/x/did/types/perms.go +++ b/x/did/types/scopes.go @@ -22,8 +22,8 @@ var ( StringToPermissionScope = map[string]PermissionScope{ "PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, "PERMISSION_SCOPE_BASIC_INFO": PermissionScope_PERMISSION_SCOPE_BASIC_INFO, - "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_RECORDS_READ, - "PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_RECORDS_WRITE, + "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, diff --git a/x/did/types/extractor.go b/x/did/types/serivce.go similarity index 61% rename from x/did/types/extractor.go rename to x/did/types/serivce.go index 1f49d4fda..101dd03ee 100644 --- a/x/did/types/extractor.go +++ b/x/did/types/serivce.go @@ -7,6 +7,7 @@ func (m *MsgRegisterService) ExtractServiceRecord() (*didv1.ServiceRecord, error Controller: m.Controller, OriginUri: m.OriginUri, Description: m.Description, + Permissions: convertPermissions(m.GetScopes()), }, nil } @@ -16,3 +17,12 @@ func convertPermissions(permissions *Permissions) *didv1.Permissions { } return &didv1.Permissions{} } + +// UserInfo represents the user information. +type UserInfo struct { + DID string `json:"did"` + Sub string `json:"sub"` + Name string `json:"name"` + Email string `json:"email"` + // Add other claims as needed +} diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index 9691a3002..f270dfdcd 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -23,31 +23,154 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) -type Assertion struct { +// Authentication represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) +type Authentication struct { // The unique identifier of the attestation Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The controller of the attestation Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The value of the linked identifier - CredentialId []byte `protobuf:"bytes,4,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` - // The display label of the attestation - CredentialLabel string `protobuf:"bytes,5,opt,name=credential_label,json=credentialLabel,proto3" json:"credential_label,omitempty"` // The origin of the attestation - Origin string `protobuf:"bytes,6,opt,name=origin,proto3" json:"origin,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` // The subject of the attestation - Subject string `protobuf:"bytes,7,opt,name=subject,proto3" json:"subject,omitempty"` + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // The value of the linked identifier + CredentialId []byte `protobuf:"bytes,6,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + // The credential label + CredentialLabel string `protobuf:"bytes,7,opt,name=credential_label,json=credentialLabel,proto3" json:"credential_label,omitempty"` + // The display label of the attestation + CredentialTransport []string `protobuf:"bytes,8,rep,name=credential_transport,json=credentialTransport,proto3" json:"credential_transport,omitempty"` + // The attestationtype of the attestation + AttestationType string `protobuf:"bytes,9,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` // Metadata is optional additional information about the assertion - Metadata *Metadata `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *Metadata `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *Authentication) Reset() { *m = Authentication{} } +func (m *Authentication) String() string { return proto.CompactTextString(m) } +func (*Authentication) ProtoMessage() {} +func (*Authentication) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{0} +} +func (m *Authentication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Authentication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Authentication.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 *Authentication) XXX_Merge(src proto.Message) { + xxx_messageInfo_Authentication.Merge(m, src) +} +func (m *Authentication) XXX_Size() int { + return m.Size() +} +func (m *Authentication) XXX_DiscardUnknown() { + xxx_messageInfo_Authentication.DiscardUnknown(m) +} + +var xxx_messageInfo_Authentication proto.InternalMessageInfo + +func (m *Authentication) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Authentication) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *Authentication) GetPublicKey() *PubKey { + if m != nil { + return m.PublicKey + } + return nil +} + +func (m *Authentication) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *Authentication) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *Authentication) GetCredentialId() []byte { + if m != nil { + return m.CredentialId + } + return nil +} + +func (m *Authentication) GetCredentialLabel() string { + if m != nil { + return m.CredentialLabel + } + return "" +} + +func (m *Authentication) GetCredentialTransport() []string { + if m != nil { + return m.CredentialTransport + } + return nil +} + +func (m *Authentication) GetAttestationType() string { + if m != nil { + return m.AttestationType + } + return "" +} + +func (m *Authentication) GetMetadata() *Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +// Assertion represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) +type Assertion struct { + // The unique identifier of the attestation + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The value of the linked identifier + PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The origin of the attestation + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // The subject of the attestation + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // The controller of the attestation + Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *Assertion) Reset() { *m = Assertion{} } func (m *Assertion) String() string { return proto.CompactTextString(m) } func (*Assertion) ProtoMessage() {} func (*Assertion) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{0} + return fileDescriptor_f44bb702879c34b4, []int{1} } func (m *Assertion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -97,20 +220,6 @@ func (m *Assertion) GetPublicKey() *PubKey { return nil } -func (m *Assertion) GetCredentialId() []byte { - if m != nil { - return m.CredentialId - } - return nil -} - -func (m *Assertion) GetCredentialLabel() string { - if m != nil { - return m.CredentialLabel - } - return "" -} - func (m *Assertion) GetOrigin() string { if m != nil { return m.Origin @@ -132,97 +241,6 @@ func (m *Assertion) GetMetadata() *Metadata { return nil } -// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) -type Attestation struct { - // The unique identifier of the attestation - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // The value of the linked identifier - PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The origin of the attestation - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // The subject of the attestation - Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` - // The controller of the attestation - Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *Attestation) Reset() { *m = Attestation{} } -func (m *Attestation) String() string { return proto.CompactTextString(m) } -func (*Attestation) ProtoMessage() {} -func (*Attestation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{1} -} -func (m *Attestation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Attestation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Attestation.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 *Attestation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attestation.Merge(m, src) -} -func (m *Attestation) XXX_Size() int { - return m.Size() -} -func (m *Attestation) XXX_DiscardUnknown() { - xxx_messageInfo_Attestation.DiscardUnknown(m) -} - -var xxx_messageInfo_Attestation proto.InternalMessageInfo - -func (m *Attestation) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Attestation) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Attestation) GetPublicKey() *PubKey { - if m != nil { - return m.PublicKey - } - return nil -} - -func (m *Attestation) GetOrigin() string { - if m != nil { - return m.Origin - } - return "" -} - -func (m *Attestation) GetSubject() string { - if m != nil { - return m.Subject - } - return "" -} - -func (m *Attestation) GetMetadata() *Metadata { - if m != nil { - return m.Metadata - } - return nil -} - // Controller represents a Sonr DWN Vault type Controller struct { // The unique identifier of the controller @@ -515,8 +533,8 @@ func (m *ServiceRecord) GetMetadata() *Metadata { } func init() { + proto.RegisterType((*Authentication)(nil), "did.v1.Authentication") proto.RegisterType((*Assertion)(nil), "did.v1.Assertion") - proto.RegisterType((*Attestation)(nil), "did.v1.Attestation") proto.RegisterType((*Controller)(nil), "did.v1.Controller") proto.RegisterType((*Delegation)(nil), "did.v1.Delegation") proto.RegisterType((*ServiceRecord)(nil), "did.v1.ServiceRecord") @@ -526,60 +544,63 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 796 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0x41, 0x4f, 0x23, 0x37, - 0x14, 0xc7, 0x99, 0x99, 0x24, 0x24, 0x6f, 0x92, 0x10, 0x0c, 0x14, 0x17, 0xd4, 0x69, 0x08, 0x87, - 0xa6, 0x2a, 0x4d, 0x04, 0x55, 0xd5, 0x2a, 0x6a, 0x0f, 0x94, 0x72, 0x40, 0xb4, 0x52, 0x95, 0xb6, - 0x52, 0xc5, 0x25, 0x9d, 0x8c, 0xad, 0xe0, 0x76, 0x32, 0x8e, 0x6c, 0x4f, 0x44, 0x3e, 0x43, 0xa5, - 0xaa, 0x9f, 0xa0, 0x9f, 0xa7, 0x87, 0x1e, 0x90, 0xf6, 0xb2, 0xa7, 0xd5, 0x0a, 0xa4, 0xfd, 0x00, - 0x7b, 0xde, 0xc3, 0x6a, 0x3c, 0x1e, 0x32, 0x84, 0x45, 0x08, 0x0e, 0x7b, 0x41, 0xf8, 0xff, 0xfe, - 0x8e, 0xdf, 0xfb, 0x3d, 0x3f, 0x0f, 0x20, 0xc2, 0x48, 0x77, 0xba, 0xdf, 0x95, 0xca, 0x57, 0xb4, - 0x33, 0x11, 0x5c, 0x71, 0x54, 0x22, 0x8c, 0x74, 0xa6, 0xfb, 0x5b, 0x9b, 0x01, 0x97, 0x63, 0x2e, - 0xbb, 0x5c, 0x8c, 0x13, 0x0b, 0x17, 0xe3, 0xd4, 0xb0, 0xb5, 0x6e, 0x36, 0x8d, 0x68, 0x44, 0x25, - 0x93, 0x46, 0x5d, 0x33, 0xea, 0x98, 0x13, 0x1a, 0x1a, 0xb1, 0xf5, 0xc6, 0x86, 0xca, 0xa1, 0x94, - 0x54, 0x28, 0xc6, 0x23, 0x54, 0x07, 0x9b, 0x11, 0x6c, 0x35, 0xad, 0x76, 0xa5, 0x6f, 0x33, 0x82, - 0x3c, 0x80, 0x80, 0x47, 0x4a, 0xf0, 0x30, 0xa4, 0x02, 0xdb, 0x5a, 0xcf, 0x29, 0xe8, 0x73, 0x80, - 0x49, 0x3c, 0x0c, 0x59, 0x30, 0xf8, 0x93, 0xce, 0xb0, 0xd3, 0xb4, 0xda, 0xee, 0x41, 0xbd, 0x93, - 0xa6, 0xd7, 0xf9, 0x29, 0x1e, 0x9e, 0xd2, 0x59, 0xbf, 0x92, 0x3a, 0x4e, 0xe9, 0x0c, 0xed, 0x42, - 0x2d, 0x10, 0x94, 0xd0, 0x48, 0x31, 0x3f, 0x1c, 0x30, 0x82, 0x0b, 0x4d, 0xab, 0x5d, 0xed, 0x57, - 0xe7, 0xe2, 0x09, 0x41, 0x9f, 0x42, 0x23, 0x67, 0x0a, 0xfd, 0x21, 0x0d, 0x71, 0x51, 0x9f, 0xbc, - 0x32, 0xd7, 0x7f, 0x48, 0x64, 0xf4, 0x01, 0x94, 0xb8, 0x60, 0x23, 0x16, 0xe1, 0x92, 0x36, 0x98, - 0x15, 0xc2, 0xb0, 0x2c, 0xe3, 0xe1, 0x1f, 0x34, 0x50, 0x78, 0x59, 0x07, 0xb2, 0x25, 0xda, 0x83, - 0xf2, 0x98, 0x2a, 0x9f, 0xf8, 0xca, 0xc7, 0x65, 0x9d, 0x6e, 0x23, 0x4b, 0xf7, 0x47, 0xa3, 0xf7, - 0x6f, 0x1c, 0xbd, 0xdf, 0x5f, 0xff, 0xfb, 0xec, 0x6f, 0xe7, 0x0c, 0x0a, 0x09, 0x16, 0xb4, 0x0e, - 0x75, 0xf3, 0x33, 0x7b, 0xe9, 0x39, 0x0d, 0x0b, 0x5b, 0x68, 0x13, 0x56, 0xe7, 0x40, 0xb2, 0x80, - 0x8d, 0x2d, 0xb4, 0x03, 0xdb, 0xb9, 0xc0, 0x62, 0x49, 0x0d, 0x07, 0x5b, 0xd8, 0x6a, 0xfd, 0x65, - 0x83, 0x7b, 0xa8, 0x14, 0x4d, 0xda, 0xfb, 0x1e, 0x1a, 0x30, 0x07, 0x56, 0xb8, 0x0f, 0x58, 0xf1, - 0x7e, 0x60, 0xa5, 0x07, 0x81, 0x7d, 0xab, 0x81, 0x7d, 0xf5, 0x24, 0x60, 0xd8, 0x6e, 0xfd, 0x6f, - 0x01, 0x1c, 0xcd, 0x8b, 0x5b, 0x84, 0x81, 0x61, 0xd9, 0x27, 0x44, 0x50, 0x29, 0x0d, 0x89, 0x6c, - 0xa9, 0x23, 0x21, 0xf3, 0x25, 0x95, 0xd8, 0x69, 0x3a, 0x3a, 0x92, 0x2e, 0x17, 0x00, 0x15, 0x1e, - 0x02, 0xb4, 0x0d, 0x95, 0xa9, 0x1f, 0x87, 0x6a, 0x10, 0x30, 0x62, 0x50, 0x94, 0xb5, 0x70, 0xc4, - 0x48, 0xaf, 0xa3, 0xab, 0x6b, 0x9b, 0xea, 0x6a, 0x37, 0xd9, 0xe8, 0xb2, 0x56, 0x72, 0x3b, 0x75, - 0x39, 0x4e, 0xeb, 0x85, 0x0d, 0xf0, 0x3d, 0x0d, 0xe9, 0xe8, 0x69, 0xbd, 0xfd, 0x18, 0xdc, 0xe0, - 0xdc, 0x67, 0xd1, 0x80, 0x45, 0x84, 0x5e, 0xe8, 0xe6, 0x26, 0x86, 0x44, 0x3a, 0x49, 0x94, 0xc7, - 0xd6, 0xf6, 0x09, 0xac, 0xf8, 0x41, 0xc0, 0xe3, 0x48, 0x0d, 0x32, 0x8c, 0x69, 0x85, 0x75, 0x23, - 0x1f, 0x1a, 0x9a, 0xbb, 0x50, 0xcb, 0x8c, 0xe9, 0xf8, 0xa5, 0xd3, 0x55, 0x35, 0x62, 0x3a, 0x7b, - 0x1f, 0x42, 0xd9, 0x64, 0x47, 0xb2, 0x21, 0x4b, 0x53, 0x23, 0xbd, 0x91, 0xe6, 0xe4, 0x1b, 0x4e, - 0x1e, 0xe0, 0x85, 0x63, 0xf7, 0xb2, 0x8d, 0x1a, 0x9c, 0x07, 0x38, 0x77, 0x1f, 0x6e, 0x1d, 0xac, - 0xe7, 0x68, 0x13, 0xd6, 0xf2, 0x73, 0x94, 0x6d, 0x75, 0x70, 0xa1, 0xf5, 0xca, 0x81, 0xda, 0xcf, - 0x54, 0x4c, 0x59, 0x40, 0xfb, 0x34, 0xe0, 0x82, 0xdc, 0x61, 0xbc, 0x03, 0x55, 0x99, 0x1a, 0x06, - 0x6a, 0x36, 0xa1, 0x86, 0xb2, 0x6b, 0xb4, 0x5f, 0x66, 0x13, 0xba, 0xd0, 0x06, 0xe7, 0x4e, 0x1b, - 0x3e, 0x02, 0x48, 0x2f, 0xe9, 0x20, 0x16, 0xcc, 0xcc, 0x4d, 0x25, 0x55, 0x7e, 0x15, 0x0c, 0x35, - 0xc1, 0x25, 0x54, 0x06, 0x82, 0x4d, 0x92, 0x26, 0x1b, 0xa2, 0x79, 0x09, 0xfd, 0x06, 0xab, 0x59, - 0x0e, 0x34, 0x22, 0x13, 0xce, 0x22, 0x25, 0x71, 0xa9, 0xe9, 0xb4, 0xdd, 0x83, 0xcf, 0xb2, 0x6e, - 0xdd, 0xaa, 0x22, 0x5b, 0x1d, 0x67, 0xee, 0xe3, 0x48, 0x89, 0x59, 0xbf, 0x21, 0x17, 0x64, 0xf4, - 0x25, 0xb8, 0x13, 0x2a, 0xc6, 0x4c, 0x4a, 0xc6, 0x23, 0xa9, 0xdb, 0xe0, 0x1e, 0xac, 0xdd, 0xdc, - 0x80, 0x79, 0xa8, 0x9f, 0xf7, 0x3d, 0xee, 0x11, 0xdc, 0x3a, 0x82, 0x8d, 0x77, 0xe6, 0x83, 0x1a, - 0xe0, 0x24, 0xf7, 0x2e, 0x85, 0x9d, 0xfc, 0x8b, 0xd6, 0xa1, 0x38, 0xf5, 0xc3, 0x38, 0xc3, 0x9c, - 0x2e, 0x7a, 0xf6, 0xd7, 0xd6, 0xc2, 0xc3, 0xd0, 0xc8, 0x23, 0xd5, 0x97, 0x60, 0x1b, 0x36, 0xee, - 0x3c, 0x0a, 0x3a, 0x98, 0x4c, 0x52, 0xf1, 0xbb, 0x6f, 0xfe, 0xbb, 0xf2, 0xac, 0xcb, 0x2b, 0xcf, - 0x7a, 0x79, 0xe5, 0x59, 0xff, 0x5c, 0x7b, 0x4b, 0x97, 0xd7, 0xde, 0xd2, 0xf3, 0x6b, 0x6f, 0xe9, - 0xac, 0x35, 0x62, 0xea, 0x3c, 0x1e, 0x76, 0x02, 0x3e, 0xee, 0xf2, 0x48, 0xf2, 0x48, 0x74, 0xf5, - 0x9f, 0x8b, 0x6e, 0xf2, 0xb5, 0x4b, 0x7a, 0x2e, 0x87, 0x25, 0xfd, 0xa9, 0xfb, 0xe2, 0x6d, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x39, 0xd5, 0x9b, 0xc7, 0x4c, 0x07, 0x00, 0x00, + // 833 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x41, 0x6f, 0x23, 0x35, + 0x14, 0xc7, 0x3b, 0x33, 0x6d, 0x9a, 0xbc, 0xb4, 0x69, 0xd6, 0xed, 0x52, 0xd3, 0x8a, 0x21, 0x9b, + 0x3d, 0x10, 0x44, 0x49, 0xd4, 0x22, 0x04, 0xaa, 0xe0, 0x50, 0xca, 0x1e, 0x56, 0x0b, 0x12, 0x1a, + 0x16, 0x09, 0xed, 0x25, 0x38, 0x63, 0x2b, 0x35, 0x4c, 0xec, 0x91, 0xed, 0x89, 0x36, 0x1f, 0x81, + 0x0b, 0xe2, 0x13, 0xf0, 0x79, 0x38, 0x70, 0x58, 0x89, 0x0b, 0x27, 0x40, 0xad, 0xc4, 0x07, 0xe0, + 0x13, 0xa0, 0xb1, 0x3d, 0xcd, 0x34, 0x45, 0xaa, 0xe8, 0x89, 0x4b, 0x55, 0xff, 0xdf, 0xdf, 0xce, + 0x7b, 0xbf, 0xe7, 0xe7, 0x01, 0x44, 0x39, 0x1d, 0xcd, 0x8f, 0x47, 0xda, 0x10, 0xc3, 0x86, 0xb9, + 0x92, 0x46, 0xa2, 0x06, 0xe5, 0x74, 0x38, 0x3f, 0x3e, 0xd8, 0x4f, 0xa5, 0x9e, 0x49, 0x3d, 0x92, + 0x6a, 0x56, 0x5a, 0xa4, 0x9a, 0x39, 0xc3, 0xc1, 0x9e, 0xdf, 0x34, 0x65, 0x82, 0x69, 0xae, 0xbd, + 0xba, 0xeb, 0xd5, 0x99, 0xa4, 0x2c, 0xf3, 0x62, 0xff, 0x8f, 0x08, 0x3a, 0x67, 0x85, 0xb9, 0x60, + 0xc2, 0xf0, 0x94, 0x18, 0x2e, 0x05, 0xea, 0x40, 0xc8, 0x29, 0x0e, 0x7a, 0xc1, 0xa0, 0x95, 0x84, + 0x9c, 0xa2, 0x18, 0x20, 0x95, 0xc2, 0x28, 0x99, 0x65, 0x4c, 0xe1, 0xd0, 0xea, 0x35, 0x05, 0xbd, + 0x0b, 0x90, 0x17, 0x93, 0x8c, 0xa7, 0xe3, 0xef, 0xd8, 0x02, 0x47, 0xbd, 0x60, 0xd0, 0x3e, 0xe9, + 0x0c, 0x5d, 0x8e, 0xc3, 0x2f, 0x8a, 0xc9, 0x33, 0xb6, 0x48, 0x5a, 0xce, 0xf1, 0x8c, 0x2d, 0xd0, + 0x6b, 0xd0, 0x90, 0x8a, 0x4f, 0xb9, 0xc0, 0xeb, 0xf6, 0x28, 0xbf, 0x42, 0x18, 0x36, 0x75, 0x31, + 0xf9, 0x96, 0xa5, 0x06, 0x6f, 0xd8, 0x40, 0xb5, 0x44, 0x8f, 0x61, 0x3b, 0x55, 0x8c, 0x96, 0x29, + 0x92, 0x6c, 0xcc, 0x29, 0x6e, 0xf4, 0x82, 0xc1, 0x56, 0xb2, 0xb5, 0x14, 0x9f, 0x52, 0xf4, 0x36, + 0x74, 0x6b, 0xa6, 0x8c, 0x4c, 0x58, 0x86, 0x37, 0xed, 0x39, 0x3b, 0x4b, 0xfd, 0xb3, 0x52, 0x46, + 0xc7, 0xb0, 0x57, 0xb3, 0x1a, 0x45, 0x84, 0xce, 0xa5, 0x32, 0xb8, 0xd9, 0x8b, 0x06, 0xad, 0x64, + 0x77, 0x19, 0x7b, 0x5e, 0x85, 0xca, 0xd3, 0x89, 0x31, 0xac, 0xec, 0x02, 0x97, 0x62, 0x6c, 0x16, + 0x39, 0xc3, 0x2d, 0x77, 0x7a, 0x4d, 0x7f, 0xbe, 0xc8, 0x19, 0x3a, 0x82, 0xe6, 0x8c, 0x19, 0x42, + 0x89, 0x21, 0x18, 0x2c, 0x8c, 0x6e, 0x05, 0xe3, 0x73, 0xaf, 0x27, 0xd7, 0x8e, 0xd3, 0x6f, 0xfe, + 0xfe, 0xe9, 0xd7, 0x1f, 0xa2, 0x17, 0xb0, 0x5e, 0x42, 0x47, 0x7b, 0xd0, 0xf1, 0x45, 0x1f, 0x39, + 0x2a, 0xdd, 0x00, 0x07, 0x68, 0x1f, 0x1e, 0x2c, 0x71, 0x57, 0x81, 0x10, 0x07, 0xe8, 0x11, 0x1c, + 0xd6, 0x02, 0xab, 0xe5, 0x77, 0x23, 0x1c, 0xe0, 0xa0, 0xff, 0x7d, 0x08, 0xad, 0x33, 0xad, 0x99, + 0xfa, 0x7f, 0x36, 0xb7, 0x8e, 0xab, 0x71, 0x27, 0xae, 0x8f, 0x2d, 0xae, 0x0f, 0xee, 0x85, 0x0b, + 0x87, 0xfd, 0x5f, 0x02, 0x80, 0xf3, 0x65, 0x71, 0xab, 0x30, 0x30, 0x6c, 0x12, 0x4a, 0x15, 0xd3, + 0xda, 0x93, 0xa8, 0x96, 0x36, 0x92, 0x71, 0xa2, 0x99, 0xc6, 0x91, 0xbd, 0x25, 0xd5, 0x72, 0x05, + 0xd0, 0xfa, 0x5d, 0x80, 0x0e, 0xa1, 0x35, 0x27, 0x45, 0x66, 0xc6, 0x29, 0xa7, 0x1e, 0x45, 0xd3, + 0x0a, 0xe7, 0x9c, 0x9e, 0x0e, 0x6d, 0x75, 0x03, 0x5f, 0xdd, 0xf6, 0x75, 0x36, 0xb6, 0xac, 0x9d, + 0xda, 0x4e, 0x5b, 0x4e, 0xd4, 0xff, 0x3d, 0x04, 0xf8, 0x94, 0x65, 0x6c, 0x7a, 0xbf, 0xc1, 0x7d, + 0x13, 0xda, 0xe9, 0x05, 0xe1, 0x62, 0xcc, 0x05, 0x65, 0x2f, 0x6d, 0x73, 0x4b, 0x43, 0x29, 0x3d, + 0x2d, 0x95, 0xff, 0x5a, 0xdb, 0x5b, 0xb0, 0x43, 0xd2, 0x54, 0x16, 0xc2, 0x8c, 0x2b, 0x8c, 0xae, + 0xc2, 0x8e, 0x97, 0xcf, 0x3c, 0xcd, 0xc7, 0xb0, 0x5d, 0x19, 0xdd, 0xa0, 0x36, 0xac, 0x6d, 0xcb, + 0x8b, 0x6e, 0x4a, 0x5f, 0x87, 0xa6, 0xcf, 0x8e, 0xfa, 0x41, 0xde, 0x74, 0xa9, 0xd1, 0xd3, 0xa9, + 0xe5, 0x44, 0x3c, 0xa7, 0x18, 0xf0, 0xca, 0xcf, 0x1e, 0x55, 0x1b, 0x2d, 0xb8, 0x18, 0x70, 0xed, + 0x3e, 0xdc, 0xf8, 0x61, 0x3b, 0x45, 0xfb, 0xb0, 0x5b, 0x9f, 0xa2, 0x6a, 0x6b, 0x84, 0xd7, 0xfb, + 0x7f, 0x45, 0xb0, 0xfd, 0x25, 0x53, 0x73, 0x9e, 0xb2, 0x84, 0xa5, 0x52, 0xd1, 0x5b, 0x8c, 0x1f, + 0xc1, 0x96, 0x76, 0x06, 0xf7, 0x28, 0x38, 0xca, 0x6d, 0xaf, 0xd9, 0x07, 0xe1, 0x66, 0x1b, 0xa2, + 0x5b, 0x6d, 0x78, 0x03, 0xc0, 0x5d, 0xd2, 0x71, 0xa1, 0xb8, 0x9f, 0x9b, 0x96, 0x53, 0xbe, 0x52, + 0x1c, 0xf5, 0xa0, 0x4d, 0x99, 0x4e, 0x15, 0xcf, 0xcb, 0x26, 0x7b, 0xa2, 0x75, 0x09, 0x7d, 0x0d, + 0x0f, 0xaa, 0x1c, 0x98, 0xa0, 0xb9, 0xe4, 0xc2, 0x68, 0xdc, 0xe8, 0x45, 0x83, 0xf6, 0xc9, 0x3b, + 0x55, 0xb7, 0x6e, 0x54, 0x51, 0xad, 0x9e, 0x54, 0xee, 0x27, 0xc2, 0xa8, 0x45, 0xd2, 0xd5, 0x2b, + 0x32, 0x7a, 0x1f, 0xda, 0x39, 0x53, 0x33, 0xae, 0x35, 0x97, 0x42, 0xdb, 0x36, 0xb4, 0x4f, 0x76, + 0xaf, 0x6f, 0xc0, 0x32, 0x94, 0xd4, 0x7d, 0x37, 0x66, 0xba, 0x79, 0xd7, 0x4c, 0x1f, 0x9c, 0xc3, + 0xc3, 0x7f, 0xcd, 0x07, 0x75, 0x21, 0x2a, 0xef, 0x9d, 0x83, 0x5d, 0xfe, 0x8b, 0xf6, 0x60, 0x63, + 0x4e, 0xb2, 0xa2, 0xc2, 0xec, 0x16, 0xa7, 0xe1, 0x87, 0xc1, 0xca, 0xc3, 0xd0, 0xad, 0x23, 0xb5, + 0x97, 0xe0, 0x10, 0x1e, 0xde, 0x7a, 0x14, 0x6c, 0xb0, 0x9c, 0xa4, 0x8d, 0x4f, 0x3e, 0xfa, 0xf9, + 0x32, 0x0e, 0x5e, 0x5d, 0xc6, 0xc1, 0x9f, 0x97, 0x71, 0xf0, 0xe3, 0x55, 0xbc, 0xf6, 0xea, 0x2a, + 0x5e, 0xfb, 0xed, 0x2a, 0x5e, 0x7b, 0xd1, 0x9f, 0x72, 0x73, 0x51, 0x4c, 0x86, 0xa9, 0x9c, 0x8d, + 0xa4, 0xd0, 0x52, 0xa8, 0x91, 0xfd, 0xf3, 0x72, 0x54, 0x7e, 0x4e, 0xcb, 0x9e, 0xeb, 0x49, 0xc3, + 0x7e, 0x4b, 0xdf, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x9d, 0xfa, 0x62, 0xad, 0x07, 0x00, + 0x00, } -func (m *Assertion) Marshal() (dAtA []byte, err error) { +func (m *Authentication) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -589,12 +610,12 @@ func (m *Assertion) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Assertion) MarshalTo(dAtA []byte) (int, error) { +func (m *Authentication) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Authentication) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -609,34 +630,50 @@ func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintState(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x52 } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) + if len(m.AttestationType) > 0 { + i -= len(m.AttestationType) + copy(dAtA[i:], m.AttestationType) + i = encodeVarintState(dAtA, i, uint64(len(m.AttestationType))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x4a } - 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] = 0x32 + if len(m.CredentialTransport) > 0 { + for iNdEx := len(m.CredentialTransport) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CredentialTransport[iNdEx]) + copy(dAtA[i:], m.CredentialTransport[iNdEx]) + i = encodeVarintState(dAtA, i, uint64(len(m.CredentialTransport[iNdEx]))) + i-- + dAtA[i] = 0x42 + } } if len(m.CredentialLabel) > 0 { i -= len(m.CredentialLabel) copy(dAtA[i:], m.CredentialLabel) i = encodeVarintState(dAtA, i, uint64(len(m.CredentialLabel))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } if len(m.CredentialId) > 0 { i -= len(m.CredentialId) copy(dAtA[i:], m.CredentialId) i = encodeVarintState(dAtA, i, uint64(len(m.CredentialId))) i-- + dAtA[i] = 0x32 + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x2a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) + i-- dAtA[i] = 0x22 } if m.PublicKey != nil { @@ -668,7 +705,7 @@ func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Attestation) Marshal() (dAtA []byte, err error) { +func (m *Assertion) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -678,12 +715,12 @@ func (m *Attestation) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Attestation) MarshalTo(dAtA []byte) (int, error) { +func (m *Assertion) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -997,7 +1034,7 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Assertion) Size() (n int) { +func (m *Authentication) Size() (n int) { if m == nil { return 0 } @@ -1015,6 +1052,14 @@ func (m *Assertion) Size() (n int) { l = m.PublicKey.Size() n += 1 + l + sovState(uint64(l)) } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } l = len(m.CredentialId) if l > 0 { n += 1 + l + sovState(uint64(l)) @@ -1023,11 +1068,13 @@ func (m *Assertion) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Origin) - if l > 0 { - n += 1 + l + sovState(uint64(l)) + if len(m.CredentialTransport) > 0 { + for _, s := range m.CredentialTransport { + l = len(s) + n += 1 + l + sovState(uint64(l)) + } } - l = len(m.Subject) + l = len(m.AttestationType) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -1038,7 +1085,7 @@ func (m *Assertion) Size() (n int) { return n } -func (m *Attestation) Size() (n int) { +func (m *Assertion) Size() (n int) { if m == nil { return 0 } @@ -1190,7 +1237,7 @@ func sovState(x uint64) (n int) { func sozState(x uint64) (n int) { return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Assertion) Unmarshal(dAtA []byte) error { +func (m *Authentication) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1213,10 +1260,10 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Assertion: wiretype end group for non-group") + return fmt.Errorf("proto: Authentication: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Authentication: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1320,6 +1367,70 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) } @@ -1353,7 +1464,7 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { m.CredentialId = []byte{} } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CredentialLabel", wireType) } @@ -1385,71 +1496,71 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { } m.CredentialLabel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subject = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialTransport", 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.CredentialTransport = append(m.CredentialTransport, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + 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 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.AttestationType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -1506,7 +1617,7 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { } return nil } -func (m *Attestation) Unmarshal(dAtA []byte) error { +func (m *Assertion) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1529,10 +1640,10 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Attestation: wiretype end group for non-group") + return fmt.Errorf("proto: Assertion: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Attestation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index aeea91030..5492fb762 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -142,8 +142,8 @@ type MsgAllocateVault struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // subject is a unique human-defined identifier to associate with the vault. Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` - // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + // origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` } func (m *MsgAllocateVault) Reset() { *m = MsgAllocateVault{} } @@ -193,11 +193,11 @@ func (m *MsgAllocateVault) GetSubject() string { return "" } -func (m *MsgAllocateVault) GetToken() *Token { +func (m *MsgAllocateVault) GetOrigin() string { if m != nil { - return m.Token + return m.Origin } - return nil + return "" } // MsgAllocateVaultResponse is the response type for the AllocateVault RPC. @@ -206,6 +206,8 @@ type MsgAllocateVaultResponse struct { Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` // 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"` } func (m *MsgAllocateVaultResponse) Reset() { *m = MsgAllocateVaultResponse{} } @@ -255,6 +257,13 @@ func (m *MsgAllocateVaultResponse) GetExpiryBlock() int64 { return 0 } +func (m *MsgAllocateVaultResponse) GetRegistrationOptions() string { + if m != nil { + return m.RegistrationOptions + } + return "" +} + // MsgProveWitness is the message type for the ProveWitness RPC. type MsgProveWitness struct { // authority is the address of the governance account. @@ -937,68 +946,69 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 974 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xce, 0xda, 0xb1, 0x13, 0xbf, 0xf9, 0x32, 0x53, 0xb7, 0x71, 0x57, 0xc4, 0x0d, 0x8b, 0x90, - 0xa2, 0x52, 0xec, 0x36, 0x95, 0x50, 0x15, 0x90, 0x50, 0x12, 0x55, 0xaa, 0x84, 0xac, 0x96, 0x0d, - 0x01, 0xa9, 0x12, 0x8a, 0x36, 0xb3, 0xa3, 0xed, 0x10, 0x7b, 0x67, 0x35, 0x33, 0x36, 0x31, 0x07, - 0x04, 0xfc, 0x02, 0xae, 0xfc, 0x07, 0x0e, 0x3d, 0xf4, 0x27, 0x70, 0xe8, 0xb1, 0x42, 0x1c, 0x38, - 0x21, 0x94, 0x1c, 0x2a, 0xf1, 0x2b, 0xd0, 0xec, 0xcc, 0x7e, 0xd8, 0xb1, 0x13, 0xc7, 0x5c, 0x12, - 0xbf, 0x1f, 0xf3, 0xce, 0xf3, 0x3e, 0xcf, 0x3b, 0xb3, 0x03, 0x6b, 0x3e, 0xf5, 0x5b, 0xfd, 0x07, - 0x2d, 0x79, 0xda, 0x8c, 0x38, 0x93, 0x0c, 0x95, 0x7d, 0xea, 0x37, 0xfb, 0x0f, 0xec, 0x75, 0xcc, - 0x44, 0x97, 0x89, 0x56, 0x57, 0x04, 0x2a, 0xde, 0x15, 0x81, 0x4e, 0xb0, 0x6f, 0xeb, 0xc0, 0x51, - 0x6c, 0xb5, 0xb4, 0x61, 0x42, 0xb7, 0x4c, 0x31, 0xcc, 0x42, 0x21, 0xbd, 0x50, 0x26, 0xfe, 0x9a, - 0xf1, 0x07, 0x24, 0x24, 0x82, 0x26, 0xde, 0x1b, 0xc6, 0xdb, 0x65, 0x3e, 0xe9, 0xa4, 0xa9, 0x01, - 0x0b, 0x98, 0x2e, 0xad, 0x7e, 0x69, 0xaf, 0xf3, 0x9b, 0x05, 0x6b, 0x6d, 0x11, 0x1c, 0x46, 0xbe, - 0x27, 0xc9, 0x33, 0x8f, 0x7b, 0x5d, 0x81, 0x3e, 0x86, 0x8a, 0xd7, 0x93, 0x2f, 0x18, 0xa7, 0x72, - 0x50, 0xb7, 0x36, 0xad, 0xad, 0xca, 0x5e, 0xfd, 0x8f, 0x57, 0x1f, 0xd5, 0x0c, 0xa2, 0x5d, 0xdf, - 0xe7, 0x44, 0x88, 0x03, 0xc9, 0x69, 0x18, 0xb8, 0x59, 0x2a, 0xba, 0x07, 0xe5, 0x28, 0xae, 0x50, - 0x2f, 0x6c, 0x5a, 0x5b, 0x4b, 0xdb, 0xab, 0x4d, 0xdd, 0x71, 0x53, 0xd7, 0xdd, 0x9b, 0x7f, 0xfd, - 0xf7, 0x9d, 0x39, 0xd7, 0xe4, 0xa0, 0xf7, 0xa1, 0x24, 0xd9, 0x09, 0x09, 0xeb, 0xc5, 0x38, 0x79, - 0x25, 0x49, 0xfe, 0x52, 0x39, 0x5d, 0x1d, 0xdb, 0x59, 0xfd, 0xf9, 0xed, 0xcb, 0xbb, 0xd9, 0x16, - 0xce, 0x6d, 0x58, 0x1f, 0x41, 0xeb, 0x12, 0x11, 0xb1, 0x50, 0x10, 0xe7, 0x57, 0x0b, 0xaa, 0x6d, - 0x11, 0xec, 0x76, 0x3a, 0x0c, 0x7b, 0x92, 0x7c, 0xe5, 0xf5, 0x3a, 0x72, 0xe6, 0x56, 0xea, 0xb0, - 0x20, 0x7a, 0xc7, 0xdf, 0x12, 0x2c, 0xe3, 0x5e, 0x2a, 0x6e, 0x62, 0xce, 0x06, 0xfb, 0x29, 0xd4, - 0x47, 0xa1, 0x25, 0xb8, 0x51, 0x15, 0x8a, 0x98, 0xfa, 0x1a, 0x9c, 0xab, 0x7e, 0xa2, 0xf7, 0x60, - 0x99, 0x9c, 0x46, 0x94, 0x0f, 0x8e, 0x8e, 0x3b, 0x0c, 0x9f, 0xc4, 0x08, 0x8a, 0xee, 0x92, 0xf6, - 0xed, 0x29, 0x97, 0xf3, 0x4a, 0xcb, 0xf6, 0x8c, 0xb3, 0x3e, 0xf9, 0x9a, 0xca, 0x90, 0x88, 0xd9, - 0x65, 0xb3, 0x61, 0x31, 0xe2, 0x2c, 0x22, 0x5c, 0x0e, 0x4c, 0xb3, 0xa9, 0xad, 0x78, 0xf8, 0x4e, - 0x97, 0x8f, 0xfb, 0x5d, 0x76, 0x13, 0x33, 0xe3, 0x61, 0xfe, 0x5a, 0x3c, 0xac, 0x8f, 0xa0, 0x4e, - 0x69, 0x88, 0x19, 0xc7, 0x58, 0xed, 0xa4, 0xb0, 0x2f, 0xba, 0x89, 0x79, 0x19, 0x3e, 0xe7, 0x07, - 0x58, 0x6e, 0x8b, 0xe0, 0x60, 0x10, 0x62, 0xad, 0xf7, 0x23, 0x00, 0xcc, 0x42, 0xc9, 0x59, 0xa7, - 0x43, 0xf8, 0x95, 0x24, 0xe4, 0x72, 0xa7, 0xd3, 0x75, 0x4d, 0xf5, 0x93, 0x5b, 0xe5, 0xdc, 0x87, - 0x5a, 0x7e, 0xff, 0xab, 0xbb, 0x71, 0xfe, 0xb5, 0xe0, 0x66, 0x5b, 0x04, 0x2e, 0x09, 0xa8, 0x90, - 0x84, 0xef, 0x67, 0x08, 0x66, 0xd5, 0xcf, 0x0c, 0x50, 0x21, 0x1b, 0xa0, 0x5b, 0x50, 0x66, 0x9c, - 0x06, 0x54, 0x37, 0x53, 0x71, 0x8d, 0x85, 0x76, 0x60, 0x55, 0x2d, 0x23, 0xa1, 0xa4, 0xd8, 0x93, - 0x94, 0x29, 0xf1, 0x8a, 0x5b, 0x4b, 0xdb, 0x28, 0x69, 0x76, 0x9f, 0x13, 0x5f, 0x45, 0xbd, 0x8e, - 0x3b, 0x92, 0x99, 0xf1, 0x53, 0xba, 0x86, 0xde, 0x3f, 0x15, 0x60, 0x63, 0x6c, 0xb3, 0x53, 0xc8, - 0x3e, 0x2c, 0x65, 0xe1, 0x1a, 0x52, 0x3e, 0x85, 0x45, 0x0f, 0x63, 0xd6, 0x0b, 0xa5, 0x9a, 0x5a, - 0xd5, 0xe0, 0xc3, 0x04, 0xed, 0xa5, 0x60, 0x9a, 0xbb, 0x66, 0xd5, 0xe3, 0x50, 0xf2, 0x81, 0x9b, - 0x16, 0xb1, 0x3f, 0x81, 0x95, 0xa1, 0x90, 0xa2, 0xfc, 0x84, 0x0c, 0x92, 0x33, 0x7b, 0x42, 0x06, - 0xa8, 0x06, 0xa5, 0xbe, 0xd7, 0xe9, 0x11, 0x23, 0x83, 0x36, 0x76, 0x0a, 0x8f, 0x2c, 0xc5, 0x81, - 0x9a, 0xd1, 0x5d, 0x4d, 0xca, 0xf7, 0x64, 0x66, 0x9d, 0x67, 0x27, 0x64, 0x1b, 0x16, 0x3c, 0x1d, - 0xd4, 0x03, 0x71, 0xc9, 0xb2, 0x24, 0x31, 0x37, 0x43, 0xf3, 0x43, 0x33, 0x34, 0xd3, 0x1c, 0x1c, - 0xc6, 0xc7, 0x24, 0xa5, 0x60, 0x0a, 0xf5, 0xd3, 0x6d, 0x0a, 0x93, 0xb7, 0x71, 0x7e, 0x2f, 0x02, - 0xca, 0x29, 0x7a, 0x40, 0x78, 0x9f, 0x62, 0xf2, 0x3f, 0x2e, 0x81, 0x0d, 0x00, 0xdd, 0xe6, 0x51, - 0x8f, 0x53, 0x23, 0x65, 0x45, 0x7b, 0x0e, 0x39, 0x45, 0x1f, 0x42, 0x59, 0x60, 0x16, 0x11, 0x61, - 0x2e, 0x89, 0x1b, 0xe9, 0x07, 0x8e, 0xf0, 0x2e, 0x15, 0x82, 0xb2, 0x50, 0xb8, 0x26, 0x05, 0x6d, - 0xc2, 0x92, 0x4f, 0x04, 0xe6, 0x34, 0x32, 0x27, 0x4d, 0x15, 0xcb, 0xbb, 0xd0, 0x37, 0xf0, 0x8e, - 0xd0, 0x90, 0x8f, 0x48, 0xe8, 0x47, 0x8c, 0xaa, 0x81, 0x2d, 0xc5, 0x03, 0x7b, 0x7f, 0xcc, 0xc0, - 0x9a, 0xf6, 0x9a, 0xe6, 0xff, 0xe3, 0x64, 0x89, 0x9e, 0xd6, 0xaa, 0x18, 0x71, 0xa3, 0x7b, 0xb0, - 0xd8, 0x25, 0xd2, 0xf3, 0x3d, 0xe9, 0xd5, 0xcb, 0x31, 0xde, 0x6a, 0x5a, 0xd5, 0xf8, 0xdd, 0x34, - 0x23, 0x23, 0x7c, 0x61, 0x32, 0xe1, 0xf6, 0x3e, 0xdc, 0x1c, 0xbb, 0xfb, 0x75, 0x0e, 0xc4, 0xc5, - 0x4b, 0xf4, 0x09, 0xd8, 0x17, 0xdb, 0x9c, 0x62, 0x46, 0xaa, 0x50, 0xf4, 0xb3, 0x8b, 0xcf, 0xa7, - 0xfe, 0xf6, 0x9f, 0x45, 0x28, 0xb6, 0x45, 0x80, 0x9e, 0xc0, 0xf2, 0xd0, 0x8b, 0x66, 0x3d, 0x47, - 0x67, 0x3e, 0x60, 0xdf, 0x99, 0x10, 0x48, 0x77, 0xff, 0x0c, 0x2a, 0xd9, 0xc9, 0xad, 0xe5, 0xb2, - 0x53, 0xaf, 0xfd, 0xee, 0x38, 0x6f, 0x5a, 0xe0, 0x73, 0x58, 0x19, 0x7e, 0x92, 0xd4, 0xf3, 0xe9, - 0xf9, 0x88, 0xbd, 0x39, 0x29, 0x92, 0x47, 0x93, 0x7d, 0xeb, 0xf2, 0x68, 0x52, 0xef, 0x10, 0x9a, - 0x8b, 0xdf, 0xa5, 0xe7, 0x80, 0xc6, 0x7c, 0x79, 0x36, 0x2e, 0xbd, 0x1e, 0xed, 0x0f, 0xa6, 0xba, - 0x3d, 0xd1, 0x17, 0xb0, 0x36, 0x7a, 0x12, 0xed, 0xc9, 0x63, 0x6c, 0x3b, 0x93, 0x63, 0x49, 0x49, - 0xbb, 0xf4, 0xe3, 0xdb, 0x97, 0x77, 0xad, 0xbd, 0x4f, 0x5f, 0x9f, 0x35, 0xac, 0x37, 0x67, 0x0d, - 0xeb, 0x9f, 0xb3, 0x86, 0xf5, 0xcb, 0x79, 0x63, 0xee, 0xcd, 0x79, 0x63, 0xee, 0xaf, 0xf3, 0xc6, - 0xdc, 0x73, 0x27, 0xa0, 0xf2, 0x45, 0xef, 0xb8, 0x89, 0x59, 0xb7, 0xc5, 0x42, 0xc1, 0x42, 0xde, - 0x8a, 0xff, 0x9c, 0xb6, 0xd4, 0x13, 0x58, 0x0e, 0x22, 0x22, 0x8e, 0xcb, 0xf1, 0x4b, 0xf7, 0xe1, - 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xbe, 0xf6, 0x61, 0x91, 0x0b, 0x00, 0x00, + // 992 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xda, 0x89, 0x13, 0xbf, 0xfc, 0x33, 0x13, 0x97, 0xb8, 0x2b, 0xe2, 0x9a, 0x45, 0x48, + 0x51, 0x29, 0x76, 0x93, 0x4a, 0xa8, 0x0a, 0x48, 0x28, 0x89, 0x2a, 0x55, 0x42, 0x56, 0xca, 0x86, + 0x80, 0x54, 0x09, 0x59, 0x9b, 0xdd, 0xd1, 0x76, 0xc8, 0x7a, 0x67, 0x35, 0x33, 0x36, 0x31, 0x07, + 0x04, 0x3d, 0x73, 0xe0, 0x83, 0x70, 0xe8, 0xa1, 0x1f, 0x81, 0x43, 0x8f, 0x15, 0xe2, 0xc0, 0x09, + 0xa1, 0xe4, 0x50, 0x89, 0x4f, 0x81, 0x66, 0x67, 0xf6, 0x8f, 0x1d, 0x3b, 0x75, 0xcc, 0xc5, 0xde, + 0x79, 0xef, 0xcd, 0x7b, 0xbf, 0xf7, 0x7e, 0xbf, 0x99, 0x5d, 0x58, 0xf7, 0x88, 0xd7, 0xea, 0xef, + 0xb4, 0xc4, 0x79, 0x33, 0x62, 0x54, 0x50, 0x54, 0xf2, 0x88, 0xd7, 0xec, 0xef, 0x98, 0x9b, 0x2e, + 0xe5, 0x5d, 0xca, 0x5b, 0x5d, 0xee, 0x4b, 0x7f, 0x97, 0xfb, 0x2a, 0xc0, 0xbc, 0xad, 0x1c, 0x9d, + 0x78, 0xd5, 0x52, 0x0b, 0xed, 0xaa, 0xea, 0x64, 0x3e, 0x0e, 0x31, 0x27, 0x89, 0x75, 0x43, 0x5b, + 0xbb, 0xd4, 0xc3, 0x41, 0x1a, 0xea, 0x53, 0x9f, 0xaa, 0x14, 0xf2, 0x49, 0x59, 0xad, 0xdf, 0x0c, + 0x58, 0x6f, 0x73, 0xff, 0x24, 0xf2, 0x1c, 0x81, 0x9f, 0x38, 0xcc, 0xe9, 0x72, 0xf4, 0x09, 0x94, + 0x9d, 0x9e, 0x78, 0x46, 0x19, 0x11, 0x83, 0x9a, 0xd1, 0x30, 0xb6, 0xcb, 0x07, 0xb5, 0x3f, 0x5e, + 0x7e, 0x5c, 0xd5, 0x95, 0xf7, 0x3d, 0x8f, 0x61, 0xce, 0x8f, 0x05, 0x23, 0xa1, 0x6f, 0x67, 0xa1, + 0xe8, 0x1e, 0x94, 0xa2, 0x38, 0x43, 0xad, 0xd0, 0x30, 0xb6, 0x97, 0x77, 0xd7, 0x9a, 0xaa, 0xb3, + 0xa6, 0xca, 0x7b, 0x30, 0xff, 0xea, 0xef, 0x3b, 0x73, 0xb6, 0x8e, 0x41, 0x1f, 0xc0, 0x82, 0xa0, + 0x67, 0x38, 0xac, 0x15, 0xe3, 0xe0, 0xd5, 0x24, 0xf8, 0x2b, 0x69, 0xb4, 0x95, 0x6f, 0x6f, 0xed, + 0xf9, 0x9b, 0x17, 0x77, 0xb3, 0x12, 0xd6, 0x6d, 0xd8, 0x1c, 0x41, 0x6b, 0x63, 0x1e, 0xd1, 0x90, + 0x63, 0xeb, 0x17, 0x03, 0x2a, 0x6d, 0xee, 0xef, 0x07, 0x01, 0x75, 0x1d, 0x81, 0xbf, 0x76, 0x7a, + 0x81, 0x98, 0xb9, 0x95, 0x1a, 0x2c, 0xf2, 0xde, 0xe9, 0x77, 0xd8, 0x15, 0x71, 0x2f, 0x65, 0x3b, + 0x59, 0xa2, 0x77, 0xa1, 0x44, 0x19, 0xf1, 0x89, 0xc2, 0x5d, 0xb6, 0xf5, 0xea, 0x0a, 0xd2, 0xe7, + 0x06, 0xd4, 0x46, 0xe1, 0x24, 0x58, 0x51, 0x05, 0x8a, 0x2e, 0xf1, 0x14, 0x20, 0x5b, 0x3e, 0xa2, + 0xf7, 0x61, 0x05, 0x9f, 0x47, 0x84, 0x0d, 0x3a, 0xa7, 0x01, 0x75, 0xcf, 0xe2, 0xaa, 0x45, 0x7b, + 0x59, 0xd9, 0x0e, 0xa4, 0x09, 0xed, 0x40, 0x95, 0x61, 0x9f, 0x70, 0xc1, 0x1c, 0x41, 0x68, 0xd8, + 0xa1, 0x91, 0xfc, 0xe3, 0x1a, 0xc7, 0x46, 0xde, 0x77, 0xa4, 0x5c, 0xd6, 0x4b, 0xc5, 0xee, 0x13, + 0x46, 0xfb, 0xf8, 0x1b, 0x22, 0x42, 0xcc, 0x67, 0x67, 0xd7, 0x84, 0xa5, 0x88, 0xd1, 0x08, 0x33, + 0x31, 0xd0, 0x33, 0x49, 0xd7, 0x72, 0x5c, 0xdf, 0xab, 0xf4, 0x31, 0x9a, 0x15, 0x3b, 0x59, 0x66, + 0x2c, 0xcf, 0xdf, 0x80, 0xe5, 0xa3, 0x98, 0xe5, 0x3c, 0xea, 0x74, 0x72, 0x31, 0x31, 0xae, 0x2b, + 0x2b, 0x49, 0xec, 0x4b, 0x76, 0xb2, 0xbc, 0x0e, 0x9f, 0xf5, 0x23, 0xac, 0xb4, 0xb9, 0x7f, 0x3c, + 0x08, 0x5d, 0x25, 0x8b, 0x87, 0x00, 0x2e, 0x0d, 0x05, 0xa3, 0x41, 0x80, 0xd9, 0x5b, 0x87, 0x90, + 0x8b, 0x9d, 0x4e, 0xb5, 0xeb, 0xb2, 0x9f, 0xdc, 0x2e, 0xeb, 0x3e, 0x54, 0xf3, 0xf5, 0xdf, 0xde, + 0x8d, 0xf5, 0xaf, 0x01, 0xb7, 0xda, 0xdc, 0xb7, 0x63, 0x52, 0x31, 0x3b, 0xcc, 0x10, 0xcc, 0xca, + 0x9f, 0xd6, 0x5c, 0x21, 0xd3, 0xdc, 0x04, 0x29, 0xa3, 0x3d, 0x58, 0x93, 0xdb, 0x70, 0x28, 0x88, + 0x1b, 0xcb, 0xa9, 0x36, 0xdf, 0x28, 0x6e, 0x2f, 0xef, 0xa2, 0xa4, 0xd9, 0x43, 0x86, 0x3d, 0xe9, + 0x75, 0x02, 0x7b, 0x24, 0x32, 0x9b, 0xcf, 0xc2, 0x0d, 0xf8, 0xfe, 0xb9, 0x00, 0x5b, 0x63, 0x9b, + 0x9d, 0x82, 0xf6, 0x61, 0x2a, 0x0b, 0x37, 0xa0, 0xf2, 0x08, 0x96, 0x1c, 0xd7, 0xa5, 0xbd, 0x50, + 0x48, 0xd5, 0xca, 0x06, 0x1f, 0x24, 0x68, 0xaf, 0x05, 0xd3, 0xdc, 0xd7, 0xbb, 0x1e, 0x85, 0x82, + 0x0d, 0xec, 0x34, 0x89, 0xf9, 0x29, 0xac, 0x0e, 0xb9, 0xe4, 0xc8, 0xcf, 0xf0, 0x20, 0x39, 0xe6, + 0x67, 0x78, 0x80, 0xaa, 0xb0, 0xd0, 0x77, 0x82, 0x1e, 0xd6, 0x34, 0xa8, 0xc5, 0x5e, 0xe1, 0xa1, + 0x21, 0x67, 0x20, 0x35, 0xba, 0xaf, 0x86, 0xf2, 0x03, 0x9e, 0x99, 0xe7, 0xd9, 0x07, 0xb2, 0x0b, + 0x8b, 0x8e, 0x72, 0x2a, 0x41, 0x5c, 0xb3, 0x2d, 0x09, 0xcc, 0x69, 0x68, 0x7e, 0x48, 0x43, 0x33, + 0xe9, 0xe0, 0x24, 0x3e, 0x26, 0xe9, 0x08, 0xa6, 0x60, 0x3f, 0x2d, 0x53, 0x98, 0x5c, 0xc6, 0xfa, + 0xbd, 0x08, 0x28, 0xc7, 0xe8, 0x31, 0x66, 0x7d, 0xe2, 0xe2, 0xff, 0x71, 0x09, 0x6c, 0x01, 0xa8, + 0x36, 0x3b, 0x3d, 0x46, 0x34, 0x95, 0x65, 0x65, 0x39, 0x61, 0x04, 0x7d, 0x04, 0x25, 0xee, 0xd2, + 0x08, 0x73, 0x7d, 0x49, 0x6c, 0xa4, 0xef, 0x41, 0xcc, 0xba, 0x84, 0x73, 0x79, 0x35, 0xdb, 0x3a, + 0x04, 0x35, 0x60, 0xd9, 0xc3, 0xdc, 0x65, 0x24, 0xd2, 0x27, 0x4d, 0x26, 0xcb, 0x9b, 0xd0, 0xb7, + 0xf0, 0x0e, 0x57, 0x90, 0x3b, 0x38, 0xf4, 0x22, 0x4a, 0xa4, 0x60, 0x17, 0x62, 0xc1, 0xde, 0x1f, + 0x23, 0x58, 0xdd, 0x5e, 0x53, 0xff, 0x3f, 0x4a, 0xb6, 0x28, 0xb5, 0x56, 0xf8, 0x88, 0x19, 0xdd, + 0x83, 0xa5, 0x2e, 0x16, 0x8e, 0xe7, 0x08, 0xa7, 0x56, 0x8a, 0xf1, 0x56, 0xd2, 0xac, 0xda, 0x6e, + 0xa7, 0x11, 0xd9, 0xc0, 0x17, 0x27, 0x0f, 0xdc, 0x3c, 0x84, 0x5b, 0x63, 0xab, 0xdf, 0xe4, 0x40, + 0x5c, 0xbd, 0x44, 0x1f, 0x83, 0x79, 0xb5, 0xcd, 0x29, 0x34, 0x52, 0x81, 0xa2, 0x97, 0x5d, 0x7c, + 0x1e, 0xf1, 0x76, 0xff, 0x2c, 0x42, 0xb1, 0xcd, 0x7d, 0xf4, 0x18, 0x56, 0x86, 0x3e, 0x7c, 0x36, + 0x73, 0xe3, 0xcc, 0x3b, 0xcc, 0x3b, 0x13, 0x1c, 0x69, 0xf5, 0xcf, 0xa1, 0x9c, 0x9d, 0xdc, 0x6a, + 0x2e, 0x3a, 0xb5, 0x9a, 0xef, 0x8d, 0xb3, 0xa6, 0x09, 0xbe, 0x80, 0xd5, 0xe1, 0x2f, 0x97, 0x5a, + 0x3e, 0x3c, 0xef, 0x31, 0x1b, 0x93, 0x3c, 0x79, 0x34, 0xd9, 0xbb, 0x2e, 0x8f, 0x26, 0xb5, 0x0e, + 0xa1, 0xb9, 0xfa, 0x5e, 0x7a, 0x0a, 0x68, 0xcc, 0x9b, 0x67, 0xeb, 0xda, 0xeb, 0xd1, 0xfc, 0x70, + 0xaa, 0xdb, 0x13, 0x7d, 0x09, 0xeb, 0xa3, 0x27, 0xd1, 0x9c, 0x2c, 0x63, 0xd3, 0x9a, 0xec, 0x4b, + 0x52, 0x9a, 0x0b, 0x3f, 0xbd, 0x79, 0x71, 0xd7, 0x38, 0xf8, 0xec, 0xd5, 0x45, 0xdd, 0x78, 0x7d, + 0x51, 0x37, 0xfe, 0xb9, 0xa8, 0x1b, 0xbf, 0x5e, 0xd6, 0xe7, 0x5e, 0x5f, 0xd6, 0xe7, 0xfe, 0xba, + 0xac, 0xcf, 0x3d, 0xb5, 0x7c, 0x22, 0x9e, 0xf5, 0x4e, 0x9b, 0x2e, 0xed, 0xb6, 0x68, 0xc8, 0x69, + 0xc8, 0x5a, 0xf1, 0xcf, 0x79, 0x4b, 0x7e, 0x29, 0x8b, 0x41, 0x84, 0xf9, 0x69, 0x29, 0xfe, 0x20, + 0x7e, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0xa6, 0x2b, 0x0b, 0xa0, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1374,15 +1384,10 @@ func (m *MsgAllocateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Origin))) i-- dAtA[i] = 0x1a } @@ -1423,6 +1428,13 @@ func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if len(m.RegistrationOptions) > 0 { + i -= len(m.RegistrationOptions) + copy(dAtA[i:], m.RegistrationOptions) + i = encodeVarintTx(dAtA, i, uint64(len(m.RegistrationOptions))) + i-- + dAtA[i] = 0x1a + } if m.ExpiryBlock != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ExpiryBlock)) i-- @@ -2038,8 +2050,8 @@ func (m *MsgAllocateVault) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Origin) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -2058,6 +2070,10 @@ func (m *MsgAllocateVaultResponse) Size() (n int) { if m.ExpiryBlock != 0 { n += 1 + sovTx(uint64(m.ExpiryBlock)) } + l = len(m.RegistrationOptions) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2590,9 +2606,9 @@ func (m *MsgAllocateVault) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2602,27 +2618,23 @@ func (m *MsgAllocateVault) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2725,6 +2737,38 @@ func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegistrationOptions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])