From f3f7017510a71f3859a73f2d610e8ddc69377aa9 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Mon, 24 Feb 2025 14:31:27 +0100 Subject: [PATCH 01/20] chore: initial commit --- .gitignore | 2 + .../package.json | 2 + .../src/endpoints.ts | 13 + .../src/environment.ts | 9 + .../src/index.ts | 29 + .../src/message-processor.ts | 85 + .../src/traction-functions.ts | 66 + .../tsconfig.json | 9 +- .../LICENSE | 201 + .../README.md | 60 + .../openapi/traction-openapi.yaml | 14732 ++++++++++++++++ .../package.json | 25 + .../pom.xml | 94 + .../tsconfig.json | 10 + packages/tsconfig.json | 1 + pnpm-lock.yaml | 13 +- 16 files changed, 15345 insertions(+), 6 deletions(-) create mode 100644 packages/credential-showcase-traction-adapter/src/endpoints.ts create mode 100644 packages/credential-showcase-traction-adapter/src/environment.ts create mode 100644 packages/credential-showcase-traction-adapter/src/message-processor.ts create mode 100644 packages/credential-showcase-traction-adapter/src/traction-functions.ts create mode 100644 packages/credential-showcase-traction-openapi/LICENSE create mode 100644 packages/credential-showcase-traction-openapi/README.md create mode 100644 packages/credential-showcase-traction-openapi/openapi/traction-openapi.yaml create mode 100644 packages/credential-showcase-traction-openapi/package.json create mode 100644 packages/credential-showcase-traction-openapi/pom.xml create mode 100644 packages/credential-showcase-traction-openapi/tsconfig.json diff --git a/.gitignore b/.gitignore index 18f17f6..8ae2344 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ test/*.js # Ignore Open API generated packages packages/credential-showcase-openapi/src +packages/credential-showcase-traction-openapi/src packages/**/dist packages/**/target /packages/*/dist @@ -61,3 +62,4 @@ packages/**/target **/.env **/.env.* !**/.env.example + diff --git a/packages/credential-showcase-traction-adapter/package.json b/packages/credential-showcase-traction-adapter/package.json index b643f43..fd3f367 100644 --- a/packages/credential-showcase-traction-adapter/package.json +++ b/packages/credential-showcase-traction-adapter/package.json @@ -10,6 +10,8 @@ "build:clean": "tsc --build --clean && tsc --build" }, "dependencies": { + "credential-showcase-openapi": "workspace:*", + "credential-showcase-traction-openapi": "workspace:*", "express": "^4.21.2", "rhea": "^3.0.3", "rhea-promise": "^3.0.3", diff --git a/packages/credential-showcase-traction-adapter/src/endpoints.ts b/packages/credential-showcase-traction-adapter/src/endpoints.ts new file mode 100644 index 0000000..34913c0 --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/endpoints.ts @@ -0,0 +1,13 @@ + +const TRACTION_BASE = { + API_BASE: process.env.TRACTION_API_ENDPOINT || 'http://localhost:8032', + WALLET_ID: process.env.WALLET_ID || '3edcac06-4548-4416-95a1-9bbb4c9e5e16', +} + +export const endpoints = { + TRACTION: { + ...TRACTION_BASE, + TOKEN_ENDPOINT: `/multitenancy/wallet/${TRACTION_BASE.WALLET_ID}/token`, + CREDENTIAL_DEFINITIONS: '/credential-definitions', + }, +} diff --git a/packages/credential-showcase-traction-adapter/src/environment.ts b/packages/credential-showcase-traction-adapter/src/environment.ts new file mode 100644 index 0000000..516238e --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/environment.ts @@ -0,0 +1,9 @@ +export const environment = { + RABBITMQ_HOST: process.env.RABBITMQ_HOST || 'localhost', + RABBITMQ_PORT: parseInt(process.env.RABBITMQ_PORT || '5672', 10), + RABBITMQ_USER: process.env.RABBITMQ_USER || 'guest', + RABBITMQ_PASSWORD: process.env.RABBITMQ_PASSWORD || 'guest', + + WALLET_KEY: process.env.WALLET_KEY, + WALLET_KEY_EXPIRES_AFTER_SECONDS: process.env.WALLET_KEY_EXPIRES_AFTER_SECONDS || 1800, +} diff --git a/packages/credential-showcase-traction-adapter/src/index.ts b/packages/credential-showcase-traction-adapter/src/index.ts index e69de29..9dbe2ed 100644 --- a/packages/credential-showcase-traction-adapter/src/index.ts +++ b/packages/credential-showcase-traction-adapter/src/index.ts @@ -0,0 +1,29 @@ +import { MessageProcessor } from './message-processor' + +async function main() { + const processor = new MessageProcessor('credential-definitions') + + try { + await processor.start() + console.log('AMQ 1.0 message processor started') + + process.on('SIGINT', async () => { + console.log('Received SIGINT. Shutting down...') + await processor.stop() + process.exit(0) + }) + + process.on('SIGTERM', async () => { + console.log('Received SIGTERM. Shutting down...') + await processor.stop() + process.exit(0) + }) + + process.stdin.resume() + } catch (error) { + console.error('Error:', error) + process.exit(1) + } +} + +void main() diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts new file mode 100644 index 0000000..b2b700c --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -0,0 +1,85 @@ +import { Connection, Receiver, ReceiverEvents, ReceiverOptions } from 'rhea-promise' +import { environment } from './environment' +import { CredentialDefinitionFromJSON } from 'credential-showcase-openapi' +import { getWalletToken, sendCredentialDefinition } from './traction-functions' + +export class MessageProcessor { + private readonly connection: Connection + private receiver!: Receiver + private tokenCache: { token: string; expiry: number } | null = null + + constructor(private topic: string) { + this.connection = new Connection({ + hostname: environment.RABBITMQ_HOST, + port: environment.RABBITMQ_PORT, + transport: 'tcp', + reconnect: true, + username: environment.RABBITMQ_USER, + password: environment.RABBITMQ_PASSWORD, + }) + } + + async start() { + await this.connection.open() + + const receiverOptions: ReceiverOptions = { + source: { + address: this.topic, + durable: 2, + filter: { + 'topic-filter': this.topic, + }, + }, + } + + this.receiver = await this.connection.createReceiver(receiverOptions) + + this.receiver.on(ReceiverEvents.message, async (context) => { + if (context.message) { + const jsonData = JSON.parse(context.message.body as string) + const credentialDef = CredentialDefinitionFromJSON(jsonData) + try { + console.debug('Received credential definition', credentialDef) + await sendCredentialDefinition(credentialDef, await this.getApiToken()) + if (context.delivery) { + context.delivery.accept() + } + } catch (e) { + console.error(`An error occurred while sending credential definition ${credentialDef.id}/${credentialDef.name} of type ${credentialDef.type} to Traction`) + if (context.delivery) { + context.delivery.reject() // FIXME context.delivery.release() to redeliver ?? + } + } + } + }) + + this.receiver.on(ReceiverEvents.receiverError, (context) => { + console.error(`[${this.topic}] Receiver error:`, context.receiver?.error) + }) + } + + async stop() { + if (this.receiver) { + await this.receiver.close() + } + if (this.connection) { + await this.connection.close() + } + } + + private async getApiToken(): Promise { + // Check if we have a valid cached token + if (this.tokenCache && this.tokenCache.expiry > Date.now()) { + return Promise.resolve(this.tokenCache.token) + } + + // No, get a new one + const token = await getWalletToken() + const expiresAfterMs = Number(environment.WALLET_KEY_EXPIRES_AFTER_SECONDS) * 1000 + this.tokenCache = { + token, + expiry: Date.now() + expiresAfterMs, + } + return token + } +} diff --git a/packages/credential-showcase-traction-adapter/src/traction-functions.ts b/packages/credential-showcase-traction-adapter/src/traction-functions.ts new file mode 100644 index 0000000..a576742 --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/traction-functions.ts @@ -0,0 +1,66 @@ +import { CredentialDefinition, instanceOfAnonCredRevocation } from 'credential-showcase-openapi' +import { + CreateWalletTokenRequest, + CreateWalletTokenRequestToJSON, + CredentialDefinitionSendRequest, + CredentialDefinitionSendRequestToJSON, +} from 'credential-showcase-traction-openapi' +import { endpoints } from './endpoints' +import { environment } from './environment' + +const credentialsEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.CREDENTIAL_DEFINITIONS}` +const tokenEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.TOKEN_ENDPOINT}` + +export async function getWalletToken(): Promise { + const request: CreateWalletTokenRequest = { + walletKey: environment.WALLET_KEY, + } + + const response = await fetch(tokenEndpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(CreateWalletTokenRequestToJSON(request)), + }) + + if (!response.ok) { + throw new Error(`Failed to get wallet API token: ${response.status} ${response.statusText}`) + } + + const data = await response.json() + return data.token +} + +export async function sendCredentialDefinition(credentialDef: CredentialDefinition, apiToken: string) { + const sendRequest: CredentialDefinitionSendRequest = { + schemaId: credentialDef.id, + tag: credentialDef.name, + supportRevocation: false, + } + + if (credentialDef.revocation) { + sendRequest.supportRevocation = true + + if (instanceOfAnonCredRevocation(credentialDef.revocation)) { + sendRequest.revocationRegistrySize = 1000 // FIXME do we need this? + } + } + + const headers: Record = { + 'Content-Type': 'application/json', + Authorization: `Bearer ${apiToken}`, + } + + const response = await fetch(credentialsEndpoint, { + method: 'POST', + headers, + body: JSON.stringify(CredentialDefinitionSendRequestToJSON(sendRequest)), + }) + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } + + return await response.json() +} diff --git a/packages/credential-showcase-traction-adapter/tsconfig.json b/packages/credential-showcase-traction-adapter/tsconfig.json index 2b55281..528da31 100644 --- a/packages/credential-showcase-traction-adapter/tsconfig.json +++ b/packages/credential-showcase-traction-adapter/tsconfig.json @@ -6,5 +6,12 @@ "declarationDir": "dist", "noUnusedLocals": false }, - "references": [] + "references": [ + { + "path": "credential-showcase-openapi" + }, + { + "path": "credential-showcase-traction-openapi" + } + ] } diff --git a/packages/credential-showcase-traction-openapi/LICENSE b/packages/credential-showcase-traction-openapi/LICENSE new file mode 100644 index 0000000..c2ae897 --- /dev/null +++ b/packages/credential-showcase-traction-openapi/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2025] [4Sure] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/credential-showcase-traction-openapi/README.md b/packages/credential-showcase-traction-openapi/README.md new file mode 100644 index 0000000..ee305c8 --- /dev/null +++ b/packages/credential-showcase-traction-openapi/README.md @@ -0,0 +1,60 @@ +## credential-showcase-traction-openapi + +### Environment setup + +Make sure following software is installed on your PC. + +- [OpenJDK 17](https://jdk.java.net/java-se-ri/17). +- [Maven 3.8.1](https://maven.apache.org/download.cgi) or later. + +### Generate API/Models + +The following command will generate the models in `src/models`. + +``` +mvn -U clean generate-sources +``` + +**Profile id defaults to typescript-fetch-models and may be ignored at the moment** + +### Using the models + +The models will be generated in `src/models`, therefore, they may be imported into another submodule as a workspace dependency by: + +adding the lines below to the respective files + +###### package.json + +```json +{ + "dependencies": { + "credential-showcase-traction-openapi": "workspace:*" + } +} +``` + +###### tsconfig.json + +```json +{ + "references": [ + { + "path": "../credential-showcase-traction-openapi" + } + ] +} +``` + +running the command below from the root project + +```shell +pnpm install +``` + +And importing them as any other package + +```typescript +import { Asset } from 'credential-showcase-traction-openapi' + +const asset: Asset = {} +``` diff --git a/packages/credential-showcase-traction-openapi/openapi/traction-openapi.yaml b/packages/credential-showcase-traction-openapi/openapi/traction-openapi.yaml new file mode 100644 index 0000000..1cabb14 --- /dev/null +++ b/packages/credential-showcase-traction-openapi/openapi/traction-openapi.yaml @@ -0,0 +1,14732 @@ +paths: + /action-menu/{conn_id}/close: + post: + responses: + '200': + schema: + $ref: '#/definitions/ActionMenuModulesResult' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - action-menu + summary: Close the active menu associated with a connection + produces: + - application/json + /action-menu/{conn_id}/fetch: + post: + responses: + '200': + schema: + $ref: '#/definitions/ActionMenuFetchResult' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - action-menu + summary: Fetch the active menu + produces: + - application/json + /action-menu/{conn_id}/perform: + post: + responses: + '200': + schema: + $ref: '#/definitions/ActionMenuModulesResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/PerformRequest' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - action-menu + summary: Perform an action associated with the active menu + produces: + - application/json + /action-menu/{conn_id}/request: + post: + responses: + '200': + schema: + $ref: '#/definitions/ActionMenuModulesResult' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - action-menu + summary: Request the active menu + produces: + - application/json + /action-menu/{conn_id}/send-menu: + post: + responses: + '200': + schema: + $ref: '#/definitions/ActionMenuModulesResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SendMenu' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - action-menu + summary: Send an action menu to a connection + produces: + - application/json + /anoncreds/credential-definition: + post: + responses: + '200': + schema: + $ref: '#/definitions/CredDefResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CredDefPostRequest' + tags: + - anoncreds - credential definitions + summary: Create a credential definition on the connected datastore + produces: + - application/json + /anoncreds/credential-definition/{cred_def_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetCredDefResult' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + description: Credential definition identifier + example: did:(method):3:CL:20:tag + required: true + tags: + - anoncreds - credential definitions + summary: Retrieve an individual credential definition details + produces: + - application/json + /anoncreds/credential-definitions: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetCredDefsResponse' + description: '' + parameters: + - in: query + name: issuer_id + type: string + description: Issuer Identifier of the credential definition + example: did:(method):WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: schema_id + type: string + description: Schema identifier + example: did:(method):2:schema_name:1.0 + required: false + - in: query + name: schema_name + type: string + description: Schema name + example: example-schema + required: false + - in: query + name: schema_version + type: string + description: Schema version + example: '1.0' + required: false + tags: + - anoncreds - credential definitions + summary: Retrieve all credential definition ids + produces: + - application/json + /anoncreds/registry/{rev_reg_id}/active: + put: + responses: + '200': + schema: + $ref: '#/definitions/RevocationModuleResponse' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Update the active registry + produces: + - application/json + /anoncreds/registry/{rev_reg_id}/tails-file: + put: + responses: + '200': + schema: + $ref: '#/definitions/RevocationModuleResponse' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Upload local tails file to server + produces: + - application/json + /anoncreds/revocation-list: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevListResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RevListCreateRequest' + tags: + - anoncreds - revocation + summary: Create and publish a revocation status list on the connected datastore + produces: + - application/json + /anoncreds/revocation-registry-definition: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevRegDefResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RevRegCreateRequestSchemaAnoncreds' + tags: + - anoncreds - revocation + summary: Create and publish a registration revocation on the connected datastore + produces: + - application/json + /anoncreds/revocation/active-registry/{cred_def_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + pattern: ^(.+$) + description: Credential definition identifier + example: did:(method):3:CL:20:tag + required: true + tags: + - anoncreds - revocation + summary: Get current active revocation registry by credential definition id + produces: + - application/json + /anoncreds/revocation/active-registry/{cred_def_id}/rotate: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevRegsCreatedSchemaAnoncreds' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + pattern: ^(.+$) + description: Credential definition identifier + example: did:(method):3:CL:20:tag + required: true + tags: + - anoncreds - revocation + summary: Rotate revocation registry + produces: + - application/json + /anoncreds/revocation/credential-record: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevRecordResultSchemaAnoncreds' + description: '' + parameters: + - in: query + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: cred_rev_id + type: string + pattern: ^[1-9][0-9]*$ + description: Credential revocation identifier + example: '12345' + required: false + - in: query + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: false + tags: + - anoncreds - revocation + summary: Get credential revocation status + produces: + - application/json + /anoncreds/revocation/publish-revocations: + post: + responses: + '200': + schema: + $ref: '#/definitions/PublishRevocationsResultSchemaAnoncreds' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/PublishRevocationsSchemaAnoncreds' + tags: + - anoncreds - revocation + summary: Publish pending revocations to ledger + produces: + - application/json + /anoncreds/revocation/registries: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegsCreatedSchemaAnoncreds' + description: '' + parameters: + - in: query + name: cred_def_id + type: string + pattern: ^(.+$) + description: Credential definition identifier + example: did:(method):3:CL:20:tag + required: false + - in: query + name: state + type: string + enum: + - finished + - failed + - action + - wait + - decommissioned + - full + description: Revocation registry state + required: false + tags: + - anoncreds - revocation + summary: Search for matching revocation registries that current agent created + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Get revocation registry by revocation registry id + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}/fix-revocation-entry-state: + put: + responses: + '200': + schema: + $ref: '#/definitions/RevRegWalletUpdatedResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + - in: query + name: apply_ledger_update + type: boolean + description: Apply updated accumulator transaction to ledger + required: true + tags: + - anoncreds - revocation + summary: Fix revocation state in wallet and return number of updated entries + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}/issued: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegIssuedResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Get number of credentials issued against revocation registry + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}/issued/details: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevRecordDetailsResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Get details of credentials issued against revocation registry + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}/issued/indy_recs: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevIndyRecordsResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Get details of revoked credentials from ledger + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}/set-state: + patch: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResultSchemaAnoncreds' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + - in: query + name: state + type: string + enum: + - finished + - failed + - action + - wait + - decommissioned + - full + description: Revocation registry state to set + required: true + tags: + - anoncreds - revocation + summary: Set revocation registry state manually + produces: + - application/json + /anoncreds/revocation/registry/{rev_reg_id}/tails-file: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevocationAnoncredsModuleResponse' + description: tails file + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^(.+$) + description: Revocation Registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - anoncreds - revocation + summary: Download tails file + produces: + - application/octet-stream + /anoncreds/revocation/revoke: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevocationAnoncredsModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RevokeRequestSchemaAnoncreds' + tags: + - anoncreds - revocation + summary: Revoke an issued credential + produces: + - application/json + /anoncreds/schema: + post: + responses: + '200': + schema: + $ref: '#/definitions/SchemaResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SchemaPostRequest' + tags: + - anoncreds - schemas + summary: Create a schema on the connected datastore + produces: + - application/json + /anoncreds/schema/{schema_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetSchemaResult' + description: '' + parameters: + - in: path + name: schema_id + type: string + description: Schema identifier + example: did:(method):2:schema_name:1.0 + required: true + tags: + - anoncreds - schemas + summary: Retrieve an individual schemas details + produces: + - application/json + /anoncreds/schemas: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetSchemasResponse' + description: '' + parameters: + - in: query + name: schema_issuer_id + type: string + description: Schema issuer identifier + example: did:(method):WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: schema_name + type: string + description: Schema name + example: example-schema + required: false + - in: query + name: schema_version + type: string + description: Schema version + example: '1.0' + required: false + tags: + - anoncreds - schemas + summary: Retrieve all schema ids + produces: + - application/json + /anoncreds/wallet/upgrade: + post: + responses: + '200': + schema: + $ref: '#/definitions/UpgradeResult' + description: '' + parameters: + - in: query + name: wallet_name + type: string + description: Name of wallet to upgrade to anoncreds + example: base-wallet + required: true + tags: + - anoncreds - wallet upgrade + summary: |2- + + Upgrade the wallet from askar to anoncreds - Be very careful with this! You + cannot go back! See migration guide for more information. + + produces: + - application/json + /basicmessages: + get: + responses: + '200': + schema: + $ref: '#/definitions/BasicMessageList' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier, if none specified, then return messages from all connections. + required: false + - in: query + name: state + type: string + enum: + - sent + - received + description: Message state + required: false + tags: + - basicmessage + summary: Query messages from all agents (basicmessage_storage v1_0 plugin) + produces: + - application/json + /basicmessages/{message_id}: + delete: + responses: + '200': + schema: + $ref: '#/definitions/DeleteResponse' + description: '' + parameters: + - in: path + name: message_id + type: string + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - basicmessage + summary: delete stored message by message_id + produces: + - application/json + /connections: + get: + responses: + '200': + schema: + $ref: '#/definitions/ConnectionList' + description: '' + parameters: + - in: query + name: alias + type: string + description: Alias + example: Barry + required: false + - in: query + name: connection_protocol + type: string + enum: + - connections/1.0 + - didexchange/1.0 + - didexchange/1.1 + description: Connection protocol used + example: connections/1.0 + required: false + - in: query + name: invitation_key + type: string + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + description: invitation key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + required: false + - in: query + name: invitation_msg_id + type: string + description: Identifier of the associated Invitation Message + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: limit + type: integer + default: 100 + description: Number of results to return + example: 50 + required: false + - in: query + name: my_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: My DID + example: WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: offset + type: integer + default: 0 + description: Offset for pagination + example: 0 + required: false + - in: query + name: state + type: string + enum: + - abandoned + - active + - completed + - error + - init + - invitation + - request + - response + - start + description: Connection state + required: false + - in: query + name: their_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: Their DID + example: WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: their_public_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: Their Public DID + example: WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: their_role + type: string + enum: + - invitee + - requester + - inviter + - responder + description: Their role in the connection protocol + example: invitee + required: false + tags: + - connection + summary: Query agent-to-agent connections + produces: + - application/json + /connections/create-invitation: + post: + responses: + '200': + schema: + $ref: '#/definitions/InvitationResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CreateInvitationRequest' + - in: query + name: alias + type: string + description: Alias + example: Barry + required: false + - in: query + name: auto_accept + type: boolean + description: Auto-accept connection (defaults to configuration) + required: false + - in: query + name: multi_use + type: boolean + description: Create invitation for multiple use (default false) + required: false + - in: query + name: public + type: boolean + description: Create invitation from public DID (default false) + required: false + tags: + - connection + summary: Create a new connection invitation + deprecated: true + produces: + - application/json + /connections/create-static: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnectionStaticResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ConnectionStaticRequest' + tags: + - connection + summary: Create a new static connection + produces: + - application/json + /connections/receive-invitation: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ReceiveInvitationRequest' + - in: query + name: alias + type: string + description: Alias + example: Barry + required: false + - in: query + name: auto_accept + type: boolean + description: Auto-accept connection (defaults to configuration) + required: false + - in: query + name: mediation_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - connection + summary: Receive a new connection invitation + deprecated: true + produces: + - application/json + /connections/{conn_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - connection + summary: Fetch a single connection record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/ConnectionModuleResponse' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - connection + summary: Remove an existing connection record + produces: + - application/json + put: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/UpdateConnectionRequest' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - connection + summary: Update connection (connection_update v1_0 plugin) + description: Currently, only `alias` can be updated. + produces: + - application/json + /connections/{conn_id}/accept-invitation: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: mediation_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: my_endpoint + type: string + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + description: My URL endpoint + example: https://myhost:8021 + required: false + - in: query + name: my_label + type: string + description: Label for connection + example: Broker + required: false + tags: + - connection + summary: Accept a stored connection invitation + deprecated: true + produces: + - application/json + /connections/{conn_id}/accept-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: my_endpoint + type: string + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + description: My URL endpoint + example: https://myhost:8021 + required: false + tags: + - connection + summary: Accept a stored connection request + deprecated: true + produces: + - application/json + /connections/{conn_id}/endpoints: + get: + responses: + '200': + schema: + $ref: '#/definitions/EndpointsResult' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - connection + summary: Fetch connection remote endpoint + produces: + - application/json + /connections/{conn_id}/invitation: + get: + responses: + '200': + schema: + $ref: '#/definitions/InvitationResult' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - connection + summary: Fetch connection invitation + produces: + - application/json + /connections/{conn_id}/metadata: + get: + responses: + '200': + schema: + $ref: '#/definitions/ConnectionMetadata' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: key + type: string + description: Key to retrieve. + required: false + tags: + - connection + summary: Fetch connection metadata + produces: + - application/json + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnectionMetadata' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ConnectionMetadataSetRequest' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - connection + summary: Set connection metadata + produces: + - application/json + /connections/{conn_id}/send-message: + post: + responses: + '200': + schema: + $ref: '#/definitions/BasicMessageModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SendMessage' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - basicmessage + summary: Send a basic message to a connection (basicmessage_storage v1_0 plugin) + produces: + - application/json + /connections/{conn_id}/send-ping: + post: + responses: + '200': + schema: + $ref: '#/definitions/PingRequestResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/PingRequest' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - trustping + summary: Send a trust ping to a connection + produces: + - application/json + /connections/{conn_id}/start-introduction: + post: + responses: + '200': + schema: + $ref: '#/definitions/IntroModuleResponse' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: target_connection_id + type: string + description: Target connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: message + type: string + description: Message + example: Allow me to introduce ... + required: false + tags: + - introduction + summary: Start an introduction between two connections + produces: + - application/json + /credential-definition-storage: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredDefStorageList' + description: '' + parameters: [ ] + tags: + - credential-definition-storage + produces: + - application/json + /credential-definition-storage/{cred_def_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredDefStorageRecord' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + description: Credential Definition identifier + required: true + tags: + - credential-definition-storage + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/CredDefStorageOperationResponse' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + description: Credential Definition identifier + required: true + tags: + - credential-definition-storage + produces: + - application/json + /credential-definitions: + post: + responses: + '200': + schema: + $ref: '#/definitions/TxnOrCredentialDefinitionSendResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CredentialDefinitionSendRequest' + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - credential-definition + summary: Sends a credential definition to the ledger + produces: + - application/json + /credential-definitions/created: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredentialDefinitionsCreatedResult' + description: '' + parameters: + - in: query + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition id + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: false + - in: query + name: issuer_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: Issuer DID + example: WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: schema_id + type: string + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + required: false + - in: query + name: schema_issuer_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: schema_name + type: string + description: Schema name + example: membership + required: false + - in: query + name: schema_version + type: string + pattern: ^[0-9.]+$ + description: Schema version + example: '1.0' + required: false + tags: + - credential-definition + summary: Search for matching credential definitions that agent originated + produces: + - application/json + /credential-definitions/{cred_def_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredentialDefinitionGetResult' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: true + tags: + - credential-definition + summary: Gets a credential definition from the ledger + produces: + - application/json + /credential-definitions/{cred_def_id}/write_record: + post: + responses: + '200': + schema: + $ref: '#/definitions/CredentialDefinitionGetResult' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: true + tags: + - credential-definition + summary: Writes a credential definition non-secret record to the wallet + produces: + - application/json + /credential/mime-types/{credential_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/AttributeMimeTypesResult' + description: '' + parameters: + - in: path + name: credential_id + type: string + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - credentials + summary: Get attribute MIME types from wallet + produces: + - application/json + /credential/revoked/{credential_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevokedResult' + description: '' + parameters: + - in: path + name: credential_id + type: string + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: from + type: string + pattern: ^[0-9]*$ + description: Earliest epoch of revocation status interval of interest + example: '0' + required: false + - in: query + name: to + type: string + pattern: ^[0-9]*$ + description: Latest epoch of revocation status interval of interest + example: '0' + required: false + tags: + - credentials + summary: Query credential revocation status by id + produces: + - application/json + /credential/w3c/{credential_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/VCRecord' + description: '' + parameters: + - in: path + name: credential_id + type: string + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - credentials + summary: Fetch W3C credential from wallet by id + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/HolderModuleResponse' + description: '' + parameters: + - in: path + name: credential_id + type: string + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - credentials + summary: Remove W3C credential from wallet by id + produces: + - application/json + /credential/{credential_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/IndyCredInfo' + description: '' + parameters: + - in: path + name: credential_id + type: string + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - credentials + summary: Fetch credential from wallet by id + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/HolderModuleResponse' + description: '' + parameters: + - in: path + name: credential_id + type: string + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - credentials + summary: Remove credential from wallet by id + produces: + - application/json + /credentials: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredInfoList' + description: '' + parameters: + - in: query + name: count + type: string + pattern: ^[1-9][0-9]*$ + description: Maximum number to retrieve + example: '1' + required: false + - in: query + name: start + type: string + pattern: ^[0-9]*$ + description: Start index + example: '0' + required: false + - in: query + name: wql + type: string + pattern: ^{.*}$ + description: (JSON) WQL query + example: '{"attr::name::value": "Alex"}' + required: false + tags: + - credentials + summary: Fetch credentials from wallet + produces: + - application/json + /credentials/w3c: + post: + responses: + '200': + schema: + $ref: '#/definitions/VCRecordList' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/W3CCredentialsListRequest' + - in: query + name: count + type: string + pattern: ^[1-9][0-9]*$ + description: Maximum number to retrieve + example: '1' + required: false + - in: query + name: start + type: string + pattern: ^[0-9]*$ + description: Start index + example: '0' + required: false + - in: query + name: wql + type: string + pattern: ^{.*}$ + description: (JSON) WQL query + example: '{"attr::name::value": "Alex"}' + required: false + tags: + - credentials + summary: Fetch W3C credentials from wallet + produces: + - application/json + /did-rotate/{conn_id}/hangup: + post: + responses: + '200': + schema: + $ref: '#/definitions/Hangup' + description: Hangup agent message for observer + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - did-rotate + summary: Send hangup of DID rotation as a rotator + produces: + - application/json + /did-rotate/{conn_id}/rotate: + post: + responses: + '200': + schema: + $ref: '#/definitions/Rotate' + description: Rotate agent message for observer + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DIDRotateRequestJSON' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - did-rotate + summary: Begin rotation of a DID as a rotator + produces: + - application/json + /didexchange/create-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: query + name: their_public_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: Qualified public DID to which to request connection + example: did:peer:WgWxqztrNooG92RXvxSTWv + required: true + - in: query + name: alias + type: string + description: Alias for connection + example: Barry + required: false + - in: query + name: auto_accept + type: boolean + description: Auto-accept connection (defaults to configuration) + required: false + - in: query + name: goal + type: string + description: A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message + example: To issue a Faber College Graduate credential + required: false + - in: query + name: goal_code + type: string + description: A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message + example: issue-vc + required: false + - in: query + name: mediation_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: my_endpoint + type: string + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + description: My URL endpoint + example: https://myhost:8021 + required: false + - in: query + name: my_label + type: string + description: Label for connection request + example: Broker + required: false + - in: query + name: protocol + type: string + enum: + - didexchange/1.0 + - didexchange/1.1 + description: Which DID Exchange Protocol version to use + example: didexchange/1.0 + required: false + - in: query + name: use_did + type: string + description: The DID to use to for this connection + example: did:example:1234 + required: false + - in: query + name: use_did_method + type: string + enum: + - did:peer:2 + - did:peer:4 + description: The DID method to use to generate a DID for this connection + example: did:peer:4 + required: false + - in: query + name: use_public_did + type: boolean + description: Use public DID for this connection + required: false + tags: + - did-exchange + summary: Create and send a request against public DID's implicit invitation + produces: + - application/json + /didexchange/receive-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DIDXRequest' + - in: query + name: alias + type: string + description: Alias for connection + example: Barry + required: false + - in: query + name: auto_accept + type: boolean + description: Auto-accept connection (defaults to configuration) + required: false + - in: query + name: mediation_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: my_endpoint + type: string + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + description: My URL endpoint + example: https://myhost:8021 + required: false + tags: + - did-exchange + summary: Receive request against public DID's implicit invitation + deprecated: true + produces: + - application/json + /didexchange/{conn_id}/accept-invitation: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: my_endpoint + type: string + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + description: My URL endpoint + example: https://myhost:8021 + required: false + - in: query + name: my_label + type: string + description: Label for connection request + example: Broker + required: false + - in: query + name: use_did + type: string + description: The DID to use to for this connection + example: did:example:1234 + required: false + - in: query + name: use_did_method + type: string + enum: + - did:peer:2 + - did:peer:4 + description: The DID method to use to generate a DID for this connection + example: did:peer:4 + required: false + tags: + - did-exchange + summary: Accept a stored connection invitation + produces: + - application/json + /didexchange/{conn_id}/accept-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: mediation_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: my_endpoint + type: string + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + description: My URL endpoint + example: https://myhost:8021 + required: false + - in: query + name: use_public_did + type: boolean + description: Use public DID for this connection + required: false + tags: + - did-exchange + summary: Accept a stored connection request + produces: + - application/json + /didexchange/{conn_id}/reject: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DIDXRejectRequest' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - did-exchange + summary: Abandon or reject a DID Exchange + produces: + - application/json + /discover-features-2.0/queries: + get: + responses: + '200': + schema: + $ref: '#/definitions/V20DiscoveryExchangeResult' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier, if none specified, then the query will provide features for this agent. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: query_goal_code + type: string + description: Goal-code feature-type query + example: '*' + required: false + - in: query + name: query_protocol + type: string + description: Protocol feature-type query + example: '*' + required: false + tags: + - discover-features v2.0 + summary: Query supported features + produces: + - application/json + /discover-features-2.0/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/V20DiscoveryExchangeListResult' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - discover-features v2.0 + summary: Discover Features v2.0 records + produces: + - application/json + /discover-features/query: + get: + responses: + '200': + schema: + $ref: '#/definitions/V10DiscoveryRecord' + description: '' + parameters: + - in: query + name: comment + type: string + description: Comment + example: test + required: false + - in: query + name: connection_id + type: string + description: Connection identifier, if none specified, then the query will provide features for this agent. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: query + type: string + description: Protocol feature query + example: '*' + required: false + tags: + - discover-features + summary: Query supported features + produces: + - application/json + /discover-features/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/V10DiscoveryExchangeListResult' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - discover-features + summary: Discover Features records + produces: + - application/json + /drpc/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/DRPCRecordList' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: state + type: string + enum: + - request-sent + - request-received + - completed + description: RPC state + required: false + - in: query + name: thread_id + type: string + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - drpc + summary: Get all DIDComm RPC records + produces: + - application/json + /drpc/records/{record_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/DRPCRecord' + description: '' + parameters: + - in: path + name: record_id + type: string + description: DRPC record identifier + required: true + tags: + - drpc + summary: Get a DIDComm RPC record + produces: + - application/json + /drpc/{conn_id}/request: + post: + responses: + '200': + schema: + $ref: '#/definitions/DRPCRequestMessage' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DRPCRequestJSON' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - drpc + summary: Send a DIDComm RPC request message + produces: + - application/json + /drpc/{conn_id}/response: + post: + responses: + '200': + schema: + $ref: '#/definitions/DRPCResponseMessage' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DRPCResponseJSON' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - drpc + summary: Send a DIDComm RPC response message + produces: + - application/json + /innkeeper/authentications/api: + post: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationsApiResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TenantAuthenticationsApiRequest' + tags: + - traction-innkeeper + summary: Create API Key Record + produces: + - application/json + /innkeeper/authentications/api/: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationApiList' + description: '' + parameters: [ ] + tags: + - traction-innkeeper + summary: List all API Key Records + produces: + - application/json + /innkeeper/authentications/api/{tenant_authentication_api_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationApiRecord' + description: '' + parameters: + - in: path + name: tenant_authentication_api_id + type: string + description: Tenant authentication api key identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + summary: Read API Key Record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationApiOperationResponse' + description: '' + parameters: + - in: path + name: tenant_authentication_api_id + type: string + description: Tenant authentication api key identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + summary: Delete API Key + produces: + - application/json + /innkeeper/default-config: + get: + responses: + '200': + schema: + $ref: '#/definitions/DefaultConfigValues' + description: '' + parameters: [ ] + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/reservations: + post: + responses: + '200': + schema: + $ref: '#/definitions/ReservationResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ReservationRequest' + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/reservations/: + get: + responses: + '200': + schema: + $ref: '#/definitions/ReservationList' + description: '' + parameters: [ ] + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/reservations/{reservation_id}/approve: + put: + responses: + '200': + schema: + $ref: '#/definitions/ReservationApproveResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ReservationApproveRequest' + - in: path + name: reservation_id + type: string + description: Reservation identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/reservations/{reservation_id}/config: + put: + responses: + '200': + schema: + $ref: '#/definitions/ReservationRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TenantConfig' + - in: path + name: reservation_id + type: string + description: Reservation identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/reservations/{reservation_id}/deny: + put: + responses: + '200': + schema: + $ref: '#/definitions/ReservationResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ReservationDenyRequest' + - in: path + name: reservation_id + type: string + description: Reservation identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/reservations/{reservation_id}/refresh-password: + put: + responses: + '200': + schema: + $ref: '#/definitions/ReservationApproveResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ReservationRefresh' + - in: path + name: reservation_id + type: string + description: Reservation identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/server/status/config: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminConfig' + description: '' + parameters: [ ] + tags: + - traction-innkeeper + summary: Fetch the server configuration + produces: + - application/json + /innkeeper/tenants/: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantList' + description: '' + parameters: + - in: query + name: state + type: string + enum: + - active + - deleted + - all + description: The state of the tenants to filter by. + example: active + required: false + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/tenants/{tenant_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: + - in: path + name: tenant_id + type: string + description: Tenant identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: + - in: path + name: tenant_id + type: string + description: Tenant identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/tenants/{tenant_id}/config: + put: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TenantConfig' + - in: path + name: tenant_id + type: string + description: Tenant identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/tenants/{tenant_id}/hard: + delete: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: + - in: path + name: tenant_id + type: string + description: Tenant identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /innkeeper/tenants/{tenant_id}/restore: + put: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TenantConfig' + - in: path + name: tenant_id + type: string + description: Tenant identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-innkeeper + produces: + - application/json + /issue-credential-2.0/create: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20IssueCredSchemaCore' + tags: + - issue-credential v2.0 + summary: Create a credential record without sending (generally for use with Out-Of-Band) + produces: + - application/json + /issue-credential-2.0/create-offer: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredOfferConnFreeRequest' + tags: + - issue-credential v2.0 + summary: Create a credential offer, independent of any proposal or connection + produces: + - application/json + /issue-credential-2.0/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecordListResult' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: limit + type: integer + default: 100 + description: Number of results to return + example: 50 + required: false + - in: query + name: offset + type: integer + default: 0 + description: Offset for pagination + example: 0 + required: false + - in: query + name: role + type: string + enum: + - issuer + - holder + description: Role assigned in credential exchange + required: false + - in: query + name: state + type: string + enum: + - proposal-sent + - proposal-received + - offer-sent + - offer-received + - request-sent + - request-received + - credential-issued + - credential-received + - done + - credential-revoked + - abandoned + description: Credential exchange state + required: false + - in: query + name: thread_id + type: string + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - issue-credential v2.0 + summary: Fetch all credential exchange records + produces: + - application/json + /issue-credential-2.0/records/{cred_ex_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecordDetail' + description: '' + parameters: + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Fetch a single credential exchange record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/V20IssueCredentialModuleResponse' + description: '' + parameters: + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Remove an existing credential exchange record + produces: + - application/json + /issue-credential-2.0/records/{cred_ex_id}/issue: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecordDetail' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredIssueRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Send holder a credential + produces: + - application/json + /issue-credential-2.0/records/{cred_ex_id}/problem-report: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20IssueCredentialModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredIssueProblemReportRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Send a problem report for credential exchange + produces: + - application/json + /issue-credential-2.0/records/{cred_ex_id}/send-offer: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredBoundOfferRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Send holder a credential offer in reference to a proposal with preview + produces: + - application/json + /issue-credential-2.0/records/{cred_ex_id}/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredRequestRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Send issuer a credential request + produces: + - application/json + /issue-credential-2.0/records/{cred_ex_id}/store: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecordDetail' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredStoreRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v2.0 + summary: Store a received credential + produces: + - application/json + /issue-credential-2.0/send: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredExFree' + tags: + - issue-credential v2.0 + summary: Send holder a credential, automating entire flow + produces: + - application/json + /issue-credential-2.0/send-offer: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredOfferRequest' + tags: + - issue-credential v2.0 + summary: Send holder a credential offer, independent of any proposal + produces: + - application/json + /issue-credential-2.0/send-proposal: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredExFree' + tags: + - issue-credential v2.0 + summary: Send issuer a credential proposal + produces: + - application/json + /issue-credential-2.0/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20CredExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20CredRequestFree' + tags: + - issue-credential v2.0 + summary: Send issuer a credential request not bound to an existing thread. Indy credentials cannot start at a request + produces: + - application/json + /issue-credential/create: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialCreate' + tags: + - issue-credential v1.0 + summary: Create a credential record without sending (generally for use with Out-Of-Band) + deprecated: true + produces: + - application/json + /issue-credential/create-offer: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialConnFreeOfferRequest' + tags: + - issue-credential v1.0 + summary: Create a credential offer, independent of any proposal or connection + deprecated: true + produces: + - application/json + /issue-credential/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchangeListResult' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: limit + type: integer + default: 100 + description: Number of results to return + example: 50 + required: false + - in: query + name: offset + type: integer + default: 0 + description: Offset for pagination + example: 0 + required: false + - in: query + name: role + type: string + enum: + - issuer + - holder + description: Role assigned in credential exchange + required: false + - in: query + name: state + type: string + enum: + - proposal_sent + - proposal_received + - offer_sent + - offer_received + - request_sent + - request_received + - credential_issued + - credential_received + - credential_acked + - credential_revoked + - abandoned + description: Credential exchange state + required: false + - in: query + name: thread_id + type: string + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - issue-credential v1.0 + summary: Fetch all credential exchange records + deprecated: true + produces: + - application/json + /issue-credential/records/{cred_ex_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Fetch a single credential exchange record + deprecated: true + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/IssueCredentialModuleResponse' + description: '' + parameters: + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Remove an existing credential exchange record + deprecated: true + produces: + - application/json + /issue-credential/records/{cred_ex_id}/issue: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialIssueRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Send holder a credential + deprecated: true + produces: + - application/json + /issue-credential/records/{cred_ex_id}/problem-report: + post: + responses: + '200': + schema: + $ref: '#/definitions/IssueCredentialModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialProblemReportRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Send a problem report for credential exchange + deprecated: true + produces: + - application/json + /issue-credential/records/{cred_ex_id}/send-offer: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialBoundOfferRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Send holder a credential offer in reference to a proposal with preview + deprecated: true + produces: + - application/json + /issue-credential/records/{cred_ex_id}/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialExchangeAutoRemoveRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Send issuer a credential request + deprecated: true + produces: + - application/json + /issue-credential/records/{cred_ex_id}/store: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialStoreRequest' + - in: path + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - issue-credential v1.0 + summary: Store a received credential + deprecated: true + produces: + - application/json + /issue-credential/send: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialProposalRequestMand' + tags: + - issue-credential v1.0 + summary: Send holder a credential, automating entire flow + deprecated: true + produces: + - application/json + /issue-credential/send-offer: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialFreeOfferRequest' + tags: + - issue-credential v1.0 + summary: Send holder a credential offer, independent of any proposal + deprecated: true + produces: + - application/json + /issue-credential/send-proposal: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10CredentialExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10CredentialProposalRequestOpt' + tags: + - issue-credential v1.0 + summary: Send issuer a credential proposal + deprecated: true + produces: + - application/json + /jsonld/sign: + post: + responses: + '200': + schema: + $ref: '#/definitions/SignResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SignRequest' + tags: + - jsonld + summary: Sign a JSON-LD structure and return it + deprecated: true + produces: + - application/json + /jsonld/verify: + post: + responses: + '200': + schema: + $ref: '#/definitions/VerifyResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/VerifyRequest' + tags: + - jsonld + summary: Verify a JSON-LD structure. + deprecated: true + produces: + - application/json + /ledger/config: + get: + responses: + '200': + schema: + $ref: '#/definitions/LedgerConfigList' + description: '' + parameters: [ ] + tags: + - ledger + summary: Fetch the multiple ledger configuration currently in use + produces: + - application/json + /ledger/did-endpoint: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetDIDEndpointResponse' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: DID of interest + example: WgWxqztrNooG92RXvxSTWv + required: true + - in: query + name: endpoint_type + type: string + enum: + - Endpoint + - Profile + - LinkedDomains + description: Endpoint type of interest (default 'Endpoint') + example: Endpoint + required: false + tags: + - ledger + summary: Get the endpoint for a DID from the ledger. + produces: + - application/json + /ledger/did-verkey: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetDIDVerkeyResponse' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: DID of interest + example: WgWxqztrNooG92RXvxSTWv + required: true + tags: + - ledger + summary: Get the verkey for a DID from the ledger. + produces: + - application/json + /ledger/get-nym-role: + get: + responses: + '200': + schema: + $ref: '#/definitions/GetNymRoleResponse' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: DID of interest + example: WgWxqztrNooG92RXvxSTWv + required: true + tags: + - ledger + summary: Get the role from the NYM registration of a public DID. + produces: + - application/json + /ledger/get-write-ledger: + get: + responses: + '200': + schema: + $ref: '#/definitions/WriteLedger' + description: '' + parameters: [ ] + tags: + - ledger + summary: Fetch the current write ledger + produces: + - application/json + /ledger/get-write-ledgers: + get: + responses: + '200': + schema: + $ref: '#/definitions/ConfigurableWriteLedgers' + description: '' + parameters: [ ] + tags: + - ledger + summary: Fetch list of available write ledgers + produces: + - application/json + /ledger/register-nym: + post: + responses: + '200': + schema: + $ref: '#/definitions/TxnOrRegisterLedgerNymResponse' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: DID to register + example: WgWxqztrNooG92RXvxSTWv + required: true + - in: query + name: verkey + type: string + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + description: Verification key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + required: true + - in: query + name: alias + type: string + description: Alias + example: Barry + required: false + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + - in: query + name: role + type: string + enum: + - STEWARD + - TRUSTEE + - ENDORSER + - NETWORK_MONITOR + - reset + description: Role + required: false + tags: + - ledger + summary: Send a NYM registration to the ledger. + produces: + - application/json + /ledger/rotate-public-did-keypair: + patch: + responses: + '200': + schema: + $ref: '#/definitions/LedgerModulesResult' + description: '' + parameters: [ ] + tags: + - ledger + summary: Rotate key pair for public DID. + produces: + - application/json + /ledger/taa: + get: + responses: + '200': + schema: + $ref: '#/definitions/TAAResult' + description: '' + parameters: [ ] + tags: + - ledger + summary: Fetch the current transaction author agreement, if any + produces: + - application/json + /ledger/taa/accept: + post: + responses: + '200': + schema: + $ref: '#/definitions/LedgerModulesResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TAAAccept' + tags: + - ledger + summary: Accept the transaction author agreement + produces: + - application/json + /ledger/{ledger_id}/set-write-ledger: + put: + responses: + '200': + schema: + $ref: '#/definitions/WriteLedger' + description: '' + parameters: + - in: path + name: ledger_id + type: string + required: true + tags: + - ledger + summary: Set write ledger + produces: + - application/json + /mediation/default-mediator: + get: + responses: + '200': + schema: + $ref: '#/definitions/MediationRecord' + description: '' + parameters: [ ] + tags: + - mediation + summary: Get default mediator + produces: + - application/json + delete: + responses: + '201': + schema: + $ref: '#/definitions/MediationRecord' + description: '' + parameters: [ ] + tags: + - mediation + summary: Clear default mediator + produces: + - application/json + /mediation/keylists: + get: + responses: + '200': + schema: + $ref: '#/definitions/Keylist' + description: '' + parameters: + - in: query + name: conn_id + type: string + description: Connection identifier (optional) + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: role + type: string + default: server + enum: + - client + - server + description: Filer on role, 'client' for keys mediated by other agents, 'server' for keys mediated by this agent + required: false + tags: + - mediation + summary: Retrieve keylists by connection or role + produces: + - application/json + /mediation/keylists/{mediation_id}/send-keylist-query: + post: + responses: + '201': + schema: + $ref: '#/definitions/KeylistQuery' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/KeylistQueryFilterRequest' + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: paginate_limit + type: integer + default: -1 + description: limit number of results + required: false + - in: query + name: paginate_offset + type: integer + default: 0 + description: offset to use in pagination + required: false + tags: + - mediation + summary: Send keylist query to mediator + produces: + - application/json + /mediation/keylists/{mediation_id}/send-keylist-update: + post: + responses: + '201': + schema: + $ref: '#/definitions/KeylistUpdate' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/KeylistUpdateRequest' + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Send keylist update to mediator + produces: + - application/json + /mediation/request/{conn_id}: + post: + responses: + '201': + schema: + $ref: '#/definitions/MediationRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/MediationCreateRequest' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Request mediation from connection + produces: + - application/json + /mediation/requests: + get: + responses: + '200': + schema: + $ref: '#/definitions/MediationList' + description: '' + parameters: + - in: query + name: conn_id + type: string + description: Connection identifier (optional) + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: state + type: string + enum: + - request + - granted + - denied + description: Mediation state (optional) + example: granted + required: false + tags: + - mediation + summary: Query mediation requests, returns list of all mediation records + produces: + - application/json + /mediation/requests/{mediation_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/MediationRecord' + description: '' + parameters: + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Retrieve mediation request record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/MediationRecord' + description: '' + parameters: + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Delete mediation request by ID + produces: + - application/json + /mediation/requests/{mediation_id}/deny: + post: + responses: + '201': + schema: + $ref: '#/definitions/MediationDeny' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/AdminMediationDeny' + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Deny a stored mediation request + produces: + - application/json + /mediation/requests/{mediation_id}/grant: + post: + responses: + '201': + schema: + $ref: '#/definitions/MediationGrant' + description: '' + parameters: + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Grant received mediation + produces: + - application/json + /mediation/update-keylist/{conn_id}: + post: + responses: + '200': + schema: + $ref: '#/definitions/KeylistUpdate' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/MediationIdMatchInfo' + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Update keylist for a connection + produces: + - application/json + /mediation/{mediation_id}/default-mediator: + put: + responses: + '201': + schema: + $ref: '#/definitions/MediationRecord' + description: '' + parameters: + - in: path + name: mediation_id + type: string + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - mediation + summary: Set default mediator + produces: + - application/json + /multitenancy/reservations: + post: + responses: + '200': + schema: + $ref: '#/definitions/ReservationResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ReservationRequest' + tags: + - multitenancy + produces: + - application/json + /multitenancy/reservations/{reservation_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/ReservationRecord' + description: '' + parameters: + - in: path + name: reservation_id + type: string + description: Reservation identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - multitenancy + produces: + - application/json + /multitenancy/reservations/{reservation_id}/check-in: + post: + responses: + '200': + schema: + $ref: '#/definitions/CheckinResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/Checkin' + - in: path + name: reservation_id + type: string + description: Reservation identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - multitenancy + produces: + - application/json + /multitenancy/tenant/{tenant_id}/token: + post: + responses: + '200': + schema: + $ref: '#/definitions/CreateWalletTokenResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CustomCreateWalletTokenRequest' + - in: path + name: tenant_id + type: string + description: Tenant identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - multitenancy + summary: Get auth token for a tenant + produces: + - application/json + /multitenancy/wallet: + post: + responses: + '200': + schema: + $ref: '#/definitions/CreateWalletResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/PluginCreateWalletRequest' + tags: + - multitenancy + summary: Create a subwallet (multitenant_provider plugin override) + produces: + - application/json + /multitenancy/wallet/{wallet_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/WalletRecord' + description: '' + parameters: + - in: path + name: wallet_id + type: string + description: Subwallet identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - multitenancy + summary: Get a single subwallet + produces: + - application/json + put: + responses: + '200': + schema: + $ref: '#/definitions/WalletRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/UpdateWalletRequest' + - in: path + name: wallet_id + type: string + description: Subwallet identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - multitenancy + summary: Update a subwallet + produces: + - application/json + /multitenancy/wallet/{wallet_id}/remove: + post: + responses: + '200': + schema: + $ref: '#/definitions/MultitenantModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RemoveWalletRequest' + - in: path + name: wallet_id + type: string + description: Subwallet identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - multitenancy + summary: Remove a subwallet + produces: + - application/json + /multitenancy/wallet/{wallet_id}/token: + post: + responses: + '200': + schema: + $ref: '#/definitions/CreateWalletTokenResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CreateWalletTokenRequest' + - in: path + name: wallet_id + required: true + type: string + tags: + - multitenancy + summary: Get auth token for a subwallet (innkeeper plugin override) + produces: + - application/json + /multitenancy/wallets: + get: + responses: + '200': + schema: + $ref: '#/definitions/WalletList' + description: '' + parameters: + - in: query + name: limit + type: integer + default: 100 + description: Number of results to return + example: 50 + required: false + - in: query + name: offset + type: integer + default: 0 + description: Offset for pagination + example: 0 + required: false + - in: query + name: wallet_name + type: string + description: Wallet name + example: MyNewWallet + required: false + tags: + - multitenancy + summary: Query subwallets + produces: + - application/json + /oca: + get: + responses: + '200': + schema: + $ref: '#/definitions/OcaRecordList' + description: '' + parameters: + - in: query + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Cred Def identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: false + tags: + - oca + produces: + - application/json + post: + responses: + '200': + schema: + $ref: '#/definitions/OcaRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/AddOcaRecordRequest' + tags: + - oca + summary: Add OCA Record + produces: + - application/json + /oca/{oca_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/OcaRecord' + description: '' + parameters: + - in: path + name: oca_id + type: string + description: OCA Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - oca + summary: Read OCA Record + produces: + - application/json + put: + responses: + '200': + schema: + $ref: '#/definitions/OcaRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/OcaRecord' + - in: path + name: oca_id + type: string + description: OCA Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - oca + summary: Update OCA Record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/OcaRecordOperationResponse' + description: '' + parameters: + - in: path + name: oca_id + type: string + description: OCA Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - oca + summary: Delete OCA Record + produces: + - application/json + /out-of-band/create-invitation: + post: + responses: + '200': + schema: + $ref: '#/definitions/InvitationRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/InvitationCreateRequest' + - in: query + name: auto_accept + type: boolean + description: Auto-accept connection (defaults to configuration) + required: false + - in: query + name: create_unique_did + type: boolean + description: Create unique DID for this invitation (default false) + required: false + - in: query + name: multi_use + type: boolean + description: Create invitation for multiple use (default false) + required: false + tags: + - out-of-band + summary: Create a new connection invitation + produces: + - application/json + /out-of-band/invitations/{invi_msg_id}: + delete: + responses: + '200': + schema: + $ref: '#/definitions/InvitationRecordResponse' + description: '' + parameters: + - in: path + name: invi_msg_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Invitation Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - out-of-band + summary: Delete records associated with invitation + produces: + - application/json + /out-of-band/receive-invitation: + post: + responses: + '200': + schema: + $ref: '#/definitions/OobRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/InvitationMessage' + - in: query + name: alias + type: string + description: Alias for connection + example: Barry + required: false + - in: query + name: auto_accept + type: boolean + description: Auto-accept connection (defaults to configuration) + required: false + - in: query + name: mediation_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: use_existing_connection + type: boolean + description: Use an existing connection, if possible + required: false + tags: + - out-of-band + summary: Receive a new connection invitation + produces: + - application/json + /plugins: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminModules' + description: '' + parameters: [ ] + tags: + - server + summary: Fetch the list of loaded plugins + produces: + - application/json + /present-proof-2.0/create-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20PresCreateRequestRequest' + tags: + - present-proof v2.0 + summary: Creates a presentation request not bound to any proposal or connection + produces: + - application/json + /present-proof-2.0/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecordList' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: limit + type: integer + default: 100 + description: Number of results to return + example: 50 + required: false + - in: query + name: offset + type: integer + default: 0 + description: Offset for pagination + example: 0 + required: false + - in: query + name: role + type: string + enum: + - prover + - verifier + description: Role assigned in presentation exchange + required: false + - in: query + name: state + type: string + enum: + - proposal-sent + - proposal-received + - request-sent + - request-received + - presentation-sent + - presentation-received + - done + - abandoned + description: Presentation exchange state + required: false + - in: query + name: thread_id + type: string + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - present-proof v2.0 + summary: Fetch all present-proof exchange records + produces: + - application/json + /present-proof-2.0/records/{pres_ex_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v2.0 + summary: Fetch a single presentation exchange record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/V20PresentProofModuleResponse' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v2.0 + summary: Remove an existing presentation exchange record + produces: + - application/json + /present-proof-2.0/records/{pres_ex_id}/credentials: + get: + responses: + '200': + schema: + type: array + items: + $ref: '#/definitions/IndyCredPrecis' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: count + type: string + pattern: ^[1-9][0-9]*$ + description: Maximum number to retrieve + example: '1' + required: false + - in: query + name: extra_query + type: string + pattern: ^{\s*".*?"\s*:\s*{.*?}\s*(,\s*".*?"\s*:\s*{.*?}\s*)*\s*}$ + description: (JSON) object mapping referents to extra WQL queries + example: '{"0_drink_uuid": {"attr::drink::value": "martini"}}' + required: false + - in: query + name: referent + type: string + description: Proof request referents of interest, comma-separated + example: 1_name_uuid,2_score_uuid + required: false + - in: query + name: start + type: string + pattern: ^[0-9]*$ + description: Start index + example: '0' + required: false + tags: + - present-proof v2.0 + summary: Fetch credentials from wallet for presentation request + produces: + - application/json + /present-proof-2.0/records/{pres_ex_id}/problem-report: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresentProofModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20PresProblemReportRequest' + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v2.0 + summary: Send a problem report for presentation exchange + produces: + - application/json + /present-proof-2.0/records/{pres_ex_id}/send-presentation: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20PresSpecByFormatRequest' + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v2.0 + summary: Sends a proof presentation + produces: + - application/json + /present-proof-2.0/records/{pres_ex_id}/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20PresentationSendRequestToProposal' + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v2.0 + summary: Sends a presentation request in reference to a proposal + produces: + - application/json + /present-proof-2.0/records/{pres_ex_id}/verify-presentation: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v2.0 + summary: Verify a received presentation + produces: + - application/json + /present-proof-2.0/send-proposal: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20PresProposalRequest' + tags: + - present-proof v2.0 + summary: Sends a presentation proposal + produces: + - application/json + /present-proof-2.0/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V20PresExRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V20PresSendRequestRequest' + tags: + - present-proof v2.0 + summary: Sends a free presentation request not bound to any proposal + produces: + - application/json + /present-proof/create-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10PresentationCreateRequestRequest' + tags: + - present-proof v1.0 + summary: Creates a presentation request not bound to any proposal or connection + deprecated: true + produces: + - application/json + /present-proof/records: + get: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchangeList' + description: '' + parameters: + - in: query + name: connection_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: limit + type: integer + default: 100 + description: Number of results to return + example: 50 + required: false + - in: query + name: offset + type: integer + default: 0 + description: Offset for pagination + example: 0 + required: false + - in: query + name: role + type: string + enum: + - prover + - verifier + description: Role assigned in presentation exchange + required: false + - in: query + name: state + type: string + enum: + - proposal_sent + - proposal_received + - request_sent + - request_received + - presentation_sent + - presentation_received + - verified + - presentation_acked + - abandoned + description: Presentation exchange state + required: false + - in: query + name: thread_id + type: string + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + tags: + - present-proof v1.0 + summary: Fetch all present-proof exchange records + deprecated: true + produces: + - application/json + /present-proof/records/{pres_ex_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v1.0 + summary: Fetch a single presentation exchange record + deprecated: true + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentProofModuleResponse' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v1.0 + summary: Remove an existing presentation exchange record + deprecated: true + produces: + - application/json + /present-proof/records/{pres_ex_id}/credentials: + get: + responses: + '200': + schema: + type: array + items: + $ref: '#/definitions/IndyCredPrecis' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: count + type: string + pattern: ^[1-9][0-9]*$ + description: Maximum number to retrieve + example: '1' + required: false + - in: query + name: extra_query + type: string + pattern: ^{\s*".*?"\s*:\s*{.*?}\s*(,\s*".*?"\s*:\s*{.*?}\s*)*\s*}$ + description: (JSON) object mapping referents to extra WQL queries + example: '{"0_drink_uuid": {"attr::drink::value": "martini"}}' + required: false + - in: query + name: referent + type: string + description: Proof request referents of interest, comma-separated + example: 1_name_uuid,2_score_uuid + required: false + - in: query + name: start + type: string + pattern: ^[0-9]*$ + description: Start index + example: '0' + required: false + tags: + - present-proof v1.0 + summary: Fetch credentials for a presentation request from wallet + deprecated: true + produces: + - application/json + /present-proof/records/{pres_ex_id}/problem-report: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentProofModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10PresentationProblemReportRequest' + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v1.0 + summary: Send a problem report for presentation exchange + deprecated: true + produces: + - application/json + /present-proof/records/{pres_ex_id}/send-presentation: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10PresentationSendRequest' + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v1.0 + summary: Sends a proof presentation + deprecated: true + produces: + - application/json + /present-proof/records/{pres_ex_id}/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10PresentationSendRequestToProposal' + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v1.0 + summary: Sends a presentation request in reference to a proposal + deprecated: true + produces: + - application/json + /present-proof/records/{pres_ex_id}/verify-presentation: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: path + name: pres_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - present-proof v1.0 + summary: Verify a received presentation + deprecated: true + produces: + - application/json + /present-proof/send-proposal: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10PresentationProposalRequest' + tags: + - present-proof v1.0 + summary: Sends a presentation proposal + deprecated: true + produces: + - application/json + /present-proof/send-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/V10PresentationExchange' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/V10PresentationSendRequestRequest' + tags: + - present-proof v1.0 + summary: Sends a free presentation request not bound to any proposal + deprecated: true + produces: + - application/json + /resolver/resolve/{did}: + get: + responses: + '200': + schema: + $ref: '#/definitions/ResolutionResult' + description: '' + parameters: + - in: path + name: did + type: string + pattern: ^did:([a-z0-9]+):((?:[a-zA-Z0-9._%-]*:)*[a-zA-Z0-9._%-]+)$ + description: DID + example: did:ted:WgWxqztrNooG92RXvxSTWv + required: true + tags: + - resolver + summary: Retrieve doc for requested did + produces: + - application/json + /revocation/active-registry/{cred_def_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResult' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: true + tags: + - revocation + summary: Get current active revocation registry by credential definition id + produces: + - application/json + /revocation/active-registry/{cred_def_id}/rotate: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevRegsCreated' + description: '' + parameters: + - in: path + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: true + tags: + - revocation + summary: Rotate revocation registry + produces: + - application/json + /revocation/clear-pending-revocations: + post: + responses: + '200': + schema: + $ref: '#/definitions/PublishRevocations' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ClearPendingRevocationsRequest' + tags: + - revocation + summary: Clear pending revocations + produces: + - application/json + /revocation/create-registry: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RevRegCreateRequest' + tags: + - revocation + summary: Creates a new revocation registry + produces: + - application/json + /revocation/credential-record: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevRecordResult' + description: '' + parameters: + - in: query + name: cred_ex_id + type: string + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: cred_rev_id + type: string + pattern: ^[1-9][0-9]*$ + description: Credential revocation identifier + example: '12345' + required: false + - in: query + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: false + tags: + - revocation + summary: Get credential revocation status + produces: + - application/json + /revocation/publish-revocations: + post: + responses: + '200': + schema: + $ref: '#/definitions/TxnOrPublishRevocationsResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/PublishRevocations' + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - revocation + summary: Publish pending revocations to ledger + produces: + - application/json + /revocation/registries/created: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegsCreated' + description: '' + parameters: + - in: query + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: false + - in: query + name: state + type: string + enum: + - init + - generated + - posted + - active + - full + - decommissioned + description: Revocation registry state + required: false + tags: + - revocation + summary: Search for matching revocation registries that current agent created + produces: + - application/json + /revocation/registry/delete-tails-file: + delete: + responses: + '200': + schema: + $ref: '#/definitions/TailsDeleteResponse' + description: '' + parameters: + - in: query + name: cred_def_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + required: false + - in: query + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: false + tags: + - revocation + summary: Delete the tail files + produces: + - application/json + /revocation/registry/{rev_reg_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Get revocation registry by revocation registry id + produces: + - application/json + patch: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RevRegUpdateTailsFileUri' + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Update revocation registry with new public URI to its tails file + produces: + - application/json + /revocation/registry/{rev_reg_id}/definition: + post: + responses: + '200': + schema: + $ref: '#/definitions/TxnOrRevRegResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - revocation + summary: Send revocation registry definition to ledger + produces: + - application/json + /revocation/registry/{rev_reg_id}/entry: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - revocation + summary: Send revocation registry entry to ledger + produces: + - application/json + /revocation/registry/{rev_reg_id}/fix-revocation-entry-state: + put: + responses: + '200': + schema: + $ref: '#/definitions/RevRegWalletUpdatedResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + - in: query + name: apply_ledger_update + type: boolean + description: Apply updated accumulator transaction to ledger + required: true + tags: + - revocation + summary: Fix revocation state in wallet and return number of updated entries + produces: + - application/json + /revocation/registry/{rev_reg_id}/issued: + get: + responses: + '200': + schema: + $ref: '#/definitions/RevRegIssuedResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Get number of credentials issued against revocation registry + produces: + - application/json + /revocation/registry/{rev_reg_id}/issued/details: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevRecordDetailsResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Get details of credentials issued against revocation registry + produces: + - application/json + /revocation/registry/{rev_reg_id}/issued/indy_recs: + get: + responses: + '200': + schema: + $ref: '#/definitions/CredRevIndyRecordsResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Get details of revoked credentials from ledger + produces: + - application/json + /revocation/registry/{rev_reg_id}/set-state: + patch: + responses: + '200': + schema: + $ref: '#/definitions/RevRegResult' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + - in: query + name: state + type: string + enum: + - init + - generated + - posted + - active + - full + description: Revocation registry state to set + required: true + tags: + - revocation + summary: Set revocation registry state manually + produces: + - application/json + /revocation/registry/{rev_reg_id}/tails-file: + put: + responses: + '200': + schema: + $ref: '#/definitions/RevocationModuleResponse' + description: '' + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Upload local tails file to server + produces: + - application/json + get: + responses: + '200': + schema: + type: string + format: binary + description: tails file + parameters: + - in: path + name: rev_reg_id + type: string + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + description: Revocation Registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + required: true + tags: + - revocation + summary: Download tails file + produces: + - application/octet-stream + /revocation/revoke: + post: + responses: + '200': + schema: + $ref: '#/definitions/RevocationModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/RevokeRequest' + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - revocation + summary: Revoke an issued credential + produces: + - application/json + /schema-storage: + get: + responses: + '200': + schema: + $ref: '#/definitions/SchemaStorageList' + description: '' + parameters: [ ] + tags: + - schema-storage + produces: + - application/json + post: + responses: + '200': + schema: + $ref: '#/definitions/SchemaStorageRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SchemaStorageAdd' + tags: + - schema-storage + produces: + - application/json + /schema-storage/sync-created: + post: + responses: + '200': + schema: + $ref: '#/definitions/SchemaStorageList' + description: '' + parameters: [ ] + tags: + - schema-storage + produces: + - application/json + /schema-storage/{schema_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/SchemaStorageRecord' + description: '' + parameters: + - in: path + name: schema_id + type: string + description: Schema identifier + required: true + tags: + - schema-storage + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/SchemaStorageOperationResponse' + description: '' + parameters: + - in: path + name: schema_id + type: string + description: Schema identifier + required: true + tags: + - schema-storage + produces: + - application/json + /schemas: + post: + responses: + '200': + schema: + $ref: '#/definitions/TxnOrSchemaSendResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SchemaSendRequest' + - in: query + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - schema + summary: Sends a schema to the ledger + produces: + - application/json + /schemas/created: + get: + responses: + '200': + schema: + $ref: '#/definitions/SchemasCreatedResult' + description: '' + parameters: + - in: query + name: schema_id + type: string + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + required: false + - in: query + name: schema_issuer_did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: schema_name + type: string + description: Schema name + example: membership + required: false + - in: query + name: schema_version + type: string + pattern: ^[0-9.]+$ + description: Schema version + example: '1.0' + required: false + tags: + - schema + summary: Search for matching schema that agent originated + produces: + - application/json + /schemas/{schema_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/SchemaGetResult' + description: '' + parameters: + - in: path + name: schema_id + type: string + pattern: ^[1-9][0-9]*|[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + required: true + tags: + - schema + summary: Gets a schema from the ledger + produces: + - application/json + /schemas/{schema_id}/write_record: + post: + responses: + '200': + schema: + $ref: '#/definitions/SchemaGetResult' + description: '' + parameters: + - in: path + name: schema_id + type: string + pattern: ^[1-9][0-9]*|[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + required: true + tags: + - schema + summary: Writes a schema non-secret record to the wallet + produces: + - application/json + /settings: + put: + responses: + '200': + schema: + $ref: '#/definitions/ProfileSettings' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/UpdateProfileSettings' + tags: + - settings + summary: Update configurable settings associated with the profile. + produces: + - application/json + get: + responses: + '200': + schema: + $ref: '#/definitions/ProfileSettings' + description: '' + parameters: [ ] + tags: + - settings + summary: Get the configurable settings associated with the profile. + produces: + - application/json + /shutdown: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminShutdown' + description: '' + parameters: [ ] + tags: + - server + summary: Shut down server + produces: + - application/json + /status: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminStatus' + description: '' + parameters: [ ] + tags: + - server + summary: Fetch the server status + produces: + - application/json + /status/config: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminConfig' + description: '' + parameters: [ ] + tags: + - server + summary: Fetch the server configuration + produces: + - application/json + /status/live: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminStatusLiveliness' + description: '' + parameters: [ ] + tags: + - server + summary: Liveliness check + produces: + - application/json + /status/ready: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminStatusReadiness' + description: '' + parameters: [ ] + tags: + - server + summary: Readiness check + produces: + - application/json + /status/reset: + post: + responses: + '200': + schema: + $ref: '#/definitions/AdminReset' + description: '' + parameters: [ ] + tags: + - server + summary: Reset statistics + produces: + - application/json + /tenant: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: [ ] + tags: + - traction-tenant + produces: + - application/json + /tenant/authentications/api: + post: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationsApiResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TenantApiKeyRequest' + tags: + - traction-tenant + summary: Create API Key Record + produces: + - application/json + /tenant/authentications/api/: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationApiList' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: List tenant API Key Records + produces: + - application/json + /tenant/authentications/api/{tenant_authentication_api_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationApiRecord' + description: '' + parameters: + - in: path + name: tenant_authentication_api_id + type: string + description: Tenant authentication api key identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-tenant + summary: Read API Key Record + produces: + - application/json + delete: + responses: + '200': + schema: + $ref: '#/definitions/TenantAuthenticationApiOperationResponse' + description: '' + parameters: + - in: path + name: tenant_authentication_api_id + type: string + description: Tenant authentication api key identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - traction-tenant + summary: Delete API Key + produces: + - application/json + /tenant/config: + get: + responses: + '200': + schema: + $ref: '#/definitions/TenantConfig' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: Get tenant setting + produces: + - application/json + /tenant/config/set-ledger-id: + put: + responses: + '200': + schema: + $ref: '#/definitions/TenantLedgerIdConfig' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/TenantLedgerIdConfig' + tags: + - traction-tenant + summary: Set tenant curr_ledger_id setting + produces: + - application/json + /tenant/contact_email: + put: + responses: + '200': + schema: + $ref: '#/definitions/UpdateContactRequest' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/UpdateContactRequest' + tags: + - traction-tenant + summary: Update tenant email + produces: + - application/json + /tenant/endorser-connection: + post: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: Set connection with configured endorser + produces: + - application/json + get: + responses: + '200': + schema: + $ref: '#/definitions/ConnRecord' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: Get connection with configured endorser + produces: + - application/json + /tenant/endorser-info: + get: + responses: + '200': + schema: + $ref: '#/definitions/EndorserInfo' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: Get configured endorser information + produces: + - application/json + /tenant/hard: + delete: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: [ ] + tags: + - traction-tenant + produces: + - application/json + /tenant/server/status/config: + get: + responses: + '200': + schema: + $ref: '#/definitions/AdminConfig' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: Fetch the server configuration + produces: + - application/json + /tenant/soft: + delete: + responses: + '200': + schema: + $ref: '#/definitions/TenantRecord' + description: '' + parameters: [ ] + tags: + - traction-tenant + produces: + - application/json + /tenant/wallet: + get: + responses: + '200': + schema: + $ref: '#/definitions/WalletRecord' + description: '' + parameters: [ ] + tags: + - traction-tenant + summary: Get a tenant subwallet + produces: + - application/json + put: + responses: + '200': + schema: + $ref: '#/definitions/WalletRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CustomUpdateWalletRequest' + tags: + - traction-tenant + summary: Update tenant wallet + produces: + - application/json + /transaction/{tran_id}/resend: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: path + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - endorse-transaction + summary: For Author to resend a particular transaction request + produces: + - application/json + /transactions: + get: + responses: + '200': + schema: + $ref: '#/definitions/TransactionList' + description: '' + parameters: [ ] + tags: + - endorse-transaction + summary: Query transactions + produces: + - application/json + /transactions/create-request: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/Date' + - in: query + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - endorse-transaction + summary: For author to send a transaction request + produces: + - application/json + /transactions/{conn_id}/set-endorser-info: + post: + responses: + '200': + schema: + $ref: '#/definitions/EndorserInfo' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: endorser_did + type: string + description: Endorser DID + required: true + - in: query + name: endorser_name + type: string + description: Endorser Name + required: false + tags: + - endorse-transaction + summary: Set Endorser Info + produces: + - application/json + /transactions/{conn_id}/set-endorser-role: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionJobs' + description: '' + parameters: + - in: path + name: conn_id + type: string + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: transaction_my_job + type: string + enum: + - TRANSACTION_AUTHOR + - TRANSACTION_ENDORSER + - reset + description: Transaction related jobs + required: false + tags: + - endorse-transaction + summary: Set transaction jobs + produces: + - application/json + /transactions/{tran_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: path + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - endorse-transaction + summary: Fetch a single transaction record + produces: + - application/json + /transactions/{tran_id}/cancel: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: path + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - endorse-transaction + summary: For Author to cancel a particular transaction request + produces: + - application/json + /transactions/{tran_id}/endorse: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: path + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + - in: query + name: endorser_did + type: string + description: Endorser DID + required: false + tags: + - endorse-transaction + summary: For Endorser to endorse a particular transaction record + produces: + - application/json + /transactions/{tran_id}/refuse: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: path + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - endorse-transaction + summary: For Endorser to refuse a particular transaction record + produces: + - application/json + /transactions/{tran_id}/write: + post: + responses: + '200': + schema: + $ref: '#/definitions/TransactionRecord' + description: '' + parameters: + - in: path + name: tran_id + type: string + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: true + tags: + - endorse-transaction + summary: For Author / Endorser to write an endorsed transaction to the ledger + produces: + - application/json + /vc/credentials: + get: + responses: + '200': + schema: + $ref: '#/definitions/ListCredentialsResponse' + description: '' + parameters: [ ] + tags: + - vc-api + summary: List credentials + produces: + - application/json + /vc/credentials/issue: + post: + responses: + '200': + schema: + $ref: '#/definitions/IssueCredentialResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/IssueCredentialRequest' + tags: + - vc-api + summary: Issue a credential + produces: + - application/json + /vc/credentials/store: + post: + responses: + '200': + schema: + $ref: '#/definitions/StoreCredentialResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/StoreCredentialRequest' + tags: + - vc-api + summary: Store a credential + produces: + - application/json + /vc/credentials/verify: + post: + responses: + '200': + schema: + $ref: '#/definitions/VerifyCredentialResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/VerifyCredentialRequest' + tags: + - vc-api + summary: Verify a credential + produces: + - application/json + /vc/credentials/{credential_id}: + get: + responses: + '200': + schema: + $ref: '#/definitions/FetchCredentialResponse' + description: '' + parameters: + - in: path + name: credential_id + required: true + type: string + tags: + - vc-api + summary: Fetch credential by ID + produces: + - application/json + /vc/di/add-proof: + post: + responses: + '200': + schema: + $ref: '#/definitions/AddProofResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/AddProof' + tags: + - vc + summary: Add a DataIntegrityProof to a document. + produces: + - application/json + /vc/di/verify: + post: + responses: + '200': + schema: + $ref: '#/definitions/VerifyDiResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/VerifyDiRequest' + tags: + - vc + summary: Verify a document secured with a data integrity proof. + produces: + - application/json + /vc/presentations/prove: + post: + responses: + '200': + schema: + $ref: '#/definitions/ProvePresentationResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/ProvePresentationRequest' + tags: + - vc-api + summary: Prove a presentation + produces: + - application/json + /vc/presentations/verify: + post: + responses: + '200': + schema: + $ref: '#/definitions/VerifyPresentationResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/VerifyPresentationRequest' + tags: + - vc-api + summary: Verify a Presentation + produces: + - application/json + /wallet/did: + get: + responses: + '200': + schema: + $ref: '#/definitions/DIDList' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + required: false + - in: query + name: key_type + type: string + enum: + - ed25519 + - bls12381g2 + - p256 + example: ed25519 + description: Key type to query for. + required: false + - in: query + name: method + type: string + example: key + description: DID method to query for. e.g. sov to only fetch indy/sov DIDs + required: false + - in: query + name: posture + type: string + enum: + - public + - posted + - wallet_only + description: Whether DID is current public DID, posted to ledger but current public DID, or local to the wallet + example: wallet_only + required: false + - in: query + name: verkey + type: string + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + description: Verification key of interest + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + required: false + tags: + - wallet + summary: List wallet DIDs + produces: + - application/json + /wallet/did/create: + post: + responses: + '200': + schema: + $ref: '#/definitions/DIDResult' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DIDCreate' + tags: + - wallet + summary: Create a local DID + produces: + - application/json + /wallet/did/local/rotate-keypair: + patch: + responses: + '200': + schema: + $ref: '#/definitions/WalletModuleResponse' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + required: true + tags: + - wallet + summary: Rotate keypair for a DID not posted to the ledger + produces: + - application/json + /wallet/did/public: + get: + responses: + '200': + schema: + $ref: '#/definitions/DIDResult' + description: '' + parameters: [ ] + tags: + - wallet + summary: Fetch the current public DID + produces: + - application/json + post: + responses: + '200': + schema: + $ref: '#/definitions/DIDResult' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + required: true + - in: query + name: conn_id + type: string + description: Connection identifier + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + - in: query + name: mediation_id + type: string + description: Mediation identifier + required: false + tags: + - wallet + summary: Assign the current public DID + produces: + - application/json + /wallet/get-did-endpoint: + get: + responses: + '200': + schema: + $ref: '#/definitions/DIDEndpoint' + description: '' + parameters: + - in: query + name: did + type: string + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + required: true + tags: + - wallet + summary: Query DID endpoint in wallet + produces: + - application/json + /wallet/jwt/sign: + post: + responses: + '200': + schema: + $ref: '#/definitions/WalletModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/JWSCreate' + tags: + - wallet + summary: Create a jws using did keys with a given payload + produces: + - application/json + /wallet/jwt/verify: + post: + responses: + '200': + schema: + $ref: '#/definitions/JWSVerifyResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/JWSVerify' + tags: + - wallet + summary: Verify a jws using did keys with a given JWS + produces: + - application/json + /wallet/keys: + post: + responses: + '200': + schema: + $ref: '#/definitions/CreateKeyResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/CreateKeyRequest' + tags: + - wallet + summary: Create a key pair + produces: + - application/json + put: + responses: + '200': + schema: + $ref: '#/definitions/UpdateKeyResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/UpdateKeyRequest' + tags: + - wallet + summary: Update a key pair's kid + produces: + - application/json + /wallet/keys/{multikey}: + get: + responses: + '200': + schema: + $ref: '#/definitions/FetchKeyResponse' + description: '' + parameters: + - in: path + name: multikey + required: true + type: string + tags: + - wallet + summary: Fetch key info. + produces: + - application/json + /wallet/sd-jwt/sign: + post: + responses: + '200': + schema: + $ref: '#/definitions/WalletModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SDJWSCreate' + tags: + - wallet + summary: Create an sd-jws using did keys with a given payload + produces: + - application/json + /wallet/sd-jwt/verify: + post: + responses: + '200': + schema: + $ref: '#/definitions/SDJWSVerifyResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/SDJWSVerify' + tags: + - wallet + summary: Verify an sd-jws using did keys with a given SD-JWS with optional key binding + produces: + - application/json + /wallet/set-did-endpoint: + post: + responses: + '200': + schema: + $ref: '#/definitions/WalletModuleResponse' + description: '' + parameters: + - in: body + required: false + name: body + schema: + $ref: '#/definitions/DIDEndpointWithType' + - in: query + name: conn_id + type: string + description: Connection identifier + required: false + - in: query + name: create_transaction_for_endorser + type: boolean + description: Create Transaction For Endorser's signature + required: false + tags: + - wallet + summary: Update endpoint in wallet and on ledger if posted to it + produces: + - application/json +info: + title: Traction Agent + version: v1.2.2 +swagger: '2.0' +definitions: + AMLRecord: + properties: + aml: + additionalProperties: + type: string + type: object + amlContext: + type: string + version: + type: string + type: object + ActionMenuFetchResult: + properties: + result: + allOf: + - $ref: '#/definitions/Menu' + description: Action menu + type: object + ActionMenuModulesResult: + properties: { } + type: object + AddOcaRecordRequest: + properties: + bundle: + additionalProperties: { } + description: OCA Bundle + type: object + cred_def_id: + description: Cred Def identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + url: + description: (Public) Url for OCA Bundle + type: string + type: object + AddProof: + properties: + document: + additionalProperties: { } + example: + hello: world + type: object + options: + allOf: + - $ref: '#/definitions/DataIntegrityProofOptions' + example: + cryptosuite: eddsa-jcs-2022 + proofPurpose: assertionMethod + type: DataIntegrityProof + verificationMethod: did:web:example.com#key-01 + required: + - document + type: object + AddProofResponse: + properties: + secured_document: + additionalProperties: { } + example: + hello: world + type: object + required: + - secured_document + type: object + AdminConfig: + properties: + config: + additionalProperties: { } + description: Configuration settings + type: object + required: + - config + type: object + AdminMediationDeny: + properties: { } + type: object + AdminModules: + properties: + result: + description: List of admin modules + items: + description: admin module + type: string + type: array + type: object + AdminReset: + properties: { } + type: object + AdminShutdown: + properties: { } + type: object + AdminStatus: + properties: + conductor: + additionalProperties: { } + description: Conductor statistics + type: object + label: + description: Default label + type: string + x-nullable: true + timing: + additionalProperties: { } + description: Timing results + type: object + version: + description: Version code + type: string + type: object + AdminStatusLiveliness: + properties: + alive: + description: Liveliness status + example: true + type: boolean + type: object + AdminStatusReadiness: + properties: + ready: + description: Readiness status + example: true + type: boolean + type: object + AnonCredsSchema: + properties: + attrNames: + description: Schema attribute names + items: + description: Attribute name + example: score + type: string + type: array + issuerId: + description: Issuer Identifier of the credential definition or schema + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + name: + description: Schema name + example: Example schema + type: string + version: + description: Schema version + example: '1.0' + type: string + required: + - attrNames + - issuerId + - name + - version + type: object + AnoncredsPresentationReqAttrSpec: + properties: + name: + description: Attribute name + example: favouriteDrink + type: string + names: + description: Attribute name group + items: + example: age + type: string + type: array + non_revoked: + $ref: '#/definitions/AnoncredsPresentationReqAttrSpecNonRevoked' + x-nullable: true + restrictions: + description: 'If present, credential must satisfy one of given restrictions: specify schema_id, schema_issuer_did, schema_name, schema_version, issuer_did, cred_def_id, and/or attr::::value where represents a credential attribute name' + items: + additionalProperties: + example: did:(method):3:CL:20:tag + type: string + type: object + type: array + type: object + AnoncredsPresentationReqAttrSpecNonRevoked: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + AnoncredsPresentationReqPredSpec: + properties: + name: + description: Attribute name + example: index + type: string + non_revoked: + $ref: '#/definitions/AnoncredsPresentationReqPredSpecNonRevoked' + x-nullable: true + p_type: + description: Predicate type ('<', '<=', '>=', or '>') + enum: + - < + - <= + - '>=' + - '>' + example: '>=' + type: string + p_value: + description: Threshold value + type: integer + restrictions: + description: 'If present, credential must satisfy one of given restrictions: specify schema_id, schema_issuer_did, schema_name, schema_version, issuer_did, cred_def_id, and/or attr::::value where represents a credential attribute name' + items: + additionalProperties: + example: did:(method):3:CL:20:tag + type: string + type: object + type: array + required: + - name + - p_type + - p_value + type: object + AnoncredsPresentationReqPredSpecNonRevoked: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + AnoncredsPresentationRequest: + properties: + name: + description: Proof request name + example: Proof request + type: string + non_revoked: + $ref: '#/definitions/AnoncredsPresentationRequestNonRevoked' + x-nullable: true + nonce: + description: Nonce + example: '1' + pattern: ^[1-9][0-9]*$ + type: string + requested_attributes: + additionalProperties: + $ref: '#/definitions/AnoncredsPresentationReqAttrSpec' + description: Requested attribute specifications of proof request + type: object + requested_predicates: + additionalProperties: + $ref: '#/definitions/AnoncredsPresentationReqPredSpec' + description: Requested predicate specifications of proof request + type: object + version: + description: Proof request version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + required: + - requested_attributes + - requested_predicates + type: object + AnoncredsPresentationRequestNonRevoked: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + AttachDecorator: + properties: + '@id': + description: Attachment identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + byte_count: + description: Byte count of data included by reference + example: 1234 + type: integer + data: + $ref: '#/definitions/AttachDecoratorData' + description: + description: Human-readable description of content + example: view from doorway, facing east, with lights off + type: string + filename: + description: File name + example: IMG1092348.png + type: string + lastmod_time: + description: Hint regarding last modification datetime, in ISO-8601 format + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + mime-type: + description: MIME type + example: image/png + type: string + required: + - data + type: object + AttachDecoratorData: + properties: + base64: + description: Base64-encoded data + example: ey4uLn0= + pattern: ^[a-zA-Z0-9+/]*={0,2}$ + type: string + json: + description: JSON-serialized data + example: '{"sample": "content"}' + jws: + allOf: + - $ref: '#/definitions/AttachDecoratorDataJWS' + description: Detached Java Web Signature + links: + description: List of hypertext links to data + items: + example: https://link.to/data + type: string + type: array + sha256: + description: SHA256 hash (binhex encoded) of content + example: 617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb + pattern: ^[a-fA-F0-9+/]{64}$ + type: string + type: object + AttachDecoratorData1JWS: + properties: + header: + $ref: '#/definitions/AttachDecoratorDataJWSHeader' + protected: + description: protected JWS header + example: ey4uLn0 + pattern: ^[-_a-zA-Z0-9]*$ + type: string + signature: + description: signature + example: ey4uLn0 + pattern: ^[-_a-zA-Z0-9]*$ + type: string + required: + - header + - signature + type: object + AttachDecoratorDataJWS: + properties: + header: + $ref: '#/definitions/AttachDecoratorDataJWSHeader' + protected: + description: protected JWS header + example: ey4uLn0 + pattern: ^[-_a-zA-Z0-9]*$ + type: string + signature: + description: signature + example: ey4uLn0 + pattern: ^[-_a-zA-Z0-9]*$ + type: string + signatures: + description: List of signatures + items: + $ref: '#/definitions/AttachDecoratorData1JWS' + type: array + type: object + AttachDecoratorDataJWSHeader: + properties: + kid: + description: Key identifier, in W3C did:key or DID URL format + example: did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4 + pattern: ^did:(?:key:z[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+|sov:[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}(;.*)?(\?.*)?#.+)$ + type: string + required: + - kid + type: object + AttachmentDef: + properties: + id: + description: Attachment identifier + example: attachment-0 + type: string + type: + description: Attachment type + enum: + - credential-offer + - present-proof + example: present-proof + type: string + type: object + AttributeMimeTypesResult: + properties: + results: + additionalProperties: + description: MIME type + type: string + type: object + x-nullable: true + type: object + BasicMessageList: + properties: + results: + description: List of basic message records + items: + $ref: '#/definitions/BasicMessageRecord' + type: array + type: object + BasicMessageModuleResponse: + properties: { } + type: object + BasicMessageRecord: + properties: + connection_id: + type: string + content: + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + locale: + type: string + message_id: + type: string + sent_time: + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + Checkin: + properties: + reservation_pwd: + description: The reservation password + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - reservation_pwd + type: object + CheckinResponse: + properties: + token: + description: Authorization token to authenticate wallet requests + example: eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + type: string + wallet_id: + description: Subwallet identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + wallet_key: + description: Master key used for key derivation. + example: MySecretKey123 + type: string + required: + - wallet_id + type: object + ClaimFormat: + properties: + di_vc: + additionalProperties: { } + type: object + jwt: + additionalProperties: { } + type: object + jwt_vc: + additionalProperties: { } + type: object + jwt_vp: + additionalProperties: { } + type: object + ldp: + additionalProperties: { } + type: object + ldp_vc: + additionalProperties: { } + type: object + ldp_vp: + additionalProperties: { } + type: object + type: object + ClearPendingRevocationsRequest: + properties: + purge: + additionalProperties: + items: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + type: array + description: 'Credential revocation ids by revocation registry id: omit for all, specify null or empty list for all pending per revocation registry' + type: object + type: object + ConfigurableWriteLedgers: + properties: + write_ledgers: + description: List of configurable write ledgers identifiers + items: + description: Ledgers identifiers + type: string + type: array + type: object + ConnRecord: + properties: + accept: + description: 'Connection acceptance: manual or auto' + enum: + - manual + - auto + example: auto + type: string + alias: + description: Optional alias to apply to connection for later use + example: Bob, providing quotes + type: string + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + connection_protocol: + description: Connection protocol used + enum: + - connections/1.0 + - didexchange/1.0 + - didexchange/1.1 + example: connections/1.0 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + error_msg: + description: Error message + example: No DIDDoc provided; cannot connect to public DID + type: string + inbound_connection_id: + description: Inbound routing connection id to use + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + invitation_key: + description: Public key for connection + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + invitation_mode: + description: Invitation mode + enum: + - once + - multi + - static + example: once + type: string + invitation_msg_id: + description: ID of out-of-band invitation message + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + my_did: + description: Our DID for connection + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + request_id: + description: Connection request identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + rfc23_state: + description: State per RFC 23 + example: invitation-sent + readOnly: true + type: string + state: + description: Current record state + example: active + type: string + their_did: + description: Their DID for connection + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + their_label: + description: Their label for connection + example: Bob + type: string + their_public_did: + description: Other agent's public DID for connection + example: 2cpBmR3FqGKWi5EyUbpRY8 + type: string + their_role: + description: Their role in the connection protocol + enum: + - invitee + - requester + - inviter + - responder + example: requester + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - connection_id + type: object + ConnectionInvitation: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + did: + description: DID for connection invitation + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + imageUrl: + description: Optional image URL for connection invitation + example: http://192.168.56.101/img/logo.jpg + format: url + type: string + x-nullable: true + label: + description: Optional label for connection invitation + example: Bob + type: string + recipientKeys: + description: List of recipient keys + items: + description: Recipient public key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + routingKeys: + description: List of routing keys + items: + description: Routing key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + serviceEndpoint: + description: Service endpoint at which to reach this agent + example: http://192.168.56.101:8020 + type: string + type: object + ConnectionList: + properties: + results: + description: List of connection records + items: + $ref: '#/definitions/ConnRecord' + type: array + required: + - results + type: object + ConnectionMetadata: + properties: + results: + additionalProperties: { } + description: Dictionary of metadata associated with connection. + type: object + type: object + ConnectionMetadataSetRequest: + properties: + metadata: + additionalProperties: { } + description: Dictionary of metadata to set for connection. + type: object + required: + - metadata + type: object + ConnectionModuleResponse: + properties: { } + type: object + ConnectionStaticRequest: + properties: + alias: + description: Alias to assign to this connection + type: string + my_did: + description: Local DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + my_seed: + description: Seed to use for the local DID + type: string + their_did: + description: Remote DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + their_endpoint: + description: URL endpoint for other party + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + their_label: + description: Other party's label for this connection + type: string + their_seed: + description: Seed to use for the remote DID + type: string + their_verkey: + description: Remote verification key + type: string + type: object + ConnectionStaticResult: + properties: + my_did: + description: Local DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + my_endpoint: + description: My URL endpoint + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + my_verkey: + description: My verification key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + record: + $ref: '#/definitions/ConnRecord' + their_did: + description: Remote DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + their_verkey: + description: Remote verification key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + required: + - my_did + - my_endpoint + - my_verkey + - record + - their_did + - their_verkey + type: object + Constraints: + properties: + fields: + items: + $ref: '#/definitions/DIFField' + type: array + is_holder: + items: + $ref: '#/definitions/DIFHolder' + type: array + limit_disclosure: + description: LimitDisclosure + type: string + status_active: + enum: + - required + - allowed + - disallowed + type: string + status_revoked: + enum: + - required + - allowed + - disallowed + type: string + status_suspended: + enum: + - required + - allowed + - disallowed + type: string + subject_is_issuer: + description: SubjectIsIssuer + enum: + - required + - preferred + type: string + type: object + CreateInvitationRequest: + properties: + mediation_id: + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + metadata: + additionalProperties: { } + description: Optional metadata to attach to the connection created with the invitation + type: object + my_label: + description: Optional label for connection invitation + example: Bob + type: string + recipient_keys: + description: List of recipient keys + items: + description: Recipient public key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + routing_keys: + description: List of routing keys + items: + description: Routing key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + service_endpoint: + description: Connection endpoint + example: http://192.168.56.102:8020 + type: string + type: object + CreateKeyRequest: + properties: + alg: + description: Which key algorithm to use. + example: ed25519 + type: string + kid: + description: Optional kid to bind to the keypair, such as a verificationMethod. + example: did:web:example.com#key-01 + type: string + seed: + description: Optional seed to generate the key pair. Must enable insecure wallet mode. + example: '00000000000000000000000000000000' + type: string + type: object + CreateKeyResponse: + properties: + kid: + description: The associated kid + example: did:web:example.com#key-01 + type: string + multikey: + description: The Public Key Multibase format (multikey) + example: z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i + type: string + type: object + CreateWalletResponse: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + key_management_mode: + description: Mode regarding management of wallet key + enum: + - managed + - unmanaged + type: string + settings: + additionalProperties: { } + description: Settings for this wallet. + type: object + state: + description: Current record state + example: active + type: string + token: + description: Authorization token to authenticate wallet requests + example: eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + wallet_id: + description: Wallet record ID + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - key_management_mode + - wallet_id + type: object + CreateWalletTokenRequest: + properties: + wallet_key: + description: Master key used for key derivation. Only required for unmanaged wallets. + example: MySecretKey123 + type: string + type: object + CreateWalletTokenResponse: + properties: + token: + description: Authorization token to authenticate wallet requests + example: eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + type: string + type: object + CredAttrSpec: + properties: + mime-type: + description: 'MIME type: omit for (null) default' + example: image/jpeg + type: string + x-nullable: true + name: + description: Attribute name + example: favourite_drink + type: string + value: + description: 'Attribute value: base64-encode if MIME type is present' + example: martini + type: string + required: + - name + - value + type: object + CredDef: + properties: + issuerId: + description: Issuer Identifier of the credential definition or schema + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + schemaId: + description: Schema identifier + example: did:(method):2:schema_name:1.0 + type: string + tag: + description: The tag value passed in by the Issuer to an AnonCred's Credential Definition create and store implementation. + example: default + type: string + type: + enum: + - CL + type: string + value: + $ref: '#/definitions/CredDefValueSchemaAnoncreds' + type: object + CredDefPostOptions: + properties: + create_transaction_for_endorser: + description: Create transaction for endorser (optional, default false). Use this for agents who don't specify an author role but want to create a transaction for an endorser to sign. + example: false + type: boolean + endorser_connection_id: + description: Connection identifier (optional) (this is an example). You can set this if you know the endorser's connection id you want to use. If not specified then the agent will attempt to find an endorser connection. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + revocation_registry_size: + description: Maximum number of credential revocations per registry + example: 1000 + type: integer + support_revocation: + description: Support credential revocation + type: boolean + type: object + CredDefPostRequest: + properties: + credential_definition: + $ref: '#/definitions/InnerCredDef' + options: + $ref: '#/definitions/CredDefPostOptions' + type: object + CredDefResult: + properties: + credential_definition_metadata: + additionalProperties: { } + type: object + credential_definition_state: + $ref: '#/definitions/CredDefState' + job_id: + type: string + registration_metadata: + additionalProperties: { } + type: object + type: object + CredDefState: + properties: + credential_definition: + allOf: + - $ref: '#/definitions/CredDef' + description: credential definition + credential_definition_id: + description: credential definition id + example: did:(method):3:CL:20:tag + type: string + x-nullable: true + state: + enum: + - finished + - failed + - action + - wait + type: string + type: object + CredDefStorageList: + properties: + results: + description: List of cred def storage records + items: + $ref: '#/definitions/CredDefStorageRecord' + type: array + type: object + CredDefStorageOperationResponse: + properties: + success: + description: True if operation successful, false if otherwise + type: boolean + required: + - success + type: object + CredDefStorageRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_def_id: + description: Cred Def identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + rev_reg_size: + description: Revocation registry size + example: 1000 + maximum: 32768 + minimum: 4 + type: integer + x-nullable: true + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + state: + description: Current record state + example: active + type: string + support_revocation: + description: Revocation supported flag + type: boolean + tag: + description: Credential definition identifier tag + example: default + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - cred_def_id + type: object + CredDefValue: + properties: + primary: + allOf: + - $ref: '#/definitions/CredDefValuePrimary' + description: Primary value for credential definition + revocation: + allOf: + - $ref: '#/definitions/CredDefValueRevocation' + description: Revocation value for credential definition + type: object + CredDefValuePrimary: + properties: + 'n': + example: '0' + pattern: ^[0-9]*$ + type: string + r: + $ref: '#/definitions/Generated' + rctxt: + example: '0' + pattern: ^[0-9]*$ + type: string + s: + example: '0' + pattern: ^[0-9]*$ + type: string + z: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + CredDefValuePrimarySchemaAnoncreds: + properties: + 'n': + example: '0' + pattern: ^[0-9]*$ + type: string + r: + additionalProperties: { } + type: object + rctxt: + example: '0' + pattern: ^[0-9]*$ + type: string + s: + example: '0' + pattern: ^[0-9]*$ + type: string + z: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + CredDefValueRevocation: + properties: + g: + example: 1 1F14F&ECB578F 2 095E45DDF417D + type: string + g_dash: + example: 1 1D64716fCDC00C 1 0C781960FA66E3D3 2 095E45DDF417D + type: string + h: + example: 1 16675DAE54BFAE8 2 095E45DD417D + type: string + h0: + example: 1 21E5EF9476EAF18 2 095E45DDF417D + type: string + h1: + example: 1 236D1D99236090 2 095E45DDF417D + type: string + h2: + example: 1 1C3AE8D1F1E277 2 095E45DDF417D + type: string + h_cap: + example: 1 1B2A32CF3167 1 2490FEBF6EE55 1 0000000000000000 + type: string + htilde: + example: 1 1D8549E8C0F8 2 095E45DDF417D + type: string + pk: + example: 1 142CD5E5A7DC 1 153885BD903312 2 095E45DDF417D + type: string + u: + example: 1 0C430AAB2B4710 1 1CB3A0932EE7E 1 0000000000000000 + type: string + 'y': + example: 1 153558BD903312 2 095E45DDF417D 1 0000000000000000 + type: string + type: object + CredDefValueRevocationSchemaAnoncreds: + properties: + g: + example: 1 1F14F&ECB578F 2 095E45DDF417D + type: string + g_dash: + example: 1 1D64716fCDC00C 1 0C781960FA66E3D3 2 095E45DDF417D + type: string + h: + example: 1 16675DAE54BFAE8 2 095E45DD417D + type: string + h0: + example: 1 21E5EF9476EAF18 2 095E45DDF417D + type: string + h1: + example: 1 236D1D99236090 2 095E45DDF417D + type: string + h2: + example: 1 1C3AE8D1F1E277 2 095E45DDF417D + type: string + h_cap: + example: 1 1B2A32CF3167 1 2490FEBF6EE55 1 0000000000000000 + type: string + htilde: + example: 1 1D8549E8C0F8 2 095E45DDF417D + type: string + pk: + example: 1 142CD5E5A7DC 1 153885BD903312 2 095E45DDF417D + type: string + u: + example: 1 0C430AAB2B4710 1 1CB3A0932EE7E 1 0000000000000000 + type: string + 'y': + example: 1 153558BD903312 2 095E45DDF417D 1 0000000000000000 + type: string + type: object + CredDefValueSchemaAnoncreds: + properties: + primary: + allOf: + - $ref: '#/definitions/CredDefValuePrimarySchemaAnoncreds' + description: Primary value for credential definition + revocation: + allOf: + - $ref: '#/definitions/CredDefValueRevocationSchemaAnoncreds' + description: Revocation value for credential definition + type: object + CredInfoList: + properties: + results: + items: + $ref: '#/definitions/IndyCredInfo' + type: array + type: object + CredRevIndyRecordsResult: + properties: + rev_reg_delta: + additionalProperties: { } + description: Indy revocation registry delta + type: object + type: object + CredRevIndyRecordsResultSchemaAnoncreds: + properties: + rev_reg_delta: + additionalProperties: { } + description: Indy revocation registry delta + type: object + type: object + CredRevRecordDetailsResult: + properties: + results: + items: + $ref: '#/definitions/IssuerCredRevRecord' + type: array + type: object + CredRevRecordDetailsResultSchemaAnoncreds: + properties: + results: + items: + $ref: '#/definitions/IssuerCredRevRecordSchemaAnoncreds' + type: array + type: object + CredRevRecordResult: + properties: + result: + $ref: '#/definitions/IssuerCredRevRecord' + type: object + CredRevRecordResultSchemaAnoncreds: + properties: + result: + $ref: '#/definitions/IssuerCredRevRecordSchemaAnoncreds' + type: object + CredRevokedResult: + properties: + revoked: + description: Whether credential is revoked on the ledger + type: boolean + type: object + Credential: + additionalProperties: true + properties: + '@context': + description: The JSON-LD context of the credential + example: + - https://www.w3.org/2018/credentials/v1 + - https://www.w3.org/2018/credentials/examples/v1 + items: { } + type: array + credentialStatus: + example: + id: https://example.com/credentials/status/3#94567 + statusListCredential: https://example.com/credentials/status/3 + statusListIndex: '94567' + statusPurpose: revocation + type: BitstringStatusListEntry + credentialSubject: + example: + alumniOf: + id: did:example:c276e12ec21ebfeb1f712ebc6f1 + id: did:example:ebfeb1f712ebc6f1c276e12ec21 + expirationDate: + description: The expiration date + example: '2010-01-01T19:23:24Z' + pattern: ^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt ]([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?$ + type: string + id: + description: The ID of the credential + example: http://example.edu/credentials/1872 + pattern: \w+:(\/?\/?)[^\s]+ + type: string + issuanceDate: + description: The issuance date + example: '2010-01-01T19:23:24Z' + pattern: ^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt ]([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?$ + type: string + issuer: + description: The JSON-LD Verifiable Credential Issuer. Either string of object with id field. + example: did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + proof: + allOf: + - $ref: '#/definitions/LinkedDataProof' + description: The proof of the credential + example: + created: '2019-12-11T03:50:55' + jws: eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0JiNjQiXX0..lKJU0Df_keblRKhZAS9Qq6zybm-HqUXNVZ8vgEPNTAjQKBhQDxvXNo7nvtUBb_Eq1Ch6YBKY5qBQ + proofPurpose: assertionMethod + type: Ed25519Signature2018 + verificationMethod: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + type: + description: The JSON-LD type of the credential + example: + - VerifiableCredential + - AlumniCredential + items: + type: string + type: array + required: + - '@context' + - credentialSubject + - issuanceDate + - issuer + - type + type: object + CredentialDefinition: + properties: + id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + schemaId: + description: Schema identifier within credential definition identifier + example: '20' + type: string + tag: + description: Tag within credential definition identifier + example: tag + type: string + type: + default: CL + description: 'Signature type: CL for Camenisch-Lysyanskaya' + example: CL + value: + allOf: + - $ref: '#/definitions/CredDefValue' + description: Credential definition primary and revocation values + ver: + description: Node protocol version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + CredentialDefinitionGetResult: + properties: + credential_definition: + $ref: '#/definitions/CredentialDefinition' + type: object + CredentialDefinitionSendRequest: + properties: + revocation_registry_size: + description: Revocation registry size + example: 1000 + maximum: 32768 + minimum: 4 + type: integer + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + support_revocation: + description: Revocation supported flag + type: boolean + tag: + description: Credential definition identifier tag + example: default + type: string + type: object + CredentialDefinitionSendResult: + properties: + credential_definition_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + required: + - credential_definition_id + type: object + CredentialDefinitionsCreatedResult: + properties: + credential_definition_ids: + items: + description: Credential definition identifiers + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + type: array + type: object + CredentialOffer: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + credential_preview: + $ref: '#/definitions/CredentialPreview' + offers~attach: + items: + $ref: '#/definitions/AttachDecorator' + type: array + required: + - offers~attach + type: object + CredentialPreview: + properties: + '@type': + description: Message type identifier + example: issue-credential/1.0/credential-preview + type: string + attributes: + items: + $ref: '#/definitions/CredAttrSpec' + type: array + required: + - attributes + type: object + CredentialProposal: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + cred_def_id: + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_proposal: + $ref: '#/definitions/CredentialPreview' + issuer_did: + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_id: + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + schema_issuer_did: + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_name: + type: string + schema_version: + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + CredentialStatusOptions: + additionalProperties: true + properties: + type: + description: Credential status method type to use for the credential. Should match status method registered in the Verifiable Credential Extension Registry + example: CredentialStatusList2017 + type: string + required: + - type + type: object + CustomCreateWalletTokenRequest: + properties: + api_key: + description: API key for this wallet + example: 3bd14a1e8fb645ddadf9913c0922ff3b + type: string + wallet_key: + description: Master key used for key derivation. Only required for unmanaged wallets. + example: MySecretKey123 + type: string + type: object + CustomUpdateWalletRequest: + properties: + extra_settings: + additionalProperties: { } + description: Agent config key-value pairs + type: object + image_url: + description: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. + example: https://aries.ca/images/sample.png + type: string + label: + description: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. + example: Alice + type: string + wallet_dispatch_type: + description: 'Webhook target dispatch type for this wallet. default: Dispatch only to webhooks associated with this wallet. base: Dispatch only to webhooks associated with the base wallet. both: Dispatch to both webhook targets.' + enum: + - default + - both + - base + example: default + type: string + wallet_webhook_urls: + description: List of Webhook URLs associated with this subwallet + items: + description: Optional webhook URL to receive webhook messages + example: http://localhost:8022/webhooks + type: string + type: array + type: object + DID: + properties: + did: + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + key_type: + description: Key type associated with the DID + enum: + - ed25519 + - bls12381g2 + - p256 + example: ed25519 + type: string + metadata: + additionalProperties: { } + description: Additional metadata associated with the DID + type: object + method: + description: Did method associated with the DID + example: sov + type: string + posture: + description: Whether DID is current public DID, posted to ledger but not current public DID, or local to the wallet + enum: + - public + - posted + - wallet_only + example: wallet_only + type: string + verkey: + description: Public verification key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + required: + - did + - key_type + - method + - posture + - verkey + type: object + DIDCreate: + properties: + method: + description: Method for the requested DID.Supported methods are 'key', 'sov', and any other registered method. + example: sov + type: string + options: + allOf: + - $ref: '#/definitions/DIDCreateOptions' + description: To define a key type and/or a did depending on chosen DID method. + seed: + description: Optional seed to use for DID, Must be enabled in configuration before use. + example: 000000000000000000000000Trustee1 + type: string + type: object + DIDCreateOptions: + properties: + did: + description: 'Specify final value of the did (including did:: prefix)if the method supports or requires so.' + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + key_type: + description: Key type to use for the DID keypair. Validated with the chosen DID method's supported key types. + enum: + - ed25519 + - bls12381g2 + - p256 + example: ed25519 + type: string + required: + - key_type + type: object + DIDEndpoint: + properties: + did: + description: DID of interest + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + endpoint: + description: Endpoint to set (omit to delete) + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + required: + - did + type: object + DIDEndpointWithType: + properties: + did: + description: DID of interest + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + endpoint: + description: Endpoint to set (omit to delete) + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + endpoint_type: + description: Endpoint type to set (default 'Endpoint'); affects only public or posted DIDs + enum: + - Endpoint + - Profile + - LinkedDomains + example: Endpoint + type: string + mediation_id: + description: Mediation ID to use for endpoint information. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + required: + - did + type: object + DIDList: + properties: + results: + description: DID list + items: + $ref: '#/definitions/DID' + type: array + type: object + DIDResult: + properties: + result: + $ref: '#/definitions/DID' + type: object + DIDRotateRequestJSON: + properties: + to_did: + description: The DID the rotating party is rotating to + example: did:web:example.com + type: string + required: + - to_did + type: object + DIDXRejectRequest: + properties: + reason: + description: Reason for rejecting the DID Exchange + example: Request rejected + type: string + type: object + DIDXRequest: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + did: + description: DID of exchange + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + did_doc~attach: + allOf: + - $ref: '#/definitions/AttachDecorator' + description: As signed attachment, DID Doc associated with DID + goal: + description: A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message + example: To issue a Faber College Graduate credential + type: string + goal_code: + description: A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message + example: issue-vc + type: string + label: + description: Label for DID exchange request + example: Request to connect with Bob + type: string + required: + - label + type: object + DIFField: + properties: + filter: + $ref: '#/definitions/Filter' + id: + description: ID + type: string + path: + items: + description: Path + type: string + type: array + predicate: + description: Preference + enum: + - required + - preferred + type: string + purpose: + description: Purpose + type: string + type: object + DIFHolder: + properties: + directive: + description: Preference + enum: + - required + - preferred + type: string + field_id: + items: + description: FieldID + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + type: array + type: object + DIFOptions: + properties: + challenge: + description: Challenge protect against replay attack + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + domain: + description: Domain protect against replay attack + example: 4jt78h47fh47 + type: string + type: object + DIFPresSpec: + properties: + issuer_id: + description: Issuer identifier to sign the presentation, if different from current public DID + type: string + presentation_definition: + $ref: '#/definitions/PresentationDefinition' + record_ids: + additionalProperties: { } + description: Mapping of input_descriptor id to list of stored W3C credential record_id + example: + : + - + - + : + - + type: object + reveal_doc: + additionalProperties: { } + description: reveal doc [JSON-LD frame] dict used to derive the credential when selective disclosure is required + example: + '@context': + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/security/bbs/v1 + '@explicit': true + '@requireAll': true + credentialSubject: + '@explicit': true + '@requireAll': true + Observation: + - effectiveDateTime: { } + '@explicit': true + '@requireAll': true + issuanceDate: { } + issuer: { } + type: + - VerifiableCredential + - LabReport + type: object + type: object + DIFProofProposal: + properties: + input_descriptors: + items: + $ref: '#/definitions/InputDescriptors' + type: array + options: + $ref: '#/definitions/DIFOptions' + type: object + DIFProofRequest: + additionalProperties: true + properties: + options: + $ref: '#/definitions/DIFOptions' + presentation_definition: + $ref: '#/definitions/PresentationDefinition' + required: + - presentation_definition + type: object + DRPCRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + request: + description: RPC request + example: + id: 1 + jsonrpc: '2.0' + method: example.method + params: + - '1' + - a + response: + default: null + description: RPC response + example: + id: 1 + jsonrpc: '2.0' + result: result + x-nullable: true + state: + description: RPC state + enum: + - request-sent + - request-received + - completed + example: request-received + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - request + - state + type: object + DRPCRecordList: + properties: + results: + description: List of DIDComm RPC request/reponse exchanges + items: + $ref: '#/definitions/DRPCRecord' + type: array + required: + - results + type: object + DRPCRequestJSON: + properties: + request: + description: RPC Request + example: + id: 1 + jsonrpc: '2.0' + method: example.method + params: + - '1' + - a + required: + - request + type: object + DRPCRequestMessage: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + request: + description: RPC request + example: + id: 1 + jsonrpc: '2.0' + method: example.method + params: + - '1' + - a + required: + - request + type: object + DRPCResponseJSON: + properties: + response: + description: RPC Response + example: + id: 1 + jsonrpc: '2.0' + result: result + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - response + - thread_id + type: object + DRPCResponseMessage: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + response: + description: RPC response + example: + id: 1 + jsonrpc: '2.0' + result: result + required: + - response + type: object + DataIntegrityProofOptions: + additionalProperties: true + properties: + challenge: + description: The value is used once for a particular domain and window of time. This value is used to mitigate replay attacks. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created: + description: The date and time the proof was created is OPTIONAL and, if included, MUST be specified as an [XMLSCHEMA11-2] dateTimeStamp string + example: '2010-01-01T19:23:24Z' + type: string + cryptosuite: + description: An identifier for the cryptographic suite that can be used to verify the proof. + example: eddsa-jcs-2022 + type: string + domain: + description: It conveys one or more security domains in which the proof is meant to be used. + example: example.com + type: string + expires: + description: The expires property is OPTIONAL and, if present, specifies when the proof expires. If present, it MUST be an [XMLSCHEMA11-2] dateTimeStamp string + example: '2010-01-01T19:23:24Z' + type: string + id: + description: An optional identifier for the proof, which MUST be a URL [URL], such as a UUID as a URN + example: urn:uuid:6a1676b8-b51f-11ed-937b-d76685a20ff5 + type: string + nonce: + description: One use of this field is to increase privacy by decreasing linkability that is the result of deterministically generated signatures. + example: CF69iO3nfvqRsRBNElE8b4wO39SyJHPM7Gg1nExltW5vSfQA1lvDCR/zXX1To0/4NLo== + type: string + previousProof: + description: Each value identifies another data integrity proof that MUST verify before the current proof is processed. + example: urn:uuid:6a1676b8-b51f-11ed-937b-d76685a20ff5 + type: string + proofPurpose: + description: The proof purpose acts as a safeguard to prevent the proof from being misused by being applied to a purpose other than the one that was intended. + example: assertionMethod + type: string + proofValue: + description: The value of the proof signature. + example: zsy1AahqbzJQ63n9RtekmwzqZeVj494VppdAVJBnMYrTwft6cLJJGeTSSxCCJ6HKnRtwE7jjDh6sB2z2AAiZY9BBnCD8wUVgwqH3qchGRCuC2RugA4eQ9fUrR4Yuycac3caiaaay + type: string + type: + description: The specific type of proof MUST be specified as a string that maps to a URL [URL]. + example: DataIntegrityProof + type: string + verificationMethod: + description: A verification method is the means and information needed to verify the proof. + example: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + pattern: \w+:(\/?\/?)[^\s]+ + type: string + required: + - cryptosuite + - proofPurpose + - type + - verificationMethod + type: object + Date: + properties: + expires_time: + description: Expiry Date + example: '2021-03-29T05:22:19Z' + format: date-time + type: string + required: + - expires_time + type: object + DefaultConfigValues: + properties: + connected_to_endorsers: + description: Endorser config + items: + $ref: '#/definitions/EndorserLedgerConfig' + type: array + created_public_did: + description: Public DID config + items: + description: Ledger identifier + type: string + type: array + type: object + DeleteResponse: + properties: { } + type: object + Disclose: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + protocols: + description: List of protocol descriptors + items: + $ref: '#/definitions/ProtocolDescriptor' + type: array + required: + - protocols + type: object + Disclosures: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + disclosures: + description: List of protocol or goal_code descriptors + items: { } + type: array + required: + - disclosures + type: object + Doc: + properties: + credential: + additionalProperties: { } + description: Credential to sign + type: object + options: + allOf: + - $ref: '#/definitions/SignatureOptions' + description: Signature options + required: + - credential + - options + type: object + DocumentVerificationResult: + properties: + document: + additionalProperties: { } + type: object + errors: + items: + type: string + type: array + results: + items: + $ref: '#/definitions/ProofResult' + type: array + verified: + type: boolean + required: + - verified + type: object + EndorserInfo: + properties: + endorser_did: + description: Endorser DID + type: string + endorser_name: + description: Endorser Name + type: string + required: + - endorser_did + type: object + EndorserLedgerConfig: + properties: + endorser_alias: + description: Endorser alias/identifier + type: string + ledger_id: + description: Ledger identifier + type: string + required: + - endorser_alias + - ledger_id + type: object + EndpointsResult: + properties: + my_endpoint: + description: My endpoint + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + their_endpoint: + description: Their endpoint + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + type: object + FetchCredentialResponse: + properties: + results: + $ref: '#/definitions/VerifiableCredential' + type: object + FetchKeyResponse: + properties: + kid: + description: The associated kid + example: did:web:example.com#key-01 + type: string + multikey: + description: The Public Key Multibase format (multikey) + example: z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i + type: string + type: object + Filter: + properties: + const: + description: Const + enum: + items: + description: Enum + type: array + exclusiveMaximum: + description: ExclusiveMaximum + exclusiveMinimum: + description: ExclusiveMinimum + format: + description: Format + type: string + maxLength: + description: Max Length + example: 1234 + type: integer + maximum: + description: Maximum + minLength: + description: Min Length + example: 1234 + type: integer + minimum: + description: Minimum + not: + description: Not + example: false + type: boolean + pattern: + description: Pattern + type: string + type: + description: Type + type: string + type: object + Generated: + properties: + master_secret: + example: '0' + pattern: ^[0-9]*$ + type: string + number: + example: '0' + pattern: ^[0-9]*$ + type: string + remainder: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + GetCredDefResult: + properties: + credential_definition: + allOf: + - $ref: '#/definitions/CredDef' + description: credential definition + credential_definition_id: + description: credential definition id + example: did:(method):3:CL:20:tag + type: string + credential_definitions_metadata: + additionalProperties: { } + type: object + resolution_metadata: + additionalProperties: { } + type: object + type: object + GetCredDefsResponse: + properties: + credential_definition_ids: + items: + description: credential definition identifiers + example: GvLGiRogTJubmj5B36qhYz:3:CL:8:faber.agent.degree_schema + type: string + type: array + type: object + GetDIDEndpointResponse: + properties: + endpoint: + description: Full verification key + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + x-nullable: true + type: object + GetDIDVerkeyResponse: + properties: + verkey: + description: Full verification key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + x-nullable: true + type: object + GetNymRoleResponse: + properties: + role: + description: Ledger role + enum: + - STEWARD + - TRUSTEE + - ENDORSER + - NETWORK_MONITOR + - USER + - ROLE_REMOVE + example: ENDORSER + type: string + type: object + GetSchemaResult: + properties: + resolution_metadata: + additionalProperties: { } + type: object + schema: + $ref: '#/definitions/AnonCredsSchema' + schema_id: + description: Schema identifier + example: did:(method):2:schema_name:1.0 + type: string + schema_metadata: + additionalProperties: { } + type: object + type: object + GetSchemasResponse: + properties: + schema_ids: + items: + description: Schema identifiers + example: did:(method):2:schema_name:1.0 + type: string + type: array + type: object + Hangup: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + type: object + HolderModuleResponse: + properties: { } + type: object + IndyAttrValue: + properties: + encoded: + description: Attribute encoded value + example: '-1' + pattern: ^-?[0-9]*$ + type: string + raw: + description: Attribute raw value + type: string + required: + - encoded + - raw + type: object + IndyCredAbstract: + properties: + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + key_correctness_proof: + allOf: + - $ref: '#/definitions/IndyKeyCorrectnessProof' + description: Key correctness proof + nonce: + description: Nonce in credential abstract + example: '0' + pattern: ^[0-9]*$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + required: + - cred_def_id + - key_correctness_proof + - nonce + - schema_id + type: object + IndyCredInfo: + properties: + attrs: + additionalProperties: + example: alice + type: string + description: Attribute names and value + type: object + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + cred_rev_id: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + x-nullable: true + referent: + description: Wallet referent + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + rev_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + x-nullable: true + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + type: object + IndyCredPrecis: + properties: + cred_info: + allOf: + - $ref: '#/definitions/IndyCredInfo' + description: Credential info + interval: + allOf: + - $ref: '#/definitions/IndyNonRevocationInterval' + description: Non-revocation interval from presentation request + presentation_referents: + items: + description: presentation referent + example: 1_age_uuid + type: string + type: array + required: + - cred_info + type: object + IndyCredRequest: + properties: + blinded_ms: + additionalProperties: { } + description: Blinded master secret + type: object + blinded_ms_correctness_proof: + additionalProperties: { } + description: Blinded master secret correctness proof + type: object + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + nonce: + description: Nonce in credential request + example: '0' + pattern: ^[0-9]*$ + type: string + prover_did: + description: Prover DID/Random String/UUID + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - blinded_ms + - blinded_ms_correctness_proof + - cred_def_id + - nonce + - prover_did + type: object + IndyCredential: + properties: + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + rev_reg: + additionalProperties: { } + description: Revocation registry state + type: object + x-nullable: true + rev_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + x-nullable: true + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + signature: + additionalProperties: { } + description: Credential signature + type: object + signature_correctness_proof: + additionalProperties: { } + description: Credential signature correctness proof + type: object + values: + additionalProperties: + $ref: '#/definitions/IndyAttrValue' + description: Credential attributes + type: object + witness: + additionalProperties: { } + description: Witness for revocation proof + type: object + x-nullable: true + required: + - cred_def_id + - schema_id + - signature + - signature_correctness_proof + - values + type: object + IndyEQProof: + properties: + a_prime: + example: '0' + pattern: ^[0-9]*$ + type: string + e: + example: '0' + pattern: ^[0-9]*$ + type: string + m: + additionalProperties: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + m2: + example: '0' + pattern: ^[0-9]*$ + type: string + revealed_attrs: + additionalProperties: + example: '-1' + pattern: ^-?[0-9]*$ + type: string + type: object + v: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + IndyGEProof: + properties: + alpha: + example: '0' + pattern: ^[0-9]*$ + type: string + mj: + example: '0' + pattern: ^[0-9]*$ + type: string + predicate: + $ref: '#/definitions/IndyGEProofPred' + r: + additionalProperties: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + t: + additionalProperties: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + u: + additionalProperties: + example: '0' + pattern: ^[0-9]*$ + type: string + type: object + type: object + IndyGEProofPred: + properties: + attr_name: + description: Attribute name, indy-canonicalized + type: string + p_type: + description: Predicate type + enum: + - LT + - LE + - GE + - GT + type: string + value: + description: Predicate threshold value + type: integer + type: object + IndyKeyCorrectnessProof: + properties: + c: + description: c in key correctness proof + example: '0' + pattern: ^[0-9]*$ + type: string + xr_cap: + description: xr_cap in key correctness proof + items: + description: xr_cap components in key correctness proof + items: + description: xr_cap component values in key correctness proof + type: string + type: array + type: array + xz_cap: + description: xz_cap in key correctness proof + example: '0' + pattern: ^[0-9]*$ + type: string + required: + - c + - xr_cap + - xz_cap + type: object + IndyNonRevocProof: + properties: + c_list: + additionalProperties: + type: string + type: object + x_list: + additionalProperties: + type: string + type: object + type: object + IndyNonRevocationInterval: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + IndyPresAttrSpec: + properties: + cred_def_id: + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + mime-type: + description: MIME type (default null) + example: image/jpeg + type: string + name: + description: Attribute name + example: favourite_drink + type: string + referent: + description: Credential referent + example: '0' + type: string + value: + description: Attribute value + example: martini + type: string + required: + - name + type: object + IndyPresPredSpec: + properties: + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + name: + description: Attribute name + example: high_score + type: string + predicate: + description: Predicate type ('<', '<=', '>=', or '>') + enum: + - < + - <= + - '>=' + - '>' + example: '>=' + type: string + threshold: + description: Threshold value + type: integer + required: + - name + - predicate + - threshold + type: object + IndyPresPreview: + properties: + '@type': + description: Message type identifier + example: https://didcomm.org/present-proof/1.0/presentation-preview + type: string + attributes: + items: + $ref: '#/definitions/IndyPresAttrSpec' + type: array + predicates: + items: + $ref: '#/definitions/IndyPresPredSpec' + type: array + required: + - attributes + - predicates + type: object + IndyPresSpec: + properties: + requested_attributes: + additionalProperties: + $ref: '#/definitions/IndyRequestedCredsRequestedAttr' + description: Nested object mapping proof request attribute referents to requested-attribute specifiers + type: object + requested_predicates: + additionalProperties: + $ref: '#/definitions/IndyRequestedCredsRequestedPred' + description: Nested object mapping proof request predicate referents to requested-predicate specifiers + type: object + self_attested_attributes: + additionalProperties: + description: Self-attested attribute values to use in requested-credentials structure for proof construction + example: self_attested_value + type: string + description: Self-attested attributes to build into proof + type: object + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - requested_attributes + - requested_predicates + - self_attested_attributes + type: object + IndyPrimaryProof: + properties: + eq_proof: + allOf: + - $ref: '#/definitions/IndyEQProof' + description: Indy equality proof + x-nullable: true + ge_proofs: + description: Indy GE proofs + items: + $ref: '#/definitions/IndyGEProof' + type: array + x-nullable: true + type: object + IndyProof: + properties: + identifiers: + description: Indy proof.identifiers content + items: + $ref: '#/definitions/IndyProofIdentifier' + type: array + proof: + allOf: + - $ref: '#/definitions/IndyProofProof' + description: Indy proof.proof content + requested_proof: + allOf: + - $ref: '#/definitions/IndyProofRequestedProof' + description: Indy proof.requested_proof content + type: object + IndyProofIdentifier: + properties: + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + rev_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + x-nullable: true + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + timestamp: + description: Timestamp epoch + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + x-nullable: true + type: object + IndyProofProof: + properties: + aggregated_proof: + allOf: + - $ref: '#/definitions/IndyProofProofAggregatedProof' + description: Indy proof aggregated proof + proofs: + description: Indy proof proofs + items: + $ref: '#/definitions/IndyProofProofProofsProof' + type: array + type: object + IndyProofProofAggregatedProof: + properties: + c_hash: + description: c_hash value + type: string + c_list: + description: c_list value + items: + items: + type: integer + type: array + type: array + type: object + IndyProofProofProofsProof: + properties: + non_revoc_proof: + allOf: + - $ref: '#/definitions/IndyNonRevocProof' + description: Indy non-revocation proof + x-nullable: true + primary_proof: + allOf: + - $ref: '#/definitions/IndyPrimaryProof' + description: Indy primary proof + type: object + IndyProofReqAttrSpec: + properties: + name: + description: Attribute name + example: favouriteDrink + type: string + names: + description: Attribute name group + items: + example: age + type: string + type: array + non_revoked: + $ref: '#/definitions/IndyProofReqAttrSpecNonRevoked' + x-nullable: true + restrictions: + description: 'If present, credential must satisfy one of given restrictions: specify schema_id, schema_issuer_did, schema_name, schema_version, issuer_did, cred_def_id, and/or attr::::value where represents a credential attribute name' + items: + additionalProperties: + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + type: string + type: object + type: array + type: object + IndyProofReqAttrSpecNonRevoked: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + IndyProofReqPredSpec: + properties: + name: + description: Attribute name + example: index + type: string + non_revoked: + $ref: '#/definitions/IndyProofReqPredSpecNonRevoked' + x-nullable: true + p_type: + description: Predicate type ('<', '<=', '>=', or '>') + enum: + - < + - <= + - '>=' + - '>' + example: '>=' + type: string + p_value: + description: Threshold value + type: integer + restrictions: + description: 'If present, credential must satisfy one of given restrictions: specify schema_id, schema_issuer_did, schema_name, schema_version, issuer_did, cred_def_id, and/or attr::::value where represents a credential attribute name' + items: + additionalProperties: + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + type: string + type: object + type: array + required: + - name + - p_type + - p_value + type: object + IndyProofReqPredSpecNonRevoked: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + IndyProofRequest: + properties: + name: + description: Proof request name + example: Proof request + type: string + non_revoked: + $ref: '#/definitions/IndyProofRequestNonRevoked' + x-nullable: true + nonce: + description: Nonce + example: '1' + pattern: ^[1-9][0-9]*$ + type: string + requested_attributes: + additionalProperties: + $ref: '#/definitions/IndyProofReqAttrSpec' + description: Requested attribute specifications of proof request + type: object + requested_predicates: + additionalProperties: + $ref: '#/definitions/IndyProofReqPredSpec' + description: Requested predicate specifications of proof request + type: object + version: + description: Proof request version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + required: + - requested_attributes + - requested_predicates + type: object + IndyProofRequestNonRevoked: + properties: + from: + description: Earliest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + to: + description: Latest time of interest in non-revocation interval + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + IndyProofRequestedProof: + properties: + predicates: + additionalProperties: + $ref: '#/definitions/IndyProofRequestedProofPredicate' + description: Proof requested proof predicates. + type: object + revealed_attr_groups: + additionalProperties: + $ref: '#/definitions/IndyProofRequestedProofRevealedAttrGroup' + description: Proof requested proof revealed attribute groups + type: object + x-nullable: true + revealed_attrs: + additionalProperties: + $ref: '#/definitions/IndyProofRequestedProofRevealedAttr' + description: Proof requested proof revealed attributes + type: object + x-nullable: true + self_attested_attrs: + additionalProperties: { } + description: Proof requested proof self-attested attributes + type: object + unrevealed_attrs: + additionalProperties: { } + description: Unrevealed attributes + type: object + type: object + IndyProofRequestedProofPredicate: + properties: + sub_proof_index: + description: Sub-proof index + type: integer + type: object + IndyProofRequestedProofRevealedAttr: + properties: + encoded: + description: Encoded value + example: '-1' + pattern: ^-?[0-9]*$ + type: string + raw: + description: Raw value + type: string + sub_proof_index: + description: Sub-proof index + type: integer + type: object + IndyProofRequestedProofRevealedAttrGroup: + properties: + sub_proof_index: + description: Sub-proof index + type: integer + values: + additionalProperties: + $ref: '#/definitions/RawEncoded' + description: Indy proof requested proof revealed attr groups group value + type: object + type: object + IndyRequestedCredsRequestedAttr: + properties: + cred_id: + description: Wallet credential identifier (typically but not necessarily a UUID) + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + revealed: + description: Whether to reveal attribute in proof (default true) + type: boolean + required: + - cred_id + type: object + IndyRequestedCredsRequestedPred: + properties: + cred_id: + description: Wallet credential identifier (typically but not necessarily a UUID) + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + timestamp: + description: Epoch timestamp of interest for non-revocation proof + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + required: + - cred_id + type: object + IndyRevRegDef: + properties: + credDefId: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + id: + description: Indy revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + revocDefType: + description: Revocation registry type (specify CL_ACCUM) + enum: + - CL_ACCUM + example: CL_ACCUM + type: string + tag: + description: Revocation registry tag + type: string + value: + allOf: + - $ref: '#/definitions/IndyRevRegDefValue' + description: Revocation registry definition value + ver: + description: Version of revocation registry definition + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + IndyRevRegDefValue: + properties: + issuanceType: + description: Issuance type + enum: + - ISSUANCE_ON_DEMAND + - ISSUANCE_BY_DEFAULT + type: string + maxCredNum: + description: Maximum number of credentials; registry size + example: 10 + minimum: 1 + type: integer + publicKeys: + allOf: + - $ref: '#/definitions/IndyRevRegDefValuePublicKeys' + description: Public keys + tailsHash: + description: Tails hash value + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + tailsLocation: + description: Tails file location + type: string + type: object + IndyRevRegDefValuePublicKeys: + properties: + accumKey: + $ref: '#/definitions/IndyRevRegDefValuePublicKeysAccumKey' + type: object + IndyRevRegDefValuePublicKeysAccumKey: + properties: + z: + description: Value for z + example: 1 120F522F81E6B7 1 09F7A59005C4939854 + type: string + type: object + IndyRevRegEntry: + properties: + value: + allOf: + - $ref: '#/definitions/IndyRevRegEntryValue' + description: Revocation registry entry value + ver: + description: Version of revocation registry entry + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + IndyRevRegEntryValue: + properties: + accum: + description: Accumulator value + example: 21 11792B036AED0AAA12A4 4 298B2571FFC63A737 + type: string + prevAccum: + description: Previous accumulator value + example: 21 137AC810975E4 6 76F0384B6F23 + type: string + revoked: + description: Revoked credential revocation identifiers + items: + type: integer + type: array + type: object + InnerCredDef: + properties: + issuerId: + description: Issuer Identifier of the credential definition + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + schemaId: + description: Schema identifier + example: did:(method):2:schema_name:1.0 + type: string + tag: + description: Credential definition tag + example: default + type: string + required: + - issuerId + - schemaId + - tag + type: object + InnerRevRegDef: + properties: + credDefId: + description: Credential definition identifier + example: did:(method):2:schema_name:1.0 + type: string + issuerId: + description: Issuer Identifier of the credential definition or schema + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + maxCredNum: + description: Maximum number of credential revocations per registry + example: 777 + type: integer + tag: + description: tag for revocation registry + example: default + type: string + required: + - credDefId + - issuerId + - maxCredNum + - tag + type: object + InputDescriptors: + properties: + constraints: + $ref: '#/definitions/Constraints' + group: + items: + description: Group + type: string + type: array + id: + description: ID + type: string + metadata: + additionalProperties: { } + description: Metadata dictionary + type: object + name: + description: Name + type: string + purpose: + description: Purpose + type: string + schema: + allOf: + - $ref: '#/definitions/SchemasInputDescriptorFilter' + description: Accepts a list of schema or a dict containing filters like oneof_filter. + example: + oneof_filter: + - - uri: https://www.w3.org/Test1#Test1 + - uri: https://www.w3.org/Test2#Test2 + - oneof_filter: + - - uri: https://www.w3.org/Test1#Test1 + - - uri: https://www.w3.org/Test2#Test2 + type: object + IntroModuleResponse: + properties: { } + type: object + InvitationCreateRequest: + properties: + accept: + description: List of mime type in order of preference that should be use in responding to the message + example: + - didcomm/aip1 + - didcomm/aip2;env=rfc19 + items: + type: string + type: array + alias: + description: Alias for connection + example: Barry + type: string + attachments: + description: Optional invitation attachments + items: + $ref: '#/definitions/AttachmentDef' + type: array + goal: + description: A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message + example: To issue a Faber College Graduate credential + type: string + goal_code: + description: A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message + example: issue-vc + type: string + handshake_protocols: + items: + description: Handshake protocol to specify in invitation + example: https://didcomm.org/didexchange/1.0 + type: string + type: array + mediation_id: + description: Identifier for active mediation record to be used + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + metadata: + additionalProperties: { } + description: Optional metadata to attach to the connection created with the invitation + type: object + my_label: + description: Label for connection invitation + example: Invitation to Barry + type: string + protocol_version: + description: OOB protocol version + example: '1.1' + type: string + use_did: + description: DID to use in invitation + example: did:example:123 + type: string + use_did_method: + description: DID method to use in invitation + enum: + - did:peer:2 + - did:peer:4 + example: did:peer:2 + type: string + use_public_did: + description: Whether to use public DID in invitation + example: false + type: boolean + type: object + InvitationMessage: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + accept: + description: List of mime type in order of preference + example: + - didcomm/aip1 + - didcomm/aip2;env=rfc19 + items: + type: string + type: array + goal: + description: A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message + example: To issue a Faber College Graduate credential + type: string + goal_code: + description: A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message + example: issue-vc + type: string + handshake_protocols: + items: + description: Handshake protocol + example: https://didcomm.org/didexchange/1.0 + type: string + type: array + imageUrl: + description: Optional image URL for out-of-band invitation + example: http://192.168.56.101/img/logo.jpg + format: url + type: string + x-nullable: true + label: + description: Optional label + example: Bob + type: string + requests~attach: + description: Optional request attachment + items: + $ref: '#/definitions/AttachDecorator' + type: array + services: + example: + - did: WgWxqztrNooG92RXvxSTWv + id: string + recipientKeys: + - did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + routingKeys: + - did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + serviceEndpoint: http://192.168.56.101:8020 + type: string + - did:sov:WgWxqztrNooG92RXvxSTWv + items: + description: Either a DIDComm service object (as per RFC0067) or a DID string. + type: array + type: object + InvitationRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + invi_msg_id: + description: Invitation message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + invitation: + allOf: + - $ref: '#/definitions/InvitationMessage' + description: Out of band invitation message + invitation_id: + description: Invitation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + invitation_url: + description: Invitation message URL + example: https://example.com/endpoint?c_i=eyJAdHlwZSI6ICIuLi4iLCAiLi4uIjogIi4uLiJ9XX0= + type: string + oob_id: + description: Out of band record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + state: + description: Out of band message exchange state + example: await_response + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + InvitationRecordResponse: + properties: { } + type: object + InvitationResult: + properties: + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + invitation: + $ref: '#/definitions/ConnectionInvitation' + invitation_url: + description: Invitation URL + example: http://192.168.56.101:8020/invite?c_i=eyJAdHlwZSI6Li4ufQ== + type: string + required: + - connection_id + - invitation + - invitation_url + type: object + IssueCredentialModuleResponse: + properties: { } + type: object + IssueCredentialRequest: + properties: + credential: + $ref: '#/definitions/Credential' + options: + $ref: '#/definitions/LDProofVCOptions' + type: object + IssueCredentialResponse: + properties: + verifiableCredential: + $ref: '#/definitions/VerifiableCredential' + type: object + IssuerCredRevRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + cred_ex_id: + description: Credential exchange record identifier at credential issue + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_ex_version: + description: Credential exchange version + type: string + cred_rev_id: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + record_id: + description: Issuer credential revocation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + rev_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + state: + description: Issue credential revocation record state + example: issued + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + IssuerCredRevRecordSchemaAnoncreds: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_def_id: + description: Credential definition identifier + type: string + cred_ex_id: + description: Credential exchange record identifier at credential issue + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_ex_version: + description: Credential exchange version + type: string + cred_rev_id: + description: Credential revocation identifier + type: string + record_id: + description: Issuer credential revocation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + rev_reg_id: + description: Revocation registry identifier + type: string + state: + description: Issue credential revocation record state + example: issued + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + IssuerRevRegRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + error_msg: + description: Error message + example: Revocation registry undefined + type: string + issuer_did: + description: Issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + max_cred_num: + description: Maximum number of credentials for revocation registry + example: 1000 + type: integer + pending_pub: + description: Credential revocation identifier for credential revoked and pending publication to ledger + items: + example: '23' + type: string + type: array + record_id: + description: Issuer revocation registry record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + revoc_def_type: + description: Revocation registry type (specify CL_ACCUM) + enum: + - CL_ACCUM + example: CL_ACCUM + type: string + revoc_reg_def: + allOf: + - $ref: '#/definitions/IndyRevRegDef' + description: Revocation registry definition + revoc_reg_entry: + allOf: + - $ref: '#/definitions/IndyRevRegEntry' + description: Revocation registry entry + revoc_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + state: + description: Issue revocation registry record state + example: active + type: string + tag: + description: Tag within issuer revocation registry identifier + type: string + tails_hash: + description: Tails hash + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + tails_local_path: + description: Local path to tails file + type: string + tails_public_uri: + description: Public URI for tails file + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + JWSCreate: + properties: + did: + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + headers: + additionalProperties: { } + type: object + payload: + additionalProperties: { } + type: object + verificationMethod: + description: Information used for proof verification + example: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + pattern: \w+:(\/?\/?)[^\s]+ + type: string + required: + - payload + type: object + JWSVerify: + properties: + jwt: + example: eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + pattern: ^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]+$ + type: string + type: object + JWSVerifyResponse: + properties: + error: + description: Error text + type: string + headers: + additionalProperties: { } + description: Headers from verified JWT. + type: object + kid: + description: kid of signer + type: string + payload: + additionalProperties: { } + description: Payload from verified JWT + type: object + valid: + type: boolean + required: + - headers + - kid + - payload + - valid + type: object + Keylist: + properties: + results: + description: List of keylist records + items: + $ref: '#/definitions/RouteRecord' + type: array + type: object + KeylistQuery: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + filter: + additionalProperties: { } + description: Query dictionary object + example: + filter: { } + type: object + paginate: + allOf: + - $ref: '#/definitions/KeylistQueryPaginate' + description: Pagination info + type: object + KeylistQueryFilterRequest: + properties: + filter: + additionalProperties: { } + description: Filter for keylist query + type: object + type: object + KeylistQueryPaginate: + properties: + limit: + description: Limit for keylist query + example: 30 + type: integer + offset: + description: Offset value for query + example: 0 + type: integer + type: object + KeylistUpdate: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + updates: + description: List of update rules + items: + $ref: '#/definitions/KeylistUpdateRule' + type: array + type: object + KeylistUpdateRequest: + properties: + updates: + items: + $ref: '#/definitions/KeylistUpdateRule' + type: array + type: object + KeylistUpdateRule: + properties: + action: + description: Action for specific key + enum: + - add + - remove + example: add + type: string + recipient_key: + description: Key to remove or add + example: did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + pattern: ^did:key:z[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$|^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + required: + - action + - recipient_key + type: object + LDProofVCDetail: + additionalProperties: true + properties: + credential: + allOf: + - $ref: '#/definitions/Credential' + description: Detail of the JSON-LD Credential to be issued + example: + '@context': + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/citizenship/v1 + credentialSubject: + familyName: SMITH + gender: Male + givenName: JOHN + type: + - PermanentResident + - Person + description: Government of Example Permanent Resident Card. + identifier: '83627465' + issuanceDate: '2019-12-03T12:19:52Z' + issuer: did:key:z6MkmjY8GnV5i9YTDtPETC2uUAW6ejw3nk5mXF5yci5ab7th + name: Permanent Resident Card + type: + - VerifiableCredential + - PermanentResidentCard + options: + allOf: + - $ref: '#/definitions/LDProofVCOptions' + description: Options for specifying how the linked data proof is created. + example: + proofType: Ed25519Signature2018 + required: + - credential + - options + type: object + LDProofVCOptions: + additionalProperties: true + properties: + challenge: + description: A challenge to include in the proof. SHOULD be provided by the requesting party of the credential (=holder) + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created: + description: The date and time of the proof (with a maximum accuracy in seconds). Defaults to current system time + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + credentialStatus: + allOf: + - $ref: '#/definitions/CredentialStatusOptions' + description: The credential status mechanism to use for the credential. Omitting the property indicates the issued credential will not include a credential status + domain: + description: The intended domain of validity for the proof + example: example.com + type: string + proofPurpose: + description: The proof purpose used for the proof. Should match proof purposes registered in the Linked Data Proofs Specification + example: assertionMethod + type: string + proofType: + description: The proof type used for the proof. Should match suites registered in the Linked Data Cryptographic Suite Registry + example: Ed25519Signature2018 + type: string + verificationMethod: + description: The verification method to use for the proof. Should match a verification method in the wallet + example: did:example:123456#key-1 + type: string + type: object + LedgerConfigInstance: + properties: + genesis_file: + description: genesis_file + type: string + genesis_transactions: + description: genesis_transactions + type: string + genesis_url: + description: genesis_url + type: string + id: + description: ledger_id + type: string + is_production: + description: is_production + type: boolean + type: object + LedgerConfigList: + properties: + ledger_config_list: + items: + $ref: '#/definitions/LedgerConfigInstance' + type: array + required: + - ledger_config_list + type: object + LedgerModulesResult: + properties: { } + type: object + LinkedDataProof: + additionalProperties: true + properties: + challenge: + description: Associates a challenge with a proof, for use with a proofPurpose such as authentication + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created: + description: The string value of an ISO8601 combined date and time string generated by the Signature Algorithm + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + domain: + description: A string value specifying the restricted domain of the signature. + example: https://example.com + type: string + jws: + description: Associates a Detached Json Web Signature with a proof + example: eyJhbGciOiAiRWREUc2UsICJjcml0IjogWyJiNjQiXX0..lKJU0Df_keblRKhZAS9Qq6zybm-HqUXNVZ8vgEPNTAjQ1Ch6YBKY7UBAjg6iBX5qBQ + type: string + nonce: + description: The nonce + example: CF69iO3nfvqRsRBNElE8b4wO39SyJHPM7Gg1nExltW5vSfQA1lvDCR/zXX1To0/4NLo== + type: string + proofPurpose: + description: Proof purpose + example: assertionMethod + type: string + proofValue: + description: The proof value of a proof + example: sy1AahqbzJQ63n9RtekmwzqZeVj494VppdAVJBnMYrTwft6cLJJGeTSSxCCJ6HKnRtwE7jjDh6sB2z2AAiZY9BBnCD8wUVgwqH3qchGRCuC2RugA4eQ9fUrR4Yuycac3caiaaay + type: string + type: + description: Identifies the digital signature suite that was used to create the signature + example: Ed25519Signature2018 + type: string + verificationMethod: + description: Information used for proof verification + example: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + pattern: \w+:(\/?\/?)[^\s]+ + type: string + required: + - proofPurpose + - type + - verificationMethod + type: object + ListCredentialsResponse: + properties: + results: + items: + $ref: '#/definitions/VerifiableCredential' + type: array + type: object + MediationCreateRequest: + properties: { } + type: object + MediationDeny: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + type: object + MediationGrant: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + endpoint: + description: endpoint on which messages destined for the recipient are received. + example: http://192.168.56.102:8020/ + type: string + routing_keys: + items: + description: Keys to use for forward message packaging + type: string + type: array + type: object + MediationIdMatchInfo: + properties: + mediation_id: + description: Mediation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - mediation_id + type: object + MediationList: + properties: + results: + description: List of mediation records + items: + $ref: '#/definitions/MediationRecord' + type: array + required: + - results + type: object + MediationRecord: + properties: + connection_id: + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + endpoint: + type: string + mediation_id: + type: string + mediator_terms: + items: + type: string + type: array + recipient_terms: + items: + type: string + type: array + role: + type: string + routing_keys: + items: + example: did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + pattern: ^did:key:z[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$ + type: string + type: array + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - connection_id + - role + type: object + Menu: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + description: + description: Introductory text for the menu + example: This menu presents options + type: string + errormsg: + description: An optional error message to display in menu header + example: 'Error: item not found' + type: string + options: + description: List of menu options + items: + $ref: '#/definitions/MenuOption' + type: array + title: + description: Menu title + example: My Menu + type: string + required: + - options + type: object + MenuForm: + properties: + description: + description: Additional descriptive text for menu form + example: Window preference settings + type: string + params: + description: List of form parameters + items: + $ref: '#/definitions/MenuFormParam' + type: array + submit-label: + description: Alternative label for form submit button + example: Send + type: string + title: + description: Menu form title + example: Preferences + type: string + type: object + MenuFormParam: + properties: + default: + description: Default parameter value + example: '0' + type: string + description: + description: Additional descriptive text for menu form parameter + example: Delay in seconds before starting + type: string + name: + description: Menu parameter name + example: delay + type: string + required: + description: Whether parameter is required + example: 'False' + type: boolean + title: + description: Menu parameter title + example: Delay in seconds + type: string + type: + description: Menu form parameter input type + example: int + type: string + required: + - name + - title + type: object + MenuJson: + properties: + description: + description: Introductory text for the menu + example: User preferences for window settings + type: string + errormsg: + description: Optional error message to display in menu header + example: 'Error: item not present' + type: string + options: + description: List of menu options + items: + $ref: '#/definitions/MenuOption' + type: array + title: + description: Menu title + example: My Menu + type: string + required: + - options + type: object + MenuOption: + properties: + description: + description: Additional descriptive text for menu option + example: Window display preferences + type: string + disabled: + description: Whether to show option as disabled + example: 'False' + type: boolean + form: + $ref: '#/definitions/MenuForm' + name: + description: Menu option name (unique identifier) + example: window_prefs + type: string + title: + description: Menu option title + example: Window Preferences + type: string + required: + - name + - title + type: object + MultitenantModuleResponse: + properties: { } + type: object + OcaRecord: + properties: + bundle: + additionalProperties: { } + description: OCA Bundle + type: object + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_def_id: + description: Cred Def identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + oca_id: + description: OCA Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + owner_did: + description: Public DID of OCA record owner + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + url: + description: (Public) Url for OCA Bundle + type: string + required: + - oca_id + type: object + OcaRecordList: + properties: + results: + description: List of OCA records + items: + $ref: '#/definitions/OcaRecord' + type: array + type: object + OcaRecordOperationResponse: + properties: + success: + description: True if operation successful, false if otherwise + type: boolean + required: + - success + type: object + OobRecord: + properties: + attach_thread_id: + description: Connection record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + connection_id: + description: Connection record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + invi_msg_id: + description: Invitation message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + invitation: + allOf: + - $ref: '#/definitions/InvitationMessage' + description: Out of band invitation message + multi_use: + description: Allow for multiple uses of the oob invitation + example: true + type: boolean + oob_id: + description: Oob record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + our_recipient_key: + description: Recipient key used for oob invitation + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + role: + description: OOB Role + enum: + - sender + - receiver + example: receiver + type: string + state: + description: Out of band message exchange state + enum: + - initial + - prepare-response + - await-response + - reuse-not-accepted + - reuse-accepted + - done + - deleted + example: await-response + type: string + their_service: + $ref: '#/definitions/ServiceDecorator' + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - invi_msg_id + - invitation + - oob_id + - state + type: object + PerformRequest: + properties: + name: + description: Menu option name + example: Query + type: string + params: + additionalProperties: + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + description: Input parameter values + type: object + type: object + PingRequest: + properties: + comment: + description: Comment for the ping message + type: string + x-nullable: true + type: object + PingRequestResponse: + properties: + thread_id: + description: Thread ID of the ping message + type: string + type: object + PluginCreateWalletRequest: + properties: + extra_settings: + additionalProperties: { } + description: Agent config key-value pairs + type: object + image_url: + description: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. + example: https://aries.ca/images/sample.png + type: string + key_management_mode: + description: Key management method to use for this wallet. + enum: + - managed + example: managed + type: string + label: + description: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. + example: Alice + type: string + wallet_dispatch_type: + description: 'Webhook target dispatch type for this wallet. default: Dispatch only to webhooks associated with this wallet. base: Dispatch only to webhooks associated with the base wallet. both: Dispatch to both webhook targets.' + enum: + - default + - both + - base + example: default + type: string + wallet_key: + description: Master key used for key derivation. + example: MySecretKey123 + type: string + wallet_key_derivation: + description: Key derivation + enum: + - ARGON2I_MOD + - ARGON2I_INT + - RAW + example: RAW + type: string + wallet_name: + description: Wallet name + example: MyNewWallet + type: string + wallet_type: + description: Type of the wallet to create. Must be same as base wallet. + enum: + - askar + - askar-anoncreds + example: askar + type: string + wallet_webhook_urls: + description: List of Webhook URLs associated with this subwallet + items: + description: Optional webhook URL to receive webhook messages + example: http://localhost:8022/webhooks + type: string + type: array + type: object + Presentation: + additionalProperties: true + properties: + '@context': + description: The JSON-LD context of the presentation + example: + - https://www.w3.org/2018/credentials/v1 + items: { } + type: array + holder: + description: The JSON-LD Verifiable Credential Holder. Either string of object with id field. + example: did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + id: + description: The ID of the presentation + example: http://example.edu/presentations/1872 + pattern: \w+:(\/?\/?)[^\s]+ + type: string + proof: + allOf: + - $ref: '#/definitions/LinkedDataProof' + description: The proof of the presentation + example: + created: '2019-12-11T03:50:55' + jws: eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0JiNjQiXX0..lKJU0Df_keblRKhZAS9Qq6zybm-HqUXNVZ8vgEPNTAjQKBhQDxvXNo7nvtUBb_Eq1Ch6YBKY5qBQ + proofPurpose: assertionMethod + type: Ed25519Signature2018 + verificationMethod: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + type: + description: The JSON-LD type of the presentation + example: + - VerifiablePresentation + items: + type: string + type: array + verifiableCredential: + items: + additionalProperties: { } + type: object + type: array + required: + - '@context' + - type + type: object + PresentationDefinition: + properties: + format: + $ref: '#/definitions/ClaimFormat' + id: + description: Unique Resource Identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + input_descriptors: + items: + $ref: '#/definitions/InputDescriptors' + type: array + name: + description: Human-friendly name that describes what the presentation definition pertains to + type: string + purpose: + description: Describes the purpose for which the Presentation Definition's inputs are being requested + type: string + submission_requirements: + items: + $ref: '#/definitions/SubmissionRequirements' + type: array + type: object + PresentationProposal: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + presentation_proposal: + $ref: '#/definitions/IndyPresPreview' + required: + - presentation_proposal + type: object + PresentationRequest: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + request_presentations~attach: + items: + $ref: '#/definitions/AttachDecorator' + type: array + required: + - request_presentations~attach + type: object + PresentationVerificationResult: + properties: + credential_results: + items: + $ref: '#/definitions/DocumentVerificationResult' + type: array + errors: + items: + type: string + type: array + presentation_result: + $ref: '#/definitions/DocumentVerificationResult' + verified: + type: boolean + required: + - verified + type: object + ProfileSettings: + properties: + settings: + additionalProperties: { } + description: Profile settings dict + example: + debug.invite_public: true + log.level: INFO + public_invites: false + type: object + type: object + ProofResult: + properties: + error: + type: string + proof: + additionalProperties: { } + type: object + purpose_result: + $ref: '#/definitions/PurposeResult' + verified: + type: boolean + type: object + ProtocolDescriptor: + properties: + pid: + type: string + roles: + description: List of roles + items: + description: 'Role: requester or responder' + example: requester + type: string + type: array + x-nullable: true + required: + - pid + type: object + ProvePresentationRequest: + properties: + options: + $ref: '#/definitions/LDProofVCOptions' + presentation: + $ref: '#/definitions/Presentation' + type: object + ProvePresentationResponse: + properties: + verifiablePresentation: + $ref: '#/definitions/VerifiablePresentation' + type: object + PublishRevocations: + properties: + rrid2crid: + additionalProperties: + items: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + type: array + description: Credential revocation ids by revocation registry id + type: object + type: object + PublishRevocationsOptions: + properties: + create_transaction_for_endorser: + description: Create transaction for endorser (optional, default false). Use this for agents who don't specify an author role but want to create a transaction for an endorser to sign. + example: false + required: false + type: boolean + endorser_connection_id: + description: Connection identifier (optional) (this is an example). You can set this if you know the endorser's connection id you want to use. If not specified then the agent will attempt to find an endorser connection. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + required: false + type: string + type: object + PublishRevocationsResultSchemaAnoncreds: + properties: + rrid2crid: + additionalProperties: + items: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + type: array + description: Credential revocation ids by revocation registry id + type: object + type: object + PublishRevocationsSchemaAnoncreds: + properties: + options: + $ref: '#/definitions/PublishRevocationsOptions' + rrid2crid: + additionalProperties: + items: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + type: array + description: Credential revocation ids by revocation registry id + type: object + type: object + PurposeResult: + properties: + controller: + additionalProperties: { } + type: object + error: + type: string + valid: + type: boolean + type: object + Queries: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + queries: + items: + $ref: '#/definitions/QueryItem' + type: array + type: object + Query: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + type: string + x-nullable: true + query: + type: string + required: + - query + type: object + QueryItem: + properties: + feature-type: + description: feature type + enum: + - protocol + - goal-code + type: string + match: + description: match + type: string + required: + - feature-type + - match + type: object + RawEncoded: + properties: + encoded: + description: Encoded value + example: '-1' + pattern: ^-?[0-9]*$ + type: string + raw: + description: Raw value + type: string + type: object + ReceiveInvitationRequest: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + did: + description: DID for connection invitation + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + imageUrl: + description: Optional image URL for connection invitation + example: http://192.168.56.101/img/logo.jpg + format: url + type: string + x-nullable: true + label: + description: Optional label for connection invitation + example: Bob + type: string + recipientKeys: + description: List of recipient keys + items: + description: Recipient public key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + routingKeys: + description: List of routing keys + items: + description: Routing key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + serviceEndpoint: + description: Service endpoint at which to reach this agent + example: http://192.168.56.101:8020 + type: string + type: object + RemoveWalletRequest: + properties: + wallet_key: + description: Master key used for key derivation. Only required for unmanaged wallets. + example: MySecretKey123 + type: string + type: object + ReservationApproveRequest: + properties: + state_notes: + description: Reason(s) for approving a tenant reservation + example: Welcome + type: string + type: object + ReservationApproveResponse: + properties: + reservation_pwd: + description: The reservation password - deliver to tenant contact + type: string + required: + - reservation_pwd + type: object + ReservationDenyRequest: + properties: + state_notes: + description: Reason(s) for approving or denying a tenant reservation + example: No room at the inn. + type: string + required: + - state_notes + type: object + ReservationList: + properties: + results: + description: List of reservations + items: + $ref: '#/definitions/ReservationRecord' + type: array + type: object + ReservationRecord: + properties: + connect_to_endorser: + example: '{"endorser_alias": " ... ", "ledger_id": " ... "}' + items: + additionalProperties: { } + description: Endorser and ledger config + type: object + type: array + contact_email: + description: Contact email for this tenant request + type: string + contact_name: + description: Contact name for this tenant request + type: string + contact_phone: + description: Contact phone number for this tenant request + type: string + context_data: + additionalProperties: { } + description: Context data for this tenant request + example: '{"tenant_reason": " ... ", "contact_name": " ... ", "contact_phone": " ... "}' + type: object + create_public_did: + items: + description: Ledger id + type: string + type: array + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + reservation_id: + description: Tenant Reservation Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + state: + description: The state of the tenant request. + enum: + - requested + - approved + - checked_in + example: requested + type: string + state_notes: + description: Notes about the state of the tenant request + type: string + tenant_id: + description: Tenant Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + tenant_name: + description: Proposed name of Tenant + example: line of business short name + type: string + tenant_reason: + description: Reason(s) for requesting a tenant + example: Issue permits to clients + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + wallet_id: + description: Tenant Wallet Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - contact_email + - contact_name + - contact_phone + - reservation_id + - state + - tenant_name + - tenant_reason + type: object + ReservationRefresh: + properties: { } + type: object + ReservationRequest: + properties: + contact_email: + description: Contact email for this tenant request + type: string + context_data: + additionalProperties: { } + description: Optional context data for this tenant request + example: + contact_phone: 555-555-5555 + type: object + tenant_name: + description: Proposed name of Tenant + example: line of business short name + type: string + required: + - contact_email + - tenant_name + type: object + ReservationResponse: + properties: + reservation_id: + description: The reservation record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - reservation_id + type: object + ResolutionResult: + properties: + did_document: + additionalProperties: { } + description: DID Document + type: object + metadata: + additionalProperties: { } + description: Resolution metadata + type: object + required: + - did_document + - metadata + type: object + RevList: + properties: + currentAccumulator: + description: The current accumulator value + example: 21 118...1FB + type: string + issuerId: + description: Issuer Identifier of the credential definition or schema + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + revRegDefId: + description: The ID of the revocation registry definition + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + type: string + revocationList: + description: Bit list representing revoked credentials + example: + - 0 + - 1 + - 1 + - 0 + items: + type: integer + type: array + timestamp: + description: Timestamp at which revocation list is applicable + example: '2021-12-31T23:59:59Z' + type: integer + type: object + RevListCreateRequest: + properties: + options: + $ref: '#/definitions/RevListOptions' + rev_reg_def_id: + description: Revocation registry definition identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + type: string + required: + - rev_reg_def_id + type: object + RevListOptions: + properties: + create_transaction_for_endorser: + description: Create transaction for endorser (optional, default false). Use this for agents who don't specify an author role but want to create a transaction for an endorser to sign. + example: false + type: boolean + endorser_connection_id: + description: Connection identifier (optional) (this is an example). You can set this if you know the endorser's connection id you want to use. If not specified then the agent will attempt to find an endorser connection. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + type: object + RevListResult: + properties: + job_id: + type: string + registration_metadata: + additionalProperties: { } + type: object + revocation_list_metadata: + additionalProperties: { } + type: object + revocation_list_state: + $ref: '#/definitions/RevListState' + type: object + RevListState: + properties: + revocation_list: + allOf: + - $ref: '#/definitions/RevList' + description: revocation list + state: + enum: + - finished + - failed + - action + - wait + type: string + type: object + RevRegCreateRequest: + properties: + credential_definition_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + max_cred_num: + description: Revocation registry size + example: 1000 + maximum: 32768 + minimum: 4 + type: integer + type: object + RevRegCreateRequestSchemaAnoncreds: + properties: + options: + $ref: '#/definitions/RevRegDefOptions' + revocation_registry_definition: + $ref: '#/definitions/InnerRevRegDef' + type: object + RevRegDef: + properties: + credDefId: + description: Credential definition identifier + example: did:(method):3:CL:20:tag + type: string + issuerId: + description: Issuer Identifier of the credential definition or schema + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + revocDefType: + type: string + tag: + description: tag for the revocation registry definition + example: default + type: string + value: + $ref: '#/definitions/RevRegDefValue' + type: object + RevRegDefOptions: + properties: + create_transaction_for_endorser: + description: Create transaction for endorser (optional, default false). Use this for agents who don't specify an author role but want to create a transaction for an endorser to sign. + example: false + type: boolean + endorser_connection_id: + description: Connection identifier (optional) (this is an example). You can set this if you know the endorser's connection id you want to use. If not specified then the agent will attempt to find an endorser connection. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + type: object + RevRegDefResult: + properties: + job_id: + type: string + registration_metadata: + additionalProperties: { } + type: object + revocation_registry_definition_metadata: + additionalProperties: { } + type: object + revocation_registry_definition_state: + $ref: '#/definitions/RevRegDefState' + type: object + RevRegDefState: + properties: + revocation_registry_definition: + allOf: + - $ref: '#/definitions/RevRegDef' + description: revocation registry definition + revocation_registry_definition_id: + description: revocation registry definition id + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + type: string + state: + enum: + - finished + - failed + - action + - wait + - decommissioned + - full + type: string + type: object + RevRegDefValue: + properties: + maxCredNum: + example: 777 + type: integer + publicKeys: + additionalProperties: { } + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + type: object + tailsHash: + example: 7Qen9RDyemMuV7xGQvp7NjwMSpyHieJyBakycxN7dX7P + type: string + tailsLocation: + example: https://tails-server.com/hash/7Qen9RDyemMuV7xGQvp7NjwMSpyHieJyBakycxN7dX7P + type: string + type: object + RevRegIssuedResult: + properties: + result: + description: Number of credentials issued against revocation registry + example: 0 + minimum: 0 + type: integer + type: object + RevRegIssuedResultSchemaAnoncreds: + properties: + result: + description: Number of credentials issued against revocation registry + example: 0 + minimum: 0 + type: integer + type: object + RevRegResult: + properties: + result: + $ref: '#/definitions/IssuerRevRegRecord' + type: object + RevRegResultSchemaAnoncreds: + properties: + result: + $ref: '#/definitions/IssuerRevRegRecord' + type: object + RevRegUpdateTailsFileUri: + properties: + tails_public_uri: + description: Public URI to the tails file + example: http://192.168.56.133:6543/revocation/registry/WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0/tails-file + format: url + type: string + required: + - tails_public_uri + type: object + RevRegWalletUpdatedResult: + properties: + accum_calculated: + additionalProperties: { } + description: Calculated accumulator for phantom revocations + type: object + accum_fixed: + additionalProperties: { } + description: Applied ledger transaction to fix revocations + type: object + rev_reg_delta: + additionalProperties: { } + description: Indy revocation registry delta + type: object + type: object + RevRegWalletUpdatedResultSchemaAnoncreds: + properties: + accum_calculated: + additionalProperties: { } + description: Calculated accumulator for phantom revocations + type: object + accum_fixed: + additionalProperties: { } + description: Applied ledger transaction to fix revocations + type: object + rev_reg_delta: + additionalProperties: { } + description: Indy revocation registry delta + type: object + type: object + RevRegsCreated: + properties: + rev_reg_ids: + items: + description: Revocation registry identifiers + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + type: array + type: object + RevRegsCreatedSchemaAnoncreds: + properties: + rev_reg_ids: + items: + description: Revocation registry identifiers + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + pattern: ^(.+$) + type: string + type: array + type: object + RevocationAnoncredsModuleResponse: + properties: { } + type: object + RevocationModuleResponse: + properties: { } + type: object + RevokeRequest: + properties: + comment: + description: Optional comment to include in revocation notification + type: string + connection_id: + description: Connection ID to which the revocation notification will be sent; required if notify is true + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + cred_ex_id: + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + cred_rev_id: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + notify: + description: Send a notification to the credential recipient + type: boolean + notify_version: + description: Specify which version of the revocation notification should be sent + enum: + - v1_0 + - v2_0 + type: string + publish: + description: (True) publish revocation to ledger immediately, or (default, False) mark it pending + type: boolean + rev_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + thread_id: + description: Thread ID of the credential exchange message thread resulting in the credential now being revoked; required if notify is true + type: string + type: object + RevokeRequestSchemaAnoncreds: + properties: + comment: + description: Optional comment to include in revocation notification + type: string + connection_id: + description: Connection ID to which the revocation notification will be sent; required if notify is true + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + cred_ex_id: + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + pattern: '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}' + type: string + cred_rev_id: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + notify: + description: Send a notification to the credential recipient + type: boolean + notify_version: + description: Specify which version of the revocation notification should be sent + enum: + - v1_0 + - v2_0 + type: string + publish: + description: (True) publish revocation to ledger immediately, or (default, False) mark it pending + type: boolean + rev_reg_id: + description: Revocation registry identifier + example: did:(method):4:did::3:CL:20:tag:CL_ACCUM:0 + pattern: ^(.+$) + type: string + thread_id: + description: Thread ID of the credential exchange message thread resulting in the credential now being revoked; required if notify is true + type: string + type: object + Rotate: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + to_did: + description: The DID the rotating party is rotating to + example: did:example:newdid + type: string + required: + - to_did + type: object + RouteRecord: + properties: + connection_id: + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + recipient_key: + type: string + record_id: + type: string + role: + type: string + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + wallet_id: + type: string + required: + - recipient_key + type: object + SDJWSCreate: + properties: + did: + description: DID of interest + example: did:peer:WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$ + type: string + headers: + additionalProperties: { } + type: object + non_sd_list: + items: + example: + - name + - address + - address.street_address + - nationalities[1:3] + pattern: '[a-z0-9:\[\]_\.@?\(\)]' + type: string + type: array + payload: + additionalProperties: { } + type: object + verificationMethod: + description: Information used for proof verification + example: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + pattern: \w+:(\/?\/?)[^\s]+ + type: string + required: + - payload + type: object + SDJWSVerify: + properties: + sd_jwt: + example: eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk~WyJEM3BUSFdCYWNRcFdpREc2TWZKLUZnIiwgIkRFIl0~WyJPMTFySVRjRTdHcXExYW9oRkd0aDh3IiwgIlNBIl0~WyJkVmEzX1JlTGNsWTU0R1FHZm5oWlRnIiwgInVwZGF0ZWRfYXQiLCAxNTcwMDAwMDAwXQ + pattern: ^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]+(?:~[a-zA-Z0-9._-]+)*~?$ + type: string + type: object + SDJWSVerifyResponse: + properties: + disclosures: + description: Disclosure arrays associated with the SD-JWT + example: + - - fx1iT_mETjGiC-JzRARnVg + - name + - Alice + - - n4-t3mlh8jSS6yMIT7QHnA + - street_address + - _sd: + - kLZrLK7enwfqeOzJ9-Ss88YS3mhjOAEk9lr_ix2Heng + items: + items: { } + type: array + type: array + error: + description: Error text + type: string + headers: + additionalProperties: { } + description: Headers from verified JWT. + type: object + kid: + description: kid of signer + type: string + payload: + additionalProperties: { } + description: Payload from verified JWT + type: object + valid: + type: boolean + required: + - headers + - kid + - payload + - valid + type: object + Schema: + properties: + attrNames: + description: Schema attribute names + items: + description: Attribute name + example: score + type: string + type: array + id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + name: + description: Schema name + example: schema_name + type: string + seqNo: + description: Schema sequence number + example: 10 + minimum: 1 + type: integer + ver: + description: Node protocol version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + SchemaGetResult: + properties: + schema: + $ref: '#/definitions/Schema' + type: object + SchemaInputDescriptor: + properties: + required: + description: Required + type: boolean + uri: + description: URI + type: string + type: object + SchemaPostOption: + properties: + create_transaction_for_endorser: + description: Create transaction for endorser (optional, default false). Use this for agents who don't specify an author role but want to create a transaction for an endorser to sign. + example: false + type: boolean + endorser_connection_id: + description: Connection identifier (optional) (this is an example). You can set this if you know the endorser's connection id you want to use. If not specified then the agent will attempt to find an endorser connection. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + type: object + SchemaPostRequest: + properties: + options: + $ref: '#/definitions/SchemaPostOption' + schema: + $ref: '#/definitions/AnonCredsSchema' + type: object + SchemaResult: + properties: + job_id: + type: string + registration_metadata: + additionalProperties: { } + type: object + schema_metadata: + additionalProperties: { } + type: object + schema_state: + $ref: '#/definitions/SchemaState' + type: object + SchemaSendRequest: + properties: + attributes: + description: List of schema attributes + items: + description: attribute name + example: score + type: string + type: array + schema_name: + description: Schema name + example: prefs + type: string + schema_version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + required: + - attributes + - schema_name + - schema_version + type: object + SchemaSendResult: + properties: + schema: + allOf: + - $ref: '#/definitions/Schema' + description: Schema definition + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + required: + - schema_id + type: object + SchemaState: + properties: + schema: + $ref: '#/definitions/AnonCredsSchema' + schema_id: + description: Schema identifier + example: did:(method):2:schema_name:1.0 + type: string + state: + enum: + - finished + - failed + - action + - wait + type: string + type: object + SchemaStorageAdd: + properties: + schema_id: + description: Schema identifier + type: string + required: + - schema_id + type: object + SchemaStorageList: + properties: + results: + description: List of schema storage records + items: + $ref: '#/definitions/SchemaStorageRecord' + type: array + type: object + SchemaStorageOperationResponse: + properties: + success: + description: True if operation successful, false if otherwise + type: boolean + required: + - success + type: object + SchemaStorageRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + ledger_id: + description: Schema identifier + type: string + schema: + additionalProperties: { } + description: (Indy) schema + type: object + schema_dict: + additionalProperties: { } + description: Serialized schema + type: object + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - schema_id + type: object + SchemasCreatedResult: + properties: + schema_ids: + items: + description: Schema identifiers + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + type: array + type: object + SchemasInputDescriptorFilter: + properties: + oneof_filter: + description: oneOf + type: boolean + uri_groups: + items: + items: + $ref: '#/definitions/SchemaInputDescriptor' + type: array + type: array + type: object + SendMenu: + properties: + menu: + allOf: + - $ref: '#/definitions/MenuJson' + description: Menu to send to connection + required: + - menu + type: object + SendMessage: + properties: + content: + description: Message content + example: Hello + type: string + type: object + ServiceDecorator: + properties: + recipientKeys: + description: List of recipient keys + items: + description: Recipient public key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + routingKeys: + description: List of routing keys + items: + description: Routing key + example: H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$ + type: string + type: array + serviceEndpoint: + description: Service endpoint at which to reach this agent + example: http://192.168.56.101:8020 + type: string + required: + - recipientKeys + - serviceEndpoint + type: object + SignRequest: + properties: + doc: + $ref: '#/definitions/Doc' + verkey: + description: Verkey to use for signing + type: string + required: + - doc + - verkey + type: object + SignResponse: + properties: + error: + description: Error text + type: string + signed_doc: + additionalProperties: { } + description: Signed document + type: object + type: object + SignatureOptions: + properties: + challenge: + type: string + domain: + type: string + proofPurpose: + type: string + type: + type: string + verificationMethod: + type: string + required: + - proofPurpose + - verificationMethod + type: object + SignedDoc: + additionalProperties: true + properties: + proof: + allOf: + - $ref: '#/definitions/SignatureOptions' + description: Linked data proof + required: + - proof + type: object + StoreCredentialRequest: + properties: + verifiableCredential: + $ref: '#/definitions/VerifiableCredential' + type: object + StoreCredentialResponse: + properties: + credentialId: + type: string + type: object + SubmissionRequirements: + properties: + count: + description: Count Value + example: 1234 + type: integer + from: + description: From + type: string + from_nested: + items: + $ref: '#/definitions/SubmissionRequirements' + type: array + max: + description: Max Value + example: 1234 + type: integer + min: + description: Min Value + example: 1234 + type: integer + name: + description: Name + type: string + purpose: + description: Purpose + type: string + rule: + description: Selection + enum: + - all + - pick + type: string + type: object + TAAAccept: + properties: + mechanism: + type: string + text: + type: string + version: + type: string + type: object + TAAAcceptance: + properties: + mechanism: + type: string + time: + example: 1640995199 + maximum: 18446744073709552000 + minimum: 0 + type: integer + type: object + TAAInfo: + properties: + aml_record: + $ref: '#/definitions/AMLRecord' + taa_accepted: + $ref: '#/definitions/TAAAcceptance' + taa_record: + $ref: '#/definitions/TAARecord' + taa_required: + type: boolean + type: object + TAARecord: + properties: + digest: + type: string + text: + type: string + version: + type: string + type: object + TAAResult: + properties: + result: + $ref: '#/definitions/TAAInfo' + type: object + TailsDeleteResponse: + properties: + message: + type: string + type: object + TenantApiKeyRequest: + properties: + alias: + description: Alias/label + example: API key for my Tenant + type: string + required: + - alias + type: object + TenantAuthenticationApiList: + properties: + results: + description: List of reservations + items: + $ref: '#/definitions/TenantAuthenticationApiRecord' + type: array + type: object + TenantAuthenticationApiOperationResponse: + properties: + success: + description: True if operation successful, false if otherwise + type: boolean + required: + - success + type: object + TenantAuthenticationApiRecord: + properties: + alias: + description: Alias description for this API key + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + state: + description: Current record state + example: active + type: string + tenant_authentication_api_id: + description: Tenant Authentication API Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + tenant_id: + description: Tenant Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + required: + - alias + - tenant_authentication_api_id + type: object + TenantAuthenticationsApiRequest: + properties: + alias: + description: Alias/label + example: API key for sample line of business + type: string + tenant_id: + description: Tenant ID + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - alias + - tenant_id + type: object + TenantAuthenticationsApiResponse: + properties: + api_key: + description: The API key + example: 3bd14a1e8fb645ddadf9913c0922ff3b + type: string + tenant_authentication_api_id: + description: The API key record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - api_key + - tenant_authentication_api_id + type: object + TenantConfig: + properties: + auto_issuer: + description: True if tenant can make itself issuer, false if only innkeeper can + type: boolean + connect_to_endorser: + description: Endorser config + items: + $ref: '#/definitions/EndorserLedgerConfig' + type: array + create_public_did: + description: Public DID config + items: + description: Ledger identifier + type: string + type: array + curr_ledger_id: + description: Current ledger identifier + type: string + enable_ledger_switch: + description: True if tenant can switch endorser/ledger + type: boolean + type: object + TenantLedgerIdConfig: + properties: + ledger_id: + description: Ledger identifier + type: string + required: + - ledger_id + type: object + TenantList: + properties: + results: + description: List of tenants + items: + $ref: '#/definitions/TenantRecord' + type: array + type: object + TenantRecord: + properties: + auto_issuer: + description: True if tenant can make itself issuer, false if only innkeeper can + type: boolean + connect_to_endorser: + example: '{"endorser_alias": " ... ", "ledger_id": " ... "}' + items: + additionalProperties: { } + description: Endorser and ledger config + type: object + type: array + contact_email: + description: Email used to contact this Tenant + example: tmp@emailserver.com + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + created_public_did: + items: + description: Ledger id + type: string + type: array + curr_ledger_id: + description: Current ledger identifier + type: string + deleted_at: + description: Timestamp of the deletion + example: '2023-10-30T01:01:01Z' + type: string + enable_ledger_switch: + description: True if tenant can switch endorser/ledger + type: boolean + state: + description: The state of the tenant. + enum: + - active + - deleted + example: active + type: string + tenant_id: + description: Tenant Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + tenant_name: + description: Proposed name of Tenant + example: line of business short name + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + wallet_id: + description: Tenant Wallet Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - contact_email + - state + - tenant_id + - tenant_name + type: object + TransactionJobs: + properties: + transaction_my_job: + description: My transaction related job + enum: + - TRANSACTION_AUTHOR + - TRANSACTION_ENDORSER + - reset + type: string + transaction_their_job: + description: Their transaction related job + enum: + - TRANSACTION_AUTHOR + - TRANSACTION_ENDORSER + - reset + type: string + type: object + TransactionList: + properties: + results: + description: List of transaction records + items: + $ref: '#/definitions/TransactionRecord' + type: array + type: object + TransactionRecord: + properties: + _type: + description: Transaction type + example: '101' + type: string + connection_id: + description: The connection identifier for this particular transaction record + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + endorser_write_txn: + description: Request Endorser to write the ledger transaction, this parameter is deprecated and no longer supported. + example: false + type: boolean + formats: + items: + additionalProperties: + type: string + example: + attach_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + format: dif/endorse-transaction/request@v1.0 + type: object + type: array + messages_attach: + items: + additionalProperties: { } + example: + '@id': 143c458d-1b1c-40c7-ab85-4d16808ddf0a + data: + json: '{"endorser": "V4SGRU86Z58d6TV7PBUe6f","identifier": "LjgpST2rjsoxYegQDRm7EL","operation": {"data": {"attr_names": ["first_name", "last_name"],"name": "test_schema","version": "2.1",},"type": "101",},"protocolVersion": 2,"reqId": 1597766666168851000,"signatures": {"LjgpST2rjsox": "4ATKMn6Y9sTgwqaGTm7py2c2M8x1EVDTWKZArwyuPgjU"}, "taaAcceptance": {"mechanism": "manual","taaDigest": "f50fe2c2ab977006761d36bd6f23e4c6a7e0fc2feb9f62","time": 1597708800,}}' + mime-type: application/json + type: object + type: array + meta_data: + additionalProperties: { } + example: + context: + param1: param1_value + param2: param2_value + post_process: + - topic: topic_value + other: other_value + type: object + signature_request: + items: + additionalProperties: { } + example: + author_goal_code: aries.transaction.ledger.write + context: did:sov + method: add-signature + signature_type: default + signer_goal_code: aries.transaction.endorse + type: object + type: array + signature_response: + items: + additionalProperties: { } + example: + context: did:sov + message_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + method: add-signature + signer_goal_code: aries.transaction.refuse + type: object + type: array + state: + description: Current record state + example: active + type: string + thread_id: + description: Thread Identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + timing: + additionalProperties: { } + example: + expires_time: 2020-12-13T17:29:06+0000 + type: object + trace: + description: Record trace information, based on agent configuration + type: boolean + transaction_id: + description: Transaction identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + TxnOrCredentialDefinitionSendResult: + properties: + sent: + $ref: '#/definitions/CredentialDefinitionSendResult' + txn: + allOf: + - $ref: '#/definitions/TransactionRecord' + description: Credential definition transaction to endorse + type: object + TxnOrPublishRevocationsResult: + properties: + rrid2crid: + additionalProperties: + items: + description: Credential revocation identifier + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + type: array + description: Credential revocation ids by revocation registry id + type: object + txn: + items: + allOf: + - $ref: '#/definitions/TransactionRecord' + description: Revocation registry revocations transaction to endorse + type: array + type: object + TxnOrRegisterLedgerNymResponse: + properties: + success: + description: Success of nym registration operation + example: true + type: boolean + txn: + allOf: + - $ref: '#/definitions/TransactionRecord' + description: DID transaction to endorse + type: object + TxnOrRevRegResult: + properties: + sent: + $ref: '#/definitions/RevRegResult' + txn: + allOf: + - $ref: '#/definitions/TransactionRecord' + description: Revocation registry definition transaction to endorse + type: object + TxnOrSchemaSendResult: + properties: + sent: + allOf: + - $ref: '#/definitions/SchemaSendResult' + description: Content sent + txn: + allOf: + - $ref: '#/definitions/TransactionRecord' + description: Schema transaction to endorse + type: object + UpdateConnectionRequest: + properties: + alias: + description: Optional alias to apply to connection for later use + example: Bob, providing quotes + type: string + type: object + UpdateContactRequest: + properties: + contact_email: + description: The new email to associate with this tenant. + example: example@exampleserver.com + type: string + type: object + UpdateKeyRequest: + properties: + kid: + description: New kid to bind to the key pair, such as a verificationMethod. + example: did:web:example.com#key-02 + type: string + multikey: + description: Multikey of the key pair to update + example: z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i + type: string + required: + - kid + - multikey + type: object + UpdateKeyResponse: + properties: + kid: + description: The associated kid + example: did:web:example.com#key-02 + type: string + multikey: + description: The Public Key Multibase format (multikey) + example: z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i + type: string + type: object + UpdateProfileSettings: + properties: + extra_settings: + additionalProperties: { } + description: Agent config key-value pairs + example: + ACAPY_INVITE_PUBLIC: true + log-level: INFO + public-invites: false + type: object + type: object + UpdateWalletRequest: + properties: + extra_settings: + additionalProperties: { } + description: Agent config key-value pairs + type: object + image_url: + description: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. + example: https://aries.ca/images/sample.png + type: string + label: + description: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. + example: Alice + type: string + wallet_dispatch_type: + description: 'Webhook target dispatch type for this wallet. default: Dispatch only to webhooks associated with this wallet. base: Dispatch only to webhooks associated with the base wallet. both: Dispatch to both webhook targets.' + enum: + - default + - both + - base + example: default + type: string + wallet_webhook_urls: + description: List of Webhook URLs associated with this subwallet + items: + description: Optional webhook URL to receive webhook messages + example: http://localhost:8022/webhooks + type: string + type: array + type: object + UpgradeResult: + properties: { } + type: object + V10CredentialBoundOfferRequest: + properties: + counter_proposal: + allOf: + - $ref: '#/definitions/CredentialProposal' + description: Optional counter-proposal + type: object + V10CredentialConnFreeOfferRequest: + properties: + auto_issue: + description: Whether to respond automatically to credential requests, creating and issuing requested credentials + type: boolean + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_preview: + $ref: '#/definitions/CredentialPreview' + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - cred_def_id + - credential_preview + type: object + V10CredentialCreate: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_proposal: + $ref: '#/definitions/CredentialPreview' + issuer_did: + description: Credential issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + schema_issuer_did: + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_name: + description: Schema name + example: preferences + type: string + schema_version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - credential_proposal + type: object + V10CredentialExchange: + properties: + auto_issue: + description: Issuer choice to issue to request in this credential exchange + example: false + type: boolean + auto_offer: + description: Holder choice to accept offer in this credential exchange + example: false + type: boolean + auto_remove: + description: Issuer choice to remove this credential exchange record when complete + example: false + type: boolean + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + credential: + allOf: + - $ref: '#/definitions/IndyCredInfo' + description: Credential as stored + credential_definition_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_exchange_id: + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + credential_id: + description: Credential identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + credential_offer: + allOf: + - $ref: '#/definitions/IndyCredAbstract' + description: (Indy) credential offer + credential_offer_dict: + allOf: + - $ref: '#/definitions/CredentialOffer' + description: Credential offer message + credential_proposal_dict: + allOf: + - $ref: '#/definitions/CredentialProposal' + description: Credential proposal message + credential_request: + allOf: + - $ref: '#/definitions/IndyCredRequest' + description: (Indy) credential request + credential_request_metadata: + additionalProperties: { } + description: (Indy) credential request metadata + type: object + error_msg: + description: Error message + example: Credential definition identifier is not set in proposal + type: string + initiator: + description: 'Issue-credential exchange initiator: self or external' + enum: + - self + - external + example: self + type: string + parent_thread_id: + description: Parent thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + raw_credential: + allOf: + - $ref: '#/definitions/IndyCredential' + description: Credential as received, prior to storage in holder wallet + revoc_reg_id: + description: Revocation registry identifier + type: string + revocation_id: + description: Credential identifier within revocation registry + type: string + role: + description: 'Issue-credential exchange role: holder or issuer' + enum: + - holder + - issuer + example: issuer + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + state: + description: Issue-credential exchange state + example: credential_acked + type: string + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + V10CredentialExchangeAutoRemoveRequest: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + type: object + V10CredentialExchangeListResult: + properties: + results: + description: Aries#0036 v1.0 credential exchange records + items: + $ref: '#/definitions/V10CredentialExchange' + type: array + type: object + V10CredentialFreeOfferRequest: + properties: + auto_issue: + description: Whether to respond automatically to credential requests, creating and issuing requested credentials + type: boolean + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_preview: + $ref: '#/definitions/CredentialPreview' + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - connection_id + - cred_def_id + - credential_preview + type: object + V10CredentialIssueRequest: + properties: + comment: + description: Human-readable comment + type: string + x-nullable: true + type: object + V10CredentialProblemReportRequest: + properties: + description: + type: string + required: + - description + type: object + V10CredentialProposalRequestMand: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_proposal: + $ref: '#/definitions/CredentialPreview' + issuer_did: + description: Credential issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + schema_issuer_did: + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_name: + description: Schema name + example: preferences + type: string + schema_version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - connection_id + - credential_proposal + type: object + V10CredentialProposalRequestOpt: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + credential_proposal: + $ref: '#/definitions/CredentialPreview' + issuer_did: + description: Credential issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + schema_issuer_did: + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_name: + description: Schema name + example: preferences + type: string + schema_version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - connection_id + type: object + V10CredentialStoreRequest: + properties: + credential_id: + type: string + type: object + V10DiscoveryExchangeListResult: + properties: + results: + items: + allOf: + - $ref: '#/definitions/V10DiscoveryRecord' + description: Discover Features v1.0 exchange record + type: array + type: object + V10DiscoveryRecord: + properties: + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + disclose: + allOf: + - $ref: '#/definitions/Disclose' + description: Disclose message + discovery_exchange_id: + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + query_msg: + allOf: + - $ref: '#/definitions/Query' + description: Query message + state: + description: Current record state + example: active + type: string + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + V10PresentProofModuleResponse: + properties: { } + type: object + V10PresentationCreateRequestRequest: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + example: false + type: boolean + comment: + type: string + x-nullable: true + proof_request: + $ref: '#/definitions/IndyProofRequest' + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - proof_request + type: object + V10PresentationExchange: + properties: + auto_present: + description: Prover choice to auto-present proof as verifier requests + example: false + type: boolean + auto_remove: + description: Verifier choice to remove this presentation exchange record when complete + example: false + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + type: boolean + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + error_msg: + description: Error message + example: Invalid structure + type: string + initiator: + description: 'Present-proof exchange initiator: self or external' + enum: + - self + - external + example: self + type: string + presentation: + allOf: + - $ref: '#/definitions/IndyProof' + description: (Indy) presentation (also known as proof) + presentation_exchange_id: + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + presentation_proposal_dict: + allOf: + - $ref: '#/definitions/PresentationProposal' + description: Presentation proposal message + presentation_request: + allOf: + - $ref: '#/definitions/IndyProofRequest' + description: (Indy) presentation request (also known as proof request) + presentation_request_dict: + allOf: + - $ref: '#/definitions/PresentationRequest' + description: Presentation request message + role: + description: 'Present-proof exchange role: prover or verifier' + enum: + - prover + - verifier + example: prover + type: string + state: + description: Present-proof exchange state + example: verified + type: string + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + verified: + description: 'Whether presentation is verified: true or false' + enum: + - 'true' + - 'false' + example: 'true' + type: string + verified_msgs: + items: + description: Proof verification warning or error information + type: string + type: array + type: object + V10PresentationExchangeList: + properties: + results: + description: Aries RFC 37 v1.0 presentation exchange records + items: + $ref: '#/definitions/V10PresentationExchange' + type: array + type: object + V10PresentationProblemReportRequest: + properties: + description: + type: string + required: + - description + type: object + V10PresentationProposalRequest: + properties: + auto_present: + description: Whether to respond automatically to presentation requests, building and presenting requested proof + type: boolean + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + presentation_proposal: + $ref: '#/definitions/IndyPresPreview' + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - connection_id + - presentation_proposal + type: object + V10PresentationSendRequest: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + requested_attributes: + additionalProperties: + $ref: '#/definitions/IndyRequestedCredsRequestedAttr' + description: Nested object mapping proof request attribute referents to requested-attribute specifiers + type: object + requested_predicates: + additionalProperties: + $ref: '#/definitions/IndyRequestedCredsRequestedPred' + description: Nested object mapping proof request predicate referents to requested-predicate specifiers + type: object + self_attested_attributes: + additionalProperties: + description: Self-attested attribute values to use in requested-credentials structure for proof construction + example: self_attested_value + type: string + description: Self-attested attributes to build into proof + type: object + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - requested_attributes + - requested_predicates + - self_attested_attributes + type: object + V10PresentationSendRequestRequest: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + example: false + type: boolean + comment: + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + proof_request: + $ref: '#/definitions/IndyProofRequest' + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - connection_id + - proof_request + type: object + V10PresentationSendRequestToProposal: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + example: false + type: boolean + trace: + description: Whether to trace event (default false) + example: false + type: boolean + type: object + V20CredAttrSpec: + properties: + mime-type: + description: 'MIME type: omit for (null) default' + example: image/jpeg + type: string + x-nullable: true + name: + description: Attribute name + example: favourite_drink + type: string + value: + description: 'Attribute value: base64-encode if MIME type is present' + example: martini + type: string + required: + - name + - value + type: object + V20CredBoundOfferRequest: + properties: + counter_preview: + allOf: + - $ref: '#/definitions/V20CredPreview' + description: Optional content for counter-proposal + filter: + allOf: + - $ref: '#/definitions/V20CredFilter' + description: Credential specification criteria by format + type: object + V20CredExFree: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + credential_preview: + $ref: '#/definitions/V20CredPreview' + filter: + allOf: + - $ref: '#/definitions/V20CredFilter' + description: Credential specification criteria by format + replacement_id: + description: Optional identifier used to manage credential replacement + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + x-nullable: true + trace: + description: Record trace information, based on agent configuration + type: boolean + verification_method: + description: For ld-proofs. Verification method for signing. + type: string + x-nullable: true + required: + - connection_id + - filter + type: object + V20CredExRecord: + properties: + auto_issue: + description: Issuer choice to issue to request in this credential exchange + example: false + type: boolean + auto_offer: + description: Holder choice to accept offer in this credential exchange + example: false + type: boolean + auto_remove: + description: Issuer choice to remove this credential exchange record when complete + example: false + type: boolean + by_format: + allOf: + - $ref: '#/definitions/V20CredExRecordByFormat' + description: Attachment content by format for proposal, offer, request, and issue + readOnly: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_ex_id: + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_issue: + allOf: + - $ref: '#/definitions/V20CredIssue' + description: Serialized credential issue message + cred_offer: + allOf: + - $ref: '#/definitions/V20CredOffer' + description: Credential offer message + cred_preview: + allOf: + - $ref: '#/definitions/V20CredPreview' + description: Credential preview from credential proposal + readOnly: true + cred_proposal: + allOf: + - $ref: '#/definitions/V20CredProposal' + description: Credential proposal message + cred_request: + allOf: + - $ref: '#/definitions/V20CredRequest' + description: Serialized credential request message + error_msg: + description: Error message + example: The front fell off + type: string + initiator: + description: 'Issue-credential exchange initiator: self or external' + enum: + - self + - external + example: self + type: string + parent_thread_id: + description: Parent thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + role: + description: 'Issue-credential exchange role: holder or issuer' + enum: + - issuer + - holder + example: issuer + type: string + state: + description: Issue-credential exchange state + enum: + - proposal-sent + - proposal-received + - offer-sent + - offer-received + - request-sent + - request-received + - credential-issued + - credential-received + - done + - credential-revoked + - abandoned + - deleted + example: done + type: string + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + V20CredExRecordByFormat: + properties: + cred_issue: + additionalProperties: { } + type: object + cred_offer: + additionalProperties: { } + type: object + cred_proposal: + additionalProperties: { } + type: object + cred_request: + additionalProperties: { } + type: object + type: object + V20CredExRecordDetail: + properties: + cred_ex_record: + allOf: + - $ref: '#/definitions/V20CredExRecord' + description: Credential exchange record + indy: + $ref: '#/definitions/V20CredExRecordIndy' + ld_proof: + $ref: '#/definitions/V20CredExRecordLDProof' + vc_di: + $ref: '#/definitions/V20CredExRecord' + type: object + V20CredExRecordIndy: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_ex_id: + description: Corresponding v2.0 credential exchange record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_ex_indy_id: + description: Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_id_stored: + description: Credential identifier stored in wallet + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_request_metadata: + additionalProperties: { } + description: Credential request metadata for indy holder + type: object + cred_rev_id: + description: Credential revocation identifier within revocation registry + example: '12345' + pattern: ^[1-9][0-9]*$ + type: string + rev_reg_id: + description: Revocation registry identifier + example: WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0 + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):4:([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$) + type: string + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + V20CredExRecordLDProof: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + cred_ex_id: + description: Corresponding v2.0 credential exchange record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_ex_ld_proof_id: + description: Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + cred_id_stored: + description: Credential identifier stored in wallet + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + V20CredExRecordListResult: + properties: + results: + description: Credential exchange records and corresponding detail records + items: + $ref: '#/definitions/V20CredExRecordDetail' + type: array + type: object + V20CredFilter: + properties: + anoncreds: + allOf: + - $ref: '#/definitions/V20CredFilterAnoncreds' + description: Credential filter for anoncreds + indy: + allOf: + - $ref: '#/definitions/V20CredFilterIndy' + description: Credential filter for indy + ld_proof: + allOf: + - $ref: '#/definitions/LDProofVCDetail' + description: Credential filter for linked data proof + vc_di: + allOf: + - $ref: '#/definitions/V20CredFilterVCDI' + description: Credential filter for vc_di + type: object + V20CredFilterAnoncreds: + properties: + cred_def_id: + description: Credential definition identifier + example: did:(method):3:CL:20:tag + type: string + issuer_id: + description: Credential issuer ID + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + schema_id: + description: Schema identifier + example: did:(method):2:schema_name:1.0 + type: string + schema_issuer_id: + description: Schema issuer ID + example: did:(method):WgWxqztrNooG92RXvxSTWv + type: string + schema_name: + description: Schema name + example: preferences + type: string + schema_version: + description: Schema version + example: '1.0' + type: string + type: object + V20CredFilterIndy: + properties: + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + issuer_did: + description: Credential issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + schema_issuer_did: + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_name: + description: Schema name + example: preferences + type: string + schema_version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + V20CredFilterLDProof: + properties: + ld_proof: + allOf: + - $ref: '#/definitions/LDProofVCDetail' + description: Credential filter for linked data proof + required: + - ld_proof + type: object + V20CredFilterVCDI: + properties: + cred_def_id: + description: Credential definition identifier + example: WgWxqztrNooG92RXvxSTWv:3:CL:20:tag + pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$ + type: string + issuer_did: + description: Credential issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_id: + description: Schema identifier + example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0 + pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+$ + type: string + schema_issuer_did: + description: Schema issuer DID + example: WgWxqztrNooG92RXvxSTWv + pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$ + type: string + schema_name: + description: Schema name + example: preferences + type: string + schema_version: + description: Schema version + example: '1.0' + pattern: ^[0-9.]+$ + type: string + type: object + V20CredFormat: + properties: + attach_id: + description: Attachment identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + format: + description: Attachment format specifier + example: aries/ld-proof-vc-detail@v1.0 + type: string + required: + - attach_id + - format + type: object + V20CredIssue: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + credentials~attach: + description: Credential attachments + items: + $ref: '#/definitions/AttachDecorator' + type: array + formats: + description: Acceptable attachment formats + items: + $ref: '#/definitions/V20CredFormat' + type: array + replacement_id: + description: Issuer-unique identifier to coordinate credential replacement + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - credentials~attach + - formats + type: object + V20CredIssueProblemReportRequest: + properties: + description: + type: string + required: + - description + type: object + V20CredIssueRequest: + properties: + comment: + description: Human-readable comment + type: string + x-nullable: true + type: object + V20CredOffer: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + credential_preview: + $ref: '#/definitions/V20CredPreview' + formats: + description: Acceptable credential formats + items: + $ref: '#/definitions/V20CredFormat' + type: array + offers~attach: + description: Offer attachments + items: + $ref: '#/definitions/AttachDecorator' + type: array + replacement_id: + description: Issuer-unique identifier to coordinate credential replacement + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - formats + - offers~attach + type: object + V20CredOfferConnFreeRequest: + properties: + auto_issue: + description: Whether to respond automatically to credential requests, creating and issuing requested credentials + type: boolean + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + credential_preview: + $ref: '#/definitions/V20CredPreview' + filter: + allOf: + - $ref: '#/definitions/V20CredFilter' + description: Credential specification criteria by format + replacement_id: + description: Optional identifier used to manage credential replacement + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + x-nullable: true + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - filter + type: object + V20CredOfferRequest: + properties: + auto_issue: + description: Whether to respond automatically to credential requests, creating and issuing requested credentials + type: boolean + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + credential_preview: + $ref: '#/definitions/V20CredPreview' + filter: + allOf: + - $ref: '#/definitions/V20CredFilter' + description: Credential specification criteria by format + replacement_id: + description: Optional identifier used to manage credential replacement + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + x-nullable: true + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - connection_id + - filter + type: object + V20CredPreview: + properties: + '@type': + description: Message type identifier + example: issue-credential/2.0/credential-preview + type: string + attributes: + items: + $ref: '#/definitions/V20CredAttrSpec' + type: array + required: + - attributes + type: object + V20CredProposal: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + credential_preview: + allOf: + - $ref: '#/definitions/V20CredPreview' + description: Credential preview + filters~attach: + description: Credential filter per acceptable format on corresponding identifier + items: + $ref: '#/definitions/AttachDecorator' + type: array + formats: + description: Attachment formats + items: + $ref: '#/definitions/V20CredFormat' + type: array + required: + - filters~attach + - formats + type: object + V20CredRequest: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + formats: + description: Acceptable attachment formats + items: + $ref: '#/definitions/V20CredFormat' + type: array + requests~attach: + description: Request attachments + items: + $ref: '#/definitions/AttachDecorator' + type: array + required: + - formats + - requests~attach + type: object + V20CredRequestFree: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + filter: + allOf: + - $ref: '#/definitions/V20CredFilterLDProof' + description: Credential specification criteria by format + holder_did: + description: Holder DID to substitute for the credentialSubject.id + example: did:key:ahsdkjahsdkjhaskjdhakjshdkajhsdkjahs + type: string + x-nullable: true + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - connection_id + - filter + type: object + V20CredRequestRequest: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + holder_did: + description: Holder DID to substitute for the credentialSubject.id + example: did:key:ahsdkjahsdkjhaskjdhakjshdkajhsdkjahs + type: string + x-nullable: true + type: object + V20CredStoreRequest: + properties: + credential_id: + type: string + type: object + V20DiscoveryExchangeListResult: + properties: + results: + items: + allOf: + - $ref: '#/definitions/V20DiscoveryRecord' + description: Discover Features v2.0 exchange record + type: array + type: object + V20DiscoveryExchangeResult: + properties: + results: + allOf: + - $ref: '#/definitions/V20DiscoveryRecord' + description: Discover Features v2.0 exchange record + type: object + V20DiscoveryRecord: + properties: + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + disclosures: + allOf: + - $ref: '#/definitions/Disclosures' + description: Disclosures message + discovery_exchange_id: + description: Credential exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + queries_msg: + allOf: + - $ref: '#/definitions/Queries' + description: Queries message + state: + description: Current record state + example: active + type: string + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + type: object + V20IssueCredSchemaCore: + properties: + auto_remove: + description: Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + credential_preview: + $ref: '#/definitions/V20CredPreview' + filter: + allOf: + - $ref: '#/definitions/V20CredFilter' + description: Credential specification criteria by format + replacement_id: + description: Optional identifier used to manage credential replacement + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + x-nullable: true + trace: + description: Record trace information, based on agent configuration + type: boolean + required: + - filter + type: object + V20IssueCredentialModuleResponse: + properties: { } + type: object + V20Pres: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + x-nullable: true + formats: + description: Acceptable attachment formats + items: + $ref: '#/definitions/V20PresFormat' + type: array + presentations~attach: + items: + $ref: '#/definitions/AttachDecorator' + type: array + required: + - formats + - presentations~attach + type: object + V20PresCreateRequestRequest: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + example: false + type: boolean + comment: + type: string + x-nullable: true + presentation_request: + $ref: '#/definitions/V20PresRequestByFormat' + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - presentation_request + type: object + V20PresExRecord: + properties: + auto_present: + description: Prover choice to auto-present proof as verifier requests + example: false + type: boolean + auto_remove: + description: Verifier choice to remove this presentation exchange record when complete + example: false + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + type: boolean + by_format: + allOf: + - $ref: '#/definitions/V20PresExRecordByFormat' + description: Attachment content by format for proposal, request, and presentation + readOnly: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + error_msg: + description: Error message + example: Invalid structure + type: string + initiator: + description: 'Present-proof exchange initiator: self or external' + enum: + - self + - external + example: self + type: string + pres: + allOf: + - $ref: '#/definitions/V20Pres' + description: Presentation message + pres_ex_id: + description: Presentation exchange identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + pres_proposal: + allOf: + - $ref: '#/definitions/V20PresProposal' + description: Presentation proposal message + pres_request: + allOf: + - $ref: '#/definitions/V20PresRequest' + description: Presentation request message + role: + description: 'Present-proof exchange role: prover or verifier' + enum: + - prover + - verifier + example: prover + type: string + state: + description: Present-proof exchange state + enum: + - proposal-sent + - proposal-received + - request-sent + - request-received + - presentation-sent + - presentation-received + - done + - abandoned + - deleted + type: string + thread_id: + description: Thread identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + trace: + description: Record trace information, based on agent configuration + type: boolean + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + verified: + description: 'Whether presentation is verified: ''true'' or ''false''' + enum: + - 'true' + - 'false' + example: 'true' + type: string + verified_msgs: + items: + description: Proof verification warning or error information + type: string + type: array + type: object + V20PresExRecordByFormat: + properties: + pres: + additionalProperties: { } + type: object + pres_proposal: + additionalProperties: { } + type: object + pres_request: + additionalProperties: { } + type: object + type: object + V20PresExRecordList: + properties: + results: + description: Presentation exchange records + items: + $ref: '#/definitions/V20PresExRecord' + type: array + type: object + V20PresFormat: + properties: + attach_id: + description: Attachment identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + format: + description: Attachment format specifier + example: dif/presentation-exchange/submission@v1.0 + type: string + required: + - attach_id + - format + type: object + V20PresProblemReportRequest: + properties: + description: + type: string + required: + - description + type: object + V20PresProposal: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + formats: + description: Acceptable attachment formats + items: + $ref: '#/definitions/V20PresFormat' + type: array + proposals~attach: + description: Attachment per acceptable format on corresponding identifier + items: + $ref: '#/definitions/AttachDecorator' + type: array + required: + - formats + - proposals~attach + type: object + V20PresProposalByFormat: + properties: + anoncreds: + allOf: + - $ref: '#/definitions/AnoncredsPresentationRequest' + description: Presentation proposal for anoncreds + dif: + allOf: + - $ref: '#/definitions/DIFProofProposal' + description: Presentation proposal for DIF + indy: + allOf: + - $ref: '#/definitions/IndyProofRequest' + description: Presentation proposal for indy + type: object + V20PresProposalRequest: + properties: + auto_present: + description: Whether to respond automatically to presentation requests, building and presenting requested proof + type: boolean + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + comment: + description: Human-readable comment + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + presentation_proposal: + $ref: '#/definitions/V20PresProposalByFormat' + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - connection_id + - presentation_proposal + type: object + V20PresRequest: + properties: + '@id': + description: Message identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + '@type': + description: Message type + example: https://didcomm.org/my-family/1.0/my-message-type + type: string + comment: + description: Human-readable comment + type: string + formats: + description: Acceptable attachment formats + items: + $ref: '#/definitions/V20PresFormat' + type: array + request_presentations~attach: + description: Attachment per acceptable format on corresponding identifier + items: + $ref: '#/definitions/AttachDecorator' + type: array + will_confirm: + description: Whether verifier will send confirmation ack + type: boolean + required: + - formats + - request_presentations~attach + type: object + V20PresRequestByFormat: + properties: + anoncreds: + allOf: + - $ref: '#/definitions/AnoncredsPresentationRequest' + description: Presentation proposal for anoncreds + dif: + allOf: + - $ref: '#/definitions/DIFProofRequest' + description: Presentation request for DIF + indy: + allOf: + - $ref: '#/definitions/IndyProofRequest' + description: Presentation request for indy + type: object + V20PresSendRequestRequest: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + example: false + type: boolean + comment: + type: string + x-nullable: true + connection_id: + description: Connection identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + presentation_request: + $ref: '#/definitions/V20PresRequestByFormat' + trace: + description: Whether to trace event (default false) + example: false + type: boolean + required: + - connection_id + - presentation_request + type: object + V20PresSpecByFormatRequest: + properties: + anoncreds: + allOf: + - $ref: '#/definitions/IndyPresSpec' + description: Presentation specification for anoncreds + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + dif: + allOf: + - $ref: '#/definitions/DIFPresSpec' + description: Optional Presentation specification for DIF, overrides the PresentationExchange record's PresRequest + indy: + allOf: + - $ref: '#/definitions/IndyPresSpec' + description: Presentation specification for indy + trace: + description: Record trace information, based on agent configuration + type: boolean + type: object + V20PresentProofModuleResponse: + properties: { } + type: object + V20PresentationSendRequestToProposal: + properties: + auto_remove: + description: Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting) + type: boolean + auto_verify: + description: Verifier choice to auto-verify proof presentation + example: false + type: boolean + trace: + description: Whether to trace event (default false) + example: false + type: boolean + type: object + VCRecord: + properties: + contexts: + items: + description: Context + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + type: array + cred_tags: + additionalProperties: + description: Retrieval tag value + type: string + type: object + cred_value: + additionalProperties: { } + description: (JSON-serializable) credential value + type: object + expanded_types: + items: + description: JSON-LD expanded type extracted from type and context + example: https://w3id.org/citizenship#PermanentResidentCard + type: string + type: array + given_id: + description: Credential identifier + example: http://example.edu/credentials/3732 + type: string + issuer_id: + description: Issuer identifier + example: https://example.edu/issuers/14 + type: string + proof_types: + items: + description: Signature suite used for proof + example: Ed25519Signature2018 + type: string + type: array + record_id: + description: Record identifier + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + schema_ids: + items: + description: Schema identifier + example: https://example.org/examples/degree.json + type: string + type: array + subject_ids: + items: + description: Subject identifier + example: did:example:ebfeb1f712ebc6f1c276e12ec21 + type: string + type: array + type: object + VCRecordList: + properties: + results: + items: + $ref: '#/definitions/VCRecord' + type: array + type: object + VerifiableCredential: + additionalProperties: true + properties: + '@context': + description: The JSON-LD context of the credential + example: + - https://www.w3.org/2018/credentials/v1 + - https://www.w3.org/2018/credentials/examples/v1 + items: { } + type: array + credentialStatus: + example: + id: https://example.com/credentials/status/3#94567 + statusListCredential: https://example.com/credentials/status/3 + statusListIndex: '94567' + statusPurpose: revocation + type: BitstringStatusListEntry + credentialSubject: + example: + alumniOf: + id: did:example:c276e12ec21ebfeb1f712ebc6f1 + id: did:example:ebfeb1f712ebc6f1c276e12ec21 + expirationDate: + description: The expiration date + example: '2010-01-01T19:23:24Z' + pattern: ^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt ]([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?$ + type: string + id: + description: The ID of the credential + example: http://example.edu/credentials/1872 + pattern: \w+:(\/?\/?)[^\s]+ + type: string + issuanceDate: + description: The issuance date + example: '2010-01-01T19:23:24Z' + pattern: ^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt ]([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?$ + type: string + issuer: + description: The JSON-LD Verifiable Credential Issuer. Either string of object with id field. + example: did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + proof: + allOf: + - $ref: '#/definitions/LinkedDataProof' + description: The proof of the credential + example: + created: '2019-12-11T03:50:55' + jws: eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0JiNjQiXX0..lKJU0Df_keblRKhZAS9Qq6zybm-HqUXNVZ8vgEPNTAjQKBhQDxvXNo7nvtUBb_Eq1Ch6YBKY5qBQ + proofPurpose: assertionMethod + type: Ed25519Signature2018 + verificationMethod: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + type: + description: The JSON-LD type of the credential + example: + - VerifiableCredential + - AlumniCredential + items: + type: string + type: array + required: + - '@context' + - credentialSubject + - issuanceDate + - issuer + - proof + - type + type: object + VerifiablePresentation: + additionalProperties: true + properties: + '@context': + description: The JSON-LD context of the presentation + example: + - https://www.w3.org/2018/credentials/v1 + items: { } + type: array + holder: + description: The JSON-LD Verifiable Credential Holder. Either string of object with id field. + example: did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH + id: + description: The ID of the presentation + example: http://example.edu/presentations/1872 + pattern: \w+:(\/?\/?)[^\s]+ + type: string + proof: + allOf: + - $ref: '#/definitions/LinkedDataProof' + description: The proof of the presentation + example: + created: '2019-12-11T03:50:55' + jws: eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0JiNjQiXX0..lKJU0Df_keblRKhZAS9Qq6zybm-HqUXNVZ8vgEPNTAjQKBhQDxvXNo7nvtUBb_Eq1Ch6YBKY5qBQ + proofPurpose: assertionMethod + type: Ed25519Signature2018 + verificationMethod: did:key:z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL#z6Mkgg342Ycpuk263R9d8Aq6MUaxPn1DDeHyGo38EefXmgDL + type: + description: The JSON-LD type of the presentation + example: + - VerifiablePresentation + items: + type: string + type: array + verifiableCredential: + items: + additionalProperties: { } + type: object + type: array + required: + - '@context' + - proof + - type + type: object + VerifyCredentialRequest: + properties: + options: + $ref: '#/definitions/LDProofVCOptions' + verifiableCredential: + $ref: '#/definitions/VerifiableCredential' + type: object + VerifyCredentialResponse: + properties: + results: + $ref: '#/definitions/PresentationVerificationResult' + type: object + VerifyDiRequest: + properties: + securedDocument: + additionalProperties: { } + example: + hello: world + proof: + - cryptosuite: eddsa-jcs-2022 + proofPurpose: assertionMethod + type: DataIntegrityProof + verificationMethod: 'did:key: z6MksxraKwH8GR7NKeQ4HVZAeRKvD76kfd6G7jm8MscbDmy8# z6MksxraKwH8GR7NKeQ4HVZAeRKvD76kfd6G7jm8MscbDmy8' + proofValue: zHtda8vV7kJQUPfSKiTGSQDhZfhkgtpnVziT7cdEzhu fjPjbeRmysHvizMJEox1eHR7xUGzNUj1V4yaKiLw7UA6E + type: object + required: + - securedDocument + type: object + VerifyDiResponse: + properties: + verified: + description: Verified + example: true + type: boolean + type: object + VerifyPresentationRequest: + properties: + options: + $ref: '#/definitions/LDProofVCOptions' + verifiablePresentation: + $ref: '#/definitions/VerifiablePresentation' + type: object + VerifyPresentationResponse: + properties: + results: + $ref: '#/definitions/PresentationVerificationResult' + type: object + VerifyRequest: + properties: + doc: + allOf: + - $ref: '#/definitions/SignedDoc' + description: Signed document + verkey: + description: Verkey to use for doc verification + type: string + required: + - doc + type: object + VerifyResponse: + properties: + error: + description: Error text + type: string + valid: + type: boolean + required: + - valid + type: object + W3CCredentialsListRequest: + properties: + contexts: + items: + description: Credential context to match + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + type: array + given_id: + description: Given credential id to match + type: string + issuer_id: + description: Credential issuer identifier to match + type: string + max_results: + description: Maximum number of results to return + type: integer + proof_types: + items: + description: Signature suite used for proof + example: Ed25519Signature2018 + type: string + type: array + schema_ids: + description: Schema identifiers, all of which to match + items: + description: Credential schema identifier + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + type: array + subject_ids: + description: Subject identifiers, all of which to match + items: + description: Subject identifier + type: string + type: array + tag_query: + additionalProperties: + description: Tag value + type: string + description: Tag filter + type: object + types: + items: + description: Credential type to match + example: https://myhost:8021 + pattern: ^[A-Za-z0-9\.\-\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$ + type: string + type: array + type: object + WalletList: + properties: + results: + description: List of wallet records + items: + $ref: '#/definitions/WalletRecord' + type: array + type: object + WalletModuleResponse: + properties: { } + type: object + WalletRecord: + properties: + created_at: + description: Time of record creation + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + key_management_mode: + description: Mode regarding management of wallet key + enum: + - managed + - unmanaged + type: string + settings: + additionalProperties: { } + description: Settings for this wallet. + type: object + state: + description: Current record state + example: active + type: string + updated_at: + description: Time of last record update + example: '2021-12-31T23:59:59Z' + pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$ + type: string + wallet_id: + description: Wallet record ID + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + required: + - key_management_mode + - wallet_id + type: object + WriteLedger: + properties: + ledger_id: + type: string + type: object +securityDefinitions: + ApiKeyHeader: + type: apiKey + in: header + name: X-API-KEY + AuthorizationHeader: + type: apiKey + in: header + name: Authorization + description: Bearer token. Be sure to prepend token with 'Bearer ' +security: + - ApiKeyHeader: [ ] + - AuthorizationHeader: [ ] + ApiKeyHeader: [ ] +tags: + - name: action-menu + description: Menu interaction over connection + - name: anoncreds - credential definitions + description: Anoncreds credential definition management + externalDocs: + description: Specification + url: https://hyperledger.github.io/anoncreds-spec + - name: anoncreds - revocation + description: Revocation registry management + externalDocs: + description: Overview + url: https://github.com/hyperledger/indy-hipe/tree/master/text/0011-cred-revocation + - name: anoncreds - schemas + description: Anoncreds schema management + externalDocs: + description: Specification + url: https://hyperledger.github.io/anoncreds-spec + - name: anoncreds - wallet upgrade + description: Anoncreds wallet upgrade + externalDocs: + description: Specification + url: https://hyperledger.github.io/anoncreds-spec + - name: basicmessage + description: Simple messaging + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/527849ec3aa2a8fd47a7bb6c57f918ff8bcb5e8c/features/0095-basic-message + - name: basicmessage + description: Simple messaging + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/527849ec3aa2a8fd47a7bb6c57f918ff8bcb5e8c/features/0095-basic-message + - name: connection + description: Connection management + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/9b0aaa39df7e8bd434126c4b33c097aae78d65bf/features/0160-connection-protocol + - name: credential-definition + description: Credential definition operations + externalDocs: + description: Specification + url: https://github.com/hyperledger/indy-node/blob/master/design/anoncreds.md#cred_def + - name: credential-definition-storage + description: Traction Credential Definition Storage - Local storage of credential definition metadata (traction_innkeeper/creddef_storage v1_0 plugin) + - name: credentials + description: Holder credential management + externalDocs: + description: Overview + url: https://w3c.github.io/vc-data-model/#credentials + - name: did-exchange + description: Connection management via DID exchange + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/25464a5c8f8a17b14edaa4310393df6094ace7b0/features/0023-did-exchange + - name: did-rotate + description: Rotate a DID + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/main/features/0794-did-rotate + - name: discover-features + description: Feature discovery + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0031-discover-features + - name: discover-features v2.0 + description: Feature discovery v2 + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0557-discover-features-v2 + - name: drpc + description: DIDComm RPC between Aries agents + - name: endorse-transaction + description: Endorse a Transaction + - name: introduction + description: Introduction of known parties + - name: issue-credential v1.0 + description: Credential issue v1.0 + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/bb42a6c35e0d5543718fb36dd099551ab192f7b0/features/0036-issue-credential + - name: issue-credential v2.0 + description: Credential issue v2.0 + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/cd27fc64aa2805f756a118043d7c880354353047/features/0453-issue-credential-v2 + - name: jsonld + description: Sign and verify json-ld data + externalDocs: + description: Specification + url: https://tools.ietf.org/html/rfc7515 + - name: ledger + description: Interaction with ledger + externalDocs: + description: Overview + url: https://hyperledger-indy.readthedocs.io/projects/plenum/en/latest/storage.html#ledger + - name: mediation + description: Mediation management + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/fa8dc4ea1e667eb07db8f9ffeaf074a4455697c0/features/0211-route-coordination + - name: multitenancy + description: Multitenant wallet management + - name: multitenancy + description: Multitenant wallet management + - name: oca + description: OCA Bundles - manage OCA Bundles (traction_innkeeper v1_0 plugin) + - name: out-of-band + description: Out-of-band connections + externalDocs: + description: Design + url: https://github.com/hyperledger/aries-rfcs/tree/2da7fc4ee043effa3a9960150e7ba8c9a4628b68/features/0434-outofband + - name: present-proof v1.0 + description: Proof presentation v1.0 + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/4fae574c03f9f1013db30bf2c0c676b1122f7149/features/0037-present-proof + - name: present-proof v2.0 + description: Proof presentation v2.0 + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/eace815c3e8598d4a8dd7881d8c731fdb2bcc0aa/features/0454-present-proof-v2 + - name: resolver + description: did resolver interface. + externalDocs: + description: DID Resolution Specification + url: https://www.w3.org/TR/did-core/#resolution + - name: revocation + description: Revocation registry management + externalDocs: + description: Overview + url: https://github.com/hyperledger/indy-hipe/tree/master/text/0011-cred-revocation + - name: schema + description: Schema operations + externalDocs: + description: Specification + url: https://github.com/hyperledger/indy-node/blob/master/design/anoncreds.md#schema + - name: schema-storage + description: Traction Schema Storage - Local storage of schema metadata (traction_innkeeper/schema_storage v1_0 plugin) + - name: settings + description: Agent settings interface. + - name: traction-innkeeper + description: Traction Innkeeper - manage tenants (traction_innkeeper v1_0 plugin) + - name: traction-tenant + description: Traction Tenant - tenant self administration (traction_innkeeper v1_0 plugin) + - name: trustping + description: Trust-ping over connection + externalDocs: + description: Specification + url: https://github.com/hyperledger/aries-rfcs/tree/527849ec3aa2a8fd47a7bb6c57f918ff8bcb5e8c/features/0048-trust-ping + - name: vc-api + description: Endpoints for managing w3c credentials and presentations + externalDocs: + description: Specification + url: https://w3c-ccg.github.io/vc-api/ + - name: wallet + description: DID and tag policy management + externalDocs: + description: Design + url: https://github.com/hyperledger/indy-sdk/tree/master/docs/design/003-wallet-storage +display_configurations: { } diff --git a/packages/credential-showcase-traction-openapi/package.json b/packages/credential-showcase-traction-openapi/package.json new file mode 100644 index 0000000..426a805 --- /dev/null +++ b/packages/credential-showcase-traction-openapi/package.json @@ -0,0 +1,25 @@ +{ + "name": "credential-showcase-traction-openapi", + "version": "0.1.0", + "source": "src/index.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "dev": "tsc --watch", + "build": "tsc", + "build:clean": "tsc --build --clean && tsc --build" + }, + "files": [ + "dist/**/*", + "README.md", + "LICENSE" + ], + "private": false, + "publishConfig": { + "access": "public" + }, + "repository": "git@github.com:Sphereon-Opensource/credential-showcase-api.git", + "author": "4Sure", + "license": "Apache-2.0", + "keywords": [] +} diff --git a/packages/credential-showcase-traction-openapi/pom.xml b/packages/credential-showcase-traction-openapi/pom.xml new file mode 100644 index 0000000..d96dc9e --- /dev/null +++ b/packages/credential-showcase-traction-openapi/pom.xml @@ -0,0 +1,94 @@ + + + credential-showcase-openapi + + + + typescript-fetch-traction + + true + + + + + org.openapitools + openapi-generator-maven-plugin + ${openapi-generator-version} + + + typescript-fetch-traction + + generate + + + ${project.basedir}/openapi/traction-openapi.yaml + typescript-fetch + ${project.basedir}/src + + tech.4sure.traction.api + tech.4sure.traction.model + tech.4sure.traction.handler + + true + true + ${project.version} + + false + true + true + true + + + true + true + true + + + + OffsetDateTime=Instant + + + java.time.OffsetDateTime=java.time.Instant + + + true + false + ${openapi-codegen-verbose} + + + + + + + + + + Credential Showcase Traction Openapi + 4.0.0 + Credential Showcase Traction Openapi + + + spring-boot-starter-parent + org.springframework.boot + 2.7.6 + + + + + maven-central + Maven Central + https://repo1.maven.org/maven2/ + + + + + false + UTF-8 + 7.11.0 + 3.9.0 + 17 + 17 + + diff --git a/packages/credential-showcase-traction-openapi/tsconfig.json b/packages/credential-showcase-traction-openapi/tsconfig.json new file mode 100644 index 0000000..2b55281 --- /dev/null +++ b/packages/credential-showcase-traction-openapi/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "declarationDir": "dist", + "noUnusedLocals": false + }, + "references": [] +} diff --git a/packages/tsconfig.json b/packages/tsconfig.json index c6e7099..d8aaff1 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -4,6 +4,7 @@ { "path": "credential-showcase-openapi" }, { "path": "credential-showcase-ts-model" }, { "path": "credential-showcase-ts-sdk" }, + { "path": "credential-showcase-traction-openapi" }, { "path": "credential-showcase-traction-adapter" } ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c693dcc..d57cabb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,6 +92,12 @@ importers: packages/credential-showcase-traction-adapter: dependencies: + credential-showcase-openapi: + specifier: workspace:* + version: link:../credential-showcase-openapi + credential-showcase-traction-openapi: + specifier: workspace:* + version: link:../credential-showcase-traction-openapi express: specifier: ^4.21.2 version: 4.21.2 @@ -118,6 +124,8 @@ importers: specifier: ^10.18.0 version: 10.18.0 + packages/credential-showcase-traction-openapi: {} + packages/credential-showcase-ts-model: {} packages/credential-showcase-ts-sdk: {} @@ -186,7 +194,6 @@ packages: '@babel/plugin-proposal-export-namespace-from@7.18.9': resolution: {integrity: sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -322,11 +329,9 @@ packages: '@esbuild-kit/core-utils@3.3.2': resolution: {integrity: sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==} - deprecated: 'Merged into tsx: https://tsx.is' '@esbuild-kit/esm-loader@2.6.5': resolution: {integrity: sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==} - deprecated: 'Merged into tsx: https://tsx.is' '@esbuild/aix-ppc64@0.19.12': resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} @@ -1606,7 +1611,6 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -1680,7 +1684,6 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} From 42da943a35cc412354765299b23c5d441a54085a Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Mon, 24 Feb 2025 16:54:04 +0100 Subject: [PATCH 02/20] chore: storeAnonCredentialDefinition --- .../src/endpoints.ts | 1 - .../src/mappers/credential-definition.ts | 47 +++++++++++++ .../src/message-processor.ts | 15 ++-- .../src/traction-functions.ts | 69 ++++++++----------- 4 files changed, 84 insertions(+), 48 deletions(-) create mode 100644 packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts diff --git a/packages/credential-showcase-traction-adapter/src/endpoints.ts b/packages/credential-showcase-traction-adapter/src/endpoints.ts index 34913c0..d5fc4fd 100644 --- a/packages/credential-showcase-traction-adapter/src/endpoints.ts +++ b/packages/credential-showcase-traction-adapter/src/endpoints.ts @@ -1,4 +1,3 @@ - const TRACTION_BASE = { API_BASE: process.env.TRACTION_API_ENDPOINT || 'http://localhost:8032', WALLET_ID: process.env.WALLET_ID || '3edcac06-4548-4416-95a1-9bbb4c9e5e16', diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts new file mode 100644 index 0000000..21f2d8b --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -0,0 +1,47 @@ +import { CredentialAttribute, CredentialDefinition } from 'credential-showcase-openapi' +import { CredDefPostOptions, CredDefPostRequest, InnerCredDef } from 'credential-showcase-traction-openapi' + +/** + * Converts a CredentialDefinition to a CredDefPostRequest + * @param credentialDef The credential definition to convert + * @returns A CredDefPostRequest object + */ +export function credentialDefinitionToCredDefPostRequest(credentialDef: CredentialDefinition): CredDefPostRequest { + const innerCredDef: InnerCredDef = { + issuerId: getRequiredAttribute(credentialDef.attributes, 'issuerId'), // ie. "did:(method):WgWxqztrNooG92RXvxSTWv" + schemaId: getRequiredAttribute(credentialDef.attributes, 'schemaId'), // ie. "did:(method):2:schema_name:1.0" + tag: credentialDef.version, + } + + return { + credentialDefinition: innerCredDef, + options: getRevocationOptions(credentialDef), + } +} + +/** + * Maps credential type to a supported revocation configuration + * @param credDef The credential definition + * @returns Options with revocation settings + */ +export function getRevocationOptions(credDef: CredentialDefinition): CredDefPostOptions { + if (!credDef.revocation) { + return { + supportRevocation: false, + } + } + + // Default registry size since we don't have access to the actual structure + return { + supportRevocation: true, + revocationRegistrySize: 1000, // Default size + } +} + +function getRequiredAttribute(attributes: Array, name: string): string { + const attr = attributes.find((att) => att.type === 'STRING' && att.name === name) + if (!attr || !attr.value) { + throw new Error(`Missing required attribute: ${name} in `) + } + return attr.value +} diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index b2b700c..c160cbe 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -1,12 +1,11 @@ import { Connection, Receiver, ReceiverEvents, ReceiverOptions } from 'rhea-promise' import { environment } from './environment' import { CredentialDefinitionFromJSON } from 'credential-showcase-openapi' -import { getWalletToken, sendCredentialDefinition } from './traction-functions' +import { storeAnonCredentialDefinition } from './traction-functions' export class MessageProcessor { private readonly connection: Connection private receiver!: Receiver - private tokenCache: { token: string; expiry: number } | null = null constructor(private topic: string) { this.connection = new Connection({ @@ -40,12 +39,14 @@ export class MessageProcessor { const credentialDef = CredentialDefinitionFromJSON(jsonData) try { console.debug('Received credential definition', credentialDef) - await sendCredentialDefinition(credentialDef, await this.getApiToken()) + await storeAnonCredentialDefinition(credentialDef) if (context.delivery) { context.delivery.accept() } } catch (e) { - console.error(`An error occurred while sending credential definition ${credentialDef.id}/${credentialDef.name} of type ${credentialDef.type} to Traction`) + console.error( + `An error occurred while sending credential definition ${credentialDef.id}/${credentialDef.name} of type ${credentialDef.type} to Traction`, + ) if (context.delivery) { context.delivery.reject() // FIXME context.delivery.release() to redeliver ?? } @@ -67,6 +68,10 @@ export class MessageProcessor { } } + /* Probably not needed + private tokenCache: { token: string; expiry: number } | null = null + + private async getApiToken(): Promise { // Check if we have a valid cached token if (this.tokenCache && this.tokenCache.expiry > Date.now()) { @@ -81,5 +86,5 @@ export class MessageProcessor { expiry: Date.now() + expiresAfterMs, } return token - } + }*/ } diff --git a/packages/credential-showcase-traction-adapter/src/traction-functions.ts b/packages/credential-showcase-traction-adapter/src/traction-functions.ts index a576742..71f637b 100644 --- a/packages/credential-showcase-traction-adapter/src/traction-functions.ts +++ b/packages/credential-showcase-traction-adapter/src/traction-functions.ts @@ -1,66 +1,51 @@ -import { CredentialDefinition, instanceOfAnonCredRevocation } from 'credential-showcase-openapi' -import { - CreateWalletTokenRequest, - CreateWalletTokenRequestToJSON, - CredentialDefinitionSendRequest, - CredentialDefinitionSendRequestToJSON, -} from 'credential-showcase-traction-openapi' +import { CredentialDefinition } from 'credential-showcase-openapi' +import { CredentialDefinitionSendRequestToJSON } from 'credential-showcase-traction-openapi' import { endpoints } from './endpoints' -import { environment } from './environment' +import { credentialDefinitionToCredDefPostRequest } from './mappers/credential-definition' const credentialsEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.CREDENTIAL_DEFINITIONS}` -const tokenEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.TOKEN_ENDPOINT}` -export async function getWalletToken(): Promise { - const request: CreateWalletTokenRequest = { - walletKey: environment.WALLET_KEY, - } +export async function storeAnonCredentialDefinition(credentialDef: CredentialDefinition) { + const storeRequest = credentialDefinitionToCredDefPostRequest(credentialDef) - const response = await fetch(tokenEndpoint, { + const headers: Record = { + 'Content-Type': 'application/json', + } + const response = await fetch(credentialsEndpoint, { method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(CreateWalletTokenRequestToJSON(request)), + headers, + body: JSON.stringify(CredentialDefinitionSendRequestToJSON(storeRequest)), }) if (!response.ok) { - throw new Error(`Failed to get wallet API token: ${response.status} ${response.statusText}`) + throw new Error(`HTTP error in storeAnonCredentialDefinition! status: ${response.status}`) } - const data = await response.json() - return data.token + return await response.json() } -export async function sendCredentialDefinition(credentialDef: CredentialDefinition, apiToken: string) { - const sendRequest: CredentialDefinitionSendRequest = { - schemaId: credentialDef.id, - tag: credentialDef.name, - supportRevocation: false, - } +/* Probably not needed - if (credentialDef.revocation) { - sendRequest.supportRevocation = true + const tokenEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.TOKEN_ENDPOINT}` - if (instanceOfAnonCredRevocation(credentialDef.revocation)) { - sendRequest.revocationRegistrySize = 1000 // FIXME do we need this? - } - } - - const headers: Record = { - 'Content-Type': 'application/json', - Authorization: `Bearer ${apiToken}`, +export async function getWalletToken(): Promise { + const request: CreateWalletTokenRequest = { + walletKey: environment.WALLET_KEY, } - const response = await fetch(credentialsEndpoint, { + const response = await fetch(tokenEndpoint, { method: 'POST', - headers, - body: JSON.stringify(CredentialDefinitionSendRequestToJSON(sendRequest)), + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(CreateWalletTokenRequestToJSON(request)), }) if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`) + throw new Error(`Failed to get wallet API token: ${response.status} ${response.statusText}`) } - return await response.json() + const data = await response.json() + return data.token } +*/ From d66efee2cd28e8bb348b3b0ba053f5c7d14d2236 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Mon, 24 Feb 2025 17:02:09 +0100 Subject: [PATCH 03/20] chore: cleanup --- .../credential-showcase-traction-adapter/src/endpoints.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/credential-showcase-traction-adapter/src/endpoints.ts b/packages/credential-showcase-traction-adapter/src/endpoints.ts index d5fc4fd..b6d3dbe 100644 --- a/packages/credential-showcase-traction-adapter/src/endpoints.ts +++ b/packages/credential-showcase-traction-adapter/src/endpoints.ts @@ -1,12 +1,6 @@ -const TRACTION_BASE = { - API_BASE: process.env.TRACTION_API_ENDPOINT || 'http://localhost:8032', - WALLET_ID: process.env.WALLET_ID || '3edcac06-4548-4416-95a1-9bbb4c9e5e16', -} - export const endpoints = { TRACTION: { - ...TRACTION_BASE, - TOKEN_ENDPOINT: `/multitenancy/wallet/${TRACTION_BASE.WALLET_ID}/token`, + API_BASE: process.env.TRACTION_API_ENDPOINT || 'http://localhost:8032', CREDENTIAL_DEFINITIONS: '/credential-definitions', }, } From 8e0b17e8675570aa6704f71ebf8b96623e984840 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Mon, 24 Feb 2025 17:24:25 +0100 Subject: [PATCH 04/20] chore: husky - prettier --- .prettierrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.prettierrc b/.prettierrc index 520e3a5..9baddba 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,5 +4,5 @@ "printWidth": 150, "singleQuote": true, "semi": false, - "endOfLine": "auto" + "endOfLine": "lf" } From 9eafb59e48e0db225007ae79cbd97ab5dc2685b9 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 25 Feb 2025 17:16:13 +0100 Subject: [PATCH 05/20] chore: iteration of traction-adapter --- .../credential-showcase-openapi/package.json | 1 + .../README.md | 95 +++-- .../package.json | 6 +- .../src/__tests__/message-processor.test.ts | 349 ++++++++++++++++++ .../src/__tests__/rabbit-mq.test.ts | 77 ---- .../src/endpoints.ts | 6 - .../src/environment.ts | 31 +- .../src/index.ts | 3 +- .../src/mappers/credential-definition.ts | 79 +++- .../src/message-processor.ts | 160 +++++--- .../src/services/service-manager.ts | 46 +++ .../src/services/traction-service.ts | 222 +++++++++++ .../src/traction-functions.ts | 51 --- .../src/types/index.ts | 6 + .../tsconfig.json | 4 +- .../package.json | 1 + .../pom.xml | 2 +- pnpm-lock.yaml | 296 +-------------- 18 files changed, 922 insertions(+), 513 deletions(-) create mode 100644 packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts delete mode 100644 packages/credential-showcase-traction-adapter/src/__tests__/rabbit-mq.test.ts delete mode 100644 packages/credential-showcase-traction-adapter/src/endpoints.ts create mode 100644 packages/credential-showcase-traction-adapter/src/services/service-manager.ts create mode 100644 packages/credential-showcase-traction-adapter/src/services/traction-service.ts delete mode 100644 packages/credential-showcase-traction-adapter/src/traction-functions.ts create mode 100644 packages/credential-showcase-traction-adapter/src/types/index.ts diff --git a/packages/credential-showcase-openapi/package.json b/packages/credential-showcase-openapi/package.json index 960737e..b6b5b70 100644 --- a/packages/credential-showcase-openapi/package.json +++ b/packages/credential-showcase-openapi/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "postinstall": "mvn clean generate-sources", "dev": "tsc --watch", "build": "tsc", "build:clean": "tsc --build --clean && tsc --build" diff --git a/packages/credential-showcase-traction-adapter/README.md b/packages/credential-showcase-traction-adapter/README.md index f584a64..1c1d1d8 100644 --- a/packages/credential-showcase-traction-adapter/README.md +++ b/packages/credential-showcase-traction-adapter/README.md @@ -10,43 +10,46 @@ The **Credential Showcase Traction Adapter** bridges the **Interactive Digital C ### 💡 Purpose -- Translate data model actions (e.g., credential definitions, flows) into **Traction/ACA-Py** operations. -- Decouple the builder’s core REST API from credential technology details, future-proofing for multiple adapter implementations. +- Translate data model actions (e.g., credential definitions, flows) into **Traction/ACA-Py** operations +- Decouple the builder's core REST API from credential technology details, future-proofing for multiple adapter implementations ### ⚙️ Core Functionalities -- **Asynchronous Messaging:** Uses a message broker (e.g., RabbitMQ) to handle data exchange, improving fault tolerance. -- **Credential Definition Synchronization:** Converts scenario approvals in the Showcase Builder into the creation of credential definitions in Traction/ACA-Py. -- **Event-Driven Architecture:** Processes only the messages it can handle, simplifying horizontal scaling and maintainability. -- **Error Handling & Consistency:** Ensures durable message delivery and logs all failures for quick resolution. +- **Asynchronous Messaging:** Uses AMQP 1.0 messaging (via RabbitMQ) to handle data exchange, improving fault tolerance +- **Credential Definition Synchronization:** Converts credential definitions in the Showcase Builder into schemas and credential definitions in Traction/ACA-Py +- **Event-Driven Architecture:** Processes only the messages it can handle, simplifying horizontal scaling and maintainability +- **Error Handling & Consistency:** Ensures durable message delivery and logs all failures for quick resolution -### 🏆 Key Benefits - -- **Flexibility:** Adapters can be swapped or extended to support different credential formats (e.g., SD-JWT, OID4VCI). -- **Scalability:** Asynchronous flow decouples the builder from real-time dependencies. -- **Resilience:** Durable messaging to handle temporary outages without data loss. ## 📁 Project Structure ``` credential-showcase-traction-adapter/ ├── src/ -│ └── index.ts # Main entry point +│ ├── index.ts # Main entry point +│ ├── message-processor.ts # AMQP message processing +│ ├── environment.ts # Environment configuration +│ ├── types.ts # Shared type definitions +│ ├── mappers/ +│ │ └── credential-definition.ts # Mapping between data models +│ └── services/ +│ ├── service-manager.ts # Manages tenant/wallet sessions +│ └── traction-service.ts # Traction API integration ├── __tests__/ -│ └── rabbit-mq.test.ts # Temporary test for RabbitMQ -├── dist/ # Compiled output -├── package.json # Project configuration -├── tsconfig.json # TypeScript configuration -└── README.md # Project documentation +│ └── message-processor.test.ts # Integration tests for messaging +├── dist/ # Compiled output +├── package.json # Project configuration +├── tsconfig.json # TypeScript configuration +└── README.md # Project documentation ``` ## 🛠️ Tech Stack - **Language:** TypeScript -- **Framework:** Express -- **Messaging:** rhea, rhea-promise -- **Dependency Injection:** typedi +- **Messaging:** rhea, rhea-promise (AMQP 1.0 clients) +- **Caching:** lru-cache (for tenant session management) - **Testing:** Jest, Testcontainers (@testcontainers/rabbitmq) +- **Dependencies:** credential-showcase-openapi, credential-showcase-traction-openapi ## 📦 Package Management @@ -70,12 +73,6 @@ pnpm build pnpm test ``` -For CI/CD pipelines: - -```bash -pnpm test:ci -``` - ### Start the Project ```bash @@ -84,40 +81,56 @@ pnpm start ## 🧪 Testing -A temporary test for RabbitMQ is located at: +The project includes integration tests for the RabbitMQ messaging functionality: ``` -packages/credential-showcase-traction-adapter/src/__tests__/rabbit-mq.test.ts +src/__tests__/message-processor.test.ts ``` -We use **Jest** with **Testcontainers** to spin up RabbitMQ containers. - ---- +These tests verify: +- Message processing for valid credential definitions +- Error handling for invalid messages (missing actions, tenants, etc.) +- RabbitMQ connectivity and durability ## 🔬 Advanced Topics -### Decoupling & Multiple Adapters +### Message Processing Workflow + +1. The adapter listens to a configurable AMQP topic (default: `SHOWCASE_CMD`) +2. Messages contain credential definitions and actions (e.g., `store-credentialdef`) +3. Required headers include `tenantId`, `action`, and optionally `apiUrlBase`, `walletId`, and `accessTokenEnc` +4. The processor validates messages and routes them to appropriate handlers -This adapter design enables multiple credential technologies by decoupling the core REST API from specific implementations. Messages describe high-level actions (like issuing or verifying), and this adapter listens for any it can handle (currently Traction/ACA-Py). Future adapters for different transport or credential formats could subscribe to the same broker with minimal changes. +### Traction Service Integration -### Synchronization +The adapter provides several credential operations: +- Schema creation and lookup +- Credential definition creation and lookup +- Tenant token management +- Wallet token management -The adapter mostly handles one-way provisioning of scenarios and credential definitions into Traction/ACA-Py. If messages cannot be delivered or processed, the system logs the failures and retains the messages until they can be retried. Two-way sync is not yet in scope, but could be added later by incorporating callback messages into the builder’s REST API. +### Tenant/Wallet Session Management + +A service manager provides: +- LRU caching of tenant sessions +- Configurable TTL and cache sizes +- Token refreshing for existing sessions ### Error Handling -Durable messaging ensures errors do not cause data loss. When the adapter encounters issues (e.g., invalid payloads or unavailable Traction APIs), it immediately throws errors and logs them for administrators. Because the process is asynchronous, the REST API remains responsive. Operators can replay messages or fix data if needed. +Durable messaging ensures errors do not cause data loss: +- Invalid messages are rejected with descriptive errors +- Processing failures are logged with contextual details +- Message acceptance only occurs after successful processing ### Eventual Consistency -Since communication between the Showcase Builder and this adapter is asynchronous, the system is eventually consistent rather than transactionally consistent. Flows and credential definitions remain in a “pending” state until the adapter successfully updates the Traction/ACA-Py layer. We do not rely on XA transactions; instead, we rely on a robust queueing mechanism, clear error reporting, and possible replay of failed messages to ensure data eventually aligns across services. - ---- +Since communication between the Showcase Builder and this adapter is asynchronous, the system is eventually consistent rather than transactionally consistent. Flows and credential definitions remain in a "pending" state until the adapter successfully updates the Traction/ACA-Py layer. ## 📖 Documentation -More details on flows, data models, and API usage can be found in the main **Interactive Digital Credential Showcase Builder** documentation, including the proposed architecture and design strategies for multi-tenant, multi-credential environments. +For more details on flows, data models, and API usage, please refer to the main **Interactive Digital Credential Showcase Builder** documentation. ## 🏷️ License -This project is licensed under the **Apache-2.0** license. +This project is licensed under the **Apache-2.0** license. \ No newline at end of file diff --git a/packages/credential-showcase-traction-adapter/package.json b/packages/credential-showcase-traction-adapter/package.json index fd3f367..e28fa36 100644 --- a/packages/credential-showcase-traction-adapter/package.json +++ b/packages/credential-showcase-traction-adapter/package.json @@ -13,15 +13,17 @@ "credential-showcase-openapi": "workspace:*", "credential-showcase-traction-openapi": "workspace:*", "express": "^4.21.2", + "lru-cache": "^11.0.2", "rhea": "^3.0.3", "rhea-promise": "^3.0.3", "typedi": "^0.10.0" }, "devDependencies": { - "testcontainers": "^10.18.0", "@testcontainers/rabbitmq": "^10.18.0", "@types/express": "^5.0.0", - "@types/node": "^22.13.1" + "@types/node": "^22.13.1", + "testcontainers": "^10.18.0", + "uuid": "^11.1.0" }, "files": [ "dist/**/*", diff --git a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts new file mode 100644 index 0000000..fb15391 --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts @@ -0,0 +1,349 @@ +import { RabbitMQContainer, StartedRabbitMQContainer } from '@testcontainers/rabbitmq' +import { Connection, Sender, SenderOptions } from 'rhea-promise' +import { CredentialDefinition } from 'credential-showcase-openapi' +import { v4 as uuidv4 } from 'uuid' +import { MessageProcessor } from '../message-processor' +import { Action, Topic } from '../types' +import { getTractionService } from '../services/service-manager' + +// Create a spy on getTractionService to monitor calls +jest.spyOn(require('../services/service-manager'), 'getTractionService') + +describe('MessageProcessor Integration Test', () => { + jest.setTimeout(60000) // Extend timeout for container startup + + let container: StartedRabbitMQContainer + let connection: Connection + let sender: Sender + let processor: MessageProcessor + const testTopic: Topic = Topic.SHOWCASE_CMD_TESTING + + beforeAll(async () => { + // Start the RabbitMQ container + container = await new RabbitMQContainer('rabbitmq:4').start() + + // Setup environment variables for the processor + process.env.AMQ_HOST = container.getHost() + process.env.AMQ_PORT = container.getMappedPort(5672).toString() + process.env.AMQ_USER = 'guest' + process.env.AMQ_PASSWORD = 'guest' + process.env.DEFAULT_API_BASE_PATH = 'http://localhost:8080' + + // Establish an AMQP connection for sending test messages + connection = new Connection({ + hostname: container.getHost(), + port: container.getMappedPort(5672), + transport: 'tcp', + reconnect: true, + username: 'guest', + password: 'guest', + }) + await connection.open() + + // Create a sender + const senderOptions: SenderOptions = { + target: { address: testTopic }, + } + sender = await connection.createSender(senderOptions) + + // Start the message processor + processor = new MessageProcessor(testTopic) + await processor.start() + }) + + afterAll(async () => { + // Close AMQP entities and stop the container + await sender.close() + await processor.stop() + await connection.close() + await container.stop() + }) + + beforeEach(() => { + jest.clearAllMocks() + }) + + test('should process store-credentialdef message successfully', async () => { + // Create a sample credential definition + const credDef: CredentialDefinition = { + id: 'test-id', + name: 'Test Credential', + version: '1.0', + type: 'ANONCRED', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING', + value: 'John', + }, + { + id: 'attr2', + name: 'lastName', + type: 'STRING', + value: 'Doe', + }, + ], + representations: [ + { + id: 'rep1', + credDefId: 'cred-def-1', + schemaId: 'schema-1', + }, + ], + icon: { + id: 'icon1', + mediaType: 'image/png', + content: 'base64content', + }, + } + + // Spy on console.debug to detect when the message is processed + const consoleSpy = jest.spyOn(console, 'debug') + + // Send a message with the credential definition + const messageId = uuidv4() + void await sender.send({ + message_id: messageId, + body: JSON.stringify(credDef), + application_properties: { + action: 'store-credentialdef' as Action, + tenantId: 'test-tenant', + apiUrlBase: 'http://localhost:8080', + walletId: 'test-wallet', + accessTokenEnc: 'test-token', + }, + }) + + // Wait for the message to be processed + await new Promise((resolve) => { + const checkInterval = setInterval(() => { + if (consoleSpy.mock.calls.some((call) => call[0] === 'Received credential definition' && call[1]?.id === 'test-id')) { + clearInterval(checkInterval) + resolve() + } + }, 100) + + // Timeout after 5 seconds + setTimeout(() => { + clearInterval(checkInterval) + resolve() + }, 5000) + }) + + // Verify that the getTractionService was called with the correct parameters + expect(getTractionService).toHaveBeenCalledWith('test-tenant', 'http://localhost:8080', 'test-wallet', 'test-token') + + consoleSpy.mockRestore() + }) + + test('should reject message with missing action', async () => { + // Create a sample credential definition + const credDef: CredentialDefinition = { + id: 'test-id', + name: 'Test Credential', + version: '1.0', + type: 'ANONCRED', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING', + }, + ], + representations: [], + icon: { + id: 'icon1', + mediaType: 'image/png', + content: 'base64content', + }, + } + + // Spy on console.error to detect when the message is rejected + const consoleSpy = jest.spyOn(console, 'error') + + // Send a message without an action + const messageId = uuidv4() + void await sender.send({ + message_id: messageId, + body: JSON.stringify(credDef), + application_properties: { + tenantId: 'test-tenant', + }, + }) + + // Wait for the message to be processed + void await new Promise((resolve) => { + const checkInterval = setInterval(() => { + if (consoleSpy.mock.calls.some((call) => call[0].includes('did not contain an action'))) { + clearInterval(checkInterval) + resolve() + } + }, 100) + + // Timeout after 5 seconds + setTimeout(() => { + clearInterval(checkInterval) + resolve() + }, 5000) + }) + + // Verify the error was logged + expect(consoleSpy.mock.calls.some((call) => call[0].includes('did not contain an action'))).toBeTruthy() + + consoleSpy.mockRestore() + }) + + test('should reject message with missing tenant ID', async () => { + // Create a sample credential definition + const credDef: CredentialDefinition = { + id: 'test-id', + name: 'Test Credential', + version: '1.0', + type: 'ANONCRED', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING', + }, + ], + representations: [], + icon: { + id: 'icon1', + mediaType: 'image/png', + content: 'base64content', + }, + } + + // Spy on console.error to detect when the message is rejected + const consoleSpy = jest.spyOn(console, 'error') + + // Send a message without a tenant ID + const messageId = uuidv4() + void await sender.send({ + message_id: messageId, + body: JSON.stringify(credDef), + application_properties: { + action: 'store-credentialdef' as Action, + }, + }) + + // Wait for the message to be processed + await new Promise((resolve) => { + const checkInterval = setInterval(() => { + if (consoleSpy.mock.calls.some((call) => call[0].includes('did not contain the tenant id'))) { + clearInterval(checkInterval) + resolve() + } + }, 100) + + // Timeout after 5 seconds + setTimeout(() => { + clearInterval(checkInterval) + resolve() + }, 5000) + }) + + // Verify the error was logged + expect(consoleSpy.mock.calls.some((call) => call[0].includes('did not contain the tenant id'))).toBeTruthy() + + consoleSpy.mockRestore() + }) + + test('should reject message with invalid JSON', async () => { + // Spy on console.error to detect when the message is rejected + const consoleSpy = jest.spyOn(console, 'error') + + // Send a message with invalid JSON + const messageId = uuidv4() + void await sender.send({ + message_id: messageId, + body: '{invalid json}', + application_properties: { + action: 'store-credentialdef' as Action, + tenantId: 'test-tenant', + apiUrlBase: 'http://localhost:8080', + }, + }) + + // Wait for the message to be processed + await new Promise((resolve) => { + const checkInterval = setInterval(() => { + if (consoleSpy.mock.calls.some((call) => call[0].includes('Failed to parse message body'))) { + clearInterval(checkInterval) + resolve() + } + }, 100) + + // Timeout after 5 seconds + setTimeout(() => { + clearInterval(checkInterval) + resolve() + }, 5000) + }) + + // Verify the error was logged + expect(consoleSpy.mock.calls.some((call) => call[0].includes('Failed to parse message body'))).toBeTruthy() + + consoleSpy.mockRestore() + }) + + test('should reject message with unsupported action', async () => { + // Create a sample credential definition + const credDef: CredentialDefinition = { + id: 'test-id', + name: 'Test Credential', + version: '1.0', + type: 'ANONCRED', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING', + }, + ], + representations: [], + icon: { + id: 'icon1', + mediaType: 'image/png', + content: 'base64content', + }, + } + + // Spy on console.error to detect when the message is rejected + const consoleSpy = jest.spyOn(console, 'error') + + // Send a message with an unsupported action + const messageId = uuidv4() + void await sender.send({ + message_id: messageId, + body: JSON.stringify(credDef), + application_properties: { + action: 'unsupported-action' as Action, + tenantId: 'test-tenant', + }, + }) + + // Wait for the message to be processed + await new Promise((resolve) => { + const checkInterval = setInterval(() => { + if (consoleSpy.mock.calls.some((call) => call[0].includes('unsupported action'))) { + clearInterval(checkInterval) + resolve() + } + }, 100) + + // Timeout after 5 seconds + setTimeout(() => { + clearInterval(checkInterval) + resolve() + }, 5000) + }) + + // Verify the error was logged + expect(consoleSpy.mock.calls.some((call) => call[0].includes('unsupported action'))).toBeTruthy() + + consoleSpy.mockRestore() + }) +}) diff --git a/packages/credential-showcase-traction-adapter/src/__tests__/rabbit-mq.test.ts b/packages/credential-showcase-traction-adapter/src/__tests__/rabbit-mq.test.ts deleted file mode 100644 index e9d3c7d..0000000 --- a/packages/credential-showcase-traction-adapter/src/__tests__/rabbit-mq.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { RabbitMQContainer, StartedRabbitMQContainer } from '@testcontainers/rabbitmq' -import { Connection, Receiver, ReceiverEvents, ReceiverOptions, Sender, SenderOptions } from 'rhea-promise' - -describe('RabbitMQ Hello World Test', () => { - jest.setTimeout(60000) // Extend timeout for container startup - - let container: StartedRabbitMQContainer - let connection: Connection - let sender: Sender - let receiver: Receiver - - beforeAll(async () => { - // Start the RabbitMQ container - container = await new RabbitMQContainer('rabbitmq:4.0.6').start() - - // Establish an AMQP connection - connection = new Connection({ - hostname: container.getHost(), - port: container.getMappedPort(5672), - transport: 'tcp', // or 'tls' if using SSL - reconnect: true, - username: 'guest', // default RabbitMQ username - password: 'guest', // default RabbitMQ password - }) - await connection.open() - - // Create a sender - const senderOptions: SenderOptions = { - target: { address: 'test-queue' }, - } - sender = await connection.createSender(senderOptions) - - // Create a receiver - const receiverOptions: ReceiverOptions = { - source: { address: 'test-queue' }, - } - receiver = await connection.createReceiver(receiverOptions) - }) - - afterAll(async () => { - // Close AMQP entities and stop the container - await sender.close() - await receiver.close() - await connection.close() - await container.stop() - }) - - test('should send and receive a message', async () => { - const messageBody = 'Hello World' - - // Set up a promise to handle message reception - const receivedMessage = new Promise((resolve, reject) => { - receiver.on(ReceiverEvents.message, (context) => { - if (context.message) { - const receivedBody = context.message.body as string - resolve(receivedBody) - } else { - reject(new Error('Received message is undefined')) - } - }) - - receiver.on(ReceiverEvents.receiverError, (context) => { - reject(context.receiver?.error || Error('Receiver encountered an error')) - }) - }) - - // Send the message - sender.send({ - body: messageBody, - }) - - // Wait for the message to be received - const result = await receivedMessage - expect(result).toBe(messageBody) - console.log('result', result) - }) -}) diff --git a/packages/credential-showcase-traction-adapter/src/endpoints.ts b/packages/credential-showcase-traction-adapter/src/endpoints.ts deleted file mode 100644 index b6d3dbe..0000000 --- a/packages/credential-showcase-traction-adapter/src/endpoints.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const endpoints = { - TRACTION: { - API_BASE: process.env.TRACTION_API_ENDPOINT || 'http://localhost:8032', - CREDENTIAL_DEFINITIONS: '/credential-definitions', - }, -} diff --git a/packages/credential-showcase-traction-adapter/src/environment.ts b/packages/credential-showcase-traction-adapter/src/environment.ts index 516238e..a725c82 100644 --- a/packages/credential-showcase-traction-adapter/src/environment.ts +++ b/packages/credential-showcase-traction-adapter/src/environment.ts @@ -1,9 +1,28 @@ +import { Topic } from './types' + export const environment = { - RABBITMQ_HOST: process.env.RABBITMQ_HOST || 'localhost', - RABBITMQ_PORT: parseInt(process.env.RABBITMQ_PORT || '5672', 10), - RABBITMQ_USER: process.env.RABBITMQ_USER || 'guest', - RABBITMQ_PASSWORD: process.env.RABBITMQ_PASSWORD || 'guest', + AMQ_HOST: process.env.AMQ_HOST || 'localhost', + AMQ_PORT: parseInt(process.env.AMQ_PORT || '5672', 10), + AMQ_USER: process.env.AMQ_USER || 'guest', + AMQ_PASSWORD: process.env.AMQ_PASSWORD || 'guest', + + DEFAULT_API_BASE_PATH: process.env.DEFAULT_API_BASE_PATH ?? 'http://localhost:8032', + + TENANT_SESSION_CACHE_SIZE: parsePositiveInt(process.env.TENANT_SESSION_CACHE_SIZE, 1024), + TENANT_SESSION_TTL_MINS: parsePositiveInt(process.env.TENANT_SESSION_TTL_MINS, 1440), + MESSAGE_PROCESSOR_TOPIC: (process.env.MESSAGE_PROCESSOR_TOPIC ?? 'showcase-cmd') as Topic, +} + +function parsePositiveInt(value: string | undefined, defaultValue: number): number { + if (!value) { + return defaultValue + } + + const parsed = parseInt(value, 10) + + if (isNaN(parsed) || parsed <= 0) { + return defaultValue + } - WALLET_KEY: process.env.WALLET_KEY, - WALLET_KEY_EXPIRES_AFTER_SECONDS: process.env.WALLET_KEY_EXPIRES_AFTER_SECONDS || 1800, + return parsed } diff --git a/packages/credential-showcase-traction-adapter/src/index.ts b/packages/credential-showcase-traction-adapter/src/index.ts index 9dbe2ed..4c6f334 100644 --- a/packages/credential-showcase-traction-adapter/src/index.ts +++ b/packages/credential-showcase-traction-adapter/src/index.ts @@ -1,7 +1,8 @@ import { MessageProcessor } from './message-processor' +import { environment } from './environment' async function main() { - const processor = new MessageProcessor('credential-definitions') + const processor = new MessageProcessor(environment.MESSAGE_PROCESSOR_TOPIC) try { await processor.start() diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts index 21f2d8b..6689fff 100644 --- a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -1,15 +1,46 @@ import { CredentialAttribute, CredentialDefinition } from 'credential-showcase-openapi' -import { CredDefPostOptions, CredDefPostRequest, InnerCredDef } from 'credential-showcase-traction-openapi' +import { + CredDefPostOptions, + CredDefPostRequest, + InnerCredDef, + AnonCredsSchema, + SchemaPostRequest, + GetCredDefResult, + CredDefResult, + CredDefState, +} from 'credential-showcase-traction-openapi' + +/** + * Converts a CredentialDefinition to a SchemaPostRequest + * @param credentialDef The credential definition to convert + * @returns A SchemaPostRequest object + */ +export function credentialDefinitionToSchemaPostRequest(credentialDef: CredentialDefinition): SchemaPostRequest { + // Extract attribute names from the CredentialDefinition + const attributeNames = credentialDef.attributes.map((attr) => attr.name) + + const schema: AnonCredsSchema = { + attrNames: attributeNames, + issuerId: 'did:(method):WgWxqztrNooG92RXvxSTWv', // TODO will be available in CredentialDefinition + name: credentialDef.name, + version: credentialDef.version, + } + + return { + schema, + } +} /** * Converts a CredentialDefinition to a CredDefPostRequest * @param credentialDef The credential definition to convert + * @param schemaId The schema ID to use in the credential definition * @returns A CredDefPostRequest object */ -export function credentialDefinitionToCredDefPostRequest(credentialDef: CredentialDefinition): CredDefPostRequest { +export function credentialDefinitionToCredDefPostRequest(credentialDef: CredentialDefinition, schemaId: string): CredDefPostRequest { const innerCredDef: InnerCredDef = { - issuerId: getRequiredAttribute(credentialDef.attributes, 'issuerId'), // ie. "did:(method):WgWxqztrNooG92RXvxSTWv" - schemaId: getRequiredAttribute(credentialDef.attributes, 'schemaId'), // ie. "did:(method):2:schema_name:1.0" + issuerId: 'did:(method):WgWxqztrNooG92RXvxSTWv', // TODO will be available in CredentialDefinition + schemaId: schemaId, tag: credentialDef.version, } @@ -38,6 +69,46 @@ export function getRevocationOptions(credDef: CredentialDefinition): CredDefPost } } +/** + * Attempts to extract a schema ID from the credential definition representations + * @param credentialDef The credential definition to extract from + * @returns The schema ID if found, otherwise null + */ +export function extractSchemaIdFromCredentialDef(credentialDef: CredentialDefinition): string | null { + // Try to find an OCA representation which contains a schema ID + for (const representation of credentialDef.representations) { + if ('schemaId' in representation) { + return representation.schemaId + } + } + return null +} + +/** + * Converts a GetCredDefResult to a CredDefResult + * @param result The GetCredDefResult to convert + * @returns A CredDefResult object + */ +export function getCredDefResultToCredDefResult(result: GetCredDefResult): CredDefResult { + if (!result) { + return {} + } + + // Create a CredDefState from the credential definition + const credentialDefinitionState: CredDefState = { + credentialDefinition: result.credentialDefinition, + credentialDefinitionId: result.credentialDefinitionId, + state: 'finished', // FIXME double-check: Assume the state is finished since it was successfully retrieved + } + + return { + credentialDefinitionMetadata: result.credentialDefinitionsMetadata || {}, + credentialDefinitionState: credentialDefinitionState, + registrationMetadata: result.resolutionMetadata || {}, + // jobId is left undefined as it doesn't exist in GetCredDefResult + } +} + function getRequiredAttribute(attributes: Array, name: string): string { const attr = attributes.find((att) => att.type === 'STRING' && att.name === name) if (!attr || !attr.value) { diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index c160cbe..386c24e 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -1,24 +1,40 @@ import { Connection, Receiver, ReceiverEvents, ReceiverOptions } from 'rhea-promise' import { environment } from './environment' import { CredentialDefinitionFromJSON } from 'credential-showcase-openapi' -import { storeAnonCredentialDefinition } from './traction-functions' +import { TractionService } from './services/traction-service' +import { getTractionService } from './services/service-manager' +import { Action, Topic } from './types' + +interface MessageHeaders { + action?: Action + tenantId?: string + apiUrlBase?: string + walletId?: string + accessTokenEnc?: string +} export class MessageProcessor { private readonly connection: Connection private receiver!: Receiver - constructor(private topic: string) { + constructor(private topic: Topic) { + // Validate that topic is a valid enum value + if (!Object.values(Topic).includes(topic)) { + throw new Error(`Invalid topic: ${topic}. Valid topics are: ${Object.values(Topic).join(', ')}`) + } + + // Setup AMQ broker connection this.connection = new Connection({ - hostname: environment.RABBITMQ_HOST, - port: environment.RABBITMQ_PORT, + hostname: environment.AMQ_HOST, + port: environment.AMQ_PORT, transport: 'tcp', reconnect: true, - username: environment.RABBITMQ_USER, - password: environment.RABBITMQ_PASSWORD, + username: environment.AMQ_USER, + password: environment.AMQ_PASSWORD, }) } - async start() { + public async start(): Promise { await this.connection.open() const receiverOptions: ReceiverOptions = { @@ -32,59 +48,117 @@ export class MessageProcessor { } this.receiver = await this.connection.createReceiver(receiverOptions) + this.setupMessageHandler() + this.setupErrorHandler() + } + private setupMessageHandler(): void { this.receiver.on(ReceiverEvents.message, async (context) => { - if (context.message) { - const jsonData = JSON.parse(context.message.body as string) - const credentialDef = CredentialDefinitionFromJSON(jsonData) - try { - console.debug('Received credential definition', credentialDef) - await storeAnonCredentialDefinition(credentialDef) - if (context.delivery) { - context.delivery.accept() - } - } catch (e) { - console.error( - `An error occurred while sending credential definition ${credentialDef.id}/${credentialDef.name} of type ${credentialDef.type} to Traction`, - ) - if (context.delivery) { - context.delivery.reject() // FIXME context.delivery.release() to redeliver ?? - } - } + const message = context.message + if (!message) { + return + } + + const headers = this.getMessageHeaders(message.application_properties) + const messageId = message.message_id + + // Validate required headers + if (!headers.action) { + this.rejectDelivery(context, `message ${messageId} did not contain an action`) + return + } + + if (!headers.tenantId) { + this.rejectDelivery(context, `message ${messageId} did not contain the tenant id`) + return + } + + const service = getTractionService(headers.tenantId, headers.apiUrlBase, headers.walletId, headers.accessTokenEnc) + + try { + const jsonData = JSON.parse(message.body as string) + await this.processMessage(headers.action, jsonData, service, context, headers) + } catch (error) { + this.rejectDelivery(context, `Failed to parse message body for ${messageId}: ${error}`, headers) } }) + } + private setupErrorHandler(): void { this.receiver.on(ReceiverEvents.receiverError, (context) => { console.error(`[${this.topic}] Receiver error:`, context.receiver?.error) }) } - async stop() { - if (this.receiver) { - await this.receiver.close() + private getMessageHeaders(applicationProperties: any): MessageHeaders { + if (!applicationProperties) { + return {} } - if (this.connection) { - await this.connection.close() + + return { + action: applicationProperties['action'] as Action | undefined, + tenantId: applicationProperties['tenantId'] as string | undefined, + apiUrlBase: applicationProperties['apiUrlBase'] as string | undefined, + walletId: applicationProperties['walletId'] as string | undefined, + accessTokenEnc: applicationProperties['accessTokenEnc'] as string | undefined, } } - /* Probably not needed - private tokenCache: { token: string; expiry: number } | null = null + private async processMessage(action: Action, jsonData: any, service: TractionService, context: any, headers: MessageHeaders): Promise { + switch (action) { + case 'store-credentialdef': { + await this.handleStoreCredentialDef(jsonData, service, context, headers) + break + } + default: { + const errorMsg = `An error occurred while processing message ${context.message.message_id}; unsupported action ${action}` + this.rejectDelivery(context, errorMsg, headers) + } + } + } + + private async handleStoreCredentialDef(jsonData: any, service: TractionService, context: any, headers: MessageHeaders): Promise { + const credentialDef = CredentialDefinitionFromJSON(jsonData) + try { + console.debug('Received credential definition', credentialDef) + await service.storeAnonCredentialDefinition(credentialDef) + if (context.delivery) { + context.delivery.accept() + } + } catch (e) { + const errorMsg = `An error occurred while sending credential definition ${credentialDef.id}/${credentialDef.name} of type ${credentialDef.type} to Traction` + console.error(errorMsg) + if (context.delivery) { + context.delivery.reject({ + info: `apiBasePath: ${headers.apiUrlBase ?? environment.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}`, + condition: 'fatal error', + description: errorMsg, + value: [credentialDef], + }) // FIXME context.delivery.release() to redeliver ?? + } + } + } + private rejectDelivery(context: any, errorMsg: string, headers?: MessageHeaders): void { + console.error(errorMsg) + if (context.delivery) { + const rejectOptions: any = { description: errorMsg } - private async getApiToken(): Promise { - // Check if we have a valid cached token - if (this.tokenCache && this.tokenCache.expiry > Date.now()) { - return Promise.resolve(this.tokenCache.token) + if (headers) { + rejectOptions.info = `apiBasePath: ${headers.apiUrlBase ?? environment.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}` + rejectOptions.condition = 'fatal error' + } + + context.delivery.reject(rejectOptions) } + } - // No, get a new one - const token = await getWalletToken() - const expiresAfterMs = Number(environment.WALLET_KEY_EXPIRES_AFTER_SECONDS) * 1000 - this.tokenCache = { - token, - expiry: Date.now() + expiresAfterMs, + public async stop(): Promise { + if (this.receiver) { + await this.receiver.close() } - return token - }*/ + if (this.connection) { + await this.connection.close() + } + } } diff --git a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts new file mode 100644 index 0000000..d1d012f --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts @@ -0,0 +1,46 @@ +import { TractionService } from './traction-service' +import { environment } from '../environment' +import { LRUCache } from 'lru-cache' + +class ServiceManager { + private readonly services = new LRUCache({ + max: environment.TENANT_SESSION_CACHE_SIZE, + ttl: environment.TENANT_SESSION_TTL_MINS * 60, + }) + + public getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: string): TractionService { + const key = this.buildKey(apiUrlBase, tenantId, walletId) + + // Return existing service if it exists + if (this.services.has(key)) { + const service = this.services.get(key)! + + // Update token if provided + if (accessTokenEnc) { + service.updateBearerToken(accessTokenEnc) + } + + return service + } + + const service = new TractionService(tenantId, apiUrlBase, walletId, accessTokenEnc) + + this.services.set(key, service) + return service + } + + private buildKey(apiUrlBase: string = environment.DEFAULT_API_BASE_PATH, tenantId: string, walletId?: string): string { + return walletId ? `${apiUrlBase}:${tenantId}:${walletId}` : `${apiUrlBase}:${tenantId}` + } +} + +// Singleton instance +const serviceRegistry = new ServiceManager() + +export function getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: string): TractionService { + if (!tenantId) { + throw new Error('tenantId is required') + } + + return serviceRegistry.getTractionService(tenantId, apiUrlBase, walletId, accessTokenEnc) +} diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts new file mode 100644 index 0000000..8ad9435 --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -0,0 +1,222 @@ +import { CredentialDefinition } from 'credential-showcase-openapi' +import { + AnoncredsCredentialDefinitionsApi, + AnoncredsSchemasApi, + ApiResponse, + Configuration, + ConfigurationParameters, + CreateWalletTokenRequest, + CreateWalletTokenResponse, + CredDefResult, + type CustomCreateWalletTokenRequest, + MultitenancyApi, + ResponseError, + SchemaResult, +} from 'credential-showcase-traction-openapi' +import { + credentialDefinitionToCredDefPostRequest, + credentialDefinitionToSchemaPostRequest, + extractSchemaIdFromCredentialDef, + getCredDefResultToCredDefResult, +} from '../mappers/credential-definition' +import { environment } from '../environment' + +export class TractionService { + private readonly config: Configuration + private readonly configOptions: ConfigurationParameters + private anoncredsApi: AnoncredsCredentialDefinitionsApi + private multitenancyApi: MultitenancyApi + private schemasApi: AnoncredsSchemasApi + + constructor( + private tenantId: string, + private basePath: string = environment.DEFAULT_API_BASE_PATH, + private walletId?: string, + private accessToken?: string, + ) { + // Create a shared configuration for this tenant + this.configOptions = { + basePath, + ...(accessToken && { apiKey: this.tokenCallback(accessToken) }), // Probably an error in the generated code, it's mapping apiKey not accessToken + } + this.config = new Configuration(this.configOptions) + + // Initialize APIs with shared config + this.anoncredsApi = new AnoncredsCredentialDefinitionsApi(this.config) + this.multitenancyApi = new MultitenancyApi(this.config) + this.schemasApi = new AnoncredsSchemasApi(this.config) + } + + public updateBearerToken(token: string): void { + this.configOptions.apiKey = this.tokenCallback(token) + } + + private tokenCallback(token: string) { + return async (name: string) => { + if (name === 'Authorization') { + return `Bearer ${token}` + } + return '' + } + } + + /** + * Checks if a schema with the given name and version exists + * @param name The schema name + * @param version The schema version + * @returns The schema ID if found, otherwise null + */ + public async findExistingSchema(name: string, version: string): Promise { + try { + const response = await this.schemasApi.anoncredsSchemasGet({ + schemaName: name, + schemaVersion: version, + }) + + if (response.schemaIds && response.schemaIds.length > 0) { + return response.schemaIds[0] + } + return null + } catch (error) { + console.error('Error checking if schema exists:', error) + return null + } + } + + /** + * Creates a schema from a credential definition + * @param credentialDef The credential definition to create a schema from + * @returns The created schema ID + */ + public async createSchema(credentialDef: CredentialDefinition): Promise { + const schemaRequest = credentialDefinitionToSchemaPostRequest(credentialDef) + + const apiResponse = await this.schemasApi.anoncredsSchemaPostRaw({ + body: schemaRequest, + }) + + const result = await this.handleApiResponse(apiResponse) + if (!result?.schemaState?.schemaId) { + return Promise.reject(Error('No schema ID was returned')) + } + + return result.schemaState.schemaId + } + + /** + * Checks if a credential definition with the given schema ID and tag exists + * @param schemaId The schema ID + * @param tag The credential definition tag (version) + * @returns The credential definition ID if found, otherwise null + */ + public async findExistingCredentialDefinition(schemaId: string, tag: string): Promise { + try { + const response = await this.anoncredsApi.anoncredsCredentialDefinitionsGet({ + schemaId, + }) + + if (response.credentialDefinitionIds && response.credentialDefinitionIds.length > 0) { + // For each credential definition ID, check if tag matches + for (const credDefId of response.credentialDefinitionIds) { + try { + const credDefResponse = await this.anoncredsApi.anoncredsCredentialDefinitionCredDefIdGet({ + credDefId, + }) + + // Check if this credential definition has the requested tag + if (credDefResponse.credentialDefinition?.tag === tag) { + return getCredDefResultToCredDefResult(credDefResponse) + } + } catch (error) { + console.error(`Error fetching credential definition ${credDefId}:`, error) + } + } + } + + return undefined + } catch (error) { + console.error('Error checking if credential definition exists:', error) + return undefined + } + } + + public async storeAnonCredentialDefinition(credentialDef: CredentialDefinition): Promise { + // First, try to extract schema ID from the credential definition + let schemaId = extractSchemaIdFromCredentialDef(credentialDef) + + // If no schema ID was found in the representations, check if a schema exists by name/version + if (!schemaId) { + schemaId = await this.findExistingSchema(credentialDef.name, credentialDef.version) + + // If schema doesn't exist, create it + if (!schemaId) { + schemaId = await this.createSchema(credentialDef) + } + } + + // Check if credential definition exists for this schema and tag + const existingCredDef = await this.findExistingCredentialDefinition(schemaId, credentialDef.version) + if (existingCredDef) { + return existingCredDef + } + + // Create new credential definition + const apiResponse = await this.anoncredsApi.anoncredsCredentialDefinitionPostRaw({ + body: credentialDefinitionToCredDefPostRequest(credentialDef, schemaId), + }) + return this.handleApiResponse(apiResponse) + } + + public async getTenantToken(apiKey: string, walletKey?: string): Promise { + if (!this.tenantId) { + return Promise.reject(Error('in order to get a tenant token, tenantId must be set')) + } + const request: CustomCreateWalletTokenRequest = { + apiKey, + walletKey, // Only required for unmanaged wallets + } + + const apiResponse = await this.multitenancyApi.multitenancyTenantTenantIdTokenPostRaw({ + tenantId: this.tenantId, + body: request, + }) + + const tokenResponse = await this.handleApiResponse(apiResponse) + if (!tokenResponse?.token) { + return Promise.reject(Error('no token was returned')) + } + return tokenResponse.token + } + + public async getSubWalletToken(walletKey: string): Promise { + if (!this.walletId) { + return Promise.reject(Error('in order to get a wallet token, walletId must be set')) + } + const request: CreateWalletTokenRequest = { + walletKey, + } + + const apiResponse = await this.multitenancyApi.multitenancyWalletWalletIdTokenPostRaw({ + walletId: this.walletId, + body: request, + }) + + const tokenResponse = await this.handleApiResponse(apiResponse) + if (!tokenResponse?.token) { + return Promise.reject(Error('no token was returned')) + } + return tokenResponse.token + } + + private async handleApiResponse(response: ApiResponse): Promise { + if (!response.raw.ok) { + const errorText = await response.raw.text().catch(() => 'No error details available') + throw new ResponseError(response.raw, `HTTP error! Status: ${response.raw.status}, Details: ${errorText}`) + } + return response.value() + } +} + +export function createTractionService(apiBase: string, tenantId: string, walletId?: string): TractionService { + return new TractionService(tenantId, apiBase, walletId) +} diff --git a/packages/credential-showcase-traction-adapter/src/traction-functions.ts b/packages/credential-showcase-traction-adapter/src/traction-functions.ts deleted file mode 100644 index 71f637b..0000000 --- a/packages/credential-showcase-traction-adapter/src/traction-functions.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { CredentialDefinition } from 'credential-showcase-openapi' -import { CredentialDefinitionSendRequestToJSON } from 'credential-showcase-traction-openapi' -import { endpoints } from './endpoints' -import { credentialDefinitionToCredDefPostRequest } from './mappers/credential-definition' - -const credentialsEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.CREDENTIAL_DEFINITIONS}` - -export async function storeAnonCredentialDefinition(credentialDef: CredentialDefinition) { - const storeRequest = credentialDefinitionToCredDefPostRequest(credentialDef) - - const headers: Record = { - 'Content-Type': 'application/json', - } - const response = await fetch(credentialsEndpoint, { - method: 'POST', - headers, - body: JSON.stringify(CredentialDefinitionSendRequestToJSON(storeRequest)), - }) - - if (!response.ok) { - throw new Error(`HTTP error in storeAnonCredentialDefinition! status: ${response.status}`) - } - - return await response.json() -} - -/* Probably not needed - - const tokenEndpoint = `${endpoints.TRACTION.API_BASE}${endpoints.TRACTION.TOKEN_ENDPOINT}` - -export async function getWalletToken(): Promise { - const request: CreateWalletTokenRequest = { - walletKey: environment.WALLET_KEY, - } - - const response = await fetch(tokenEndpoint, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(CreateWalletTokenRequestToJSON(request)), - }) - - if (!response.ok) { - throw new Error(`Failed to get wallet API token: ${response.status} ${response.statusText}`) - } - - const data = await response.json() - return data.token -} -*/ diff --git a/packages/credential-showcase-traction-adapter/src/types/index.ts b/packages/credential-showcase-traction-adapter/src/types/index.ts new file mode 100644 index 0000000..7da5e92 --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/types/index.ts @@ -0,0 +1,6 @@ +export enum Topic { + SHOWCASE_CMD = 'SHOWCASE_CMD', + SHOWCASE_CMD_TESTING = 'SHOWCASE_CMD_TESTING', +} + +export type Action = 'store-credentialdef' diff --git a/packages/credential-showcase-traction-adapter/tsconfig.json b/packages/credential-showcase-traction-adapter/tsconfig.json index 528da31..400547c 100644 --- a/packages/credential-showcase-traction-adapter/tsconfig.json +++ b/packages/credential-showcase-traction-adapter/tsconfig.json @@ -8,10 +8,10 @@ }, "references": [ { - "path": "credential-showcase-openapi" + "path": "../credential-showcase-openapi" }, { - "path": "credential-showcase-traction-openapi" + "path": "../credential-showcase-traction-openapi" } ] } diff --git a/packages/credential-showcase-traction-openapi/package.json b/packages/credential-showcase-traction-openapi/package.json index 426a805..2021478 100644 --- a/packages/credential-showcase-traction-openapi/package.json +++ b/packages/credential-showcase-traction-openapi/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "postinstall": "mvn clean generate-sources", "dev": "tsc --watch", "build": "tsc", "build:clean": "tsc --build --clean && tsc --build" diff --git a/packages/credential-showcase-traction-openapi/pom.xml b/packages/credential-showcase-traction-openapi/pom.xml index d96dc9e..3e6bea4 100644 --- a/packages/credential-showcase-traction-openapi/pom.xml +++ b/packages/credential-showcase-traction-openapi/pom.xml @@ -35,7 +35,7 @@ true ${project.version} - false + true true true true diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 21767ad..fb735bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,9 +29,6 @@ importers: jest-fetch-mock: specifier: ^3.0.3 version: 3.0.3(encoding@0.1.13) - lint-staged: - specifier: ^15.4.3 - version: 15.4.3 prettier: specifier: ^3.4.2 version: 3.4.2 @@ -107,6 +104,9 @@ importers: express: specifier: ^4.21.2 version: 4.21.2 + lru-cache: + specifier: ^11.0.2 + version: 11.0.2 rhea: specifier: ^3.0.3 version: 3.0.3 @@ -129,6 +129,9 @@ importers: testcontainers: specifier: ^10.18.0 version: 10.18.0 + uuid: + specifier: ^11.1.0 + version: 11.1.0 packages/credential-showcase-traction-openapi: {} @@ -200,6 +203,7 @@ packages: '@babel/plugin-proposal-export-namespace-from@7.18.9': resolution: {integrity: sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -335,9 +339,11 @@ packages: '@esbuild-kit/core-utils@3.3.2': resolution: {integrity: sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==} + deprecated: 'Merged into tsx: https://tsx.is' '@esbuild-kit/esm-loader@2.6.5': resolution: {integrity: sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==} + deprecated: 'Merged into tsx: https://tsx.is' '@esbuild/aix-ppc64@0.19.12': resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} @@ -870,10 +876,6 @@ packages: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} - ansi-escapes@7.0.0: - resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} - engines: {node: '>=18'} - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1084,10 +1086,6 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chalk@5.4.1: - resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -1108,14 +1106,6 @@ packages: class-validator@0.14.1: resolution: {integrity: sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ==} - cli-cursor@5.0.0: - resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} - engines: {node: '>=18'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -1138,13 +1128,6 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - commander@13.1.0: - resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} - engines: {node: '>=18'} - compress-commons@6.0.2: resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==} engines: {node: '>= 14'} @@ -1437,9 +1420,6 @@ packages: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} - emoji-regex@10.4.0: - resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} - emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -1460,10 +1440,6 @@ packages: end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} - environment@1.1.0: - resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} - engines: {node: '>=18'} - error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -1518,9 +1494,6 @@ packages: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} - eventemitter3@5.0.1: - resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} - events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -1529,10 +1502,6 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} - execa@8.0.1: - resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} - engines: {node: '>=16.17'} - exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} @@ -1617,10 +1586,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.3.0: - resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} - engines: {node: '>=18'} - get-intrinsic@1.2.7: resolution: {integrity: sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==} engines: {node: '>= 0.4'} @@ -1641,10 +1606,6 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - get-stream@8.0.1: - resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} - engines: {node: '>=16'} - get-tsconfig@4.10.0: resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==} @@ -1662,6 +1623,7 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -1709,10 +1671,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - human-signals@5.0.0: - resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} - engines: {node: '>=16.17.0'} - husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} @@ -1744,6 +1702,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -1766,14 +1725,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-fullwidth-code-point@5.0.0: - resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} - engines: {node: '>=18'} - is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} @@ -1794,10 +1745,6 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} @@ -2026,22 +1973,9 @@ packages: libphonenumber-js@1.11.19: resolution: {integrity: sha512-bW/Yp/9dod6fmyR+XqSUL1N5JE7QRxQ3KrBIbYS1FTv32e5i3SEtQVX+71CYNv8maWNSOgnlCoNp9X78f/cKiA==} - lilconfig@3.1.3: - resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} - engines: {node: '>=14'} - lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lint-staged@15.4.3: - resolution: {integrity: sha512-FoH1vOeouNh1pw+90S+cnuoFwRfUD9ijY2GKy5h7HS3OR7JVir2N2xrsa0+Twc1B7cW72L+88geG5cW4wIhn7g==} - engines: {node: '>=18.12.0'} - hasBin: true - - listr2@8.2.5: - resolution: {integrity: sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==} - engines: {node: '>=18.0.0'} - locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -2052,10 +1986,6 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - log-update@6.1.0: - resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} - engines: {node: '>=18'} - lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -2115,14 +2045,6 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -2211,10 +2133,6 @@ packages: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} - npm-run-path@5.3.0: - resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -2241,14 +2159,6 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - - onetime@7.0.0: - resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} - engines: {node: '>=18'} - only@0.0.2: resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} @@ -2291,10 +2201,6 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -2361,11 +2267,6 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - pidtree@0.6.0: - resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} - engines: {node: '>=0.10'} - hasBin: true - pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -2522,17 +2423,10 @@ packages: engines: {node: '>= 0.4'} hasBin: true - restore-cursor@5.1.0: - resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} - engines: {node: '>=18'} - retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} - rfdc@1.4.1: - resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rhea-promise@3.0.3: resolution: {integrity: sha512-a875P5YcMkePSTEWMsnmCQS7Y4v/XvIw7ZoMtJxqtQRZsqSA6PsZxuz4vktyRykPuUgdNsA6F84dS3iEXZoYnQ==} @@ -2622,14 +2516,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - slice-ansi@7.1.0: - resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} - engines: {node: '>=18'} - source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} @@ -2676,10 +2562,6 @@ packages: streamx@2.22.0: resolution: {integrity: sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==} - string-argv@0.3.2: - resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} - engines: {node: '>=0.6.19'} - string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} @@ -2692,10 +2574,6 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -2718,10 +2596,6 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} - strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -2928,6 +2802,10 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} + uuid@11.1.0: + resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} + hasBin: true + v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -2965,10 +2843,6 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.0: - resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} - engines: {node: '>=18'} - wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -3793,10 +3667,6 @@ snapshots: dependencies: type-fest: 0.21.3 - ansi-escapes@7.0.0: - dependencies: - environment: 1.1.0 - ansi-regex@5.0.1: {} ansi-regex@6.1.0: {} @@ -4062,8 +3932,6 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - chalk@5.4.1: {} - char-regex@1.0.2: {} chownr@1.1.4: {} @@ -4080,15 +3948,6 @@ snapshots: libphonenumber-js: 1.11.19 validator: 13.12.0 - cli-cursor@5.0.0: - dependencies: - restore-cursor: 5.1.0 - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -4114,10 +3973,6 @@ snapshots: color-name@1.1.4: {} - colorette@2.0.20: {} - - commander@13.1.0: {} - compress-commons@6.0.2: dependencies: crc-32: 1.2.2 @@ -4317,8 +4172,6 @@ snapshots: emittery@0.13.1: {} - emoji-regex@10.4.0: {} - emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -4336,8 +4189,6 @@ snapshots: dependencies: once: 1.4.0 - environment@1.1.0: {} - error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -4420,8 +4271,6 @@ snapshots: event-target-shim@5.0.1: {} - eventemitter3@5.0.1: {} - events@3.3.0: {} execa@5.1.1: @@ -4436,18 +4285,6 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - execa@8.0.1: - dependencies: - cross-spawn: 7.0.6 - get-stream: 8.0.1 - human-signals: 5.0.0 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.3.0 - onetime: 6.0.0 - signal-exit: 4.1.0 - strip-final-newline: 3.0.0 - exit@0.1.2: {} expand-template@2.0.3: @@ -4578,8 +4415,6 @@ snapshots: get-caller-file@2.0.5: {} - get-east-asian-width@1.3.0: {} - get-intrinsic@1.2.7: dependencies: call-bind-apply-helpers: 1.0.1 @@ -4604,8 +4439,6 @@ snapshots: get-stream@6.0.1: {} - get-stream@8.0.1: {} - get-tsconfig@4.10.0: dependencies: resolve-pkg-maps: 1.0.0 @@ -4686,8 +4519,6 @@ snapshots: human-signals@2.1.0: {} - human-signals@5.0.0: {} - husky@9.1.7: {} iconv-lite@0.4.24: @@ -4731,12 +4562,6 @@ snapshots: is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@4.0.0: {} - - is-fullwidth-code-point@5.0.0: - dependencies: - get-east-asian-width: 1.3.0 - is-generator-fn@2.1.0: {} is-generator-function@1.1.0: @@ -4759,8 +4584,6 @@ snapshots: is-stream@2.0.1: {} - is-stream@3.0.0: {} - isarray@1.0.0: {} isexe@2.0.0: {} @@ -5212,34 +5035,8 @@ snapshots: libphonenumber-js@1.11.19: {} - lilconfig@3.1.3: {} - lines-and-columns@1.2.4: {} - lint-staged@15.4.3: - dependencies: - chalk: 5.4.1 - commander: 13.1.0 - debug: 4.4.0 - execa: 8.0.1 - lilconfig: 3.1.3 - listr2: 8.2.5 - micromatch: 4.0.8 - pidtree: 0.6.0 - string-argv: 0.3.2 - yaml: 2.7.0 - transitivePeerDependencies: - - supports-color - - listr2@8.2.5: - dependencies: - cli-truncate: 4.0.0 - colorette: 2.0.20 - eventemitter3: 5.0.1 - log-update: 6.1.0 - rfdc: 1.4.1 - wrap-ansi: 9.0.0 - locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -5248,14 +5045,6 @@ snapshots: lodash@4.17.21: {} - log-update@6.1.0: - dependencies: - ansi-escapes: 7.0.0 - cli-cursor: 5.0.0 - slice-ansi: 7.1.0 - strip-ansi: 7.1.0 - wrap-ansi: 9.0.0 - lru-cache@10.4.3: {} lru-cache@11.0.2: {} @@ -5299,10 +5088,6 @@ snapshots: mimic-fn@2.1.0: {} - mimic-fn@4.0.0: {} - - mimic-function@5.0.1: {} - mimic-response@3.1.0: optional: true @@ -5382,10 +5167,6 @@ snapshots: dependencies: path-key: 3.1.1 - npm-run-path@5.3.0: - dependencies: - path-key: 4.0.0 - object-assign@4.1.1: optional: true @@ -5408,14 +5189,6 @@ snapshots: dependencies: mimic-fn: 2.1.0 - onetime@6.0.0: - dependencies: - mimic-fn: 4.0.0 - - onetime@7.0.0: - dependencies: - mimic-function: 5.0.1 - only@0.0.2: optional: true @@ -5450,8 +5223,6 @@ snapshots: path-key@3.1.1: {} - path-key@4.0.0: {} - path-parse@1.0.7: {} path-scurry@1.11.1: @@ -5520,8 +5291,6 @@ snapshots: picomatch@2.3.1: {} - pidtree@0.6.0: {} - pirates@4.0.6: {} pkg-dir@4.2.0: @@ -5684,15 +5453,8 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - restore-cursor@5.1.0: - dependencies: - onetime: 7.0.0 - signal-exit: 4.1.0 - retry@0.12.0: {} - rfdc@1.4.1: {} - rhea-promise@3.0.3: dependencies: debug: 4.4.0 @@ -5825,16 +5587,6 @@ snapshots: slash@3.0.0: {} - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - slice-ansi@7.1.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 5.0.0 - source-map-support@0.5.13: dependencies: buffer-from: 1.1.2 @@ -5885,8 +5637,6 @@ snapshots: optionalDependencies: bare-events: 2.5.4 - string-argv@0.3.2: {} - string-length@4.0.2: dependencies: char-regex: 1.0.2 @@ -5904,12 +5654,6 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 - string-width@7.2.0: - dependencies: - emoji-regex: 10.4.0 - get-east-asian-width: 1.3.0 - strip-ansi: 7.1.0 - string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 @@ -5930,8 +5674,6 @@ snapshots: strip-final-newline@2.0.0: {} - strip-final-newline@3.0.0: {} - strip-json-comments@2.0.1: optional: true @@ -6148,6 +5890,8 @@ snapshots: utils-merge@1.0.1: {} + uuid@11.1.0: {} + v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.3.0: @@ -6187,12 +5931,6 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 - wrap-ansi@9.0.0: - dependencies: - ansi-styles: 6.2.1 - string-width: 7.2.0 - strip-ansi: 7.1.0 - wrappy@1.0.2: {} write-file-atomic@4.0.2: From 6029f7f35ba6ec44062b02933c7315f53c67a0c2 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Wed, 26 Feb 2025 13:06:30 +0100 Subject: [PATCH 06/20] chore: CypherUtil.ts --- README.md | 8 + .../README.md | 7 +- .../package.json | 4 +- .../src/__tests__/message-processor.test.ts | 24 +- .../src/environment.ts | 28 ++- .../src/index.ts | 2 +- .../src/message-processor.ts | 12 +- .../src/services/service-manager.ts | 6 +- .../src/services/traction-service.ts | 2 +- .../src/util/CypherUtil.ts | 236 ++++++++++++++++++ pnpm-lock.yaml | 15 ++ 11 files changed, 308 insertions(+), 36 deletions(-) create mode 100644 packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts diff --git a/README.md b/README.md index 036c94e..890c1f3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ the backend server for the Credential Showcase application. It provides REST API Defines the OpenAPI specification for the Credential Showcase application. It provides the API contract for the backend services and can be used to generate client code, validate requests, and document the API. +# credential-showcase-traction-openapi + +Defines the OpenAPI specification for the Traction backend and contains the generated client code for that. + +# credential-showcase-traction-adapter + +Picks up Credential Showcase messages from a AMQ v1.0 message broker and translates the actions to Traction API calls + # credential-showcase-ts-sdk Contains the generated TypeScript SDK client code for interacting with the Credential Showcase API. It provides a set of functions and utilities to connect with the backend services. diff --git a/packages/credential-showcase-traction-adapter/README.md b/packages/credential-showcase-traction-adapter/README.md index 1c1d1d8..e82b60d 100644 --- a/packages/credential-showcase-traction-adapter/README.md +++ b/packages/credential-showcase-traction-adapter/README.md @@ -20,7 +20,6 @@ The **Credential Showcase Traction Adapter** bridges the **Interactive Digital C - **Event-Driven Architecture:** Processes only the messages it can handle, simplifying horizontal scaling and maintainability - **Error Handling & Consistency:** Ensures durable message delivery and logs all failures for quick resolution - ## 📁 Project Structure ``` @@ -88,6 +87,7 @@ src/__tests__/message-processor.test.ts ``` These tests verify: + - Message processing for valid credential definitions - Error handling for invalid messages (missing actions, tenants, etc.) - RabbitMQ connectivity and durability @@ -104,6 +104,7 @@ These tests verify: ### Traction Service Integration The adapter provides several credential operations: + - Schema creation and lookup - Credential definition creation and lookup - Tenant token management @@ -112,6 +113,7 @@ The adapter provides several credential operations: ### Tenant/Wallet Session Management A service manager provides: + - LRU caching of tenant sessions - Configurable TTL and cache sizes - Token refreshing for existing sessions @@ -119,6 +121,7 @@ A service manager provides: ### Error Handling Durable messaging ensures errors do not cause data loss: + - Invalid messages are rejected with descriptive errors - Processing failures are logged with contextual details - Message acceptance only occurs after successful processing @@ -133,4 +136,4 @@ For more details on flows, data models, and API usage, please refer to the main ## 🏷️ License -This project is licensed under the **Apache-2.0** license. \ No newline at end of file +This project is licensed under the **Apache-2.0** license. diff --git a/packages/credential-showcase-traction-adapter/package.json b/packages/credential-showcase-traction-adapter/package.json index e28fa36..a51ac98 100644 --- a/packages/credential-showcase-traction-adapter/package.json +++ b/packages/credential-showcase-traction-adapter/package.json @@ -7,9 +7,11 @@ "scripts": { "start": "ts-node src/index.ts", "build": "tsc", - "build:clean": "tsc --build --clean && tsc --build" + "build:clean": "tsc --build --clean && tsc --build", + "generate-key": "ts-node src/util/CypherUtil.ts generate-key" }, "dependencies": { + "bs58": "^6.0.0", "credential-showcase-openapi": "workspace:*", "credential-showcase-traction-openapi": "workspace:*", "express": "^4.21.2", diff --git a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts index fb15391..a7efafc 100644 --- a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts +++ b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts @@ -103,7 +103,7 @@ describe('MessageProcessor Integration Test', () => { // Send a message with the credential definition const messageId = uuidv4() - void await sender.send({ + void (await sender.send({ message_id: messageId, body: JSON.stringify(credDef), application_properties: { @@ -113,7 +113,7 @@ describe('MessageProcessor Integration Test', () => { walletId: 'test-wallet', accessTokenEnc: 'test-token', }, - }) + })) // Wait for the message to be processed await new Promise((resolve) => { @@ -164,16 +164,16 @@ describe('MessageProcessor Integration Test', () => { // Send a message without an action const messageId = uuidv4() - void await sender.send({ + void (await sender.send({ message_id: messageId, body: JSON.stringify(credDef), application_properties: { tenantId: 'test-tenant', }, - }) + })) // Wait for the message to be processed - void await new Promise((resolve) => { + void (await new Promise((resolve) => { const checkInterval = setInterval(() => { if (consoleSpy.mock.calls.some((call) => call[0].includes('did not contain an action'))) { clearInterval(checkInterval) @@ -186,7 +186,7 @@ describe('MessageProcessor Integration Test', () => { clearInterval(checkInterval) resolve() }, 5000) - }) + })) // Verify the error was logged expect(consoleSpy.mock.calls.some((call) => call[0].includes('did not contain an action'))).toBeTruthy() @@ -221,13 +221,13 @@ describe('MessageProcessor Integration Test', () => { // Send a message without a tenant ID const messageId = uuidv4() - void await sender.send({ + void (await sender.send({ message_id: messageId, body: JSON.stringify(credDef), application_properties: { action: 'store-credentialdef' as Action, }, - }) + })) // Wait for the message to be processed await new Promise((resolve) => { @@ -257,7 +257,7 @@ describe('MessageProcessor Integration Test', () => { // Send a message with invalid JSON const messageId = uuidv4() - void await sender.send({ + void (await sender.send({ message_id: messageId, body: '{invalid json}', application_properties: { @@ -265,7 +265,7 @@ describe('MessageProcessor Integration Test', () => { tenantId: 'test-tenant', apiUrlBase: 'http://localhost:8080', }, - }) + })) // Wait for the message to be processed await new Promise((resolve) => { @@ -316,14 +316,14 @@ describe('MessageProcessor Integration Test', () => { // Send a message with an unsupported action const messageId = uuidv4() - void await sender.send({ + void (await sender.send({ message_id: messageId, body: JSON.stringify(credDef), application_properties: { action: 'unsupported-action' as Action, tenantId: 'test-tenant', }, - }) + })) // Wait for the message to be processed await new Promise((resolve) => { diff --git a/packages/credential-showcase-traction-adapter/src/environment.ts b/packages/credential-showcase-traction-adapter/src/environment.ts index a725c82..0e79f00 100644 --- a/packages/credential-showcase-traction-adapter/src/environment.ts +++ b/packages/credential-showcase-traction-adapter/src/environment.ts @@ -1,16 +1,24 @@ import { Topic } from './types' export const environment = { - AMQ_HOST: process.env.AMQ_HOST || 'localhost', - AMQ_PORT: parseInt(process.env.AMQ_PORT || '5672', 10), - AMQ_USER: process.env.AMQ_USER || 'guest', - AMQ_PASSWORD: process.env.AMQ_PASSWORD || 'guest', - - DEFAULT_API_BASE_PATH: process.env.DEFAULT_API_BASE_PATH ?? 'http://localhost:8032', - - TENANT_SESSION_CACHE_SIZE: parsePositiveInt(process.env.TENANT_SESSION_CACHE_SIZE, 1024), - TENANT_SESSION_TTL_MINS: parsePositiveInt(process.env.TENANT_SESSION_TTL_MINS, 1440), - MESSAGE_PROCESSOR_TOPIC: (process.env.MESSAGE_PROCESSOR_TOPIC ?? 'showcase-cmd') as Topic, + messageBroker: { + AMQ_HOST: process.env.AMQ_HOST || 'localhost', + AMQ_PORT: parseInt(process.env.AMQ_PORT || '5672', 10), + AMQ_USER: process.env.AMQ_USER || 'guest', + AMQ_PASSWORD: process.env.AMQ_PASSWORD || 'guest', + MESSAGE_PROCESSOR_TOPIC: (process.env.MESSAGE_PROCESSOR_TOPIC ?? 'showcase-cmd') as Topic, + }, + traction: { + DEFAULT_API_BASE_PATH: process.env.DEFAULT_API_BASE_PATH ?? 'http://localhost:8032', + TENANT_SESSION_CACHE_SIZE: parsePositiveInt(process.env.TENANT_SESSION_CACHE_SIZE, 1024), + TENANT_SESSION_TTL_MINS: parsePositiveInt(process.env.TENANT_SESSION_TTL_MINS, 1440), + }, + encryption: { + ENCRYPTION_KEY: process.env.ENCRYPTION_KEY || '', + KEY_SIZE: parsePositiveInt(process.env.ENCRYPTION_KEY_SIZE, 32), // 256 bits + NONCE_SIZE: parsePositiveInt(process.env.ENCRYPTION_NONCE_SIZE, 12), // 96 bits for ChaCha20-Poly1305 + AUTH_TAG_LENGTH: 16, // 128 bits, fixed for ChaCha20-Poly1305 + }, } function parsePositiveInt(value: string | undefined, defaultValue: number): number { diff --git a/packages/credential-showcase-traction-adapter/src/index.ts b/packages/credential-showcase-traction-adapter/src/index.ts index 4c6f334..22cadac 100644 --- a/packages/credential-showcase-traction-adapter/src/index.ts +++ b/packages/credential-showcase-traction-adapter/src/index.ts @@ -2,7 +2,7 @@ import { MessageProcessor } from './message-processor' import { environment } from './environment' async function main() { - const processor = new MessageProcessor(environment.MESSAGE_PROCESSOR_TOPIC) + const processor = new MessageProcessor(environment.messageBroker.MESSAGE_PROCESSOR_TOPIC) try { await processor.start() diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index 386c24e..151e73b 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -25,12 +25,12 @@ export class MessageProcessor { // Setup AMQ broker connection this.connection = new Connection({ - hostname: environment.AMQ_HOST, - port: environment.AMQ_PORT, + hostname: environment.messageBroker.AMQ_HOST, + port: environment.messageBroker.AMQ_PORT, transport: 'tcp', reconnect: true, - username: environment.AMQ_USER, - password: environment.AMQ_PASSWORD, + username: environment.messageBroker.AMQ_USER, + password: environment.messageBroker.AMQ_PASSWORD, }) } @@ -130,7 +130,7 @@ export class MessageProcessor { console.error(errorMsg) if (context.delivery) { context.delivery.reject({ - info: `apiBasePath: ${headers.apiUrlBase ?? environment.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}`, + info: `apiBasePath: ${headers.apiUrlBase ?? environment.traction.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}`, condition: 'fatal error', description: errorMsg, value: [credentialDef], @@ -145,7 +145,7 @@ export class MessageProcessor { const rejectOptions: any = { description: errorMsg } if (headers) { - rejectOptions.info = `apiBasePath: ${headers.apiUrlBase ?? environment.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}` + rejectOptions.info = `apiBasePath: ${headers.apiUrlBase ?? environment.traction.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}` rejectOptions.condition = 'fatal error' } diff --git a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts index d1d012f..e6d4b71 100644 --- a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts +++ b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts @@ -4,8 +4,8 @@ import { LRUCache } from 'lru-cache' class ServiceManager { private readonly services = new LRUCache({ - max: environment.TENANT_SESSION_CACHE_SIZE, - ttl: environment.TENANT_SESSION_TTL_MINS * 60, + max: environment.traction.TENANT_SESSION_CACHE_SIZE, + ttl: environment.traction.TENANT_SESSION_TTL_MINS * 60, }) public getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: string): TractionService { @@ -29,7 +29,7 @@ class ServiceManager { return service } - private buildKey(apiUrlBase: string = environment.DEFAULT_API_BASE_PATH, tenantId: string, walletId?: string): string { + private buildKey(apiUrlBase: string = environment.traction.DEFAULT_API_BASE_PATH, tenantId: string, walletId?: string): string { return walletId ? `${apiUrlBase}:${tenantId}:${walletId}` : `${apiUrlBase}:${tenantId}` } } diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts index 8ad9435..4b4cddd 100644 --- a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -30,7 +30,7 @@ export class TractionService { constructor( private tenantId: string, - private basePath: string = environment.DEFAULT_API_BASE_PATH, + private basePath: string = environment.traction.DEFAULT_API_BASE_PATH, private walletId?: string, private accessToken?: string, ) { diff --git a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts new file mode 100644 index 0000000..01e075e --- /dev/null +++ b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts @@ -0,0 +1,236 @@ +import crypto from 'crypto' +import { Buffer } from 'buffer' +import bs58 from 'bs58' +import { environment } from '../environment' + +const env = environment.encryption + +function isChaCha20Poly1305Supported(): boolean { + try { + const supportedAlgorithms = crypto.getCiphers() + return supportedAlgorithms.includes('chacha20-poly1305') + } catch (error) { + return false + } +} + +if (!isChaCha20Poly1305Supported()) { + throw new Error('ChaCha20-Poly1305 is not supported in this Node.js version. Please upgrade to a newer version.') +} + +/** + * Encodes a key buffer to a Base58 string for storage + * @param key The key buffer to encode + * @returns Base58 encoded string representation of the key + */ +function encodeKey(key: Buffer): string { + return bs58.encode(key) +} + +/** + * Decodes a Base58 encoded key string to a Buffer + * @param encodedKey Base58 encoded key string + * @returns Buffer containing the decoded key + */ +function decodeKey(encodedKey: string): Buffer { + return Buffer.from(bs58.decode(encodedKey)) +} + +/** + * Generates a random encryption key of specified size + * @param size Key size in bytes (default from environment or 32 bytes) + * @returns Base58 encoded string representation of the generated key + */ +export function generateKey(size: number = env.KEY_SIZE): string { + const keyBuffer = crypto.randomBytes(size) + return encodeKey(keyBuffer) +} + +/** + * Gets the encryption key from environment variable or generates one if not available + * @returns Buffer containing the encryption key + */ +function getKeyFromEnv(): Buffer { + if (env.ENCRYPTION_KEY) { + return decodeKey(env.ENCRYPTION_KEY) + } + + // Log warning if no key is set in environment + console.warn('No encryption key found in environment variables. Using a temporary key for this session only.') + // Generate a temporary key as Buffer directly + return crypto.randomBytes(env.KEY_SIZE) +} + +/** + * Validates that the key and nonce sizes are correct for ChaCha20-Poly1305 + * @param key The encryption key + * @param nonceSize The nonce size + * @throws Error if key or nonce size is invalid + */ +function validateParameters(key: Buffer, nonceSize: number): void { + if (key.length !== env.KEY_SIZE) { + throw new Error(`Invalid key size. ChaCha20-Poly1305 requires a ${env.KEY_SIZE}-byte key.`) + } + + if (nonceSize !== env.NONCE_SIZE) { + throw new Error(`Invalid nonce size. ChaCha20-Poly1305 requires a ${env.NONCE_SIZE}-byte nonce.`) + } +} + +/** + * Encrypts a Buffer using ChaCha20-Poly1305 with the environment key + * @param data Buffer containing data to encrypt + * @param nonceSize Size of the nonce in bytes (default from environment) + * @returns Object containing encrypted data and nonce + */ +export function encryptBuffer( + data: Buffer, + nonceSize: number = env.NONCE_SIZE +): { encrypted: Buffer; nonce: Buffer } { + const key = getKeyFromEnv() + validateParameters(key, nonceSize) + + // Generate a random nonce + const nonce = crypto.randomBytes(nonceSize) + + // Create cipher - use 'chacha20-poly1305' algorithm + const cipher = crypto.createCipheriv('chacha20-poly1305', key, nonce, { + authTagLength: env.AUTH_TAG_LENGTH, + }) + + // Encrypt data + const ciphertext = Buffer.concat([cipher.update(data), cipher.final()]) + + // Get authentication tag + const authTag = cipher.getAuthTag() + + // Combine ciphertext and auth tag + const encrypted = Buffer.concat([ciphertext, authTag]) + + return { encrypted, nonce } +} + +/** + * Decrypts a Buffer using ChaCha20-Poly1305 with the environment key + * @param encryptedData Buffer containing encrypted data with auth tag + * @param nonce Nonce used during encryption + * @returns Buffer containing decrypted data + * @throws Error if decryption fails + */ +export function decryptBuffer( + encryptedData: Buffer, + nonce: Buffer +): Buffer { + const key = getKeyFromEnv() + validateParameters(key, nonce.length) + + if (encryptedData.length <= env.AUTH_TAG_LENGTH) { + throw new Error('Invalid encrypted data: too short to contain authentication tag') + } + + // Extract auth tag (last 16 bytes) + const authTag = encryptedData.slice(encryptedData.length - env.AUTH_TAG_LENGTH) + const ciphertext = encryptedData.slice(0, encryptedData.length - env.AUTH_TAG_LENGTH) + + // Create decipher + const decipher = crypto.createDecipheriv('chacha20-poly1305', key, nonce, { + authTagLength: env.AUTH_TAG_LENGTH, + }) + + // Set auth tag + decipher.setAuthTag(authTag) + + // Decrypt data + const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]) + + return decrypted +} + +/** + * Encrypts a string using ChaCha20-Poly1305 with the environment key + * @param text String to encrypt + * @param nonceSize Size of the nonce in bytes (default from environment) + * @returns Object containing base64 encoded encrypted data and nonce + */ +export function encryptString( + text: string, + nonceSize: number = env.NONCE_SIZE, +): { encryptedBase64: string; nonceBase64: string } { + const result = encryptBuffer(Buffer.from(text, 'utf8'), nonceSize) + return { + encryptedBase64: result.encrypted.toString('base64'), + nonceBase64: result.nonce.toString('base64'), + } +} + +/** + * Decrypts a string using ChaCha20-Poly1305 with the environment key + * @param encryptedBase64 Base64 encoded encrypted data with auth tag + * @param nonceBase64 Base64 encoded nonce used during encryption + * @returns Decrypted string + * @throws Error if decryption fails + */ +export function decryptString( + encryptedBase64: string, + nonceBase64: string +): string { + const encryptedData = Buffer.from(encryptedBase64, 'base64') + const nonce = Buffer.from(nonceBase64, 'base64') + + const decrypted = decryptBuffer(encryptedData, nonce) + return decrypted.toString('utf8') +} + +/** + * Encrypts a Uint8Array using ChaCha20-Poly1305 with the environment key + * @param data Uint8Array containing data to encrypt + * @param nonceSize Size of the nonce in bytes (default from environment) + * @returns Object containing encrypted data and nonce as Uint8Arrays + */ +export function encryptBytes( + data: Uint8Array, + nonceSize: number = env.NONCE_SIZE, +): { encrypted: Uint8Array; nonce: Uint8Array } { + const result = encryptBuffer(Buffer.from(data), nonceSize) + return { + encrypted: new Uint8Array(result.encrypted), + nonce: new Uint8Array(result.nonce), + } +} + +/** + * Decrypts a Uint8Array using ChaCha20-Poly1305 with the environment key + * @param encryptedData Uint8Array containing encrypted data with auth tag + * @param nonce Uint8Array containing nonce used during encryption + * @returns Uint8Array containing decrypted data + * @throws Error if decryption fails + */ +export function decryptBytes( + encryptedData: Uint8Array, + nonce: Uint8Array +): Uint8Array { + const result = decryptBuffer(Buffer.from(encryptedData), Buffer.from(nonce)) + return new Uint8Array(result) +} + +/** + * Main function that can be called from command line + */ +function main() { + const args = process.argv.slice(2); + const command = args[0]; + + switch (command) { + case 'generate-key': + const key = generateKey(); + console.log('Generated key:', key); + break; + default: + console.log('Unknown command. Available commands: generate-key'); + } +} + +// Run main if this file is executed directly +if (require.main === module) { + main(); +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb735bb..6d06357 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -95,6 +95,9 @@ importers: packages/credential-showcase-traction-adapter: dependencies: + bs58: + specifier: ^6.0.0 + version: 6.0.0 credential-showcase-openapi: specifier: workspace:* version: link:../credential-showcase-openapi @@ -985,6 +988,9 @@ packages: bare-events: optional: true + base-x@5.0.0: + resolution: {integrity: sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -1023,6 +1029,9 @@ packages: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} + bs58@6.0.0: + resolution: {integrity: sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==} + bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} @@ -3809,6 +3818,8 @@ snapshots: bare-events: 2.5.4 optional: true + base-x@5.0.0: {} + base64-js@1.5.1: {} bcrypt-pbkdf@1.0.2: @@ -3873,6 +3884,10 @@ snapshots: dependencies: fast-json-stable-stringify: 2.1.0 + bs58@6.0.0: + dependencies: + base-x: 5.0.0 + bser@2.1.1: dependencies: node-int64: 0.4.0 From b3c52dfc5ddca5561bcbeedb94b780b5c62ce611 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Wed, 26 Feb 2025 13:06:50 +0100 Subject: [PATCH 07/20] chore: CypherUtil.ts --- .../src/util/CypherUtil.ts | 46 ++++++------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts index 01e075e..fafc3ef 100644 --- a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts +++ b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts @@ -83,10 +83,7 @@ function validateParameters(key: Buffer, nonceSize: number): void { * @param nonceSize Size of the nonce in bytes (default from environment) * @returns Object containing encrypted data and nonce */ -export function encryptBuffer( - data: Buffer, - nonceSize: number = env.NONCE_SIZE -): { encrypted: Buffer; nonce: Buffer } { +export function encryptBuffer(data: Buffer, nonceSize: number = env.NONCE_SIZE): { encrypted: Buffer; nonce: Buffer } { const key = getKeyFromEnv() validateParameters(key, nonceSize) @@ -117,10 +114,7 @@ export function encryptBuffer( * @returns Buffer containing decrypted data * @throws Error if decryption fails */ -export function decryptBuffer( - encryptedData: Buffer, - nonce: Buffer -): Buffer { +export function decryptBuffer(encryptedData: Buffer, nonce: Buffer): Buffer { const key = getKeyFromEnv() validateParameters(key, nonce.length) @@ -152,10 +146,7 @@ export function decryptBuffer( * @param nonceSize Size of the nonce in bytes (default from environment) * @returns Object containing base64 encoded encrypted data and nonce */ -export function encryptString( - text: string, - nonceSize: number = env.NONCE_SIZE, -): { encryptedBase64: string; nonceBase64: string } { +export function encryptString(text: string, nonceSize: number = env.NONCE_SIZE): { encryptedBase64: string; nonceBase64: string } { const result = encryptBuffer(Buffer.from(text, 'utf8'), nonceSize) return { encryptedBase64: result.encrypted.toString('base64'), @@ -170,10 +161,7 @@ export function encryptString( * @returns Decrypted string * @throws Error if decryption fails */ -export function decryptString( - encryptedBase64: string, - nonceBase64: string -): string { +export function decryptString(encryptedBase64: string, nonceBase64: string): string { const encryptedData = Buffer.from(encryptedBase64, 'base64') const nonce = Buffer.from(nonceBase64, 'base64') @@ -187,10 +175,7 @@ export function decryptString( * @param nonceSize Size of the nonce in bytes (default from environment) * @returns Object containing encrypted data and nonce as Uint8Arrays */ -export function encryptBytes( - data: Uint8Array, - nonceSize: number = env.NONCE_SIZE, -): { encrypted: Uint8Array; nonce: Uint8Array } { +export function encryptBytes(data: Uint8Array, nonceSize: number = env.NONCE_SIZE): { encrypted: Uint8Array; nonce: Uint8Array } { const result = encryptBuffer(Buffer.from(data), nonceSize) return { encrypted: new Uint8Array(result.encrypted), @@ -205,10 +190,7 @@ export function encryptBytes( * @returns Uint8Array containing decrypted data * @throws Error if decryption fails */ -export function decryptBytes( - encryptedData: Uint8Array, - nonce: Uint8Array -): Uint8Array { +export function decryptBytes(encryptedData: Uint8Array, nonce: Uint8Array): Uint8Array { const result = decryptBuffer(Buffer.from(encryptedData), Buffer.from(nonce)) return new Uint8Array(result) } @@ -217,20 +199,20 @@ export function decryptBytes( * Main function that can be called from command line */ function main() { - const args = process.argv.slice(2); - const command = args[0]; + const args = process.argv.slice(2) + const command = args[0] switch (command) { case 'generate-key': - const key = generateKey(); - console.log('Generated key:', key); - break; + const key = generateKey() + console.log('Generated key:', key) + break default: - console.log('Unknown command. Available commands: generate-key'); + console.log('Unknown command. Available commands: generate-key') } } // Run main if this file is executed directly if (require.main === module) { - main(); -} \ No newline at end of file + main() +} From e2c178608f4063b8eba6b66c6a4fc38d01983c93 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Wed, 26 Feb 2025 15:10:15 +0100 Subject: [PATCH 08/20] chore: env example --- .../.env.example | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/credential-showcase-traction-adapter/.env.example diff --git a/packages/credential-showcase-traction-adapter/.env.example b/packages/credential-showcase-traction-adapter/.env.example new file mode 100644 index 0000000..846437e --- /dev/null +++ b/packages/credential-showcase-traction-adapter/.env.example @@ -0,0 +1,17 @@ + +# Messsage broker settings +AMQ_HOST=localhost +AMQ_PORT=5672 +AMQ_USER=guest +AMQ_PASSWORD=guest +MESSAGE_PROCESSOR_TOPIC=showcase-cmd + +# Traction settings +DEFAULT_API_BASE_PATH=http://localhost:8032 +TENANT_SESSION_CACHE_SIZE=1024 +TENANT_SESSION_TTL_MINS=1440 + +# Encryption settings (for token transport) +ENCRYPTION_KEY=TS9PmByXiBMmAUFSNubUzMiWWJmMCjWa2DGwgFnCaas +KEY_SIZE=32# 256 bits +NONCE_SIZE=12# 96 bits for ChaCha20-Poly1305 \ No newline at end of file From 2700ad8b9ea607af404317206d984fa34d1124a4 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Wed, 26 Feb 2025 16:08:28 +0100 Subject: [PATCH 09/20] chore: attached bearer token decryption --- .../openapi/openapi.yaml | 223 +++++++++++------- .../src/message-processor.ts | 6 +- .../src/services/service-manager.ts | 31 ++- .../src/util/CypherUtil.ts | 12 + .../package.json | 3 +- pnpm-lock.yaml | 3 + 6 files changed, 188 insertions(+), 90 deletions(-) diff --git a/packages/credential-showcase-openapi/openapi/openapi.yaml b/packages/credential-showcase-openapi/openapi/openapi.yaml index 035d287..e5aec70 100644 --- a/packages/credential-showcase-openapi/openapi/openapi.yaml +++ b/packages/credential-showcase-openapi/openapi/openapi.yaml @@ -1613,15 +1613,15 @@ paths: schema: type: array items: - $ref: '#/components/schemas/ShowcaseResponse' + $ref: '#/components/schemas/ShowcasesResponse' '400': - $ref: '#/components/responses/BadRequest' + $ref: '#/components/responses/BadRequest' '401': - $ref: '#/components/responses/Unauthorized' + $ref: '#/components/responses/Unauthorized' '403': - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/Forbidden' '500': - $ref: '#/components/responses/InternalServerError' + $ref: '#/components/responses/InternalServerError' post: tags: - Showcases @@ -1631,7 +1631,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Showcase' + $ref: '#/components/schemas/ShowcaseRequest' required: true responses: '201': @@ -1641,13 +1641,13 @@ paths: schema: $ref: '#/components/schemas/ShowcaseResponse' '400': - $ref: '#/components/responses/BadRequest' + $ref: '#/components/responses/BadRequest' '401': - $ref: '#/components/responses/Unauthorized' + $ref: '#/components/responses/Unauthorized' '403': - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/Forbidden' '500': - $ref: '#/components/responses/InternalServerError' + $ref: '#/components/responses/InternalServerError' /showcases/{showcaseId}: parameters: - name: showcaseId @@ -1667,15 +1667,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Showcase' + $ref: '#/components/schemas/ShowcaseResponse' '400': - $ref: '#/components/responses/BadRequest' + $ref: '#/components/responses/BadRequest' '401': - $ref: '#/components/responses/Unauthorized' + $ref: '#/components/responses/Unauthorized' '403': - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/Forbidden' '500': - $ref: '#/components/responses/InternalServerError' + $ref: '#/components/responses/InternalServerError' put: tags: - Showcases @@ -1686,22 +1686,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Showcase' + $ref: '#/components/schemas/ShowcaseRequest' responses: '200': description: Updated content: application/json: schema: - $ref: '#/components/schemas/Showcase' + $ref: '#/components/schemas/ShowcaseResponse' '400': - $ref: '#/components/responses/BadRequest' + $ref: '#/components/responses/BadRequest' '401': - $ref: '#/components/responses/Unauthorized' + $ref: '#/components/responses/Unauthorized' '403': - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/Forbidden' '500': - $ref: '#/components/responses/InternalServerError' + $ref: '#/components/responses/InternalServerError' delete: tags: - Showcases @@ -1709,23 +1709,23 @@ paths: operationId: deleteShowcase responses: '204': - description: Deleted - content: - application/json: - schema: - type: object - properties: - message: - type: string - description: A message indicating the showcase was deleted + description: Deleted + content: + application/json: + schema: + type: object + properties: + message: + type: string + description: A message indicating the showcase was deleted '400': - $ref: '#/components/responses/BadRequest' + $ref: '#/components/responses/BadRequest' '401': - $ref: '#/components/responses/Unauthorized' + $ref: '#/components/responses/Unauthorized' '403': - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/Forbidden' '500': - $ref: '#/components/responses/InternalServerError' + $ref: '#/components/responses/InternalServerError' components: securitySchemes: @@ -2172,7 +2172,7 @@ components: type: object properties: issuanceFlow: - $ref: '#/components/schemas/IssuanceFlow' + $ref: '#/components/schemas/IssuanceFlow' IssuanceFlow: type: object allOf: @@ -2608,53 +2608,112 @@ components: example: 123e4567-e89b-12d3-a456-426614174123 description: Anonymous Credentials specific revocation information - # Showcase: - # type: object - # required: - # - name - # - description - # properties: - # id: - # type: string - # description: Unique identifier for the showcase - # example: 123e4567-e89b-12d3-a456-426614174456 - # name: - # type: string - # description: Name of the showcase - # example: Credential Showcase BCGov - # description: - # type: string - # description: Description of the showcase - # example: Collection of credential usage scenarios - # status: - # type: string - # enum: [pending, active, archived] - # description: Current status of the showcase - # example: pending - # hidden: - # type: boolean - # description: Whether the showcase is hidden from public view - # default: false - # scenarios: - # type: array - # description: List of scenarios in this showcase - # items: - # $ref: '#/components/schemas/Scenario' - # credentials: - # type: array - # description: List of credential definitions used in this showcase - # items: - # $ref: '#/components/schemas/CredentialDefinitionsResponse' - # personas: - # type: object - # description: List of personas involved in this showcase - # items: - # $ref: '#/components/schemas/PersonasResponse' - # workflows: - # type: array - # description: List of workflows used in this showcase - # items: - # $ref: '#/components/schemas/Workflow' + Showcase: + type: object + required: + - id + - name + - description + - status + - scenarios + - personas + - credentials + - hidden + properties: + id: + type: string + description: Unique identifier for the showcase + example: 123e4567-e89b-12d3-a456-426614174456 + name: + type: string + description: Name of the showcase + example: Credential Showcase BCGov + description: + type: string + description: Description of the showcase + example: Collection of credential usage scenarios + status: + type: string + enum: [pending, active, archived] + description: Current status of the showcase + example: pending + hidden: + type: boolean + description: Whether the showcase is hidden from public view + default: false + scenarios: + type: array + description: List of scenarios in this showcase + items: + $ref: '#/components/schemas/Workflow' + credentials: + type: array + description: List of credential definitions used in this showcase + items: + $ref: '#/components/schemas/CredentialDefinition' + personas: + type: object + description: List of personas involved in this showcase + items: + $ref: '#/components/schemas/Persona' + ShowcasesResponse: + type: object + properties: + showcases: + type: array + description: "List of showcases" + items: + $ref: '#/components/schemas/Showcase' + ShowcaseResponse: + type: object + properties: + showcase: + $ref: '#/components/schemas/Showcase' + ShowcaseRequest: + required: + - name + - description + - status + - scenarios + - personas + - credentials + - hidden + properties: + name: + type: string + description: Name of the showcase + example: Credential Showcase BCGov + description: + type: string + description: Description of the showcase + example: Collection of credential usage scenarios + status: + type: string + enum: [pending, active, archived] + description: Current status of the showcase + example: pending + hidden: + type: boolean + description: Whether the showcase is hidden from public view + default: false + scenarios: + type: array + description: List of scenarios in this showcase + items: + type: string + example: 123e4567-e89b-12d3-a456-426614174469 + credentials: + type: array + description: List of credential definitions used in this showcase + items: + type: string + example: 123e4567-e89b-12d3-a456-426614174469 + personas: + type: array + description: List of personas involved in this showcase + items: + type: string + example: 123e4567-e89b-12d3-a456-426614174469 # Scenario: # type: object diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index 151e73b..5d3a57c 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -4,13 +4,15 @@ import { CredentialDefinitionFromJSON } from 'credential-showcase-openapi' import { TractionService } from './services/traction-service' import { getTractionService } from './services/service-manager' import { Action, Topic } from './types' +import { Buffer } from 'buffer' interface MessageHeaders { action?: Action tenantId?: string apiUrlBase?: string walletId?: string - accessTokenEnc?: string + accessTokenEnc?: Buffer + accessTokenNonce?: Buffer } export class MessageProcessor { @@ -100,7 +102,7 @@ export class MessageProcessor { tenantId: applicationProperties['tenantId'] as string | undefined, apiUrlBase: applicationProperties['apiUrlBase'] as string | undefined, walletId: applicationProperties['walletId'] as string | undefined, - accessTokenEnc: applicationProperties['accessTokenEnc'] as string | undefined, + accessTokenEnc: applicationProperties['accessTokenEnc'] as Buffer | undefined, } } diff --git a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts index e6d4b71..b9df26d 100644 --- a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts +++ b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts @@ -1,6 +1,8 @@ import { TractionService } from './traction-service' import { environment } from '../environment' import { LRUCache } from 'lru-cache' +import { decryptBufferAsString } from '../util/CypherUtil' +import { Buffer } from 'buffer' class ServiceManager { private readonly services = new LRUCache({ @@ -8,27 +10,46 @@ class ServiceManager { ttl: environment.traction.TENANT_SESSION_TTL_MINS * 60, }) - public getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: string): TractionService { + public getTractionService( + tenantId: string, + apiUrlBase?: string, + walletId?: string, + accessTokenEnc?: Buffer, + accessTokenNonce?: Buffer, + ): TractionService { const key = this.buildKey(apiUrlBase, tenantId, walletId) + const decodedToken = this.decodeToken(accessTokenEnc, accessTokenNonce) // Return existing service if it exists if (this.services.has(key)) { const service = this.services.get(key)! // Update token if provided - if (accessTokenEnc) { - service.updateBearerToken(accessTokenEnc) + if (decodedToken) { + service.updateBearerToken(decodedToken) } return service } - const service = new TractionService(tenantId, apiUrlBase, walletId, accessTokenEnc) + const service = new TractionService(tenantId, apiUrlBase, walletId, decodedToken) this.services.set(key, service) return service } + private decodeToken(accessTokenEnc?: Buffer, accessTokenNonce?: Buffer) { + let decodedToken: string | undefined + if (accessTokenEnc) { + if (accessTokenNonce) { + decodedToken = decryptBufferAsString(accessTokenEnc, accessTokenNonce) + } else { + throw Error('An access token was provided without a nonce') + } + } + return decodedToken + } + private buildKey(apiUrlBase: string = environment.traction.DEFAULT_API_BASE_PATH, tenantId: string, walletId?: string): string { return walletId ? `${apiUrlBase}:${tenantId}:${walletId}` : `${apiUrlBase}:${tenantId}` } @@ -37,7 +58,7 @@ class ServiceManager { // Singleton instance const serviceRegistry = new ServiceManager() -export function getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: string): TractionService { +export function getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: Buffer): TractionService { if (!tenantId) { throw new Error('tenantId is required') } diff --git a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts index fafc3ef..fe64786 100644 --- a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts +++ b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts @@ -169,6 +169,18 @@ export function decryptString(encryptedBase64: string, nonceBase64: string): str return decrypted.toString('utf8') } +/** + * Decrypts a string using ChaCha20-Poly1305 with the environment key + * @param encryptedData Buffer containing encrypted data with auth tag + * @param nonce Buffer containing nonce used during encryption + * @returns Decrypted string + * @throws Error if decryption fails + */ +export function decryptBufferAsString(encryptedData: Buffer, nonce: Buffer): string { + const decrypted = decryptBuffer(encryptedData, nonce) + return decrypted.toString('utf8') +} + /** * Encrypts a Uint8Array using ChaCha20-Poly1305 with the environment key * @param data Uint8Array containing data to encrypt diff --git a/packages/credential-showcase-traction-openapi/package.json b/packages/credential-showcase-traction-openapi/package.json index 2021478..3f4ba9c 100644 --- a/packages/credential-showcase-traction-openapi/package.json +++ b/packages/credential-showcase-traction-openapi/package.json @@ -5,7 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "postinstall": "mvn clean generate-sources", + "postinstall": "pnpm generate-models", + "generate-models": "rimraf ./src && mvn clean generate-sources", "dev": "tsc --watch", "build": "tsc", "build:clean": "tsc --build --clean && tsc --build" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89af933..4f26142 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,6 +126,9 @@ importers: '@types/express': specifier: ^5.0.0 version: 5.0.0 + '@types/node': + specifier: ^22.13.1 + version: 22.13.1 testcontainers: specifier: ^10.18.0 version: 10.18.0 From d3a27603e99d61ce8af619d4d1a49f5f57902c67 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 27 Feb 2025 11:15:48 +0100 Subject: [PATCH 10/20] chore: options --- .../src/mappers/credential-definition.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts index 6689fff..ab000e4 100644 --- a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -46,7 +46,7 @@ export function credentialDefinitionToCredDefPostRequest(credentialDef: Credenti return { credentialDefinition: innerCredDef, - options: getRevocationOptions(credentialDef), + options: getOptions(credentialDef), } } @@ -55,7 +55,7 @@ export function credentialDefinitionToCredDefPostRequest(credentialDef: Credenti * @param credDef The credential definition * @returns Options with revocation settings */ -export function getRevocationOptions(credDef: CredentialDefinition): CredDefPostOptions { +export function getOptions(credDef: CredentialDefinition): CredDefPostOptions { if (!credDef.revocation) { return { supportRevocation: false, From 7b1286d08d73846837b9904f94e70bc5e908adb4 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 27 Feb 2025 13:01:01 +0100 Subject: [PATCH 11/20] chore: added credential-showcase-adapter-client-api --- .../package.json | 36 +++ .../src/adapter-client-api.ts | 69 ++++++ .../src/environment.ts | 41 ++++ .../src/index.ts | 3 + .../src/types/adapter-backend.ts | 6 + .../src/types/adapter-client.ts | 7 + .../src/types/index.ts | 1 + .../src/util/CypherUtil.ts | 231 ++++++++++++++++++ .../tsconfig.json | 14 ++ .../src/message-processor.ts | 1 + .../src/util/CypherUtil.ts | 13 +- pnpm-lock.yaml | 22 ++ 12 files changed, 438 insertions(+), 6 deletions(-) create mode 100644 packages/credential-showcase-adapter-client-api/package.json create mode 100644 packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts create mode 100644 packages/credential-showcase-adapter-client-api/src/environment.ts create mode 100644 packages/credential-showcase-adapter-client-api/src/index.ts create mode 100644 packages/credential-showcase-adapter-client-api/src/types/adapter-backend.ts create mode 100644 packages/credential-showcase-adapter-client-api/src/types/adapter-client.ts create mode 100644 packages/credential-showcase-adapter-client-api/src/types/index.ts create mode 100644 packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts create mode 100644 packages/credential-showcase-adapter-client-api/tsconfig.json diff --git a/packages/credential-showcase-adapter-client-api/package.json b/packages/credential-showcase-adapter-client-api/package.json new file mode 100644 index 0000000..cf81d24 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/package.json @@ -0,0 +1,36 @@ +{ + "name": "credential-showcase-traction-adapter", + "version": "0.1.0", + "source": "src/index.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "start": "ts-node src/index.ts", + "build": "tsc", + "build:clean": "tsc --build --clean && tsc --build", + "generate-key": "ts-node src/util/CypherUtil.ts generate-key" + }, + "dependencies": { + "credential-showcase-openapi": "workspace:*", + "bs58": "^6.0.0", + "rhea": "^3.0.3", + "rhea-promise": "^3.0.3", + "typedi": "^0.10.0" + }, + "devDependencies": { + "@types/node": "^22.13.1" + }, + "files": [ + "dist/**/*", + "README.md", + "LICENSE" + ], + "private": false, + "publishConfig": { + "access": "public" + }, + "repository": "git@github.com:Sphereon-Opensource/credential-showcase-api.git", + "author": "4Sure", + "license": "Apache-2.0", + "keywords": [] +} diff --git a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts new file mode 100644 index 0000000..c570b53 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts @@ -0,0 +1,69 @@ +import { Service } from 'typedi' +import { Connection, Sender } from 'rhea-promise' +import { environment } from './environment' +import { CredentialDefinition } from 'credential-showcase-openapi' + +@Service() +export class AdapterClientApi { + private readonly isReady: Promise + private isConnected = false + private connection: Connection + private sender!: Sender + + constructor() { + this.connection = new Connection({ + hostname: environment.messageBroker.AMQ_HOST, + port: environment.messageBroker.AMQ_PORT, + transport: 'tcp', // TODO add tls support? + reconnect: true, + username: environment.messageBroker.AMQ_USER, + password: environment.messageBroker.AMQ_PASSWORD, + }) + + this.isReady = this.init() // concurrency protection + } + + private async init(): Promise { + if (this.isConnected) { + if (!this.sender?.isOpen() || !this.sender?.isRemoteOpen() || !this.connection.isOpen()) { + return Promise.reject(Error('AMQP connection or sender is no longer connected.')) + } + return + } + await this.connection.open() + this.sender = await this.connection.createSender({ target: { address: environment.messageBroker.MESSAGE_PROCESSOR_TOPIC } }) + this.isConnected = true + } + + private async send(action: string, payload: object): Promise { + try { + await this.isReady + + const delivery = this.sender.send({ + body: JSON.stringify(payload), + application_properties: { action }, + }) + + if (delivery.remote_state && 'error' in delivery.remote_state) { + return Promise.reject(Error(`Message rejected: ${delivery.remote_state.error?.description || 'Unknown error'}`)) + } + + if (!delivery.settled) { + return Promise.reject(Error('Message was not settled by the receiver')) + } + } catch (error) { + return Promise.reject(error) + } + } + + public async storeCredentialDefinition(credentialDefinition: CredentialDefinition): Promise { + return this.send('store-credentialdef', credentialDefinition) + } + + public async close(): Promise { + if (!this.isConnected) return + if (this.sender) await this.sender.close() + await this.connection.close() + this.isConnected = false + } +} diff --git a/packages/credential-showcase-adapter-client-api/src/environment.ts b/packages/credential-showcase-adapter-client-api/src/environment.ts new file mode 100644 index 0000000..eb418f7 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/environment.ts @@ -0,0 +1,41 @@ +import { Topic } from './types/adapter-backend' + +const validateTopic = (topic?: string): Topic | undefined => { + if (!topic) { + return undefined + } + if (!Object.values(Topic).includes(topic as Topic)) { + throw new Error(`Invalid topic: ${topic}. Valid topics are: ${Object.values(Topic).join(', ')}`) + } + return topic as Topic +} + +const parsePositiveInt = (value: string | undefined, defaultValue: number): number => { + if (!value) { + return defaultValue + } + + const parsed = parseInt(value, 10) + + if (isNaN(parsed) || parsed <= 0) { + return defaultValue + } + + return parsed +} + +export const environment = { + messageBroker: { + AMQ_HOST: process.env.AMQ_HOST || 'localhost', + AMQ_PORT: parseInt(process.env.AMQ_PORT || '5672', 10), + AMQ_USER: process.env.AMQ_USER || 'guest', + AMQ_PASSWORD: process.env.AMQ_PASSWORD || 'guest', + MESSAGE_PROCESSOR_TOPIC: validateTopic(process.env.MESSAGE_PROCESSOR_TOPIC) ?? Topic.SHOWCASE_CMD, + }, + encryption: { + ENCRYPTION_KEY: process.env.ENCRYPTION_KEY || '', + KEY_SIZE: parsePositiveInt(process.env.ENCRYPTION_KEY_SIZE, 32), // 256 bits + NONCE_SIZE: parsePositiveInt(process.env.ENCRYPTION_NONCE_SIZE, 12), // 96 bits for ChaCha20-Poly1305 + AUTH_TAG_LENGTH: 16, // 128 bits, fixed for ChaCha20-Poly1305 + }, +} diff --git a/packages/credential-showcase-adapter-client-api/src/index.ts b/packages/credential-showcase-adapter-client-api/src/index.ts new file mode 100644 index 0000000..8573201 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/index.ts @@ -0,0 +1,3 @@ +export * from './types' + +export { AdapterClientApi } from './adapter-client-api' diff --git a/packages/credential-showcase-adapter-client-api/src/types/adapter-backend.ts b/packages/credential-showcase-adapter-client-api/src/types/adapter-backend.ts new file mode 100644 index 0000000..7da5e92 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/types/adapter-backend.ts @@ -0,0 +1,6 @@ +export enum Topic { + SHOWCASE_CMD = 'SHOWCASE_CMD', + SHOWCASE_CMD_TESTING = 'SHOWCASE_CMD_TESTING', +} + +export type Action = 'store-credentialdef' diff --git a/packages/credential-showcase-adapter-client-api/src/types/adapter-client.ts b/packages/credential-showcase-adapter-client-api/src/types/adapter-client.ts new file mode 100644 index 0000000..57314a0 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/types/adapter-client.ts @@ -0,0 +1,7 @@ +import { CredentialDefinition } from 'credential-showcase-openapi' + +export interface IAdapterClientApi { + storeCredentialDefinition(credentialDefinition: CredentialDefinition): Promise + + close(): Promise +} diff --git a/packages/credential-showcase-adapter-client-api/src/types/index.ts b/packages/credential-showcase-adapter-client-api/src/types/index.ts new file mode 100644 index 0000000..e7ece4f --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/types/index.ts @@ -0,0 +1 @@ +export * from './adapter-client-api' diff --git a/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts b/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts new file mode 100644 index 0000000..b3c88c7 --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts @@ -0,0 +1,231 @@ +import crypto from 'crypto' +import { Buffer } from 'buffer' +import bs58 from 'bs58' +import { environment } from '../environment' +import { error } from 'rhea-promise/typings/lib/log' + +// TODO move to common package to dedup + +const env = environment.encryption + +function isChaCha20Poly1305Supported(): boolean { + try { + const supportedAlgorithms = crypto.getCiphers() + return supportedAlgorithms.includes('chacha20-poly1305') + } catch (error) { + return false + } +} + +if (!isChaCha20Poly1305Supported()) { + throw new Error('ChaCha20-Poly1305 is not supported in this Node.js version. Please upgrade to a newer version.') +} + +/** + * Encodes a key buffer to a Base58 string for storage + * @param key The key buffer to encode + * @returns Base58 encoded string representation of the key + */ +function encodeKey(key: Buffer): string { + return bs58.encode(key) +} + +/** + * Decodes a Base58 encoded key string to a Buffer + * @param encodedKey Base58 encoded key string + * @returns Buffer containing the decoded key + */ +function decodeKey(encodedKey: string): Buffer { + return Buffer.from(bs58.decode(encodedKey)) +} + +/** + * Generates a random encryption key of specified size + * @param size Key size in bytes (default from environment or 32 bytes) + * @returns Base58 encoded string representation of the generated key + */ +export function generateKey(size: number = env.KEY_SIZE): string { + const keyBuffer = crypto.randomBytes(size) + return encodeKey(keyBuffer) +} + +/** + * Gets the encryption key from environment variable or generates one if not available + * @returns Buffer containing the encryption key + * @throws Error when the ENCRYPTION_KEY env var is not found + */ +function getKeyFromEnv(): Buffer { + if (!env.ENCRYPTION_KEY) { + throw error('No encryption key found in the environment variables.') + } + + return decodeKey(env.ENCRYPTION_KEY) +} + +/** + * Validates that the key and nonce sizes are correct for ChaCha20-Poly1305 + * @param key The encryption key + * @param nonceSize The nonce size + * @throws Error if key or nonce size is invalid + */ +function validateParameters(key: Buffer, nonceSize: number): void { + if (key.length !== env.KEY_SIZE) { + throw new Error(`Invalid key size. ChaCha20-Poly1305 requires a ${env.KEY_SIZE}-byte key.`) + } + + if (nonceSize !== env.NONCE_SIZE) { + throw new Error(`Invalid nonce size. ChaCha20-Poly1305 requires a ${env.NONCE_SIZE}-byte nonce.`) + } +} + +/** + * Encrypts a Buffer using ChaCha20-Poly1305 with the environment key + * @param data Buffer containing data to encrypt + * @param nonceSize Size of the nonce in bytes (default from environment) + * @returns Object containing encrypted data and nonce + */ +export function encryptBuffer(data: Buffer, nonceSize: number = env.NONCE_SIZE): { encrypted: Buffer; nonce: Buffer } { + const key = getKeyFromEnv() + validateParameters(key, nonceSize) + + // Generate a random nonce + const nonce = crypto.randomBytes(nonceSize) + + // Create cipher - use 'chacha20-poly1305' algorithm + const cipher = crypto.createCipheriv('chacha20-poly1305', key, nonce, { + authTagLength: env.AUTH_TAG_LENGTH, + }) + + // Encrypt data + const ciphertext = Buffer.concat([cipher.update(data), cipher.final()]) + + // Get authentication tag + const authTag = cipher.getAuthTag() + + // Combine ciphertext and auth tag + const encrypted = Buffer.concat([ciphertext, authTag]) + + return { encrypted, nonce } +} + +/** + * Decrypts a Buffer using ChaCha20-Poly1305 with the environment key + * @param encryptedData Buffer containing encrypted data with auth tag + * @param nonce Nonce used during encryption + * @returns Buffer containing decrypted data + * @throws Error if decryption fails + */ +export function decryptBuffer(encryptedData: Buffer, nonce: Buffer): Buffer { + const key = getKeyFromEnv() + validateParameters(key, nonce.length) + + if (encryptedData.length <= env.AUTH_TAG_LENGTH) { + throw new Error('Invalid encrypted data: too short to contain authentication tag') + } + + // Extract auth tag (last 16 bytes) + const authTag = encryptedData.slice(encryptedData.length - env.AUTH_TAG_LENGTH) + const ciphertext = encryptedData.slice(0, encryptedData.length - env.AUTH_TAG_LENGTH) + + // Create decipher + const decipher = crypto.createDecipheriv('chacha20-poly1305', key, nonce, { + authTagLength: env.AUTH_TAG_LENGTH, + }) + + // Set auth tag + decipher.setAuthTag(authTag) + + // Decrypt data + const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]) + + return decrypted +} + +/** + * Encrypts a string using ChaCha20-Poly1305 with the environment key + * @param text String to encrypt + * @param nonceSize Size of the nonce in bytes (default from environment) + * @returns Object containing base64 encoded encrypted data and nonce + */ +export function encryptString(text: string, nonceSize: number = env.NONCE_SIZE): { encryptedBase64: string; nonceBase64: string } { + const result = encryptBuffer(Buffer.from(text, 'utf8'), nonceSize) + return { + encryptedBase64: result.encrypted.toString('base64'), + nonceBase64: result.nonce.toString('base64'), + } +} + +/** + * Decrypts a string using ChaCha20-Poly1305 with the environment key + * @param encryptedBase64 Base64 encoded encrypted data with auth tag + * @param nonceBase64 Base64 encoded nonce used during encryption + * @returns Decrypted string + * @throws Error if decryption fails + */ +export function decryptString(encryptedBase64: string, nonceBase64: string): string { + const encryptedData = Buffer.from(encryptedBase64, 'base64') + const nonce = Buffer.from(nonceBase64, 'base64') + + const decrypted = decryptBuffer(encryptedData, nonce) + return decrypted.toString('utf8') +} + +/** + * Decrypts a string using ChaCha20-Poly1305 with the environment key + * @param encryptedData Buffer containing encrypted data with auth tag + * @param nonce Buffer containing nonce used during encryption + * @returns Decrypted string + * @throws Error if decryption fails + */ +export function decryptBufferAsString(encryptedData: Buffer, nonce: Buffer): string { + const decrypted = decryptBuffer(encryptedData, nonce) + return decrypted.toString('utf8') +} + +/** + * Encrypts a Uint8Array using ChaCha20-Poly1305 with the environment key + * @param data Uint8Array containing data to encrypt + * @param nonceSize Size of the nonce in bytes (default from environment) + * @returns Object containing encrypted data and nonce as Uint8Arrays + */ +export function encryptBytes(data: Uint8Array, nonceSize: number = env.NONCE_SIZE): { encrypted: Uint8Array; nonce: Uint8Array } { + const result = encryptBuffer(Buffer.from(data), nonceSize) + return { + encrypted: new Uint8Array(result.encrypted), + nonce: new Uint8Array(result.nonce), + } +} + +/** + * Decrypts a Uint8Array using ChaCha20-Poly1305 with the environment key + * @param encryptedData Uint8Array containing encrypted data with auth tag + * @param nonce Uint8Array containing nonce used during encryption + * @returns Uint8Array containing decrypted data + * @throws Error if decryption fails + */ +export function decryptBytes(encryptedData: Uint8Array, nonce: Uint8Array): Uint8Array { + const result = decryptBuffer(Buffer.from(encryptedData), Buffer.from(nonce)) + return new Uint8Array(result) +} + +/** + * Main function that can be called from command line + */ +function main() { + const args = process.argv.slice(2) + const command = args[0] + + switch (command) { + case 'generate-key': + const key = generateKey() + console.log('Generated key:', key) + break + default: + console.log('Unknown command. Available commands: generate-key') + } +} + +// Run main if this file is executed directly +if (require.main === module) { + main() +} diff --git a/packages/credential-showcase-adapter-client-api/tsconfig.json b/packages/credential-showcase-adapter-client-api/tsconfig.json new file mode 100644 index 0000000..6824e2e --- /dev/null +++ b/packages/credential-showcase-adapter-client-api/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "declarationDir": "dist", + "noUnusedLocals": false + }, + "references": [ + { + "path": "../credential-showcase-openapi" + } + ] +} diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index 5d3a57c..cb2a3bf 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -103,6 +103,7 @@ export class MessageProcessor { apiUrlBase: applicationProperties['apiUrlBase'] as string | undefined, walletId: applicationProperties['walletId'] as string | undefined, accessTokenEnc: applicationProperties['accessTokenEnc'] as Buffer | undefined, + accessTokenNonce: applicationProperties['accessTokenNonce'] as Buffer | undefined, } } diff --git a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts index fe64786..b3c88c7 100644 --- a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts +++ b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts @@ -2,6 +2,9 @@ import crypto from 'crypto' import { Buffer } from 'buffer' import bs58 from 'bs58' import { environment } from '../environment' +import { error } from 'rhea-promise/typings/lib/log' + +// TODO move to common package to dedup const env = environment.encryption @@ -49,16 +52,14 @@ export function generateKey(size: number = env.KEY_SIZE): string { /** * Gets the encryption key from environment variable or generates one if not available * @returns Buffer containing the encryption key + * @throws Error when the ENCRYPTION_KEY env var is not found */ function getKeyFromEnv(): Buffer { - if (env.ENCRYPTION_KEY) { - return decodeKey(env.ENCRYPTION_KEY) + if (!env.ENCRYPTION_KEY) { + throw error('No encryption key found in the environment variables.') } - // Log warning if no key is set in environment - console.warn('No encryption key found in environment variables. Using a temporary key for this session only.') - // Generate a temporary key as Buffer directly - return crypto.randomBytes(env.KEY_SIZE) + return decodeKey(env.ENCRYPTION_KEY) } /** diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f26142..4300d38 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,6 +91,28 @@ importers: specifier: ^0.30.4 version: 0.30.4 + packages/credential-showcase-adapter-client-api: + dependencies: + bs58: + specifier: ^6.0.0 + version: 6.0.0 + credential-showcase-openapi: + specifier: workspace:* + version: link:../credential-showcase-openapi + rhea: + specifier: ^3.0.3 + version: 3.0.3 + rhea-promise: + specifier: ^3.0.3 + version: 3.0.3 + typedi: + specifier: ^0.10.0 + version: 0.10.0 + devDependencies: + '@types/node': + specifier: ^22.13.1 + version: 22.13.1 + packages/credential-showcase-openapi: {} packages/credential-showcase-traction-adapter: From a956c599de0a2bd096dab4c299c70addbf47acc7 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 11 Mar 2025 13:16:31 +0100 Subject: [PATCH 12/20] chore: saving work on traction adapter --- .../package.json | 1 + .../src/controllers/ShowcaseController.ts | 15 ++- .../src/types/index.ts | 2 +- .../openapi/openapi.yaml | 8 +- .../src/mappers/credential-definition.ts | 44 +++---- .../src/message-processor.ts | 18 +-- .../src/services/traction-service.ts | 107 +++++++++++++----- .../src/types/index.ts | 2 +- .../package.json | 1 - pnpm-lock.yaml | 40 +------ 10 files changed, 126 insertions(+), 112 deletions(-) diff --git a/apps/credential-showcase-api-server/package.json b/apps/credential-showcase-api-server/package.json index ec7d610..16d1c72 100644 --- a/apps/credential-showcase-api-server/package.json +++ b/apps/credential-showcase-api-server/package.json @@ -13,6 +13,7 @@ "dependencies": { "cors": "^2.8.5", "credential-showcase-openapi": "workspace:*", + "credential-showcase-traction-adapter": "workspace:*", "dotenv-flow": "^4.1.0", "drizzle-orm": "^0.39.3", "express": "^4.21.2", diff --git a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts index 293eb30..466689b 100644 --- a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts +++ b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts @@ -6,15 +6,15 @@ import { ShowcaseRequest, ShowcaseRequestToJSONTyped, ShowcasesResponse, - ShowcasesResponseFromJSONTyped, + ShowcasesResponseFromJSONTyped, ShowcaseStatus, } from 'credential-showcase-openapi' import ShowcaseService from '../services/ShowcaseService' -import { showcaseDTOFrom } from '../utils/mappers' +import { credentialDefinitionDTOFrom, showcaseDTOFrom } from '../utils/mappers' @JsonController('/showcases') @Service() class ShowcaseController { - constructor(private showcaseService: ShowcaseService) {} + constructor(private showcaseService: ShowcaseService, private adapterClientApi:AdapterClientApi) {} @Get('/') public async getAll(): Promise { @@ -39,6 +39,15 @@ class ShowcaseController { @Put('/:id') public async put(@Param('id') id: string, @Body() showcaseRequest: ShowcaseRequest): Promise { const result = await this.showcaseService.updateShowcase(id, ShowcaseRequestToJSONTyped(showcaseRequest)) + if(showcaseRequest.status === ShowcaseStatus.Active) { + console.log(`Publishing showcase ${showcaseRequest.name} to Traction`) + result.credentialDefinitions.forEach(credentialDef => { + // TODO create issuer + // TODO create credential schema + adapterClientApi.storeCredentialDefinition(credentialDefinitionDTOFrom(credentialDef)) + }) + + } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } diff --git a/packages/credential-showcase-adapter-client-api/src/types/index.ts b/packages/credential-showcase-adapter-client-api/src/types/index.ts index e7ece4f..acd86ea 100644 --- a/packages/credential-showcase-adapter-client-api/src/types/index.ts +++ b/packages/credential-showcase-adapter-client-api/src/types/index.ts @@ -1 +1 @@ -export * from './adapter-client-api' +export * from './adapter-client' diff --git a/packages/credential-showcase-openapi/openapi/openapi.yaml b/packages/credential-showcase-openapi/openapi/openapi.yaml index 6914bd3..382afe2 100644 --- a/packages/credential-showcase-openapi/openapi/openapi.yaml +++ b/packages/credential-showcase-openapi/openapi/openapi.yaml @@ -2491,6 +2491,12 @@ components: type: string description: Organization the issuer belongs to example: Acme Corporation + identifierType: + $ref: '#/components/schemas/IdentifierType' + identifier: + type: string + description: External identifier of this issuer + example: did:sov:XUeUZauFLeBNofY3NhaZCB logo: $ref: '#/components/schemas/Asset' credentialDefinitions: @@ -2695,7 +2701,7 @@ components: $ref: '#/components/schemas/IdentifierType' identifier: type: string - description: External identifier of this issuer + description: External identifier of this credential definition example: did:sov:XUeUZauFLeBNofY3NhaZCB version: type: string diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts index ab000e4..a8818ea 100644 --- a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -1,29 +1,32 @@ -import { CredentialAttribute, CredentialDefinition } from 'credential-showcase-openapi' +import { CredentialAttribute, CredentialDefinition, CredentialSchema } from 'credential-showcase-openapi' import { + AnonCredsSchema, CredDefPostOptions, CredDefPostRequest, - InnerCredDef, - AnonCredsSchema, - SchemaPostRequest, - GetCredDefResult, CredDefResult, CredDefState, + GetCredDefResult, + InnerCredDef, + SchemaPostRequest, } from 'credential-showcase-traction-openapi' /** - * Converts a CredentialDefinition to a SchemaPostRequest - * @param credentialDef The credential definition to convert + * Converts a CredentialSchema to a SchemaPostRequest + * @param credentialSchema The credential definition to convert + * @param issuerId * @returns A SchemaPostRequest object */ -export function credentialDefinitionToSchemaPostRequest(credentialDef: CredentialDefinition): SchemaPostRequest { - // Extract attribute names from the CredentialDefinition - const attributeNames = credentialDef.attributes.map((attr) => attr.name) +export function credentialSchemaToSchemaPostRequest(credentialSchema: CredentialSchema, issuerId: string): SchemaPostRequest { + if (!credentialSchema.attributes) { + throw new Error(`The credential schema ${credentialSchema.id} / ${credentialSchema.name} must at least contain one atttribute`) + } + const attributeNames = credentialSchema.attributes.map((attr) => attr.name) const schema: AnonCredsSchema = { attrNames: attributeNames, - issuerId: 'did:(method):WgWxqztrNooG92RXvxSTWv', // TODO will be available in CredentialDefinition - name: credentialDef.name, - version: credentialDef.version, + issuerId, + name: credentialSchema.name, + version: credentialSchema.version, } return { @@ -69,21 +72,6 @@ export function getOptions(credDef: CredentialDefinition): CredDefPostOptions { } } -/** - * Attempts to extract a schema ID from the credential definition representations - * @param credentialDef The credential definition to extract from - * @returns The schema ID if found, otherwise null - */ -export function extractSchemaIdFromCredentialDef(credentialDef: CredentialDefinition): string | null { - // Try to find an OCA representation which contains a schema ID - for (const representation of credentialDef.representations) { - if ('schemaId' in representation) { - return representation.schemaId - } - } - return null -} - /** * Converts a GetCredDefResult to a CredDefResult * @param result The GetCredDefResult to convert diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index cb2a3bf..c712e76 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -1,6 +1,6 @@ import { Connection, Receiver, ReceiverEvents, ReceiverOptions } from 'rhea-promise' import { environment } from './environment' -import { CredentialDefinitionFromJSON } from 'credential-showcase-openapi' +import { CredentialDefinitionFromJSON, Issuer, IssuerFromJSONTyped, Showcase, ShowcaseFromJSONTyped } from 'credential-showcase-openapi' import { TractionService } from './services/traction-service' import { getTractionService } from './services/service-manager' import { Action, Topic } from './types' @@ -109,8 +109,8 @@ export class MessageProcessor { private async processMessage(action: Action, jsonData: any, service: TractionService, context: any, headers: MessageHeaders): Promise { switch (action) { - case 'store-credentialdef': { - await this.handleStoreCredentialDef(jsonData, service, context, headers) + case 'publish-issuer': { + await this.handlePublishIssuer(jsonData, service, context, headers) break } default: { @@ -120,23 +120,23 @@ export class MessageProcessor { } } - private async handleStoreCredentialDef(jsonData: any, service: TractionService, context: any, headers: MessageHeaders): Promise { - const credentialDef = CredentialDefinitionFromJSON(jsonData) + private async handlePublishIssuer(jsonData: any, service: TractionService, context: any, headers: MessageHeaders): Promise { + const issuer: Issuer = IssuerFromJSONTyped(jsonData, false) try { - console.debug('Received credential definition', credentialDef) - await service.storeAnonCredentialDefinition(credentialDef) + console.debug('Received issuer', issuer) + await service.publishIssuer(issuer) if (context.delivery) { context.delivery.accept() } } catch (e) { - const errorMsg = `An error occurred while sending credential definition ${credentialDef.id}/${credentialDef.name} of type ${credentialDef.type} to Traction` + const errorMsg = `An error occurred while publishing issuer ${issuer.id} / ${issuer.name} of type ${issuer.type} to Traction` console.error(errorMsg) if (context.delivery) { context.delivery.reject({ info: `apiBasePath: ${headers.apiUrlBase ?? environment.traction.DEFAULT_API_BASE_PATH}, tenantId: ${headers.tenantId}, walletId: ${headers.walletId}`, condition: 'fatal error', description: errorMsg, - value: [credentialDef], + value: [issuer], }) // FIXME context.delivery.release() to redeliver ?? } } diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts index 4b4cddd..f1e3140 100644 --- a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -1,4 +1,4 @@ -import { CredentialDefinition } from 'credential-showcase-openapi' +import { CredentialSchema, Issuer } from 'credential-showcase-openapi' import { AnoncredsCredentialDefinitionsApi, AnoncredsSchemasApi, @@ -12,11 +12,11 @@ import { MultitenancyApi, ResponseError, SchemaResult, + WalletApi, } from 'credential-showcase-traction-openapi' import { credentialDefinitionToCredDefPostRequest, - credentialDefinitionToSchemaPostRequest, - extractSchemaIdFromCredentialDef, + credentialSchemaToSchemaPostRequest, getCredDefResultToCredDefResult, } from '../mappers/credential-definition' import { environment } from '../environment' @@ -27,6 +27,7 @@ export class TractionService { private anoncredsApi: AnoncredsCredentialDefinitionsApi private multitenancyApi: MultitenancyApi private schemasApi: AnoncredsSchemasApi + private walletApi: WalletApi constructor( private tenantId: string, @@ -45,6 +46,7 @@ export class TractionService { this.anoncredsApi = new AnoncredsCredentialDefinitionsApi(this.config) this.multitenancyApi = new MultitenancyApi(this.config) this.schemasApi = new AnoncredsSchemasApi(this.config) + this.walletApi = new WalletApi(this.config) } public updateBearerToken(token: string): void { @@ -64,13 +66,15 @@ export class TractionService { * Checks if a schema with the given name and version exists * @param name The schema name * @param version The schema version + * @param issuerId * @returns The schema ID if found, otherwise null */ - public async findExistingSchema(name: string, version: string): Promise { + public async findExistingSchema(name: string, version: string, issuerId: string): Promise { try { const response = await this.schemasApi.anoncredsSchemasGet({ schemaName: name, schemaVersion: version, + schemaIssuerId: issuerId, }) if (response.schemaIds && response.schemaIds.length > 0) { @@ -85,11 +89,12 @@ export class TractionService { /** * Creates a schema from a credential definition - * @param credentialDef The credential definition to create a schema from + * @param credentialSchema The credential definition to create a schema from + * @param issuerId * @returns The created schema ID */ - public async createSchema(credentialDef: CredentialDefinition): Promise { - const schemaRequest = credentialDefinitionToSchemaPostRequest(credentialDef) + public async createSchema(credentialSchema: CredentialSchema, issuerId: string): Promise { + const schemaRequest = credentialSchemaToSchemaPostRequest(credentialSchema, issuerId) const apiResponse = await this.schemasApi.anoncredsSchemaPostRaw({ body: schemaRequest, @@ -105,18 +110,21 @@ export class TractionService { /** * Checks if a credential definition with the given schema ID and tag exists - * @param schemaId The schema ID - * @param tag The credential definition tag (version) + * @param schemaId + * @param version The credential definition version + * @param issuerId * @returns The credential definition ID if found, otherwise null */ - public async findExistingCredentialDefinition(schemaId: string, tag: string): Promise { + public async findExistingCredentialDefinition(schemaId: string, version: string, issuerId:string): Promise { try { const response = await this.anoncredsApi.anoncredsCredentialDefinitionsGet({ schemaId, + schemaVersion: version, + issuerId }) if (response.credentialDefinitionIds && response.credentialDefinitionIds.length > 0) { - // For each credential definition ID, check if tag matches + // For each credential definition ID (which should be 1), double-check if tag matches for (const credDefId of response.credentialDefinitionIds) { try { const credDefResponse = await this.anoncredsApi.anoncredsCredentialDefinitionCredDefIdGet({ @@ -124,7 +132,7 @@ export class TractionService { }) // Check if this credential definition has the requested tag - if (credDefResponse.credentialDefinition?.tag === tag) { + if (credDefResponse.credentialDefinition?.tag === version) { return getCredDefResultToCredDefResult(credDefResponse) } } catch (error) { @@ -140,31 +148,68 @@ export class TractionService { } } - public async storeAnonCredentialDefinition(credentialDef: CredentialDefinition): Promise { - // First, try to extract schema ID from the credential definition - let schemaId = extractSchemaIdFromCredentialDef(credentialDef) - - // If no schema ID was found in the representations, check if a schema exists by name/version - if (!schemaId) { - schemaId = await this.findExistingSchema(credentialDef.name, credentialDef.version) + public async publishIssuer(issuer: Issuer): Promise { + const issuerId = await this.getOrCreateIssuerId(issuer) - // If schema doesn't exist, create it - if (!schemaId) { - schemaId = await this.createSchema(credentialDef) + if (issuer.credentialSchemas) { + for (const credentialSchema of issuer.credentialSchemas) { + const schemaId = await this.findExistingSchema(credentialSchema.name, credentialSchema.version, issuerId) + if (schemaId) { + return Promise.reject(Error(`Credential schema ${credentialSchema.name} version ${credentialSchema.version} for issuer ${issuer.identifier} for issuer ${issuer.id} / ${issuer.name} already exists on the ledger`)) + } + await this.createSchema(credentialSchema, issuerId) } } - // Check if credential definition exists for this schema and tag - const existingCredDef = await this.findExistingCredentialDefinition(schemaId, credentialDef.version) - if (existingCredDef) { - return existingCredDef + if(issuer.credentialDefinitions) { + for (const credentialDef of issuer.credentialDefinitions) { + const existingCredDef = await this.findExistingCredentialDefinition(credentialDef.id, credentialDef.version, ) + if (existingCredDef) { + return existingCredDef + } + + // Create new credential definition + const apiResponse = await this.anoncredsApi.anoncredsCredentialDefinitionPostRaw({ + body: credentialDefinitionToCredDefPostRequest(issuer, schemaId), + }) + return this.handleApiResponse(apiResponse) + } } - // Create new credential definition - const apiResponse = await this.anoncredsApi.anoncredsCredentialDefinitionPostRaw({ - body: credentialDefinitionToCredDefPostRequest(credentialDef, schemaId), - }) - return this.handleApiResponse(apiResponse) + } + + private async getOrCreateIssuerId(issuer: Issuer) { + if (issuer.identifier) { + const result = await this.walletApi.walletDidGet({ did: issuer.identifier }) + if (result.results?.length === 0) { + return Promise.reject(Error(`Identifier ${issuer.identifier} for issuer ${issuer.id} / ${issuer.name} could not be found on the ledger`)) + } + return issuer.identifier + } else { + const result = await this.walletApi.walletDidCreatePost({ + body: { + // TODO make configurable + method: 'sov', + options: { + keyType: 'ed25519', + }, + }, + }) + if (!result.result) { + return Promise.reject(Error(`Could not register a did for for issuer ${issuer.id} / ${issuer.name}`)) + } + + const issuerDid = result.result.did + // TODO make optional + const pubResult = await this.walletApi.walletDidPublicPost({ + did: issuerDid, + createTransactionForEndorser: false, + }) + if (pubResult.result?.did != issuerDid) { + return Promise.reject(Error(`Could not publish did ${issuerDid} as public for for issuer ${issuer.id} / ${issuer.name}`)) + } + return issuerDid + } } public async getTenantToken(apiKey: string, walletKey?: string): Promise { diff --git a/packages/credential-showcase-traction-adapter/src/types/index.ts b/packages/credential-showcase-traction-adapter/src/types/index.ts index 7da5e92..b207e54 100644 --- a/packages/credential-showcase-traction-adapter/src/types/index.ts +++ b/packages/credential-showcase-traction-adapter/src/types/index.ts @@ -3,4 +3,4 @@ export enum Topic { SHOWCASE_CMD_TESTING = 'SHOWCASE_CMD_TESTING', } -export type Action = 'store-credentialdef' +export type Action = 'publish-issuer' diff --git a/packages/credential-showcase-traction-openapi/package.json b/packages/credential-showcase-traction-openapi/package.json index 3f4ba9c..02b9f44 100644 --- a/packages/credential-showcase-traction-openapi/package.json +++ b/packages/credential-showcase-traction-openapi/package.json @@ -5,7 +5,6 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "postinstall": "pnpm generate-models", "generate-models": "rimraf ./src && mvn clean generate-sources", "dev": "tsc --watch", "build": "tsc", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed62b5b..21495a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,9 @@ importers: credential-showcase-openapi: specifier: workspace:* version: link:../../packages/credential-showcase-openapi + credential-showcase-traction-adapter: + specifier: workspace:* + version: link:../../packages/credential-showcase-traction-adapter dotenv-flow: specifier: ^4.1.0 version: 4.1.0 @@ -74,9 +77,6 @@ importers: routing-controllers: specifier: ^0.11.1 version: 0.11.1(class-transformer@0.5.1)(class-validator@0.14.1) - swagger-ui-express: - specifier: ^5.0.1 - version: 5.0.1(express@4.21.2) typedi: specifier: ^0.10.0 version: 0.10.0 @@ -96,9 +96,6 @@ importers: '@types/pg': specifier: ^8.11.11 version: 8.11.11 - '@types/swagger-ui-express': - specifier: ^4.1.8 - version: 4.1.8 drizzle-kit: specifier: ^0.30.4 version: 0.30.4 @@ -772,9 +769,6 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@scarf/scarf@1.4.0': - resolution: {integrity: sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==} - '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -892,9 +886,6 @@ packages: '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} - '@types/swagger-ui-express@4.1.8': - resolution: {integrity: sha512-AhZV8/EIreHFmBV5wAs0gzJUNq9JbbSXgJLQubCC0jtIo6prnI9MIRRxnU4MZX9RB9yXxF1V4R7jtLl/Wcj31g==} - '@types/validator@13.12.2': resolution: {integrity: sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA==} @@ -2677,15 +2668,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - swagger-ui-dist@5.20.0: - resolution: {integrity: sha512-V5pozVTZxivdoQq/SQWxj3A4cOu5opk9MEbcZANX3Pj8X8xCrD1QCtBT7744Pz9msOvt0nnmy9JvM/9PGonCdg==} - - swagger-ui-express@5.0.1: - resolution: {integrity: sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==} - engines: {node: '>= v0.10.32'} - peerDependencies: - express: '>=4.0.0 || >=5.0.0-beta' - tar-fs@2.0.1: resolution: {integrity: sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==} @@ -3564,8 +3546,6 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@scarf/scarf@1.4.0': {} - '@sinclair/typebox@0.27.8': {} '@sinonjs/commons@3.0.1': @@ -3723,11 +3703,6 @@ snapshots: '@types/stack-utils@2.0.3': {} - '@types/swagger-ui-express@4.1.8': - dependencies: - '@types/express': 5.0.0 - '@types/serve-static': 1.15.7 - '@types/validator@13.12.2': {} '@types/yargs-parser@21.0.3': {} @@ -5794,15 +5769,6 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - swagger-ui-dist@5.20.0: - dependencies: - '@scarf/scarf': 1.4.0 - - swagger-ui-express@5.0.1(express@4.21.2): - dependencies: - express: 4.21.2 - swagger-ui-dist: 5.20.0 - tar-fs@2.0.1: dependencies: chownr: 1.1.4 From 68864e4c48a87ce1a1e3938544181016022675ad Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 11 Mar 2025 13:16:45 +0100 Subject: [PATCH 13/20] chore: saving work on traction adapter --- .../src/controllers/ShowcaseController.ts | 13 ++++++++----- .../src/services/traction-service.ts | 15 +++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts index 466689b..cd541cc 100644 --- a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts +++ b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts @@ -6,7 +6,8 @@ import { ShowcaseRequest, ShowcaseRequestToJSONTyped, ShowcasesResponse, - ShowcasesResponseFromJSONTyped, ShowcaseStatus, + ShowcasesResponseFromJSONTyped, + ShowcaseStatus, } from 'credential-showcase-openapi' import ShowcaseService from '../services/ShowcaseService' import { credentialDefinitionDTOFrom, showcaseDTOFrom } from '../utils/mappers' @@ -14,7 +15,10 @@ import { credentialDefinitionDTOFrom, showcaseDTOFrom } from '../utils/mappers' @JsonController('/showcases') @Service() class ShowcaseController { - constructor(private showcaseService: ShowcaseService, private adapterClientApi:AdapterClientApi) {} + constructor( + private showcaseService: ShowcaseService, + private adapterClientApi: AdapterClientApi, + ) {} @Get('/') public async getAll(): Promise { @@ -39,14 +43,13 @@ class ShowcaseController { @Put('/:id') public async put(@Param('id') id: string, @Body() showcaseRequest: ShowcaseRequest): Promise { const result = await this.showcaseService.updateShowcase(id, ShowcaseRequestToJSONTyped(showcaseRequest)) - if(showcaseRequest.status === ShowcaseStatus.Active) { + if (showcaseRequest.status === ShowcaseStatus.Active) { console.log(`Publishing showcase ${showcaseRequest.name} to Traction`) - result.credentialDefinitions.forEach(credentialDef => { + result.credentialDefinitions.forEach((credentialDef) => { // TODO create issuer // TODO create credential schema adapterClientApi.storeCredentialDefinition(credentialDefinitionDTOFrom(credentialDef)) }) - } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts index f1e3140..4c50ef4 100644 --- a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -115,12 +115,12 @@ export class TractionService { * @param issuerId * @returns The credential definition ID if found, otherwise null */ - public async findExistingCredentialDefinition(schemaId: string, version: string, issuerId:string): Promise { + public async findExistingCredentialDefinition(schemaId: string, version: string, issuerId: string): Promise { try { const response = await this.anoncredsApi.anoncredsCredentialDefinitionsGet({ schemaId, schemaVersion: version, - issuerId + issuerId, }) if (response.credentialDefinitionIds && response.credentialDefinitionIds.length > 0) { @@ -155,15 +155,19 @@ export class TractionService { for (const credentialSchema of issuer.credentialSchemas) { const schemaId = await this.findExistingSchema(credentialSchema.name, credentialSchema.version, issuerId) if (schemaId) { - return Promise.reject(Error(`Credential schema ${credentialSchema.name} version ${credentialSchema.version} for issuer ${issuer.identifier} for issuer ${issuer.id} / ${issuer.name} already exists on the ledger`)) + return Promise.reject( + Error( + `Credential schema ${credentialSchema.name} version ${credentialSchema.version} for issuer ${issuer.identifier} for issuer ${issuer.id} / ${issuer.name} already exists on the ledger`, + ), + ) } await this.createSchema(credentialSchema, issuerId) } } - if(issuer.credentialDefinitions) { + if (issuer.credentialDefinitions) { for (const credentialDef of issuer.credentialDefinitions) { - const existingCredDef = await this.findExistingCredentialDefinition(credentialDef.id, credentialDef.version, ) + const existingCredDef = await this.findExistingCredentialDefinition(credentialDef.id, credentialDef.version) if (existingCredDef) { return existingCredDef } @@ -175,7 +179,6 @@ export class TractionService { return this.handleApiResponse(apiResponse) } } - } private async getOrCreateIssuerId(issuer: Issuer) { From 0cac0006659dbb9cc033e85c614431e02b5254a0 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 11 Mar 2025 16:50:34 +0100 Subject: [PATCH 14/20] chore: updated traction adapter implementation --- .../package.json | 2 +- .../src/controllers/ShowcaseController.ts | 75 ++++++++++++++++--- .../src/types/schema/index.ts | 2 + .../tsconfig.json | 5 +- .../package.json | 2 +- .../src/adapter-client-api.ts | 7 +- .../src/mappers/credential-definition.ts | 5 +- .../src/services/traction-service.ts | 39 +++++----- pnpm-lock.yaml | 6 +- 9 files changed, 105 insertions(+), 38 deletions(-) diff --git a/apps/credential-showcase-api-server/package.json b/apps/credential-showcase-api-server/package.json index 16d1c72..bf6e006 100644 --- a/apps/credential-showcase-api-server/package.json +++ b/apps/credential-showcase-api-server/package.json @@ -13,7 +13,7 @@ "dependencies": { "cors": "^2.8.5", "credential-showcase-openapi": "workspace:*", - "credential-showcase-traction-adapter": "workspace:*", + "credential-showcase-adapter-client-api": "workspace:*", "dotenv-flow": "^4.1.0", "drizzle-orm": "^0.39.3", "express": "^4.21.2", diff --git a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts index cd541cc..ae62958 100644 --- a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts +++ b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts @@ -1,16 +1,20 @@ import { Body, Delete, Get, HttpCode, JsonController, OnUndefined, Param, Post, Put } from 'routing-controllers' import { Service } from 'typedi' import { - ShowcaseResponse, - ShowcaseResponseFromJSONTyped, + IssuanceScenario, + Issuer, + Showcase, ShowcaseRequest, ShowcaseRequestToJSONTyped, + ShowcaseResponse, + ShowcaseResponseFromJSONTyped, ShowcasesResponse, ShowcasesResponseFromJSONTyped, ShowcaseStatus, } from 'credential-showcase-openapi' import ShowcaseService from '../services/ShowcaseService' -import { credentialDefinitionDTOFrom, showcaseDTOFrom } from '../utils/mappers' +import { showcaseDTOFrom } from '../utils/mappers' +import { AdapterClientApi } from 'credential-showcase-adapter-client-api' @JsonController('/showcases') @Service() @@ -37,6 +41,9 @@ class ShowcaseController { @Post('/') public async post(@Body() showcaseRequest: ShowcaseRequest): Promise { const result = await this.showcaseService.createShowcase(ShowcaseRequestToJSONTyped(showcaseRequest)) + if (showcaseRequest.status === ShowcaseStatus.Active) { + void await this.publishFromShowcase(showcaseDTOFrom(result)) + } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } @@ -44,16 +51,66 @@ class ShowcaseController { public async put(@Param('id') id: string, @Body() showcaseRequest: ShowcaseRequest): Promise { const result = await this.showcaseService.updateShowcase(id, ShowcaseRequestToJSONTyped(showcaseRequest)) if (showcaseRequest.status === ShowcaseStatus.Active) { - console.log(`Publishing showcase ${showcaseRequest.name} to Traction`) - result.credentialDefinitions.forEach((credentialDef) => { - // TODO create issuer - // TODO create credential schema - adapterClientApi.storeCredentialDefinition(credentialDefinitionDTOFrom(credentialDef)) - }) + void (await this.publishFromShowcase(showcaseDTOFrom(result))) } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } + private async publishFromShowcase(showcase: Showcase) { + console.log(`Publishing showcase ${showcase.name} to Traction`) + + // Get issuers from scenarios + const issuers: Array = showcase.scenarios + ?.filter((scenario) => 'issuer' in scenario && scenario.issuer) + .map((scenario) => (scenario as IssuanceScenario).issuer) + + // Process each issuer + const processedIssuerIds = new Set() + + for (const issuer of issuers) { + // Skip if we've already processed this issuer + if (processedIssuerIds.has(issuer.id)) { + continue + } + processedIssuerIds.add(issuer.id) + + const newIssuer: Issuer = { + id: issuer.id, + name: issuer.name, + description: issuer.description, + type: issuer.type, + organization: issuer.organization, + identifierType: issuer.identifierType, + identifier: issuer.identifier, + logo: issuer.logo, + credentialDefinitions: [], + credentialSchemas: [], + createdAt: issuer.createdAt, + updatedAt: issuer.updatedAt, + } + + // Find matching credential definitions from showcase + const matchingCredDefs = showcase.credentialDefinitions.filter((credDef) => + issuer.credentialDefinitions.some((issuerCredDef) => issuerCredDef.id === credDef.id), + ) + + newIssuer.credentialDefinitions = matchingCredDefs + + // Get schema IDs from matching credential definitions + const schemaIds = matchingCredDefs.map((credDef) => credDef.schemaId) + + // Look up schemas from ALL issuers (not just the current one) + newIssuer.credentialSchemas = issuers + .flatMap((i) => i.credentialSchemas || []) + .filter((schema) => schemaIds.includes(schema.id)) + // Remove duplicates + .filter((schema, index, self) => index === self.findIndex((s) => s.id === schema.id)) + + // Publish the issuer + void (await this.adapterClientApi.publishIssuer(newIssuer)) + } + } + @OnUndefined(204) @Delete('/:id') public async delete(@Param('id') id: string): Promise { diff --git a/apps/credential-showcase-api-server/src/types/schema/index.ts b/apps/credential-showcase-api-server/src/types/schema/index.ts index 8a7ff7c..83699c8 100644 --- a/apps/credential-showcase-api-server/src/types/schema/index.ts +++ b/apps/credential-showcase-api-server/src/types/schema/index.ts @@ -133,6 +133,7 @@ export type IssuanceScenario = Omit & { personas: string[] issuer: string @@ -193,6 +194,7 @@ export type Showcase = Omit & { personas: Persona[] bannerImage?: Asset | null } + export type NewShowcase = typeof showcases.$inferInsert & { scenarios: string[] credentialDefinitions: string[] diff --git a/apps/credential-showcase-api-server/tsconfig.json b/apps/credential-showcase-api-server/tsconfig.json index 14fd347..65c9f31 100644 --- a/apps/credential-showcase-api-server/tsconfig.json +++ b/apps/credential-showcase-api-server/tsconfig.json @@ -7,7 +7,10 @@ }, "references": [ { - "path": "../../packages/credential-showcase-openapi" + "path": "../../packages/credential-showcase-openapi", + }, + { + "path": "../../packages/credential-showcase-adapter-client-api" } ], "exclude": ["**/__tests__/**/*", "**/dist/**/*", "**/drizzle.config.ts"] diff --git a/packages/credential-showcase-adapter-client-api/package.json b/packages/credential-showcase-adapter-client-api/package.json index cf81d24..e0bfcdc 100644 --- a/packages/credential-showcase-adapter-client-api/package.json +++ b/packages/credential-showcase-adapter-client-api/package.json @@ -1,5 +1,5 @@ { - "name": "credential-showcase-traction-adapter", + "name": "credential-showcase-adapter-client-api", "version": "0.1.0", "source": "src/index.ts", "main": "dist/index.js", diff --git a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts index c570b53..6eac125 100644 --- a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts +++ b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts @@ -1,7 +1,8 @@ import { Service } from 'typedi' import { Connection, Sender } from 'rhea-promise' import { environment } from './environment' -import { CredentialDefinition } from 'credential-showcase-openapi' +import { CredentialDefinition, Issuer } from 'credential-showcase-openapi' + @Service() export class AdapterClientApi { @@ -56,8 +57,8 @@ export class AdapterClientApi { } } - public async storeCredentialDefinition(credentialDefinition: CredentialDefinition): Promise { - return this.send('store-credentialdef', credentialDefinition) + public async publishIssuer(issuer: Issuer): Promise { + return this.send('publish-issuer', issuer) } public async close(): Promise { diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts index a8818ea..e7af7c7 100644 --- a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -38,11 +38,12 @@ export function credentialSchemaToSchemaPostRequest(credentialSchema: Credential * Converts a CredentialDefinition to a CredDefPostRequest * @param credentialDef The credential definition to convert * @param schemaId The schema ID to use in the credential definition + * @param issuerId * @returns A CredDefPostRequest object */ -export function credentialDefinitionToCredDefPostRequest(credentialDef: CredentialDefinition, schemaId: string): CredDefPostRequest { +export function credentialDefinitionToCredDefPostRequest(credentialDef: CredentialDefinition, schemaId: string, issuerId: string): CredDefPostRequest { const innerCredDef: InnerCredDef = { - issuerId: 'did:(method):WgWxqztrNooG92RXvxSTWv', // TODO will be available in CredentialDefinition + issuerId: issuerId, schemaId: schemaId, tag: credentialDef.version, } diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts index 4c50ef4..c7762e8 100644 --- a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -150,33 +150,36 @@ export class TractionService { public async publishIssuer(issuer: Issuer): Promise { const issuerId = await this.getOrCreateIssuerId(issuer) - + const schemaIdMap = new Map() if (issuer.credentialSchemas) { + let schemaId: string | null for (const credentialSchema of issuer.credentialSchemas) { - const schemaId = await this.findExistingSchema(credentialSchema.name, credentialSchema.version, issuerId) - if (schemaId) { - return Promise.reject( - Error( - `Credential schema ${credentialSchema.name} version ${credentialSchema.version} for issuer ${issuer.identifier} for issuer ${issuer.id} / ${issuer.name} already exists on the ledger`, - ), - ) + schemaId = await this.findExistingSchema(credentialSchema.name, credentialSchema.version, issuerId) + if (!schemaId) { + schemaId = await this.createSchema(credentialSchema, issuerId) + schemaIdMap.set(credentialSchema.id, schemaId) } - await this.createSchema(credentialSchema, issuerId) } } if (issuer.credentialDefinitions) { for (const credentialDef of issuer.credentialDefinitions) { - const existingCredDef = await this.findExistingCredentialDefinition(credentialDef.id, credentialDef.version) - if (existingCredDef) { - return existingCredDef + const existingCredDef = await this.findExistingCredentialDefinition(credentialDef.id, credentialDef.version, issuerId) + if (!existingCredDef) { + // Create new credential definition + const cdSchemaId = credentialDef.schemaId ?? schemaIdMap.get(credentialDef.id) + if (!cdSchemaId) { + console.error( + `Could not determine the schema id for credential definition ${credentialDef.id} / ${credentialDef.name} version ${credentialDef.version}`, + ) + } else { + const apiResponse = await this.anoncredsApi.anoncredsCredentialDefinitionPostRaw({ + body: credentialDefinitionToCredDefPostRequest(credentialDef, cdSchemaId, issuerId), + }) + const result = await this.handleApiResponse(apiResponse) + console.log('created credential definition', result.registrationMetadata) + } } - - // Create new credential definition - const apiResponse = await this.anoncredsApi.anoncredsCredentialDefinitionPostRaw({ - body: credentialDefinitionToCredDefPostRequest(issuer, schemaId), - }) - return this.handleApiResponse(apiResponse) } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 21495a0..9876a8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,12 +53,12 @@ importers: cors: specifier: ^2.8.5 version: 2.8.5 + credential-showcase-adapter-client-api: + specifier: workspace:* + version: link:../../packages/credential-showcase-adapter-client-api credential-showcase-openapi: specifier: workspace:* version: link:../../packages/credential-showcase-openapi - credential-showcase-traction-adapter: - specifier: workspace:* - version: link:../../packages/credential-showcase-traction-adapter dotenv-flow: specifier: ^4.1.0 version: 4.1.0 From fb201447a388c3e9856001113e8e363a5d16ec04 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 11 Mar 2025 16:54:00 +0100 Subject: [PATCH 15/20] chore: updated traction adapter implementation --- .husky/pre-commit | 3 +++ .../src/controllers/ShowcaseController.ts | 2 +- apps/credential-showcase-api-server/tsconfig.json | 2 +- .../src/adapter-client-api.ts | 1 - .../src/mappers/credential-definition.ts | 6 +++++- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 3c19b90..a2649e9 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,4 @@ pnpm prettier + +# Stage the files that were modified by prettier +git add -u \ No newline at end of file diff --git a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts index ae62958..89459c5 100644 --- a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts +++ b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts @@ -42,7 +42,7 @@ class ShowcaseController { public async post(@Body() showcaseRequest: ShowcaseRequest): Promise { const result = await this.showcaseService.createShowcase(ShowcaseRequestToJSONTyped(showcaseRequest)) if (showcaseRequest.status === ShowcaseStatus.Active) { - void await this.publishFromShowcase(showcaseDTOFrom(result)) + void (await this.publishFromShowcase(showcaseDTOFrom(result))) } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } diff --git a/apps/credential-showcase-api-server/tsconfig.json b/apps/credential-showcase-api-server/tsconfig.json index 65c9f31..318e243 100644 --- a/apps/credential-showcase-api-server/tsconfig.json +++ b/apps/credential-showcase-api-server/tsconfig.json @@ -7,7 +7,7 @@ }, "references": [ { - "path": "../../packages/credential-showcase-openapi", + "path": "../../packages/credential-showcase-openapi" }, { "path": "../../packages/credential-showcase-adapter-client-api" diff --git a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts index 6eac125..6eb5a62 100644 --- a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts +++ b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts @@ -3,7 +3,6 @@ import { Connection, Sender } from 'rhea-promise' import { environment } from './environment' import { CredentialDefinition, Issuer } from 'credential-showcase-openapi' - @Service() export class AdapterClientApi { private readonly isReady: Promise diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts index e7af7c7..137fe13 100644 --- a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -41,7 +41,11 @@ export function credentialSchemaToSchemaPostRequest(credentialSchema: Credential * @param issuerId * @returns A CredDefPostRequest object */ -export function credentialDefinitionToCredDefPostRequest(credentialDef: CredentialDefinition, schemaId: string, issuerId: string): CredDefPostRequest { +export function credentialDefinitionToCredDefPostRequest( + credentialDef: CredentialDefinition, + schemaId: string, + issuerId: string, +): CredDefPostRequest { const innerCredDef: InnerCredDef = { issuerId: issuerId, schemaId: schemaId, From 3f971c665bf2bdf4ea504dedc201892077a01eae Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 11 Mar 2025 17:01:09 +0100 Subject: [PATCH 16/20] chore: lockfile --- pnpm-lock.yaml | 218 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 197 insertions(+), 21 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9876a8d..99c0ff9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@types/node': specifier: ^22.13.1 version: 22.13.1 + '@types/supertest': + specifier: ^6.0.2 + version: 6.0.2 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -35,6 +38,9 @@ importers: rimraf: specifier: ^6.0.1 version: 6.0.1 + supertest: + specifier: ^7.0.0 + version: 7.0.0 ts-jest: specifier: ^29.2.5 version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(jest@29.7.0(@types/node@22.13.1)(ts-node@10.9.2(@types/node@22.13.1)(typescript@5.7.3)))(typescript@5.7.3) @@ -68,6 +74,9 @@ importers: express: specifier: ^4.21.2 version: 4.21.2 + nanoid: + specifier: 3.3.6 + version: 3.3.6 pg: specifier: ^8.13.3 version: 8.13.3 @@ -77,6 +86,12 @@ importers: routing-controllers: specifier: ^0.11.1 version: 0.11.1(class-transformer@0.5.1)(class-validator@0.14.1) + slugify: + specifier: 1.6.6 + version: 1.6.6 + supertest: + specifier: ^7.0.0 + version: 7.0.0 typedi: specifier: ^0.10.0 version: 0.10.0 @@ -99,6 +114,9 @@ importers: drizzle-kit: specifier: ^0.30.4 version: 0.30.4 + testcontainers: + specifier: ^10.18.0 + version: 10.18.0 packages/credential-showcase-adapter-client-api: dependencies: @@ -122,7 +140,11 @@ importers: specifier: ^22.13.1 version: 22.13.1 - packages/credential-showcase-openapi: {} + packages/credential-showcase-openapi: + dependencies: + supertest: + specifier: ^7.0.0 + version: 7.0.0 packages/credential-showcase-traction-adapter: dependencies: @@ -147,6 +169,9 @@ importers: rhea-promise: specifier: ^3.0.3 version: 3.0.3 + supertest: + specifier: ^7.0.0 + version: 7.0.0 typedi: specifier: ^0.10.0 version: 0.10.0 @@ -157,21 +182,23 @@ importers: '@types/express': specifier: ^5.0.0 version: 5.0.0 - '@types/node': - specifier: ^22.13.1 - version: 22.13.1 testcontainers: specifier: ^10.18.0 version: 10.18.0 - uuid: - specifier: ^11.1.0 - version: 11.1.0 packages/credential-showcase-traction-openapi: {} - packages/credential-showcase-ts-model: {} + packages/credential-showcase-ts-model: + dependencies: + supertest: + specifier: ^7.0.0 + version: 7.0.0 - packages/credential-showcase-ts-sdk: {} + packages/credential-showcase-ts-sdk: + dependencies: + supertest: + specifier: ^7.0.0 + version: 7.0.0 packages: @@ -237,7 +264,6 @@ packages: '@babel/plugin-proposal-export-namespace-from@7.18.9': resolution: {integrity: sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -373,11 +399,9 @@ packages: '@esbuild-kit/core-utils@3.3.2': resolution: {integrity: sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==} - deprecated: 'Merged into tsx: https://tsx.is' '@esbuild-kit/esm-loader@2.6.5': resolution: {integrity: sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==} - deprecated: 'Merged into tsx: https://tsx.is' '@esbuild/aix-ppc64@0.19.12': resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} @@ -811,6 +835,9 @@ packages: '@types/connect@3.4.38': resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + '@types/cookiejar@2.1.5': + resolution: {integrity: sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==} + '@types/cors@2.8.17': resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} @@ -847,6 +874,9 @@ packages: '@types/jest@29.5.14': resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/methods@1.1.4': + resolution: {integrity: sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==} + '@types/mime@1.3.5': resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} @@ -886,6 +916,12 @@ packages: '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/superagent@8.1.9': + resolution: {integrity: sha512-pTVjI73witn+9ILmoJdajHGW2jkSaOzhiFYF1Rd3EQ94kymLqB9PjD9ISg7WaALC7+dCHT0FGe9T2LktLq/3GQ==} + + '@types/supertest@6.0.2': + resolution: {integrity: sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==} + '@types/validator@13.12.2': resolution: {integrity: sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA==} @@ -960,6 +996,9 @@ packages: array-flatten@1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + asap@2.0.6: + resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + asn1@0.2.6: resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} @@ -969,6 +1008,9 @@ packages: async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + b4a@1.6.7: resolution: {integrity: sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==} @@ -1174,6 +1216,13 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + component-emitter@1.3.1: + resolution: {integrity: sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==} + compress-commons@6.0.2: resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==} engines: {node: '>= 14'} @@ -1214,6 +1263,9 @@ packages: resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} engines: {node: '>=18'} + cookiejar@2.1.4: + resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} + cookies@0.9.1: resolution: {integrity: sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==} engines: {node: '>= 0.8'} @@ -1301,6 +1353,10 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -1324,6 +1380,9 @@ packages: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} + dezalgo@1.0.4: + resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==} + diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1499,6 +1558,10 @@ packages: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + esbuild-register@3.6.0: resolution: {integrity: sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg==} peerDependencies: @@ -1572,6 +1635,9 @@ packages: fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -1600,6 +1666,13 @@ packages: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} + form-data@4.0.2: + resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} + engines: {node: '>= 6'} + + formidable@3.5.2: + resolution: {integrity: sha512-Jqc1btCy3QzRbJaICGwKcBfGWuLADRerLzDqi2NwSt/UkXLsHJw2TVResiaoBufHVHy9aSgClOHCeJsSsFLTbg==} + forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -1667,7 +1740,6 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -1696,6 +1768,10 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hexoid@2.0.0: + resolution: {integrity: sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw==} + engines: {node: '>=8'} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -1746,7 +1822,6 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -2085,6 +2160,11 @@ packages: engines: {node: '>=4'} hasBin: true + mime@2.6.0: + resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} + engines: {node: '>=4.0.0'} + hasBin: true + mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -2140,6 +2220,11 @@ packages: nan@2.22.1: resolution: {integrity: sha512-pfRR4ZcNTSm2ZFHaztuvbICf+hyiG6ecA06SfAxoPmuHjvMu0KUIae7Y8GyVkbBqeEIidsmXeYooWIX9+qjfRQ==} + nanoid@3.3.6: + resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + napi-build-utils@2.0.0: resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} @@ -2568,6 +2653,10 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + slugify@1.6.6: + resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==} + engines: {node: '>=8.0.0'} + source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} @@ -2656,6 +2745,14 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + superagent@9.0.2: + resolution: {integrity: sha512-xuW7dzkUpcJq7QnhOsnNUgtYp3xRwpt2F7abdRYIpCsAt0hhUqia0EdxyXZQQpNmGtsCzYHryaKSV3q3GJnq7w==} + engines: {node: '>=14.18.0'} + + supertest@7.0.0: + resolution: {integrity: sha512-qlsr7fIC0lSddmA3tzojvzubYxvlGtzumcdHgPwbFWMISQwL22MhM2Y3LNt+6w9Yyx7559VW5ab70dgphm8qQA==} + engines: {node: '>=14.18.0'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -2857,10 +2954,6 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} - uuid@11.1.0: - resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} - hasBin: true - v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -3601,6 +3694,8 @@ snapshots: dependencies: '@types/node': 22.13.1 + '@types/cookiejar@2.1.5': {} + '@types/cors@2.8.17': dependencies: '@types/node': 22.13.1 @@ -3653,6 +3748,8 @@ snapshots: expect: 29.7.0 pretty-format: 29.7.0 + '@types/methods@1.1.4': {} + '@types/mime@1.3.5': {} '@types/node@18.19.76': @@ -3703,6 +3800,18 @@ snapshots: '@types/stack-utils@2.0.3': {} + '@types/superagent@8.1.9': + dependencies: + '@types/cookiejar': 2.1.5 + '@types/methods': 1.1.4 + '@types/node': 22.13.1 + form-data: 4.0.2 + + '@types/supertest@6.0.2': + dependencies: + '@types/methods': 1.1.4 + '@types/superagent': 8.1.9 + '@types/validator@13.12.2': {} '@types/yargs-parser@21.0.3': {} @@ -3778,6 +3887,8 @@ snapshots: array-flatten@1.1.1: {} + asap@2.0.6: {} + asn1@0.2.6: dependencies: safer-buffer: 2.1.2 @@ -3786,6 +3897,8 @@ snapshots: async@3.2.6: {} + asynckit@0.4.0: {} + b4a@1.6.7: {} babel-jest@29.7.0(@babel/core@7.26.7): @@ -4042,6 +4155,12 @@ snapshots: color-name@1.1.4: {} + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + + component-emitter@1.3.1: {} + compress-commons@6.0.2: dependencies: crc-32: 1.2.2 @@ -4080,6 +4199,8 @@ snapshots: cookie@1.0.2: {} + cookiejar@2.1.4: {} + cookies@0.9.1: dependencies: depd: 2.0.0 @@ -4165,6 +4286,8 @@ snapshots: deepmerge@4.3.1: {} + delayed-stream@1.0.0: {} + delegates@1.0.0: optional: true @@ -4180,6 +4303,11 @@ snapshots: detect-newline@3.1.0: {} + dezalgo@1.0.4: + dependencies: + asap: 2.0.6 + wrappy: 1.0.2 + diff-sequences@29.6.3: {} diff@4.0.2: {} @@ -4275,6 +4403,13 @@ snapshots: dependencies: es-errors: 1.3.0 + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.2.7 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + esbuild-register@3.6.0(esbuild@0.19.12): dependencies: debug: 4.4.0 @@ -4426,6 +4561,8 @@ snapshots: fast-json-stable-stringify@2.1.0: {} + fast-safe-stringify@2.1.1: {} + fb-watchman@2.0.2: dependencies: bser: 2.1.1 @@ -4472,6 +4609,19 @@ snapshots: cross-spawn: 7.0.6 signal-exit: 4.1.0 + form-data@4.0.2: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + mime-types: 2.1.35 + + formidable@3.5.2: + dependencies: + dezalgo: 1.0.4 + hexoid: 2.0.0 + once: 1.4.0 + forwarded@0.2.0: {} fresh@0.5.2: {} @@ -4560,12 +4710,13 @@ snapshots: has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 - optional: true hasown@2.0.2: dependencies: function-bind: 1.1.2 + hexoid@2.0.0: {} + html-escaper@2.0.2: {} http-assert@1.5.0: @@ -5160,6 +5311,8 @@ snapshots: mime@1.6.0: {} + mime@2.6.0: {} + mimic-fn@2.1.0: {} mimic-response@3.1.0: @@ -5213,6 +5366,8 @@ snapshots: nan@2.22.1: optional: true + nanoid@3.3.6: {} + napi-build-utils@2.0.0: optional: true @@ -5667,6 +5822,8 @@ snapshots: slash@3.0.0: {} + slugify@1.6.6: {} + source-map-support@0.5.13: dependencies: buffer-from: 1.1.2 @@ -5759,6 +5916,27 @@ snapshots: strip-json-comments@3.1.1: {} + superagent@9.0.2: + dependencies: + component-emitter: 1.3.1 + cookiejar: 2.1.4 + debug: 4.4.0 + fast-safe-stringify: 2.1.1 + form-data: 4.0.2 + formidable: 3.5.2 + methods: 1.1.2 + mime: 2.6.0 + qs: 6.13.0 + transitivePeerDependencies: + - supports-color + + supertest@7.0.0: + dependencies: + methods: 1.1.2 + superagent: 9.0.2 + transitivePeerDependencies: + - supports-color + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -5972,8 +6150,6 @@ snapshots: utils-merge@1.0.1: {} - uuid@11.1.0: {} - v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.3.0: From e7d50f934100260e8061f25af949de4586443cd7 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 11 Mar 2025 17:35:03 +0100 Subject: [PATCH 17/20] chore: traction publishing --- .../src/controllers/ShowcaseController.ts | 4 ++-- .../IssuanceScenarioController.integration.test.ts | 2 +- .../__tests__/IssuerController.integration.test.ts | 4 ++-- .../PresentationScenarioController.integration.test.ts | 2 +- .../RelyingPartyController.integration.test.ts | 4 ++-- .../__tests__/ShowcaseController.integration.test.ts | 10 +++++++++- .../src/adapter-client-api.ts | 2 +- .../src/services/traction-service.ts | 2 +- pnpm-lock.yaml | 3 +++ 9 files changed, 22 insertions(+), 11 deletions(-) diff --git a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts index 143943a..5c6eab4 100644 --- a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts +++ b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts @@ -134,7 +134,7 @@ class ShowcaseController { newIssuer.credentialDefinitions = matchingCredDefs // Get schema IDs from matching credential definitions - const schemaIds = matchingCredDefs.map((credDef) => credDef.schemaId) + const schemaIds = matchingCredDefs.map((credDef) => credDef.credentialSchema.id) // Look up schemas from ALL issuers (not just the current one) newIssuer.credentialSchemas = issuers @@ -144,7 +144,7 @@ class ShowcaseController { .filter((schema, index, self) => index === self.findIndex((s) => s.id === schema.id)) // Publish the issuer - void (await this.adapterClientApi.publishIssuer(newIssuer)) + void (await this.adapterClientApi.publishIssuer(newIssuer)) // TODO create reduced type } } diff --git a/apps/credential-showcase-api-server/src/controllers/__tests__/IssuanceScenarioController.integration.test.ts b/apps/credential-showcase-api-server/src/controllers/__tests__/IssuanceScenarioController.integration.test.ts index ab48f46..5197900 100644 --- a/apps/credential-showcase-api-server/src/controllers/__tests__/IssuanceScenarioController.integration.test.ts +++ b/apps/credential-showcase-api-server/src/controllers/__tests__/IssuanceScenarioController.integration.test.ts @@ -87,7 +87,7 @@ describe('IssuanceScenarioController Integration Tests', () => { name: 'Test Definition', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, diff --git a/apps/credential-showcase-api-server/src/controllers/__tests__/IssuerController.integration.test.ts b/apps/credential-showcase-api-server/src/controllers/__tests__/IssuerController.integration.test.ts index 1ca1e1c..67db70a 100644 --- a/apps/credential-showcase-api-server/src/controllers/__tests__/IssuerController.integration.test.ts +++ b/apps/credential-showcase-api-server/src/controllers/__tests__/IssuerController.integration.test.ts @@ -90,7 +90,7 @@ describe('IssuerController Integration Tests', () => { name: 'Test Definition', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, @@ -224,7 +224,7 @@ describe('IssuerController Integration Tests', () => { name: 'Test Definition 1', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, diff --git a/apps/credential-showcase-api-server/src/controllers/__tests__/PresentationScenarioController.integration.test.ts b/apps/credential-showcase-api-server/src/controllers/__tests__/PresentationScenarioController.integration.test.ts index b93f8d4..9083494 100644 --- a/apps/credential-showcase-api-server/src/controllers/__tests__/PresentationScenarioController.integration.test.ts +++ b/apps/credential-showcase-api-server/src/controllers/__tests__/PresentationScenarioController.integration.test.ts @@ -77,7 +77,7 @@ describe('PresentationScenarioController Integration Tests', () => { name: 'Test Definition', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, diff --git a/apps/credential-showcase-api-server/src/controllers/__tests__/RelyingPartyController.integration.test.ts b/apps/credential-showcase-api-server/src/controllers/__tests__/RelyingPartyController.integration.test.ts index 9c308d5..f139b50 100644 --- a/apps/credential-showcase-api-server/src/controllers/__tests__/RelyingPartyController.integration.test.ts +++ b/apps/credential-showcase-api-server/src/controllers/__tests__/RelyingPartyController.integration.test.ts @@ -83,7 +83,7 @@ describe('RelyingPartyController Integration Tests', () => { name: 'Test Definition', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, @@ -204,7 +204,7 @@ describe('RelyingPartyController Integration Tests', () => { name: 'Test Definition 1', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, diff --git a/apps/credential-showcase-api-server/src/controllers/__tests__/ShowcaseController.integration.test.ts b/apps/credential-showcase-api-server/src/controllers/__tests__/ShowcaseController.integration.test.ts index 171db71..913c63c 100644 --- a/apps/credential-showcase-api-server/src/controllers/__tests__/ShowcaseController.integration.test.ts +++ b/apps/credential-showcase-api-server/src/controllers/__tests__/ShowcaseController.integration.test.ts @@ -20,6 +20,7 @@ import * as schema from '../../database/schema' import { NodePgDatabase } from 'drizzle-orm/node-postgres' import { migrate } from 'drizzle-orm/node-postgres/migrator' import DatabaseService from '../../services/DatabaseService' +import { AdapterClientApi } from 'credential-showcase-adapter-client-api' describe('ShowcaseController Integration Tests', () => { let client: PGlite @@ -34,6 +35,13 @@ describe('ShowcaseController Integration Tests', () => { getConnection: jest.fn().mockResolvedValue(database), } Container.set(DatabaseService, mockDatabaseService) + + const mockAdapterClientApi = { + publishIssuer: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + } + Container.set(AdapterClientApi, mockAdapterClientApi) + useContainer(Container) Container.get(AssetRepository) Container.get(CredentialSchemaRepository) @@ -89,7 +97,7 @@ describe('ShowcaseController Integration Tests', () => { name: 'Test Definition', version: '1.0', identifierType: IdentifierType.DID, - identifier: 'did:test:123', + identifier: 'did:sov:YUeUZauFLeBNofY3NhaZCA', icon: asset.id, type: CredentialType.ANONCRED, credentialSchema: credentialSchema.id, diff --git a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts index 6eb5a62..e731e3a 100644 --- a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts +++ b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts @@ -1,7 +1,7 @@ import { Service } from 'typedi' import { Connection, Sender } from 'rhea-promise' import { environment } from './environment' -import { CredentialDefinition, Issuer } from 'credential-showcase-openapi' +import { Issuer } from 'credential-showcase-openapi' @Service() export class AdapterClientApi { diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts index c7762e8..83d8e7f 100644 --- a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -167,7 +167,7 @@ export class TractionService { const existingCredDef = await this.findExistingCredentialDefinition(credentialDef.id, credentialDef.version, issuerId) if (!existingCredDef) { // Create new credential definition - const cdSchemaId = credentialDef.schemaId ?? schemaIdMap.get(credentialDef.id) + const cdSchemaId = credentialDef.credentialSchema.id ?? schemaIdMap.get(credentialDef.id) // FIXME confirm if we still need schemaIdMap if (!cdSchemaId) { console.error( `Could not determine the schema id for credential definition ${credentialDef.id} / ${credentialDef.name} version ${credentialDef.version}`, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99c0ff9..5a5580a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -99,6 +99,9 @@ importers: '@electric-sql/pglite': specifier: ^0.2.17 version: 0.2.17 + '@testcontainers/rabbitmq': + specifier: ^10.18.0 + version: 10.18.0 '@types/cors': specifier: ^2.8.17 version: 2.8.17 From ab45d9074eb603dcd7ef8dbf3ee63573d5e363be Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 13 Mar 2025 16:10:12 +0100 Subject: [PATCH 18/20] chore: saving drizlle debug logger (commented out) --- .../src/services/DatabaseService.ts | 10 +++++++++- pnpm-lock.yaml | 3 --- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/credential-showcase-api-server/src/services/DatabaseService.ts b/apps/credential-showcase-api-server/src/services/DatabaseService.ts index 401f12f..931376a 100644 --- a/apps/credential-showcase-api-server/src/services/DatabaseService.ts +++ b/apps/credential-showcase-api-server/src/services/DatabaseService.ts @@ -19,7 +19,15 @@ export class DatabaseService { public async getConnection(): Promise> { if (!this.db) { const pool = new Pool({ connectionString: this.getDbUrl() }) - this.db = drizzle(pool, { schema }) + this.db = drizzle(pool, { + schema, + /*logger: { + logQuery: (query, params) => { + console.log('Query:', query) + console.log('Params:', params) + }, + },*/ + }) const migrationsFolder = path.resolve(__dirname, '../database/migrations') await migrate(this.db, { migrationsFolder }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a5580a..99c0ff9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -99,9 +99,6 @@ importers: '@electric-sql/pglite': specifier: ^0.2.17 version: 0.2.17 - '@testcontainers/rabbitmq': - specifier: ^10.18.0 - version: 10.18.0 '@types/cors': specifier: ^2.8.17 version: 2.8.17 From 576a750c37129bdecf12f90baa28c6847e4c7b0c Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Tue, 18 Mar 2025 22:28:07 +0100 Subject: [PATCH 19/20] chore: updated traction adapter & tests to newer model version --- .../src/util/CypherUtil.ts | 7 +- .../package.json | 3 +- .../src/__tests__/message-processor.test.ts | 142 ++++++++++++------ .../src/mappers/credential-definition.ts | 4 +- .../src/message-processor.ts | 2 +- .../src/services/traction-service.ts | 4 +- .../src/util/CypherUtil.ts | 7 +- .../package.json | 2 +- pnpm-lock.yaml | 9 ++ 9 files changed, 117 insertions(+), 63 deletions(-) diff --git a/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts b/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts index b3c88c7..75ff9b3 100644 --- a/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts +++ b/packages/credential-showcase-adapter-client-api/src/util/CypherUtil.ts @@ -2,7 +2,6 @@ import crypto from 'crypto' import { Buffer } from 'buffer' import bs58 from 'bs58' import { environment } from '../environment' -import { error } from 'rhea-promise/typings/lib/log' // TODO move to common package to dedup @@ -56,7 +55,7 @@ export function generateKey(size: number = env.KEY_SIZE): string { */ function getKeyFromEnv(): Buffer { if (!env.ENCRYPTION_KEY) { - throw error('No encryption key found in the environment variables.') + throw Error('No encryption key found in the environment variables.') } return decodeKey(env.ENCRYPTION_KEY) @@ -136,9 +135,7 @@ export function decryptBuffer(encryptedData: Buffer, nonce: Buffer): Buffer { decipher.setAuthTag(authTag) // Decrypt data - const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]) - - return decrypted + return Buffer.concat([decipher.update(ciphertext), decipher.final()]) } /** diff --git a/packages/credential-showcase-traction-adapter/package.json b/packages/credential-showcase-traction-adapter/package.json index 1e895c5..1688fd5 100644 --- a/packages/credential-showcase-traction-adapter/package.json +++ b/packages/credential-showcase-traction-adapter/package.json @@ -24,7 +24,8 @@ "devDependencies": { "@testcontainers/rabbitmq": "^10.18.0", "@types/express": "^5.0.0", - "testcontainers": "^10.18.0" + "testcontainers": "^10.18.0", + "uuid": "^11.1.0" }, "files": [ "dist/**/*", diff --git a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts index a7efafc..3277fa3 100644 --- a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts +++ b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts @@ -1,6 +1,6 @@ import { RabbitMQContainer, StartedRabbitMQContainer } from '@testcontainers/rabbitmq' import { Connection, Sender, SenderOptions } from 'rhea-promise' -import { CredentialDefinition } from 'credential-showcase-openapi' +import { CredentialAttributeType, CredentialDefinition, CredentialType } from 'credential-showcase-openapi' import { v4 as uuidv4 } from 'uuid' import { MessageProcessor } from '../message-processor' import { Action, Topic } from '../types' @@ -69,33 +69,42 @@ describe('MessageProcessor Integration Test', () => { id: 'test-id', name: 'Test Credential', version: '1.0', - type: 'ANONCRED', - attributes: [ - { - id: 'attr1', - name: 'firstName', - type: 'STRING', - value: 'John', - }, - { - id: 'attr2', - name: 'lastName', - type: 'STRING', - value: 'Doe', - }, - ], - representations: [ - { - id: 'rep1', - credDefId: 'cred-def-1', - schemaId: 'schema-1', - }, - ], + type: CredentialType.Anoncred, + credentialSchema: { + id: 'schema-id', + name: 'Test Schema', + version: '1.0', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING' as CredentialAttributeType, + value: 'John', + createdAt: new Date(), + updatedAt: new Date(), + }, + { + id: 'attr2', + name: 'lastName', + type: 'STRING' as CredentialAttributeType, + value: 'Doe', + createdAt: new Date(), + updatedAt: new Date(), + }, + ], + createdAt: new Date(), + updatedAt: new Date(), + }, + representations: [], icon: { id: 'icon1', mediaType: 'image/png', content: 'base64content', + createdAt: new Date(), + updatedAt: new Date(), }, + createdAt: new Date(), + updatedAt: new Date(), } // Spy on console.debug to detect when the message is processed @@ -143,20 +152,33 @@ describe('MessageProcessor Integration Test', () => { id: 'test-id', name: 'Test Credential', version: '1.0', - type: 'ANONCRED', - attributes: [ - { - id: 'attr1', - name: 'firstName', - type: 'STRING', - }, - ], + type: CredentialType.Anoncred, + credentialSchema: { + id: 'schema-id', + name: 'Test Schema', + version: '1.0', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING' as CredentialAttributeType, + createdAt: new Date(), + updatedAt: new Date(), + }, + ], + createdAt: new Date(), + updatedAt: new Date(), + }, representations: [], icon: { id: 'icon1', mediaType: 'image/png', content: 'base64content', + createdAt: new Date(), + updatedAt: new Date(), }, + createdAt: new Date(), + updatedAt: new Date(), } // Spy on console.error to detect when the message is rejected @@ -200,20 +222,33 @@ describe('MessageProcessor Integration Test', () => { id: 'test-id', name: 'Test Credential', version: '1.0', - type: 'ANONCRED', - attributes: [ - { - id: 'attr1', - name: 'firstName', - type: 'STRING', - }, - ], + type: CredentialType.Anoncred, + credentialSchema: { + id: 'schema-id', + name: 'Test Schema', + version: '1.0', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING' as CredentialAttributeType, + createdAt: new Date(), + updatedAt: new Date(), + }, + ], + createdAt: new Date(), + updatedAt: new Date(), + }, representations: [], icon: { id: 'icon1', mediaType: 'image/png', content: 'base64content', + createdAt: new Date(), + updatedAt: new Date(), }, + createdAt: new Date(), + updatedAt: new Date(), } // Spy on console.error to detect when the message is rejected @@ -295,20 +330,33 @@ describe('MessageProcessor Integration Test', () => { id: 'test-id', name: 'Test Credential', version: '1.0', - type: 'ANONCRED', - attributes: [ - { - id: 'attr1', - name: 'firstName', - type: 'STRING', - }, - ], + type: CredentialType.Anoncred, + credentialSchema: { + id: 'schema-id', + name: 'Test Schema', + version: '1.0', + attributes: [ + { + id: 'attr1', + name: 'firstName', + type: 'STRING' as CredentialAttributeType, + createdAt: new Date(), + updatedAt: new Date(), + }, + ], + createdAt: new Date(), + updatedAt: new Date(), + }, representations: [], icon: { id: 'icon1', mediaType: 'image/png', content: 'base64content', + createdAt: new Date(), + updatedAt: new Date(), }, + createdAt: new Date(), + updatedAt: new Date(), } // Spy on console.error to detect when the message is rejected diff --git a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts index 137fe13..1591654 100644 --- a/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts +++ b/packages/credential-showcase-traction-adapter/src/mappers/credential-definition.ts @@ -1,4 +1,4 @@ -import { CredentialAttribute, CredentialDefinition, CredentialSchema } from 'credential-showcase-openapi' +import { CredentialDefinition, CredentialSchema } from 'credential-showcase-openapi' import { AnonCredsSchema, CredDefPostOptions, @@ -101,6 +101,7 @@ export function getCredDefResultToCredDefResult(result: GetCredDefResult): CredD // jobId is left undefined as it doesn't exist in GetCredDefResult } } +/* function getRequiredAttribute(attributes: Array, name: string): string { const attr = attributes.find((att) => att.type === 'STRING' && att.name === name) @@ -109,3 +110,4 @@ function getRequiredAttribute(attributes: Array, name: stri } return attr.value } +*/ diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index c712e76..bcff217 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -1,6 +1,6 @@ import { Connection, Receiver, ReceiverEvents, ReceiverOptions } from 'rhea-promise' import { environment } from './environment' -import { CredentialDefinitionFromJSON, Issuer, IssuerFromJSONTyped, Showcase, ShowcaseFromJSONTyped } from 'credential-showcase-openapi' +import { Issuer, IssuerFromJSONTyped } from 'credential-showcase-openapi' import { TractionService } from './services/traction-service' import { getTractionService } from './services/service-manager' import { Action, Topic } from './types' diff --git a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts index 83d8e7f..8935435 100644 --- a/packages/credential-showcase-traction-adapter/src/services/traction-service.ts +++ b/packages/credential-showcase-traction-adapter/src/services/traction-service.ts @@ -37,8 +37,8 @@ export class TractionService { ) { // Create a shared configuration for this tenant this.configOptions = { - basePath, - ...(accessToken && { apiKey: this.tokenCallback(accessToken) }), // Probably an error in the generated code, it's mapping apiKey not accessToken + basePath: this.basePath, + ...(this.accessToken && { apiKey: this.tokenCallback(this.accessToken) }), // Probably an error in the generated code, it's mapping apiKey not accessToken } this.config = new Configuration(this.configOptions) diff --git a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts index b3c88c7..75ff9b3 100644 --- a/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts +++ b/packages/credential-showcase-traction-adapter/src/util/CypherUtil.ts @@ -2,7 +2,6 @@ import crypto from 'crypto' import { Buffer } from 'buffer' import bs58 from 'bs58' import { environment } from '../environment' -import { error } from 'rhea-promise/typings/lib/log' // TODO move to common package to dedup @@ -56,7 +55,7 @@ export function generateKey(size: number = env.KEY_SIZE): string { */ function getKeyFromEnv(): Buffer { if (!env.ENCRYPTION_KEY) { - throw error('No encryption key found in the environment variables.') + throw Error('No encryption key found in the environment variables.') } return decodeKey(env.ENCRYPTION_KEY) @@ -136,9 +135,7 @@ export function decryptBuffer(encryptedData: Buffer, nonce: Buffer): Buffer { decipher.setAuthTag(authTag) // Decrypt data - const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]) - - return decrypted + return Buffer.concat([decipher.update(ciphertext), decipher.final()]) } /** diff --git a/packages/credential-showcase-traction-openapi/package.json b/packages/credential-showcase-traction-openapi/package.json index 02b9f44..c4396de 100644 --- a/packages/credential-showcase-traction-openapi/package.json +++ b/packages/credential-showcase-traction-openapi/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "generate-models": "rimraf ./src && mvn clean generate-sources", + "generate:models": "rimraf ./src && mvn clean generate-sources", "dev": "tsc --watch", "build": "tsc", "build:clean": "tsc --build --clean && tsc --build" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b4e9170..a9a4508 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -185,6 +185,9 @@ importers: testcontainers: specifier: ^10.18.0 version: 10.18.0 + uuid: + specifier: ^11.1.0 + version: 11.1.0 packages/credential-showcase-traction-openapi: {} @@ -3017,6 +3020,10 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} + uuid@11.1.0: + resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} + hasBin: true + v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -6284,6 +6291,8 @@ snapshots: utils-merge@1.0.1: {} + uuid@11.1.0: {} + v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.3.0: From 0a4fb31a7544b70df0c98f9d9df6af68004be1fe Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Wed, 19 Mar 2025 16:24:14 +0100 Subject: [PATCH 20/20] chore: save work --- .../src/controllers/ShowcaseController.ts | 12 ++++---- .../src/adapter-client-api.ts | 30 ++++++++++++++++--- .../src/__tests__/message-processor.test.ts | 21 ++++++++----- .../src/message-processor.ts | 2 +- .../src/services/service-manager.ts | 10 +++++-- 5 files changed, 54 insertions(+), 21 deletions(-) diff --git a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts index 5c6eab4..8272488 100644 --- a/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts +++ b/apps/credential-showcase-api-server/src/controllers/ShowcaseController.ts @@ -1,4 +1,4 @@ -import { BadRequestError, Body, Delete, Get, HttpCode, JsonController, OnUndefined, Param, Post, Put } from 'routing-controllers' +import { BadRequestError, Body, Delete, Get, HeaderParam, HttpCode, JsonController, OnUndefined, Param, Post, Put } from 'routing-controllers' import { Service } from 'typedi' import { instanceOfShowcaseRequest, @@ -55,14 +55,14 @@ class ShowcaseController { @HttpCode(201) @Post('/') - public async post(@Body() showcaseRequest: ShowcaseRequest): Promise { + public async post(@HeaderParam('authorization') authHeader: string, @Body() showcaseRequest: ShowcaseRequest): Promise { try { if (!instanceOfShowcaseRequest(showcaseRequest)) { return Promise.reject(new BadRequestError()) } const result = await this.showcaseService.createShowcase(ShowcaseRequestToJSONTyped(showcaseRequest)) if (showcaseRequest.status === ShowcaseStatus.Active) { - void (await this.publishFromShowcase(showcaseDTOFrom(result))) + void (await this.publishFromShowcase(showcaseDTOFrom(result), authHeader)) } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } catch (e) { @@ -82,7 +82,7 @@ class ShowcaseController { } const result = await this.showcaseService.updateShowcase(id, ShowcaseRequestToJSONTyped(showcaseRequest)) if (showcaseRequest.status === ShowcaseStatus.Active) { - void (await this.publishFromShowcase(showcaseDTOFrom(result))) + void (await this.publishFromShowcase(showcaseDTOFrom(result), authHeader)) } return ShowcaseResponseFromJSONTyped({ showcase: showcaseDTOFrom(result) }, false) } catch (e) { @@ -93,7 +93,7 @@ class ShowcaseController { } } - private async publishFromShowcase(showcase: Showcase) { + private async publishFromShowcase(showcase: Showcase, authHeader: string) { console.log(`Publishing showcase ${showcase.name} to Traction`) // Get issuers from scenarios @@ -144,7 +144,7 @@ class ShowcaseController { .filter((schema, index, self) => index === self.findIndex((s) => s.id === schema.id)) // Publish the issuer - void (await this.adapterClientApi.publishIssuer(newIssuer)) // TODO create reduced type + void (await this.adapterClientApi.publishIssuer(newIssuer, authHeader)) // TODO create reduced type } } diff --git a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts index e731e3a..b589d59 100644 --- a/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts +++ b/packages/credential-showcase-adapter-client-api/src/adapter-client-api.ts @@ -2,6 +2,7 @@ import { Service } from 'typedi' import { Connection, Sender } from 'rhea-promise' import { environment } from './environment' import { Issuer } from 'credential-showcase-openapi' +import { encryptBuffer } from './util/CypherUtil' @Service() export class AdapterClientApi { @@ -35,13 +36,15 @@ export class AdapterClientApi { this.isConnected = true } - private async send(action: string, payload: object): Promise { + private async send(action: string, payload: object, authHeader?: string): Promise { try { await this.isReady + const { accessTokenEnc, accessTokenNonce } = this.encryptAuthHeader(authHeader) + const delivery = this.sender.send({ body: JSON.stringify(payload), - application_properties: { action }, + application_properties: { action, accessTokenEnc, accessTokenNonce }, }) if (delivery.remote_state && 'error' in delivery.remote_state) { @@ -56,8 +59,8 @@ export class AdapterClientApi { } } - public async publishIssuer(issuer: Issuer): Promise { - return this.send('publish-issuer', issuer) + public async publishIssuer(issuer: Issuer, authHeader: string): Promise { + return this.send('publish-issuer', issuer, authHeader) } public async close(): Promise { @@ -66,4 +69,23 @@ export class AdapterClientApi { await this.connection.close() this.isConnected = false } + + private encryptAuthHeader(authHeader?: string): { accessTokenEnc: Buffer; accessTokenNonce: Buffer } { + if (!authHeader) { + return { accessTokenEnc: Buffer.alloc(0), accessTokenNonce: Buffer.alloc(0) } + } + + const token = authHeader.replace('Bearer ', '') + + if (!token) { + return { accessTokenEnc: Buffer.alloc(0), accessTokenNonce: Buffer.alloc(0) } + } + + const result = encryptBuffer(Buffer.from(token, 'utf8')) + + return { + accessTokenEnc: result.encrypted, + accessTokenNonce: result.nonce, + } + } } diff --git a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts index 3277fa3..1dffb3d 100644 --- a/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts +++ b/packages/credential-showcase-traction-adapter/src/__tests__/message-processor.test.ts @@ -5,6 +5,8 @@ import { v4 as uuidv4 } from 'uuid' import { MessageProcessor } from '../message-processor' import { Action, Topic } from '../types' import { getTractionService } from '../services/service-manager' +import { environment } from '../environment' +import { encryptBuffer } from '../util/CypherUtil' // Create a spy on getTractionService to monitor calls jest.spyOn(require('../services/service-manager'), 'getTractionService') @@ -23,11 +25,12 @@ describe('MessageProcessor Integration Test', () => { container = await new RabbitMQContainer('rabbitmq:4').start() // Setup environment variables for the processor - process.env.AMQ_HOST = container.getHost() - process.env.AMQ_PORT = container.getMappedPort(5672).toString() - process.env.AMQ_USER = 'guest' - process.env.AMQ_PASSWORD = 'guest' - process.env.DEFAULT_API_BASE_PATH = 'http://localhost:8080' + process.env.AMQ_HOST = environment.messageBroker.AMQ_HOST = container.getHost() + environment.messageBroker.AMQ_PORT = container.getMappedPort(5672) + process.env.AMQ_PORT = environment.messageBroker.AMQ_PORT.toString() + process.env.AMQ_USER = environment.messageBroker.AMQ_USER = 'guest' + process.env.AMQ_PASSWORD = environment.messageBroker.AMQ_PASSWORD = 'guest' + process.env.DEFAULT_API_BASE_PATH = environment.traction.DEFAULT_API_BASE_PATH = 'http://localhost:8080' // Establish an AMQP connection for sending test messages connection = new Connection({ @@ -112,7 +115,8 @@ describe('MessageProcessor Integration Test', () => { // Send a message with the credential definition const messageId = uuidv4() - void (await sender.send({ + const { encrypted, nonce } = encryptBuffer(Buffer.from('test-token', 'utf8')) + void sender.send({ message_id: messageId, body: JSON.stringify(credDef), application_properties: { @@ -120,9 +124,10 @@ describe('MessageProcessor Integration Test', () => { tenantId: 'test-tenant', apiUrlBase: 'http://localhost:8080', walletId: 'test-wallet', - accessTokenEnc: 'test-token', + accessTokenEnc: encrypted, + accessTokenNonceEnc: nonce, }, - })) + }) // Wait for the message to be processed await new Promise((resolve) => { diff --git a/packages/credential-showcase-traction-adapter/src/message-processor.ts b/packages/credential-showcase-traction-adapter/src/message-processor.ts index bcff217..a20e8b1 100644 --- a/packages/credential-showcase-traction-adapter/src/message-processor.ts +++ b/packages/credential-showcase-traction-adapter/src/message-processor.ts @@ -75,7 +75,7 @@ export class MessageProcessor { return } - const service = getTractionService(headers.tenantId, headers.apiUrlBase, headers.walletId, headers.accessTokenEnc) + const service = getTractionService(headers.tenantId, headers.apiUrlBase, headers.walletId, headers.accessTokenEnc, headers.accessTokenNonce) try { const jsonData = JSON.parse(message.body as string) diff --git a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts index b9df26d..260d434 100644 --- a/packages/credential-showcase-traction-adapter/src/services/service-manager.ts +++ b/packages/credential-showcase-traction-adapter/src/services/service-manager.ts @@ -58,10 +58,16 @@ class ServiceManager { // Singleton instance const serviceRegistry = new ServiceManager() -export function getTractionService(tenantId: string, apiUrlBase?: string, walletId?: string, accessTokenEnc?: Buffer): TractionService { +export function getTractionService( + tenantId: string, + apiUrlBase?: string, + walletId?: string, + accessTokenEnc?: Buffer, + accessTokenNonce?: Buffer, +): TractionService { if (!tenantId) { throw new Error('tenantId is required') } - return serviceRegistry.getTractionService(tenantId, apiUrlBase, walletId, accessTokenEnc) + return serviceRegistry.getTractionService(tenantId, apiUrlBase, walletId, accessTokenEnc, accessTokenNonce) }