diff --git a/package.json b/package.json index e4da3178..c088b28e 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@opentelemetry/sdk-logs": "^0.202.0", "@opentelemetry/sdk-node": "^0.202.0", "@opentelemetry/semantic-conventions": "^1.34.0", - "@openwallet-foundation/askar-nodejs": "^0.3.2", + "@openwallet-foundation/askar-nodejs": "^0.4.3", "@tsoa/runtime": "^6.6.0", "@types/node-fetch": "^2.6.4", "@types/ref-struct-di": "^1.1.12", @@ -81,7 +81,7 @@ "swagger-ui-express": "^4.4.0", "tslog": "^3.3.3", "tsoa": "^6.0.1", - "tsyringe": "^4.8.0", + "tsyringe": "^4.10.0", "uuid": "^13.0.0", "ws": "^8.18.2", "yargs": "^17.7.2" diff --git a/src/cli.ts b/src/cli.ts index 8c7efa63..533cd9e4 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -176,7 +176,7 @@ export async function runCliServer() { walletConfig: { id: parsed['wallet-id'], key: parsed['wallet-key'], - storage: { + database: { type: parsed['wallet-type'], config: { host: parsed['wallet-url'], diff --git a/src/cliAgent.ts b/src/cliAgent.ts index 1d638027..516dddfc 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -1,18 +1,20 @@ +// Note: For now we need to import askar-nodejs at the top to handle the undefined askar issue +// Refer from: https://github.com/credebl/mobile-sdk/blob/main/packages/ssi/src/wallet/wallet.ts +import '@openwallet-foundation/askar-nodejs' import type { InitConfig } from '@credo-ts/core' -import type { WalletConfig } from '@credo-ts/core/build/types' import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr' -import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module' +// import { PolygonDidRegistrar, PolygonDidResolver, PolygonModule } from '@ayanworks/credo-polygon-w3c-module' import { - AnonCredsCredentialFormatService, + AnonCredsDidCommCredentialFormatService, AnonCredsModule, - AnonCredsProofFormatService, - LegacyIndyCredentialFormatService, - LegacyIndyProofFormatService, - V1CredentialProtocol, - V1ProofProtocol, + AnonCredsDidCommProofFormatService, + LegacyIndyDidCommCredentialFormatService, + LegacyIndyDidCommProofFormatService, + DidCommCredentialV1Protocol, + DidCommProofV1Protocol, } from '@credo-ts/anoncreds' -import { AskarModule, AskarMultiWalletDatabaseScheme } from '@credo-ts/askar' +import { AskarModule, AskarModuleConfigStoreOptions, AskarMultiWalletDatabaseScheme } from '@credo-ts/askar' import { DidsModule, W3cCredentialsModule, @@ -26,23 +28,16 @@ import { X509Module, } from '@credo-ts/core' import { - HttpOutboundTransport, - WsOutboundTransport, - JsonLdCredentialFormatService, - DifPresentationExchangeProofFormatService, - ConnectionsModule, - ProofsModule, - AutoAcceptCredential, - AutoAcceptProof, - V2ProofProtocol, - CredentialsModule, - V2CredentialProtocol, + DidCommHttpOutboundTransport, + DidCommWsOutboundTransport, + DidCommJsonLdCredentialFormatService, + DidCommDifPresentationExchangeProofFormatService, + DidCommAutoAcceptCredential, + DidCommAutoAcceptProof, + DidCommProofV2Protocol, + DidCommCredentialV2Protocol, DidCommModule, - OutOfBandModule, - MediationRecipientModule, - BasicMessagesModule, - MessagePickupModule, - DiscoverFeaturesModule, + DidCommDiscoverFeaturesModule, } from '@credo-ts/didcomm' import { IndyVdrAnonCredsRegistry, @@ -50,7 +45,7 @@ import { IndyVdrModule, IndyVdrIndyDidRegistrar, } from '@credo-ts/indy-vdr' -import { agentDependencies, HttpInboundTransport, WsInboundTransport } from '@credo-ts/node' +import { agentDependencies, DidCommHttpInboundTransport, DidCommWsInboundTransport } from '@credo-ts/node' import { QuestionAnswerModule } from '@credo-ts/question-answer' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' @@ -64,16 +59,16 @@ import { setupServer } from './server' import { generateSecretKey } from './utils/helpers' import { TsLogger } from './utils/logger' import { OpenId4VcHolderModule, OpenId4VcIssuerModule, OpenId4VcVerifierModule } from '@credo-ts/openid4vc' -import { Router } from 'express' import { getCredentialRequestToCredentialMapper, - getMixedCredentialRequestToCredentialMapper, getTrustedCerts, } from './utils/oid4vc-agent' import bodyParser from 'body-parser' -const openId4VciRouter = Router() -const openId4VpRouter = Router() +import express from 'express' + +const openId4VpApp = express() +const openId4VcApp = express() export type Transports = 'ws' | 'http' export type InboundTransport = { @@ -82,13 +77,13 @@ export type InboundTransport = { } const inboundTransportMapping = { - http: HttpInboundTransport, - ws: WsInboundTransport, + http: DidCommHttpInboundTransport, + ws: DidCommWsInboundTransport, } as const const outboundTransportMapping = { - http: HttpOutboundTransport, - ws: WsOutboundTransport, + http: DidCommHttpOutboundTransport, + ws: DidCommWsOutboundTransport, } as const interface indyLedger { @@ -97,14 +92,14 @@ interface indyLedger { } export interface AriesRestConfig { label: string - walletConfig: WalletConfig + walletConfig: AskarModuleConfigStoreOptions indyLedger: indyLedger[] adminPort: number publicDidSeed?: string endpoints?: string[] autoAcceptConnections?: boolean - autoAcceptCredentials?: AutoAcceptCredential - autoAcceptProofs?: AutoAcceptProof + autoAcceptCredentials?: DidCommAutoAcceptCredential + autoAcceptProofs?: DidCommAutoAcceptProof logLevel?: LogLevel inboundTransports?: InboundTransport[] outboundTransports?: Transports[] @@ -143,20 +138,25 @@ const getModules = ( rpcUrl: string, schemaManagerContractAddress: string, autoAcceptConnections: boolean, - autoAcceptCredentials: AutoAcceptCredential, - autoAcceptProofs: AutoAcceptProof, + autoAcceptCredentials: DidCommAutoAcceptCredential, + autoAcceptProofs: DidCommAutoAcceptProof, walletScheme: AskarMultiWalletDatabaseScheme, + storeOptions: AskarModuleConfigStoreOptions ) => { - const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() - const legacyIndyProofFormat = new LegacyIndyProofFormatService() - const jsonLdCredentialFormatService = new JsonLdCredentialFormatService() - const anonCredsCredentialFormatService = new AnonCredsCredentialFormatService() - const anonCredsProofFormatService = new AnonCredsProofFormatService() - const presentationExchangeProofFormatService = new DifPresentationExchangeProofFormatService() + const legacyIndyCredentialFormat = new LegacyIndyDidCommCredentialFormatService() + const legacyIndyProofFormat = new LegacyIndyDidCommProofFormatService() + const jsonLdCredentialFormatService = new DidCommJsonLdCredentialFormatService() + const anonCredsCredentialFormatService = new AnonCredsDidCommCredentialFormatService() + const anonCredsProofFormatService = new AnonCredsDidCommProofFormatService() + const presentationExchangeProofFormatService = new DidCommDifPresentationExchangeProofFormatService() return { askar: new AskarModule({ askar, + store: { + ...storeOptions + }, multiWalletDatabaseScheme: walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, + }), indyVdr: new IndyVdrModule({ @@ -165,74 +165,77 @@ const getModules = ( }), dids: new DidsModule({ - registrars: [new IndyVdrIndyDidRegistrar(), new KeyDidRegistrar(), new PolygonDidRegistrar()], - resolvers: [new IndyVdrIndyDidResolver(), new KeyDidResolver(), new WebDidResolver(), new PolygonDidResolver()], + registrars: [new IndyVdrIndyDidRegistrar(), new KeyDidRegistrar() + // , new PolygonDidRegistrar() + ], + resolvers: [new IndyVdrIndyDidResolver(), new KeyDidResolver(), new WebDidResolver() + // , new PolygonDidResolver() + ], }), anoncreds: new AnonCredsModule({ registries: [new IndyVdrAnonCredsRegistry()], anoncreds, }), - - connections: new ConnectionsModule({ - autoAcceptConnections: autoAcceptConnections || true, - }), - proofs: new ProofsModule({ - autoAcceptProofs: autoAcceptProofs || AutoAcceptProof.ContentApproved, - proofProtocols: [ - new V1ProofProtocol({ - indyProofFormat: legacyIndyProofFormat, - }), - new V2ProofProtocol({ - proofFormats: [legacyIndyProofFormat, anonCredsProofFormatService, presentationExchangeProofFormatService], - }), - ], - }), - credentials: new CredentialsModule({ - autoAcceptCredentials: autoAcceptCredentials || AutoAcceptCredential.Always, - credentialProtocols: [ - new V1CredentialProtocol({ - indyCredentialFormat: legacyIndyCredentialFormat, - }), - new V2CredentialProtocol({ - credentialFormats: [ - legacyIndyCredentialFormat, - jsonLdCredentialFormatService, - anonCredsCredentialFormatService, - ], - }), - ], - }), w3cCredentials: new W3cCredentialsModule(), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true, + anoncreds: new AnonCredsModule({ + registries: [new IndyVdrAnonCredsRegistry()], + anoncreds, + }), + mediationRecipient: true, + messagePickup: true, + mediator: false, + + basicMessages: true, + connections: { + autoAcceptConnections: autoAcceptConnections || true, + }, + proofs: { + autoAcceptProofs: autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, + proofProtocols: [ + new DidCommProofV1Protocol({ + indyProofFormat: legacyIndyProofFormat, + }), + new DidCommProofV2Protocol({ + proofFormats: [legacyIndyProofFormat, anonCredsProofFormatService, presentationExchangeProofFormatService], + }), + ], + }, + credentials: { + autoAcceptCredentials: autoAcceptCredentials || DidCommAutoAcceptCredential.Always, + credentialProtocols: [ + new DidCommCredentialV1Protocol({ + indyCredentialFormat: legacyIndyCredentialFormat, + }), + new DidCommCredentialV2Protocol({ + credentialFormats: [legacyIndyCredentialFormat, jsonLdCredentialFormatService, anonCredsCredentialFormatService], + }), + ], + }, }), - oob: new OutOfBandModule(), - mediationRecipient: new MediationRecipientModule(), - discovery: new DiscoverFeaturesModule(), - messagePickup: new MessagePickupModule(), - basicMessages: new BasicMessagesModule(), cache: new CacheModule({ cache: new InMemoryLruCache({ limit: Number(process.env.INMEMORY_LRU_CACHE_LIMIT) || Infinity }), }), questionAnswer: new QuestionAnswerModule(), - polygon: new PolygonModule({ - didContractAddress: didRegistryContractAddress - ? didRegistryContractAddress - : (process.env.DID_CONTRACT_ADDRESS as string), - schemaManagerContractAddress: - schemaManagerContractAddress || (process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string), - fileServerToken: fileServerToken ? fileServerToken : (process.env.FILE_SERVER_TOKEN as string), - rpcUrl: rpcUrl ? rpcUrl : (process.env.RPC_URL as string), - serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), - }), + // polygon: new PolygonModule({ + // didContractAddress: didRegistryContractAddress + // ? didRegistryContractAddress + // : (process.env.DID_CONTRACT_ADDRESS as string), + // schemaManagerContractAddress: + // schemaManagerContractAddress || (process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string), + // fileServerToken: fileServerToken ? fileServerToken : (process.env.FILE_SERVER_TOKEN as string), + // rpcUrl: rpcUrl ? rpcUrl : (process.env.RPC_URL as string), + // serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string), + // }), openId4VcVerifier: new OpenId4VcVerifierModule({ baseUrl: process.env.NODE_ENV === 'PROD' ? `https://${process.env.APP_URL}/oid4vp` : `${process.env.AGENT_HTTP_URL}/oid4vp`, - router: openId4VpRouter, + app: openId4VpApp, authorizationRequestExpirationInSeconds: Number(process.env.OID4VP_AUTH_REQUEST_PROOF_REQUEST_EXPIRY) || 3600, }), openId4VcIssuer: new OpenId4VcIssuerModule({ @@ -240,13 +243,13 @@ const getModules = ( process.env.NODE_ENV === 'PROD' ? `https://${process.env.APP_URL}/oid4vci` : `${process.env.AGENT_HTTP_URL}/oid4vci`, - router: openId4VciRouter, + app: openId4VcApp, statefulCredentialOfferExpirationInSeconds: Number(process.env.OID4VCI_CRED_OFFER_EXPIRY) || 3600, accessTokenExpiresInSeconds: Number(process.env.OID4VCI_ACCESS_TOKEN_EXPIRY) || 3600, authorizationCodeExpiresInSeconds: Number(process.env.OID4VCI_AUTH_CODE_EXPIRY) || 3600, cNonceExpiresInSeconds: Number(process.env.OID4VCI_CNONCE_EXPIRY) || 3600, dpopRequired: false, - credentialRequestToCredentialMapper: (...args) => getMixedCredentialRequestToCredentialMapper()(...args), + credentialRequestToCredentialMapper: (...args) => getCredentialRequestToCredentialMapper()(...args), }), openId4VcHolderModule: new OpenId4VcHolderModule(), x509: new X509Module({ @@ -269,9 +272,10 @@ const getWithTenantModules = ( rpcUrl: string, schemaManagerContractAddress: string, autoAcceptConnections: boolean, - autoAcceptCredentials: AutoAcceptCredential, - autoAcceptProofs: AutoAcceptProof, + autoAcceptCredentials: DidCommAutoAcceptCredential, + autoAcceptProofs: DidCommAutoAcceptProof, walletScheme: AskarMultiWalletDatabaseScheme, + walletConfig: AskarModuleConfigStoreOptions ) => { const modules = getModules( networkConfig, @@ -284,6 +288,7 @@ const getWithTenantModules = ( autoAcceptCredentials, autoAcceptProofs, walletScheme, + walletConfig ) return { tenants: new TenantsModule({ @@ -338,17 +343,9 @@ export async function runRestAgent(restConfig: AriesRestConfig) { const logger = new TsLogger(logLevel ?? LogLevel.error) const agentConfig: InitConfig = { - walletConfig: { - id: walletConfig.id, - key: walletConfig.key, - storage: walletConfig.storage, - }, ...afjConfig, logger, autoUpdateStorageOnStartup: true, - // As backup is only supported for sqlite storage - // we need to manually take backup of the storage before updating the storage - backupBeforeStorageUpdate: false, // Ideally for testing connection between tenant agent we need to set this to 'true'. Default is 'false' // TODO: triage: not sure if we want it to be 'true', as it would mean parallel requests on BW // Setting it for now //TODO: check if this is needed @@ -418,9 +415,10 @@ export async function runRestAgent(restConfig: AriesRestConfig) { rpcUrl || '', schemaManagerContractAddress || '', autoAcceptConnections || true, - autoAcceptCredentials || AutoAcceptCredential.Always, - autoAcceptProofs || AutoAcceptProof.ContentApproved, + autoAcceptCredentials || DidCommAutoAcceptCredential.Always, + autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, + walletConfig ) const modules = getModules( networkConfig, @@ -430,9 +428,10 @@ export async function runRestAgent(restConfig: AriesRestConfig) { rpcUrl || '', schemaManagerContractAddress || '', autoAcceptConnections || true, - autoAcceptCredentials || AutoAcceptCredential.Always, - autoAcceptProofs || AutoAcceptProof.ContentApproved, + autoAcceptCredentials || DidCommAutoAcceptCredential.Always, + autoAcceptProofs || DidCommAutoAcceptProof.ContentApproved, walletScheme || AskarMultiWalletDatabaseScheme.ProfilePerWallet, + walletConfig ) const agent = new Agent({ config: agentConfig, @@ -453,12 +452,6 @@ export async function runRestAgent(restConfig: AriesRestConfig) { agent.modules.didcomm.registerOutboundTransport(new OutboundTransport()) } - // Register inbound transports - // for (const inboundTransport of inboundTransports) { - // const InboundTransport = inboundTransportMapping[inboundTransport.transport] - // agent.modules.didcomm.registerInboundTransport(new InboundTransport({ port: inboundTransport.port })) - // } - // Register inbound transports for (const inboundTransport of inboundTransports) { const InboundTransport = inboundTransportMapping[inboundTransport.transport] @@ -466,7 +459,7 @@ export async function runRestAgent(restConfig: AriesRestConfig) { agent.modules.didcomm.registerInboundTransport(transport) // Configure the oid4vc routers on the http inbound transport - if (transport instanceof HttpInboundTransport) { + if (transport instanceof DidCommHttpInboundTransport) { transport.app.use( bodyParser.urlencoded({ extended: true, @@ -475,8 +468,8 @@ export async function runRestAgent(restConfig: AriesRestConfig) { ) transport.app.use(bodyParser.json({ limit: process.env.APP_JSON_BODY_SIZE ?? '5mb' })) - transport.app.use('/oid4vci', modules.openId4VcIssuer.config.router as any) - transport.app.use('/oid4vp', modules.openId4VcVerifier.config.router as any) + transport.app.use('/oid4vci', modules.openId4VcIssuer.config.app) + transport.app.use('/oid4vp', modules.openId4VcVerifier.config.app) } } diff --git a/src/controllers/agent/AgentController.ts b/src/controllers/agent/AgentController.ts index 55fd3b76..1d5b530f 100644 --- a/src/controllers/agent/AgentController.ts +++ b/src/controllers/agent/AgentController.ts @@ -1,31 +1,20 @@ -import type { RestAgentModules } from '../../cliAgent' import type { AgentInfo, AgentToken, - CustomW3cJsonLdSignCredentialOptions, SafeW3cJsonLdVerifyCredentialOptions, - SignDataOptions, - VerifyDataOptions, } from '../types' -import { assertAskarWallet } from '@credo-ts/askar/build/utils/assertAskarWallet' import { - Agent, - ClaimFormat, JsonTransformer, - Key, - TypedArrayEncoder, - W3cJsonLdSignCredentialOptions, W3cJsonLdVerifiableCredential, } from '@credo-ts/core' import { Request as Req } from 'express' import jwt from 'jsonwebtoken' -import { Controller, Delete, Get, Route, Tags, Security, Request, Post, Body, Path, Query } from 'tsoa' +import { Controller, Get, Route, Tags, Security, Request, Post, Body } from 'tsoa' import { injectable } from 'tsyringe' import { AgentRole, SCOPES } from '../../enums' import ErrorHandlingService from '../../errorHandlingService' -import { BadRequestError } from '../../errors' @Tags('Agent') @Route('/agent') @@ -39,7 +28,7 @@ export class AgentController extends Controller { public async getAgentInfo(@Request() request: Req): Promise { try { return { - label: request.agent.config.label, + label: request.agent.context.contextCorrelationId, endpoints: request.agent.modules.didcomm.config.endpoints, isInitialized: request.agent.isInitialized, publicDid: undefined, @@ -71,108 +60,108 @@ export class AgentController extends Controller { } } - /** - * Delete wallet - */ - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) - @Delete('/wallet') - public async deleteWallet(@Request() request: Req) { - try { - const deleteWallet = await request.agent.wallet.delete() - return deleteWallet - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Delete wallet +// */ +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Delete('/wallet') +// public async deleteWallet(@Request() request: Req) { +// try { +// const deleteWallet = await request.agent.wallet.delete() +// return deleteWallet +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Verify data using a key - * - * @param tenantId Tenant identifier - * @param request Verify options - * data - Data has to be in base64 format - * publicKeyBase58 - Public key in base58 format - * signature - Signature in base64 format - * @returns isValidSignature - true if signature is valid, false otherwise - */ - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) - @Post('/verify') - public async verify(@Request() request: Req, @Body() body: VerifyDataOptions) { - try { - assertAskarWallet(request.agent.context.wallet) - const isValidSignature = await request.agent.context.wallet.verify({ - data: TypedArrayEncoder.fromBase64(body.data), - key: Key.fromPublicKeyBase58(body.publicKeyBase58, body.keyType), - signature: TypedArrayEncoder.fromBase64(body.signature), - }) - return isValidSignature - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Verify data using a key +// * +// * @param tenantId Tenant identifier +// * @param request Verify options +// * data - Data has to be in base64 format +// * publicKeyBase58 - Public key in base58 format +// * signature - Signature in base64 format +// * @returns isValidSignature - true if signature is valid, false otherwise +// */ +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Post('/verify') +// public async verify(@Request() request: Req, @Body() body: VerifyDataOptions) { +// try { +// assertAskarWallet(request.agent.context.wallet) +// const isValidSignature = await request.agent.context.wallet.verify({ +// data: TypedArrayEncoder.fromBase64(body.data), +// key: Key.fromPublicKeyBase58(body.publicKeyBase58, body.keyType), +// signature: TypedArrayEncoder.fromBase64(body.signature), +// }) +// return isValidSignature +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - //Triage: Do we want the BW to be able to sign and verify as well? - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) - @Post('/credential/sign') - public async signCredential( - @Request() request: Req, - @Query('storeCredential') storeCredential: boolean, - @Query('dataTypeToSign') dataTypeToSign: 'rawData' | 'jsonLd', - @Body() data: CustomW3cJsonLdSignCredentialOptions | SignDataOptions | unknown, - ) { - try { - // JSON-LD VC Signing - if (dataTypeToSign === 'jsonLd') { - const credentialData = data as unknown as W3cJsonLdSignCredentialOptions - credentialData.format = ClaimFormat.LdpVc - const signedCredential = (await request.agent.w3cCredentials.signCredential( - credentialData, - )) as W3cJsonLdVerifiableCredential - if (storeCredential) { - return await request.agent.w3cCredentials.storeCredential({ credential: signedCredential }) - } - return signedCredential.toJson() - } +// //Triage: Do we want the BW to be able to sign and verify as well? +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Post('/credential/sign') +// public async signCredential( +// @Request() request: Req, +// @Query('storeCredential') storeCredential: boolean, +// @Query('dataTypeToSign') dataTypeToSign: 'rawData' | 'jsonLd', +// @Body() data: CustomW3cJsonLdSignCredentialOptions | SignDataOptions | unknown, +// ) { +// try { +// // JSON-LD VC Signing +// if (dataTypeToSign === 'jsonLd') { +// const credentialData = data as unknown as W3cJsonLdSignCredentialOptions +// credentialData.format = ClaimFormat.LdpVc +// const signedCredential = (await request.agent.w3cCredentials.signCredential( +// credentialData, +// )) as W3cJsonLdVerifiableCredential +// if (storeCredential) { +// return await request.agent.w3cCredentials.storeCredential({ credential: signedCredential }) +// } +// return signedCredential.toJson() +// } - // Raw Data Signing - const rawData = data as SignDataOptions - if (!rawData.data) throw new BadRequestError('Missing "data" for raw data signing.') +// // Raw Data Signing +// const rawData = data as SignDataOptions +// if (!rawData.data) throw new BadRequestError('Missing "data" for raw data signing.') - const hasDidOrMethod = rawData.did || rawData.method - const hasPublicKey = rawData.publicKeyBase58 && rawData.keyType - if (!hasDidOrMethod && !hasPublicKey) { - throw new BadRequestError('Either (did or method) OR (publicKeyBase58 and keyType) must be provided.') - } +// const hasDidOrMethod = rawData.did || rawData.method +// const hasPublicKey = rawData.publicKeyBase58 && rawData.keyType +// if (!hasDidOrMethod && !hasPublicKey) { +// throw new BadRequestError('Either (did or method) OR (publicKeyBase58 and keyType) must be provided.') +// } - let keyToUse: Key - if (hasDidOrMethod) { - const dids = await request.agent.dids.getCreatedDids({ - method: rawData.method || undefined, - did: rawData.did || undefined, - }) - const verificationMethod = dids[0]?.didDocument?.verificationMethod?.[0]?.publicKeyBase58 - if (!verificationMethod) { - throw new BadRequestError('No publicKeyBase58 found for the given DID or method.') - } - keyToUse = Key.fromPublicKeyBase58(verificationMethod, rawData.keyType) - } else { - keyToUse = Key.fromPublicKeyBase58(rawData.publicKeyBase58, rawData.keyType) - } +// let keyToUse: Key +// if (hasDidOrMethod) { +// const dids = await request.agent.dids.getCreatedDids({ +// method: rawData.method || undefined, +// did: rawData.did || undefined, +// }) +// const verificationMethod = dids[0]?.didDocument?.verificationMethod?.[0]?.publicKeyBase58 +// if (!verificationMethod) { +// throw new BadRequestError('No publicKeyBase58 found for the given DID or method.') +// } +// keyToUse = Key.fromPublicKeyBase58(verificationMethod, rawData.keyType) +// } else { +// keyToUse = Key.fromPublicKeyBase58(rawData.publicKeyBase58, rawData.keyType) +// } - if (!keyToUse) { - throw new Error('Unable to construct signing key. ') - } +// if (!keyToUse) { +// throw new Error('Unable to construct signing key. ') +// } - const signature = await request.agent.context.wallet.sign({ - data: TypedArrayEncoder.fromBase64(rawData.data), - key: keyToUse, - }) +// const signature = await request.agent.context.wallet.sign({ +// data: TypedArrayEncoder.fromBase64(rawData.data), +// key: keyToUse, +// }) - return TypedArrayEncoder.toBase64(signature) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return TypedArrayEncoder.toBase64(signature) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @Post('/credential/verify') diff --git a/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts b/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts index 4c643bba..57f47061 100644 --- a/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts +++ b/src/controllers/anoncreds/cred-def/CredentialDefinitionController.ts @@ -1,142 +1,142 @@ -import type { RestAgentModules } from '../../../cliAgent' -import type { SchemaId } from '../../examples' +// import type { RestAgentModules } from '../../../cliAgent' +// import type { SchemaId } from '../../examples' -import { getUnqualifiedCredentialDefinitionId, parseIndyCredentialDefinitionId } from '@credo-ts/anoncreds' -import { Agent } from '@credo-ts/core' -import { Request as Req } from 'express' -import { Body, Controller, Example, Get, Path, Post, Route, Tags, Security, Response, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { getUnqualifiedCredentialDefinitionId, parseIndyCredentialDefinitionId } from '@credo-ts/anoncreds' +// import { Agent } from '@credo-ts/core' +// import { Request as Req } from 'express' +// import { Body, Controller, Example, Get, Path, Post, Route, Tags, Security, Response, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { CredentialEnum, EndorserMode, SchemaError, SCOPES } from '../../../enums' -import ErrorHandlingService from '../../../errorHandlingService' -import { ENDORSER_DID_NOT_PRESENT } from '../../../errorMessages' -import { BadRequestError, InternalServerError, NotFoundError } from '../../../errors/errors' -import { CredentialDefinitionExample, CredentialDefinitionId } from '../../examples' +// import { CredentialEnum, EndorserMode, SchemaError, SCOPES } from '../../../enums' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { ENDORSER_DID_NOT_PRESENT } from '../../../errorMessages' +// import { BadRequestError, InternalServerError, NotFoundError } from '../../../errors/errors' +// import { CredentialDefinitionExample, CredentialDefinitionId } from '../../examples' -@Tags('Anoncreds - Credential Definitions') -@Route('/anoncreds/credential-definitions') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class CredentialDefinitionController extends Controller { - /** - * Retrieve credential definition by credential definition id - * - * @param credentialDefinitionId - * @returns CredDef - */ - @Example(CredentialDefinitionExample) - @Get('/:credentialDefinitionId') - public async getCredentialDefinitionById( - @Request() request: Req, - @Path('credentialDefinitionId') credentialDefinitionId: CredentialDefinitionId, - ) { - try { - const credentialDefinitionResult = - await request.agent.modules.anoncreds.getCredentialDefinition(credentialDefinitionId) +// @Tags('Anoncreds - Credential Definitions') +// @Route('/anoncreds/credential-definitions') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class CredentialDefinitionController extends Controller { +// /** +// * Retrieve credential definition by credential definition id +// * +// * @param credentialDefinitionId +// * @returns CredDef +// */ +// @Example(CredentialDefinitionExample) +// @Get('/:credentialDefinitionId') +// public async getCredentialDefinitionById( +// @Request() request: Req, +// @Path('credentialDefinitionId') credentialDefinitionId: CredentialDefinitionId, +// ) { +// try { +// const credentialDefinitionResult = +// await request.agent.modules.anoncreds.getCredentialDefinition(credentialDefinitionId) - if (credentialDefinitionResult.resolutionMetadata?.error === SchemaError.NotFound) { - throw new NotFoundError(credentialDefinitionResult.resolutionMetadata.message) - } - const error = credentialDefinitionResult.resolutionMetadata?.error +// if (credentialDefinitionResult.resolutionMetadata?.error === SchemaError.NotFound) { +// throw new NotFoundError(credentialDefinitionResult.resolutionMetadata.message) +// } +// const error = credentialDefinitionResult.resolutionMetadata?.error - if (error === 'invalid' || error === SchemaError.UnSupportedAnonCredsMethod) { - throw new BadRequestError(credentialDefinitionResult.resolutionMetadata.message) - } +// if (error === 'invalid' || error === SchemaError.UnSupportedAnonCredsMethod) { +// throw new BadRequestError(credentialDefinitionResult.resolutionMetadata.message) +// } - if (error !== undefined || credentialDefinitionResult.credentialDefinition === undefined) { - throw new InternalServerError(credentialDefinitionResult.resolutionMetadata.message) - } +// if (error !== undefined || credentialDefinitionResult.credentialDefinition === undefined) { +// throw new InternalServerError(credentialDefinitionResult.resolutionMetadata.message) +// } - return credentialDefinitionResult - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return credentialDefinitionResult +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Creates a new credential definition. - * - * @param credentialDefinitionRequest - * @returns CredDef - */ - @Example(CredentialDefinitionExample) - @Response(200, 'Action required') - @Response(202, 'Wait for action to complete') - @Post('/') - public async createCredentialDefinition( - @Request() request: Req, - @Body() - credentialDefinitionRequest: { - issuerId: string - schemaId: SchemaId - tag: string - endorse?: boolean - endorserDid?: string - }, - ) { - try { - const { issuerId, schemaId, tag, endorse, endorserDid } = credentialDefinitionRequest - credentialDefinitionRequest.endorse = credentialDefinitionRequest.endorse - ? credentialDefinitionRequest.endorse - : false - const credDef = { - issuerId, - schemaId, - tag, - type: 'CL', - } - const credentialDefinitionPayload = { - credentialDefinition: credDef, - options: { - endorserMode: '', - endorserDid: '', - supportRevocation: false, - }, - } - if (!endorse) { - credentialDefinitionPayload.options.endorserMode = EndorserMode.Internal - credentialDefinitionPayload.options.endorserDid = issuerId - } else { - if (!endorserDid) { - throw new BadRequestError(ENDORSER_DID_NOT_PRESENT) - } - credentialDefinitionPayload.options.endorserMode = EndorserMode.External - credentialDefinitionPayload.options.endorserDid = endorserDid ? endorserDid : '' - } +// /** +// * Creates a new credential definition. +// * +// * @param credentialDefinitionRequest +// * @returns CredDef +// */ +// @Example(CredentialDefinitionExample) +// @Response(200, 'Action required') +// @Response(202, 'Wait for action to complete') +// @Post('/') +// public async createCredentialDefinition( +// @Request() request: Req, +// @Body() +// credentialDefinitionRequest: { +// issuerId: string +// schemaId: SchemaId +// tag: string +// endorse?: boolean +// endorserDid?: string +// }, +// ) { +// try { +// const { issuerId, schemaId, tag, endorse, endorserDid } = credentialDefinitionRequest +// credentialDefinitionRequest.endorse = credentialDefinitionRequest.endorse +// ? credentialDefinitionRequest.endorse +// : false +// const credDef = { +// issuerId, +// schemaId, +// tag, +// type: 'CL', +// } +// const credentialDefinitionPayload = { +// credentialDefinition: credDef, +// options: { +// endorserMode: '', +// endorserDid: '', +// supportRevocation: false, +// }, +// } +// if (!endorse) { +// credentialDefinitionPayload.options.endorserMode = EndorserMode.Internal +// credentialDefinitionPayload.options.endorserDid = issuerId +// } else { +// if (!endorserDid) { +// throw new BadRequestError(ENDORSER_DID_NOT_PRESENT) +// } +// credentialDefinitionPayload.options.endorserMode = EndorserMode.External +// credentialDefinitionPayload.options.endorserDid = endorserDid ? endorserDid : '' +// } - const registerCredentialDefinitionResult = - await request.agent.modules.anoncreds.registerCredentialDefinition(credentialDefinitionPayload) +// const registerCredentialDefinitionResult = +// await request.agent.modules.anoncreds.registerCredentialDefinition(credentialDefinitionPayload) - if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Failed) { - throw new InternalServerError('Falied to register credef on ledger') - } +// if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Failed) { +// throw new InternalServerError('Falied to register credef on ledger') +// } - if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Wait) { - // The request has been accepted for processing, but the processing has not been completed. - this.setStatus(202) - return registerCredentialDefinitionResult - } +// if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Wait) { +// // The request has been accepted for processing, but the processing has not been completed. +// this.setStatus(202) +// return registerCredentialDefinitionResult +// } - if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Action) { - return registerCredentialDefinitionResult - } +// if (registerCredentialDefinitionResult.credentialDefinitionState.state === CredentialEnum.Action) { +// return registerCredentialDefinitionResult +// } - // TODO: Return uniform response for both Internally and Externally endorsed Schemas - if (!endorse) { - const indyCredDefId = parseIndyCredentialDefinitionId( - registerCredentialDefinitionResult.credentialDefinitionState.credentialDefinitionId as string, - ) - const getCredentialDefinitionId = await getUnqualifiedCredentialDefinitionId( - indyCredDefId.namespaceIdentifier, - indyCredDefId.schemaSeqNo, - indyCredDefId.tag, - ) - registerCredentialDefinitionResult.credentialDefinitionState.credentialDefinitionId = getCredentialDefinitionId - return registerCredentialDefinitionResult.credentialDefinitionState - } - return registerCredentialDefinitionResult - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// // TODO: Return uniform response for both Internally and Externally endorsed Schemas +// if (!endorse) { +// const indyCredDefId = parseIndyCredentialDefinitionId( +// registerCredentialDefinitionResult.credentialDefinitionState.credentialDefinitionId as string, +// ) +// const getCredentialDefinitionId = await getUnqualifiedCredentialDefinitionId( +// indyCredDefId.namespaceIdentifier, +// indyCredDefId.schemaSeqNo, +// indyCredDefId.tag, +// ) +// registerCredentialDefinitionResult.credentialDefinitionState.credentialDefinitionId = getCredentialDefinitionId +// return registerCredentialDefinitionResult.credentialDefinitionState +// } +// return registerCredentialDefinitionResult +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/anoncreds/endorser-transaction/EndorserTransactionController.ts b/src/controllers/anoncreds/endorser-transaction/EndorserTransactionController.ts index fb0ff621..cbe41fb0 100644 --- a/src/controllers/anoncreds/endorser-transaction/EndorserTransactionController.ts +++ b/src/controllers/anoncreds/endorser-transaction/EndorserTransactionController.ts @@ -1,203 +1,203 @@ -import type { IndyVdrDidCreateOptions } from '@credo-ts/indy-vdr' +// import type { IndyVdrDidCreateOptions } from '@credo-ts/indy-vdr' -import { - getUnqualifiedCredentialDefinitionId, - getUnqualifiedSchemaId, - parseIndyCredentialDefinitionId, - parseIndySchemaId, -} from '@credo-ts/anoncreds' -import { Request as Req } from 'express' -import { Body, Controller, Post, Route, Tags, Security, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { +// getUnqualifiedCredentialDefinitionId, +// getUnqualifiedSchemaId, +// parseIndyCredentialDefinitionId, +// parseIndySchemaId, +// } from '@credo-ts/anoncreds' +// import { Request as Req } from 'express' +// import { Body, Controller, Post, Route, Tags, Security, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { CredentialEnum, EndorserMode, SCOPES } from '../../../enums' -import ErrorHandlingService from '../../../errorHandlingService' -import { BadRequestError } from '../../../errors' -import { AgentType } from '../../../types' -import { DidNymTransaction, EndorserTransaction, WriteTransaction } from '../../types' +// import { CredentialEnum, EndorserMode, SCOPES } from '../../../enums' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { BadRequestError } from '../../../errors' +// import { AgentType } from '../../../types' +// import { DidNymTransaction, EndorserTransaction, WriteTransaction } from '../../types' -@Tags('Anoncreds - EndorserTransaction') -@Route('/anoncreds/transactions') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class EndorserTransactionController extends Controller { - @Post('/endorse') - public async endorserTransaction(@Request() request: Req, @Body() endorserTransaction: EndorserTransaction) { - try { - if (!endorserTransaction.transaction) { - throw new BadRequestError('Transaction is required') - } - if (!endorserTransaction.endorserDid) { - throw new BadRequestError('EndorserDid is required') - } - const signedTransaction = await request.agent.modules.indyVdr.endorseTransaction( - endorserTransaction.transaction, - endorserTransaction.endorserDid, - ) +// @Tags('Anoncreds - EndorserTransaction') +// @Route('/anoncreds/transactions') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class EndorserTransactionController extends Controller { +// @Post('/endorse') +// public async endorserTransaction(@Request() request: Req, @Body() endorserTransaction: EndorserTransaction) { +// try { +// if (!endorserTransaction.transaction) { +// throw new BadRequestError('Transaction is required') +// } +// if (!endorserTransaction.endorserDid) { +// throw new BadRequestError('EndorserDid is required') +// } +// const signedTransaction = await request.agent.modules.indyVdr.endorseTransaction( +// endorserTransaction.transaction, +// endorserTransaction.endorserDid, +// ) - return { signedTransaction } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return { signedTransaction } +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Post('/set-endorser-role') - public async didNymTransaction(@Request() request: Req, @Body() didNymTransaction: DidNymTransaction) { - try { - const didCreateSubmitResult = await request.agent.dids.create({ - did: didNymTransaction.did, - options: { - endorserMode: EndorserMode.External, - endorsedTransaction: { - nymRequest: didNymTransaction.nymRequest, - }, - }, - }) +// @Post('/set-endorser-role') +// public async didNymTransaction(@Request() request: Req, @Body() didNymTransaction: DidNymTransaction) { +// try { +// const didCreateSubmitResult = await request.agent.dids.create({ +// did: didNymTransaction.did, +// options: { +// endorserMode: EndorserMode.External, +// endorsedTransaction: { +// nymRequest: didNymTransaction.nymRequest, +// }, +// }, +// }) - // Importing did in accordance to the multi-tenant flow - await request.agent.dids.import({ - did: didNymTransaction.did, - overwrite: true, - }) +// // Importing did in accordance to the multi-tenant flow +// await request.agent.dids.import({ +// did: didNymTransaction.did, +// overwrite: true, +// }) - return didCreateSubmitResult - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return didCreateSubmitResult +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Post('/write') - public async writeSchemaAndCredDefOnLedger( - @Request() request: Req, - @Body() - writeTransaction: WriteTransaction, - ) { - try { - if (writeTransaction.schema) { - const writeSchema = await this.submitSchemaOnLedger( - request.agent, - writeTransaction.schema, - writeTransaction.endorsedTransaction, - ) - return writeSchema - } else if (writeTransaction.credentialDefinition) { - const writeCredDef = await this.submitCredDefOnLedger( - request.agent, - writeTransaction.credentialDefinition, - writeTransaction.endorsedTransaction, - ) - return writeCredDef - } else { - throw new Error('Please provide valid schema or credential-def!') - } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Post('/write') +// public async writeSchemaAndCredDefOnLedger( +// @Request() request: Req, +// @Body() +// writeTransaction: WriteTransaction, +// ) { +// try { +// if (writeTransaction.schema) { +// const writeSchema = await this.submitSchemaOnLedger( +// request.agent, +// writeTransaction.schema, +// writeTransaction.endorsedTransaction, +// ) +// return writeSchema +// } else if (writeTransaction.credentialDefinition) { +// const writeCredDef = await this.submitCredDefOnLedger( +// request.agent, +// writeTransaction.credentialDefinition, +// writeTransaction.endorsedTransaction, +// ) +// return writeCredDef +// } else { +// throw new Error('Please provide valid schema or credential-def!') +// } +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - public async submitSchemaOnLedger( - agent: AgentType, - schema: { - issuerId: string - name: string - version: string - attributes: string[] - }, - endorsedTransaction?: string, - ) { - if (!schema.issuerId) { - throw new BadRequestError('IssuerId is required') - } - if (!schema.name) { - throw new BadRequestError('Name is required') - } - if (!schema.version) { - throw new BadRequestError('Version is required') - } - if (!schema.attributes) { - throw new BadRequestError('Attributes is required') - } - const { issuerId, name, version, attributes } = schema - const { schemaState } = await agent.modules.anoncreds.registerSchema({ - options: { - endorserMode: EndorserMode.External, - endorsedTransaction, - }, - schema: { - attrNames: attributes, - issuerId: issuerId, - name: name, - version: version, - }, - }) +// public async submitSchemaOnLedger( +// agent: AgentType, +// schema: { +// issuerId: string +// name: string +// version: string +// attributes: string[] +// }, +// endorsedTransaction?: string, +// ) { +// if (!schema.issuerId) { +// throw new BadRequestError('IssuerId is required') +// } +// if (!schema.name) { +// throw new BadRequestError('Name is required') +// } +// if (!schema.version) { +// throw new BadRequestError('Version is required') +// } +// if (!schema.attributes) { +// throw new BadRequestError('Attributes is required') +// } +// const { issuerId, name, version, attributes } = schema +// const { schemaState } = await agent.modules.anoncreds.registerSchema({ +// options: { +// endorserMode: EndorserMode.External, +// endorsedTransaction, +// }, +// schema: { +// attrNames: attributes, +// issuerId: issuerId, +// name: name, +// version: version, +// }, +// }) - if (!schemaState.schemaId) { - throw new Error('Schema not created') - } - const indySchemaId = parseIndySchemaId(schemaState.schemaId) - const getSchemaUnqualifiedId = await getUnqualifiedSchemaId( - indySchemaId.namespaceIdentifier, - indySchemaId.schemaName, - indySchemaId.schemaVersion, - ) - if (schemaState.state === CredentialEnum.Finished || schemaState.state === CredentialEnum.Action) { - schemaState.schemaId = getSchemaUnqualifiedId - } - return schemaState - } +// if (!schemaState.schemaId) { +// throw new Error('Schema not created') +// } +// const indySchemaId = parseIndySchemaId(schemaState.schemaId) +// const getSchemaUnqualifiedId = await getUnqualifiedSchemaId( +// indySchemaId.namespaceIdentifier, +// indySchemaId.schemaName, +// indySchemaId.schemaVersion, +// ) +// if (schemaState.state === CredentialEnum.Finished || schemaState.state === CredentialEnum.Action) { +// schemaState.schemaId = getSchemaUnqualifiedId +// } +// return schemaState +// } - public async submitCredDefOnLedger( - agent: AgentType, - credentialDefinition: { - schemaId: string - issuerId: string - tag: string - value: unknown - type: string - }, - endorsedTransaction?: string, - ) { - if (!credentialDefinition.schemaId) { - throw new BadRequestError('SchemaId is required') - } - if (!credentialDefinition.issuerId) { - throw new BadRequestError('IssuerId is required') - } - if (!credentialDefinition.tag) { - throw new BadRequestError('Tag is required') - } - if (!credentialDefinition.value) { - throw new BadRequestError('Value is required') - } - if (!credentialDefinition.type) { - throw new BadRequestError('Type is required') - } - const { credentialDefinitionState } = await agent.modules.anoncreds.registerCredentialDefinition({ - credentialDefinition, - options: { - endorserMode: EndorserMode.External, - endorsedTransaction: endorsedTransaction, - // Keep false for now - supportRevocation: false, - }, - }) +// public async submitCredDefOnLedger( +// agent: AgentType, +// credentialDefinition: { +// schemaId: string +// issuerId: string +// tag: string +// value: unknown +// type: string +// }, +// endorsedTransaction?: string, +// ) { +// if (!credentialDefinition.schemaId) { +// throw new BadRequestError('SchemaId is required') +// } +// if (!credentialDefinition.issuerId) { +// throw new BadRequestError('IssuerId is required') +// } +// if (!credentialDefinition.tag) { +// throw new BadRequestError('Tag is required') +// } +// if (!credentialDefinition.value) { +// throw new BadRequestError('Value is required') +// } +// if (!credentialDefinition.type) { +// throw new BadRequestError('Type is required') +// } +// const { credentialDefinitionState } = await agent.modules.anoncreds.registerCredentialDefinition({ +// credentialDefinition, +// options: { +// endorserMode: EndorserMode.External, +// endorsedTransaction: endorsedTransaction, +// // Keep false for now +// supportRevocation: false, +// }, +// }) - if (!credentialDefinitionState.credentialDefinitionId) { - throw Error('Credential Definition Id not found') - } +// if (!credentialDefinitionState.credentialDefinitionId) { +// throw Error('Credential Definition Id not found') +// } - const indyCredDefId = parseIndyCredentialDefinitionId(credentialDefinitionState.credentialDefinitionId) - const getCredentialDefinitionId = await getUnqualifiedCredentialDefinitionId( - indyCredDefId.namespaceIdentifier, - indyCredDefId.schemaSeqNo, - indyCredDefId.tag, - ) - if ( - credentialDefinitionState.state === CredentialEnum.Finished || - credentialDefinitionState.state === CredentialEnum.Action - ) { - credentialDefinitionState.credentialDefinitionId = getCredentialDefinitionId - } - return credentialDefinitionState - } -} +// const indyCredDefId = parseIndyCredentialDefinitionId(credentialDefinitionState.credentialDefinitionId) +// const getCredentialDefinitionId = await getUnqualifiedCredentialDefinitionId( +// indyCredDefId.namespaceIdentifier, +// indyCredDefId.schemaSeqNo, +// indyCredDefId.tag, +// ) +// if ( +// credentialDefinitionState.state === CredentialEnum.Finished || +// credentialDefinitionState.state === CredentialEnum.Action +// ) { +// credentialDefinitionState.credentialDefinitionId = getCredentialDefinitionId +// } +// return credentialDefinitionState +// } +// } diff --git a/src/controllers/anoncreds/schema/SchemaController.ts b/src/controllers/anoncreds/schema/SchemaController.ts index e72fd2aa..7a1e8577 100644 --- a/src/controllers/anoncreds/schema/SchemaController.ts +++ b/src/controllers/anoncreds/schema/SchemaController.ts @@ -1,125 +1,125 @@ -import { getUnqualifiedSchemaId, parseIndySchemaId } from '@credo-ts/anoncreds' -import { Request as Req } from 'express' -import { Example, Get, Post, Route, Tags, Security, Path, Body, Controller, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { getUnqualifiedSchemaId, parseIndySchemaId } from '@credo-ts/anoncreds' +// import { Request as Req } from 'express' +// import { Example, Get, Post, Route, Tags, Security, Path, Body, Controller, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { CredentialEnum, EndorserMode, SchemaError, SCOPES } from '../../../enums' -import ErrorHandlingService from '../../../errorHandlingService' -import { ENDORSER_DID_NOT_PRESENT } from '../../../errorMessages' -import { BadRequestError, InternalServerError, NotFoundError } from '../../../errors/errors' -import { CreateSchemaSuccessful, SchemaExample, SchemaId } from '../../examples' -import { CreateSchemaInput } from '../../types' +// import { CredentialEnum, EndorserMode, SchemaError, SCOPES } from '../../../enums' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { ENDORSER_DID_NOT_PRESENT } from '../../../errorMessages' +// import { BadRequestError, InternalServerError, NotFoundError } from '../../../errors/errors' +// import { CreateSchemaSuccessful, SchemaExample, SchemaId } from '../../examples' +// import { CreateSchemaInput } from '../../types' -@Tags('Anoncreds - Schemas') -@Route('/anoncreds/schemas') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class SchemaController extends Controller { - /** - * Get schema by schemaId - * @param schemaId - * @param notFoundErrormessage - * @param forbiddenError - * @param badRequestError - * @param internalServerError - * @returns get schema by Id - */ - @Example(SchemaExample) - @Get('/:schemaId') - public async getSchemaById(@Request() request: Req, @Path('schemaId') schemaId: SchemaId) { - try { - const schemBySchemaId = await request.agent.modules.anoncreds.getSchema(schemaId) +// @Tags('Anoncreds - Schemas') +// @Route('/anoncreds/schemas') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class SchemaController extends Controller { +// /** +// * Get schema by schemaId +// * @param schemaId +// * @param notFoundErrormessage +// * @param forbiddenError +// * @param badRequestError +// * @param internalServerError +// * @returns get schema by Id +// */ +// @Example(SchemaExample) +// @Get('/:schemaId') +// public async getSchemaById(@Request() request: Req, @Path('schemaId') schemaId: SchemaId) { +// try { +// const schemBySchemaId = await request.agent.modules.anoncreds.getSchema(schemaId) - if ( - (schemBySchemaId && - schemBySchemaId?.resolutionMetadata && - schemBySchemaId?.resolutionMetadata?.error === SchemaError.NotFound) || - schemBySchemaId?.resolutionMetadata?.error === SchemaError.UnSupportedAnonCredsMethod - ) { - throw new NotFoundError( - schemBySchemaId?.resolutionMetadata?.message || `schema details with schema id "${schemaId}" not found.`, - ) - } +// if ( +// (schemBySchemaId && +// schemBySchemaId?.resolutionMetadata && +// schemBySchemaId?.resolutionMetadata?.error === SchemaError.NotFound) || +// schemBySchemaId?.resolutionMetadata?.error === SchemaError.UnSupportedAnonCredsMethod +// ) { +// throw new NotFoundError( +// schemBySchemaId?.resolutionMetadata?.message || `schema details with schema id "${schemaId}" not found.`, +// ) +// } - return schemBySchemaId - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return schemBySchemaId +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Create schema - * @param schema - * @param notFoundError - * @param forbiddenError - * @param badRequestError - * @param internalServerError - * @returns get schema - */ - @Post('/') - @Example(CreateSchemaSuccessful) - public async createSchema(@Request() request: Req, @Body() schema: CreateSchemaInput) { - try { - const { issuerId, name, version, attributes } = schema +// /** +// * Create schema +// * @param schema +// * @param notFoundError +// * @param forbiddenError +// * @param badRequestError +// * @param internalServerError +// * @returns get schema +// */ +// @Post('/') +// @Example(CreateSchemaSuccessful) +// public async createSchema(@Request() request: Req, @Body() schema: CreateSchemaInput) { +// try { +// const { issuerId, name, version, attributes } = schema - const schemaPayload = { - issuerId, - name, - version, - attrNames: attributes, - } - const createSchemaPayload = { - schema: schemaPayload, - options: { - endorserMode: '', - endorserDid: '', - }, - } +// const schemaPayload = { +// issuerId, +// name, +// version, +// attrNames: attributes, +// } +// const createSchemaPayload = { +// schema: schemaPayload, +// options: { +// endorserMode: '', +// endorserDid: '', +// }, +// } - if (!schema.endorse) { - createSchemaPayload.options.endorserMode = EndorserMode.Internal - createSchemaPayload.options.endorserDid = issuerId - } else { - if (!schema.endorserDid) { - throw new BadRequestError(ENDORSER_DID_NOT_PRESENT) - } - createSchemaPayload.options.endorserMode = EndorserMode.External - createSchemaPayload.options.endorserDid = schema.endorserDid - } +// if (!schema.endorse) { +// createSchemaPayload.options.endorserMode = EndorserMode.Internal +// createSchemaPayload.options.endorserDid = issuerId +// } else { +// if (!schema.endorserDid) { +// throw new BadRequestError(ENDORSER_DID_NOT_PRESENT) +// } +// createSchemaPayload.options.endorserMode = EndorserMode.External +// createSchemaPayload.options.endorserDid = schema.endorserDid +// } - const createSchemaTxResult = await request.agent.modules.anoncreds.registerSchema(createSchemaPayload) +// const createSchemaTxResult = await request.agent.modules.anoncreds.registerSchema(createSchemaPayload) - if (createSchemaTxResult.schemaState.state === CredentialEnum.Failed) { - throw new InternalServerError(`Schema creation failed. Reason: ${createSchemaTxResult.schemaState.reason}`) - } +// if (createSchemaTxResult.schemaState.state === CredentialEnum.Failed) { +// throw new InternalServerError(`Schema creation failed. Reason: ${createSchemaTxResult.schemaState.reason}`) +// } - if (createSchemaTxResult.schemaState.state === CredentialEnum.Wait) { - this.setStatus(202) - return createSchemaTxResult - } +// if (createSchemaTxResult.schemaState.state === CredentialEnum.Wait) { +// this.setStatus(202) +// return createSchemaTxResult +// } - if (createSchemaTxResult.schemaState.state === CredentialEnum.Action) { - return createSchemaTxResult - } +// if (createSchemaTxResult.schemaState.state === CredentialEnum.Action) { +// return createSchemaTxResult +// } - if (createSchemaTxResult.schemaState.state === CredentialEnum.Finished) { - // TODO: Return uniform response for both Internally and Externally endorsed Schemas - if (!schema.endorse) { - const indySchemaId = parseIndySchemaId(createSchemaTxResult.schemaState.schemaId as string) +// if (createSchemaTxResult.schemaState.state === CredentialEnum.Finished) { +// // TODO: Return uniform response for both Internally and Externally endorsed Schemas +// if (!schema.endorse) { +// const indySchemaId = parseIndySchemaId(createSchemaTxResult.schemaState.schemaId as string) - const getSchemaUnqualifiedId = await getUnqualifiedSchemaId( - indySchemaId.namespaceIdentifier, - indySchemaId.schemaName, - indySchemaId.schemaVersion, - ) +// const getSchemaUnqualifiedId = await getUnqualifiedSchemaId( +// indySchemaId.namespaceIdentifier, +// indySchemaId.schemaName, +// indySchemaId.schemaVersion, +// ) - createSchemaTxResult.schemaState.schemaId = getSchemaUnqualifiedId - return createSchemaTxResult.schemaState - } - return createSchemaTxResult - } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// createSchemaTxResult.schemaState.schemaId = getSchemaUnqualifiedId +// return createSchemaTxResult.schemaState +// } +// return createSchemaTxResult +// } +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/did/DidController.ts b/src/controllers/did/DidController.ts index 8441d148..1bc214ea 100644 --- a/src/controllers/did/DidController.ts +++ b/src/controllers/did/DidController.ts @@ -1,484 +1,580 @@ + import type { DidResolutionResultProps } from '../types' import type { PolygonDidCreateOptions } from '@ayanworks/credo-polygon-w3c-module/build/dids' import type { DidDocument, KeyDidCreateOptions, PeerDidNumAlgo2CreateOptions } from '@credo-ts/core' +import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' import { - KeyType, - TypedArrayEncoder, - DidDocumentBuilder, - getEd25519VerificationKey2018, - getBls12381G2Key2020, - createPeerDidDocumentFromServices, - PeerDidNumAlgo, + TypedArrayEncoder, + DidDocumentBuilder, + getEd25519VerificationKey2018, + createPeerDidDocumentFromServices, + PeerDidNumAlgo, + Kms, + Hasher, + LogLevel, + Agent, } from '@credo-ts/core' +import { Key, KeyAlgorithm,askar } from '@openwallet-foundation/askar-nodejs' import axios from 'axios' import { Request as Req } from 'express' import { Body, Controller, Example, Get, Path, Post, Route, Tags, Security, Request } from 'tsoa' import { injectable } from 'tsyringe' -import { DidMethod, Network, Role, SCOPES } from '../../enums' +import { DidMethod, KeyAlgorithmCurve, Network, Role, SCOPES } from '../../enums' import ErrorHandlingService from '../../errorHandlingService' import { BadRequestError, InternalServerError } from '../../errors' import { AgentType } from '../../types' +import { keyAlgorithmToCurve, p521, verkey } from '../../utils/constant' +import { getTypeFromCurve } from '../../utils/helpers' import { CreateDidResponse, Did, DidRecordExample } from '../examples' import { DidCreate } from '../types' +import { supportedKeyTypesDID } from '../x509/x509.types' +import { container } from 'tsyringe' +import { RestMultiTenantAgentModules } from '../../cliAgent' + + @Tags('Dids') @Route('/dids') @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) @injectable() export class DidController extends Controller { - /** - * Resolves did and returns did resolution result - * @param did Decentralized Identifier - * @returns DidResolutionResult - */ - @Example(DidRecordExample) - @Get('/:did') - public async getDidRecordByDid(@Request() request: Req, @Path('did') did: Did) { - try { - const resolveResult = await request.agent.dids.resolve(did) - const importDid = await request.agent.dids.import({ - did, - overwrite: true, - }) - if (!resolveResult.didDocument) { - throw new InternalServerError(`Error resolving DID docs for did: ${importDid}`) - } - - return { ...resolveResult, didDocument: resolveResult.didDocument.toJSON() } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } - - /** - * Did nym registration - * @body DidCreateOptions - * @returns DidResolutionResult - */ - // @Example(DidRecordExample) - @Example(CreateDidResponse) - @Post('/write') - public async writeDid(@Request() request: Req, @Body() createDidOptions: DidCreate) { - let didRes - - try { - if (!createDidOptions.method) { - throw new BadRequestError('Method is required') - } - - let result - switch (createDidOptions.method) { - case DidMethod.Indy: - result = await this.handleIndy(request.agent, createDidOptions) - break - - case DidMethod.Key: - result = await this.handleKey(request.agent, createDidOptions) - break - - case DidMethod.Web: - result = await this.handleWeb(request.agent, createDidOptions) - break - - case DidMethod.Polygon: - result = await this.handlePolygon(request.agent, createDidOptions) - break - - case DidMethod.Peer: - result = await this.handleDidPeer(request.agent, createDidOptions) - break - - default: - throw new BadRequestError(`Invalid method: ${createDidOptions.method}`) - } - - didRes = { ...result } - - return didRes - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } - - private async handleDidPeer(agent: AgentType, createDidOptions: DidCreate) { - let didResponse - let did - - if (!createDidOptions.keyType) { - throw Error('keyType is required') - } - - const didRouting = await agent.modules.mediationRecipient.getRouting({}) - const didDocument = createPeerDidDocumentFromServices([ - { - id: 'didcomm', - recipientKeys: [didRouting.recipientKey], - routingKeys: didRouting.routingKeys, - serviceEndpoint: didRouting.endpoints[0], - }, - ]) - - const didPeerResponse = await agent.dids.create({ - didDocument, - method: DidMethod.Peer, - options: { - numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, - }, - }) - - did = didPeerResponse.didState.did - didResponse = { - did, + /** + * Resolves did and returns did resolution result + * @param did Decentralized Identifier + * @returns DidResolutionResult + */ + private agent = container.resolve(Agent) + + @Example(DidRecordExample) + @Get('/:did') + public async getDidRecordByDid(@Request() request: Req, @Path('did') did: Did) { + try { + const resolveResult = await request.agent.dids.resolve(did) + const importDid = await request.agent.dids.import({ + did, + overwrite: true, + }) + if (!resolveResult.didDocument) { + throw new InternalServerError(`Error resolving DID docs for did: ${importDid}`) + } + + return { ...resolveResult, didDocument: resolveResult.didDocument.toJSON() } + } catch (error) { + throw ErrorHandlingService.handle(error) + } } - return didResponse - } - private async handleIndy(agent: AgentType, createDidOptions: DidCreate) { - let result - if (!createDidOptions.keyType) { - throw new BadRequestError('keyType is required') + /** + * Did nym registration + * @body DidCreateOptions + * @returns DidResolutionResult + */ + // @Example(DidRecordExample) + @Example(CreateDidResponse) + @Post('/write') + public async writeDid(@Request() request: Req, @Body() createDidOptions: DidCreate) { + let didRes + + this.agent.config.logger.info(`askar version ${askar.version()}`) + try { + if (!createDidOptions.method) { + throw new BadRequestError('Method is required') + } + + let result + switch (createDidOptions.method) { + case DidMethod.Indy: + result = await this.handleIndy(request.agent, createDidOptions) + break + + case DidMethod.Key: + result = await this.handleKey(request.agent, createDidOptions) + break + + case DidMethod.Web: + result = await this.handleWeb(request.agent, createDidOptions) + break + + case DidMethod.Polygon: + result = await this.handlePolygon(request.agent, createDidOptions) + break + + case DidMethod.Peer: + result = await this.handleDidPeer(request.agent, createDidOptions) + break + + default: + throw new BadRequestError(`Invalid method: ${createDidOptions.method}`) + } + + didRes = { ...result } + + return didRes + } catch (error) { + throw ErrorHandlingService.handle(error) + } } - if (!createDidOptions.network) { - throw new BadRequestError('For indy method network is required') - } + private async handleDidPeer(agent: AgentType, createDidOptions: DidCreate) { + let didResponse + let did - if (createDidOptions.keyType !== KeyType.Ed25519) { - throw new BadRequestError('Only ed25519 key type supported') - } + if (!createDidOptions.keyType) { + throw Error('keyType is required') + } - if (!Network.Bcovrin_Testnet && !Network.Indicio_Demonet && !Network.Indicio_Testnet) { - throw new BadRequestError(`Invalid network for 'indy' method: ${createDidOptions.network}`) - } + const didRouting = await agent.modules.didcomm.mediationRecipient.getRouting({}) + const { didDocument, keys } = createPeerDidDocumentFromServices([ + { + id: 'didcomm', + recipientKeys: [didRouting.recipientKey], + routingKeys: didRouting.routingKeys, + serviceEndpoint: didRouting.endpoints[0], + }, + ], + true) + + const didPeerResponse = await agent.dids.create({ + didDocument, + method: DidMethod.Peer, + options: { + numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, + keys + }, + }) - switch (createDidOptions?.network?.toLowerCase()) { - case Network.Bcovrin_Testnet: - result = await this.handleBcovrin( - agent, - createDidOptions, - `did:${createDidOptions.method}:${createDidOptions.network}`, - ) - break - - case Network.Indicio_Demonet: - case Network.Indicio_Testnet: - result = await this.handleIndicio( - agent, - createDidOptions, - `did:${createDidOptions.method}:${createDidOptions.network}`, - ) - break - - default: - throw new BadRequestError(`Network does not exists`) + did = didPeerResponse.didState.did + didResponse = { + did, + } + return didResponse } - return result - } - private async handleBcovrin(agent: AgentType, createDidOptions: DidCreate, didMethod: string) { - let didDocument - if (!createDidOptions.seed) { - throw new BadRequestError('Seed is required') - } - if (createDidOptions?.role?.toLowerCase() === Role.Endorser) { - if (createDidOptions.did) { - await this.importDid(agent, didMethod, createDidOptions.did, createDidOptions.seed) - const getDid = await agent.dids.getCreatedDids({ - method: createDidOptions.method, - did: `did:${createDidOptions.method}:${createDidOptions.network}:${createDidOptions.did}`, - }) - if (getDid.length > 0) { - didDocument = getDid[0].didDocument + private async handleIndy(agent: AgentType, createDidOptions: DidCreate) { + let result + if (!createDidOptions.keyType) { + throw new BadRequestError('keyType is required') } - return { - did: `${didMethod}:${createDidOptions.did}`, - didDocument: didDocument, + if (!createDidOptions.network) { + throw new BadRequestError('For indy method network is required') } - } else { - const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string - const res = await axios.post(BCOVRIN_REGISTER_URL, { - role: 'ENDORSER', - alias: 'Alias', - seed: createDidOptions.seed, - }) - const { did } = res?.data || {} - await this.importDid(agent, didMethod, did, createDidOptions.seed) - const didRecord = await agent.dids.getCreatedDids({ - method: DidMethod.Indy, - did: `did:${DidMethod.Indy}:${Network.Bcovrin_Testnet}:${res.data.did}`, - }) - if (didRecord.length > 0) { - didDocument = didRecord[0].didDocument + if (createDidOptions.keyType !== KeyAlgorithm.Ed25519) { + throw new BadRequestError('Only ed25519 key type supported') } - return { - did: `${didMethod}:${res.data.did}`, - didDocument: didDocument, + if (!Network.Bcovrin_Testnet && !Network.Indicio_Demonet && !Network.Indicio_Testnet) { + throw new BadRequestError(`Invalid network for 'indy' method: ${createDidOptions.network}`) } - } - } else { - if (!createDidOptions.endorserDid) { - throw new BadRequestError('Please provide the endorser DID or role') - } - const didCreateTxResult = await this.createEndorserDid(agent, createDidOptions.endorserDid) - return { did: didCreateTxResult.didState.did, didDocument: didCreateTxResult.didState.didDocument } - } - } - private async handleIndicio(agent: AgentType, createDidOptions: DidCreate, didMethod: string) { - let didDocument - if (!createDidOptions.seed) { - throw new BadRequestError('Seed is required') + switch (createDidOptions?.network?.toLowerCase()) { + case Network.Bcovrin_Testnet: + result = await this.handleBcovrin( + agent, + createDidOptions, + `did:${createDidOptions.method}:${createDidOptions.network}`, + ) + break + + case Network.Indicio_Demonet: + case Network.Indicio_Testnet: + result = await this.handleIndicio( + agent, + createDidOptions, + `did:${createDidOptions.method}:${createDidOptions.network}`, + ) + break + + default: + throw new BadRequestError(`Network does not exists`) + } + return result } - if (createDidOptions?.role?.toLowerCase() === Role.Endorser) { - if (createDidOptions.did) { - await this.importDid(agent, didMethod, createDidOptions.did, createDidOptions.seed) - const didRecord = await agent.dids.getCreatedDids({ - method: createDidOptions.method, - did: `did:${createDidOptions.method}:${createDidOptions.network}:${createDidOptions.did}`, - }) - if (didRecord.length > 0) { - didDocument = didRecord[0].didDocument + private async handleBcovrin(agent: AgentType, createDidOptions: DidCreate, didMethod: string) { + let didDocument + if (!createDidOptions.seed) { + throw new BadRequestError('Seed is required') + } + if (createDidOptions?.role?.toLowerCase() === Role.Endorser) { + if (createDidOptions.did) { + await this.importDid(agent, didMethod, createDidOptions.did, createDidOptions.seed) + const getDid = await agent.dids.getCreatedDids({ + method: createDidOptions.method, + did: `did:${createDidOptions.method}:${createDidOptions.network}:${createDidOptions.did}`, + }) + if (getDid.length > 0) { + didDocument = getDid[0].didDocument + } + + return { + did: `${didMethod}:${createDidOptions.did}`, + didDocument: didDocument, + } + } else { + const BCOVRIN_REGISTER_URL = process.env.BCOVRIN_REGISTER_URL as string + const res = await axios.post(BCOVRIN_REGISTER_URL, { + role: 'ENDORSER', + alias: 'Alias', + seed: createDidOptions.seed, + }) + const { did } = res?.data || {} + await this.importDid(agent, didMethod, did, createDidOptions.seed) + const didRecord = await agent.dids.getCreatedDids({ + method: DidMethod.Indy, + did: `did:${DidMethod.Indy}:${Network.Bcovrin_Testnet}:${res.data.did}`, + }) + + if (didRecord.length > 0) { + didDocument = didRecord[0].didDocument + } + + return { + did: `${didMethod}:${res.data.did}`, + didDocument: didDocument, + } + } + } else { + if (!createDidOptions.endorserDid) { + throw new BadRequestError('Please provide the endorser DID or role') + } + const didCreateTxResult = await this.createEndorserDid(agent, createDidOptions.endorserDid) + return { did: didCreateTxResult.didState.did, didDocument: didCreateTxResult.didState.didDocument } } + } - return { - did: `${didMethod}:${createDidOptions.did}`, - didDocument: didDocument, + private async handleIndicio(agent: AgentType, createDidOptions: DidCreate, didMethod: string) { + let didDocument + if (!createDidOptions.seed) { + throw new BadRequestError('Seed is required') } - } else { - const key = await this.createIndicioKey(agent, createDidOptions) - const INDICIO_NYM_URL = process.env.INDICIO_NYM_URL as string - const res = await axios.post(INDICIO_NYM_URL, key) - if (res.data.statusCode === 200) { - await this.importDid(agent, didMethod, key.did, createDidOptions.seed) - const didRecord = await agent.dids.getCreatedDids({ - method: DidMethod.Indy, - did: `${didMethod}:${key.did}`, - }) - - if (didRecord.length > 0) { - didDocument = didRecord[0].didDocument - } - - return { - did: `${didMethod}:${key.did}`, - didDocument: didDocument, - } + if (createDidOptions?.role?.toLowerCase() === Role.Endorser) { + if (createDidOptions.did) { + await this.importDid(agent, didMethod, createDidOptions.did, createDidOptions.seed) + const didRecord = await agent.dids.getCreatedDids({ + method: createDidOptions.method, + did: `did:${createDidOptions.method}:${createDidOptions.network}:${createDidOptions.did}`, + }) + + if (didRecord.length > 0) { + didDocument = didRecord[0].didDocument + } + + return { + did: `${didMethod}:${createDidOptions.did}`, + didDocument: didDocument, + } + } else { + const key = await this.createIndicioKey(agent, createDidOptions) + const INDICIO_NYM_URL = process.env.INDICIO_NYM_URL as string + const res = await axios.post(INDICIO_NYM_URL, key) + if (res.data.statusCode === 200) { + await this.importDid(agent, didMethod, key.did, createDidOptions.seed) + const didRecord = await agent.dids.getCreatedDids({ + method: DidMethod.Indy, + did: `${didMethod}:${key.did}`, + }) + + if (didRecord.length > 0) { + didDocument = didRecord[0].didDocument + } + + return { + did: `${didMethod}:${key.did}`, + didDocument: didDocument, + } + } + } + } else { + if (!createDidOptions.endorserDid) { + throw new BadRequestError('Please provide the endorser DID or role') + } + const didCreateTxResult = await this.createEndorserDid(agent, createDidOptions.endorserDid) + return didCreateTxResult } - } - } else { - if (!createDidOptions.endorserDid) { - throw new BadRequestError('Please provide the endorser DID or role') - } - const didCreateTxResult = await this.createEndorserDid(agent, createDidOptions.endorserDid) - return didCreateTxResult - } - } - - private async createEndorserDid(agent: AgentType, endorserDid: string) { - return agent.dids.create({ - method: 'indy', - options: { - endorserMode: 'external', - endorserDid: endorserDid || '', - }, - }) - } - - private async createIndicioKey(agent: AgentType, createDidOptions: DidCreate) { - if (!createDidOptions.seed) { - throw new BadRequestError('Seed is required') - } - const key = await agent.wallet.createKey({ - privateKey: TypedArrayEncoder.fromString(createDidOptions.seed), - keyType: KeyType.Ed25519, - }) - - const buffer = TypedArrayEncoder.fromBase58(key.publicKeyBase58) - const did = TypedArrayEncoder.toBase58(buffer.slice(0, 16)) - - let body - if (createDidOptions.network === Network.Indicio_Testnet) { - body = { - network: 'testnet', - did, - verkey: TypedArrayEncoder.toBase58(buffer), - } - } else if (createDidOptions.network === Network.Indicio_Demonet) { - body = { - network: 'demonet', - did, - verkey: TypedArrayEncoder.toBase58(buffer), - } - } else { - throw new BadRequestError('Please provide a valid did method') - } - return body - } - - private async importDid(agent: AgentType, didMethod: string, did: string, seed: string) { - await agent.dids.import({ - did: `${didMethod}:${did}`, - overwrite: true, - privateKeys: [ - { - keyType: KeyType.Ed25519, - privateKey: TypedArrayEncoder.fromString(seed), - }, - ], - }) - } - - public async handleKey(agent: AgentType, didOptions: DidCreate) { - let did - let didResponse - let didDocument - - if (!didOptions.seed) { - throw new BadRequestError('Seed is required') - } - if (!didOptions.keyType) { - throw new BadRequestError('keyType is required') - } - if (didOptions.keyType !== KeyType.Ed25519 && didOptions.keyType !== KeyType.Bls12381g2) { - throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') } - if (!didOptions.did) { - await agent.wallet.createKey({ - keyType: didOptions.keyType, - seed: TypedArrayEncoder.fromString(didOptions.seed), - }) - - didResponse = await agent.dids.create({ - method: DidMethod.Key, - options: { - keyType: KeyType.Ed25519, - }, - secret: { - privateKey: TypedArrayEncoder.fromString(didOptions.seed), - }, - }) - did = `${didResponse.didState.did}` - didDocument = didResponse.didState.didDocument - } else { - did = didOptions.did - const createdDid = await agent.dids.getCreatedDids({ - method: DidMethod.Key, - did: didOptions.did, - }) - didDocument = createdDid[0]?.didDocument + private async createEndorserDid(agent: AgentType, endorserDid: string) { + return agent.dids.create({ + method: 'indy', + options: { + endorserMode: 'external', + endorserDid: endorserDid || '', + }, + }) } - await agent.dids.import({ - did, - overwrite: true, - didDocument, - }) - return { did: did, didDocument: didDocument } - } - - public async handleWeb(agent: AgentType, didOptions: DidCreate) { - let didDocument: DidDocument - if (!didOptions.domain) { - throw new BadRequestError('For create did:web, domain is required') + private async createIndicioKey(agent: AgentType, createDidOptions: DidCreate) { + if (!createDidOptions.seed) { + throw new BadRequestError('Seed is required') + } + // TODO: Remove comments afterwards + // const key = await agent.kms.createKey({ + // privateKey: TypedArrayEncoder.fromString(createDidOptions.seed), + // keyType: KeyAlgorithm.Ed25519, + // }) + + // const buffer = TypedArrayEncoder.fromBase58(key.publicKeyBase58) + // const did = TypedArrayEncoder.toBase58(buffer.slice(0, 16)) + + const _verificationKey = ( + await agent.kms.createKey({ + type: { + kty: 'OKP', + crv: 'Ed25519', + }, + }) + ).publicJwk + + const verificationKey = Kms.PublicJwk.fromPublicJwk(_verificationKey) as Kms.PublicJwk + + // Create a new key and calculate did according to the rules for indy did method + const buffer = Hasher.hash(verificationKey.publicKey.publicKey, 'sha-256') + + const did = TypedArrayEncoder.toBase58(buffer.slice(0, 16)) + + let body + if (createDidOptions.network === Network.Indicio_Testnet) { + body = { + network: 'testnet', + did, + verkey: TypedArrayEncoder.toBase58(buffer), + } + } else if (createDidOptions.network === Network.Indicio_Demonet) { + body = { + network: 'demonet', + did, + verkey: TypedArrayEncoder.toBase58(buffer), + } + } else { + throw new BadRequestError('Please provide a valid did method') + } + return body } - if (!didOptions.seed) { - throw new BadRequestError('Seed is required') - } + private async importDid(agent: AgentType, didMethod: string, did: string, seed: string) { + // TODO: Remove comments afterwards + // await agent.dids.import({ + // did: `${didMethod}:${did}`, + // overwrite: true, + // privateKeys: [ + // { + // keyType: KeyAlgorithm.Ed25519, + // privateKey: TypedArrayEncoder.fromString(seed), + // }, + // ], + // }) + + const { privateJwk } = transformSeedToPrivateJwk({ + type: { + crv: 'Ed25519', + kty: 'OKP', + }, + seed: TypedArrayEncoder.fromString(seed), + }) - if (!didOptions.keyType) { - throw new BadRequestError('keyType is required') - } + const key = await agent.kms.importKey({ privateJwk }) - if (didOptions.keyType !== KeyType.Ed25519 && didOptions.keyType !== KeyType.Bls12381g2) { - throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') - } + const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) + const completeDid = `${didMethod}:${did}` + await agent.dids.import({ + did: completeDid, + keys: [ + { + kmsKeyId: key.keyId, + didDocumentRelativeKeyId: verkey, - const domain = didOptions.domain - const did = `did:${didOptions.method}:${domain}` - const keyId = `${did}#key-1` - - const key = await agent.wallet.createKey({ - keyType: didOptions.keyType, - // Commenting for now, as per the multi-tenant endpoint - // privateKey: TypedArrayEncoder.fromString(didOptions.seed), - seed: TypedArrayEncoder.fromString(didOptions.seed), - }) - - if (didOptions.keyType === KeyType.Ed25519) { - didDocument = new DidDocumentBuilder(did) - .addContext('https://w3id.org/security/suites/ed25519-2018/v1') - .addVerificationMethod(getEd25519VerificationKey2018({ key, id: keyId, controller: did })) - .addAuthentication(keyId) - .addAssertionMethod(keyId) - .build() - } else if (didOptions.keyType === KeyType.Bls12381g2) { - didDocument = new DidDocumentBuilder(did) - .addContext('https://w3id.org/security/bbs/v1') - .addVerificationMethod(getBls12381G2Key2020({ key, id: keyId, controller: did })) - .addAuthentication(keyId) - .addAssertionMethod(keyId) - .build() - } else { - throw new BadRequestError('Unsupported key type') // fallback, but this won't hit due to earlier check + } + ] + }) } - await agent.dids.import({ - did, - overwrite: true, - didDocument, - }) - return { did, didDocument } - } + public async handleKey(agent: AgentType, didOptions: DidCreate) { + let did + let didResponse + let didDocument - public async handlePolygon(agent: AgentType, createDidOptions: DidCreate) { - // need to discuss try catch logic - const { endpoint, network, privatekey } = createDidOptions + if (!didOptions.seed) { + throw new BadRequestError('Seed is required') + } + if (!didOptions.keyType) { + throw new BadRequestError('keyType is required') + } + if (didOptions.keyType === KeyAlgorithm.Bls12381G2) { + throw new BadRequestError('didOptions.keyType for type "bls12381g2" has been deprecated') + } + if (didOptions.keyType === p521 as KeyAlgorithm) { + throw new BadRequestError('didOptions.keyType for type p521 is not supported') + } + const normalizedCurve = keyAlgorithmToCurve[didOptions.keyType as KeyAlgorithm] + if (!(normalizedCurve && supportedKeyTypesDID[DidMethod.Key]?.some(kt => kt.crv === normalizedCurve))) { + throw new BadRequestError(`Invalid keyType: ${didOptions.keyType}`) + } - if (!network) { - throw new BadRequestError('Network is required for Polygon method') - } - const networkName = network?.split(':')[1] + if (!didOptions.did) { + const privateJwk = transformPrivateKeyToPrivateJwk({ + privateKey: TypedArrayEncoder.fromString(didOptions.seed), + type: getTypeFromCurve(didOptions.keyType ?? KeyAlgorithm.Ed25519), + }).privateJwk + const { keyId } = await agent.kms.importKey({ + privateJwk, + }) + this.agent.config.logger.info(`This is keyId:::::: ${keyId}`) + const didResponse = await agent.dids.create({ + method: DidMethod.Key, + options: { + keyId, + }, + }) + this.agent.config.logger.info(`This is didResponse:::::: ${JSON.stringify(didResponse)}`) + + did = `${didResponse.didState.did}` + didDocument = didResponse.didState.didDocument + } else { + did = didOptions.did + const createdDid = await agent.dids.getCreatedDids({ + method: DidMethod.Key, + did: didOptions.did, + }) + didDocument = createdDid[0]?.didDocument + } + + this.agent.config.logger.info(`This is did ${did}` ) + this.agent.config.logger.info(`This is didDocument ${didDocument}` ) - if (networkName !== 'mainnet' && networkName !== 'testnet') { - throw new BadRequestError('Invalid network type') + await agent.dids.import({ + did, + overwrite: true, + didDocument, + }) + return { did: did, didDocument: didDocument } } - if (!privatekey || typeof privatekey !== 'string' || !privatekey.trim() || privatekey.length !== 64) { - throw new BadRequestError('Invalid private key or key not supported') + + public async handleWeb(agent: AgentType, didOptions: DidCreate) { + let didDocument: DidDocument + if (!didOptions.domain) { + throw new BadRequestError('For create did:web, domain is required') + } + + if (!didOptions.seed) { + throw new BadRequestError('Seed is required') + } + + if (!didOptions.keyType) { + throw new BadRequestError('keyType is required') + } + + if (didOptions.keyType !== KeyAlgorithm.Ed25519 && didOptions.keyType !== KeyAlgorithm.Bls12381G2) { + throw new BadRequestError('Only ed25519 and bls12381g2 key type supported') + } + + const domain = didOptions.domain + const did = `did:${didOptions.method}:${domain}` + const keyId = `${did}#key-1` + + // TODO: Remove comments afterwards + // const key = await agent.kms.createKey({ + // keyType: didOptions.keyType, + // // Commenting for now, as per the multi-tenant endpoint + // // privateKey: TypedArrayEncoder.fromString(didOptions.seed), + // seed: TypedArrayEncoder.fromString(didOptions.seed), + // }) + + // const ed25519Key = await agent.kms.createKey({ + // type: { + // crv: 'Ed25519', + // kty: 'OKP', + // } + // }) + // const publicJwk = Kms.PublicJwk.fromPublicJwk(ed25519Key.publicJwk) + // const { privateJwk } = transformPrivateKeyToPrivateJwk({ + // type: { + // crv: 'Ed25519', + // kty: 'OKP', + // }, + // privateKey: TypedArrayEncoder.fromString(didOptions.seed), + // }) + + + + if (didOptions.keyType === KeyAlgorithm.Ed25519) { + const { privateJwk } = transformSeedToPrivateJwk({ + type: { + crv: 'Ed25519', + kty: 'OKP', + }, + seed: TypedArrayEncoder.fromString(didOptions.seed), + }) + + const key = await agent.kms.importKey({ privateJwk }) + + const publicJwk = Kms.PublicJwk.fromPublicJwk(key.publicJwk) + didDocument = new DidDocumentBuilder(did) + .addContext('https://w3id.org/security/suites/ed25519-2018/v1') + .addVerificationMethod(getEd25519VerificationKey2018({ id: keyId, controller: did, publicJwk })) + .addAuthentication(keyId) + .addAssertionMethod(keyId) + .build() + } else if (didOptions.keyType === KeyAlgorithm.Bls12381G2) { + // Support for BBS signature is discontinued from credo-ts version 0.6.0 + throw new BadRequestError(`Support for ${KeyAlgorithm.Bls12381G2} has been deprecated`) + } else { + throw new BadRequestError('Unsupported key type') // fallback, but this won't hit due to earlier check + } + + await agent.dids.import({ + did, + overwrite: true, + didDocument, + }) + return { did, didDocument } } - const createDidResponse = await agent.dids.create({ - method: DidMethod.Polygon, - options: { - network: networkName, - endpoint, - }, - secret: { - privateKey: TypedArrayEncoder.fromHex(`${privatekey}`), - }, - }) - const didResponse = { - did: createDidResponse?.didState?.did, - didDocument: createDidResponse?.didState?.didDocument, + public async handlePolygon(agent: AgentType, createDidOptions: DidCreate) { + // need to discuss try catch logic + const { endpoint, network, privatekey } = createDidOptions + + if (!network) { + throw new BadRequestError('Network is required for Polygon method') + } + + const networkName = network?.split(':')[1] + + if (networkName !== 'mainnet' && networkName !== 'testnet') { + throw new BadRequestError('Invalid network type') + } + if (!privatekey || typeof privatekey !== 'string' || !privatekey.trim() || privatekey.length !== 64) { + throw new BadRequestError('Invalid private key or key not supported') + } + + const createDidResponse = await agent.dids.create({ + method: DidMethod.Polygon, + options: { + network: networkName, + endpoint, + }, + secret: { + privateKey: TypedArrayEncoder.fromHex(`${privatekey}`), + }, + }) + const didResponse = { + did: createDidResponse?.didState?.did, + didDocument: createDidResponse?.didState?.didDocument, + } + return didResponse } - return didResponse - } - - @Get('/') - public async getDids(@Request() request: Req) { - try { - const createdDids = await request.agent.dids.getCreatedDids() - return createdDids - } catch (error) { - throw ErrorHandlingService.handle(error) + + @Get('/') + public async getDids(@Request() request: Req) { + try { + const createdDids = await request.agent.dids.getCreatedDids() + return createdDids + } catch (error) { + throw ErrorHandlingService.handle(error) + } } - } } diff --git a/src/controllers/didcomm/basic-messages/BasicMessageController.ts b/src/controllers/didcomm/basic-messages/BasicMessageController.ts index ecd5e81c..bc691b92 100644 --- a/src/controllers/didcomm/basic-messages/BasicMessageController.ts +++ b/src/controllers/didcomm/basic-messages/BasicMessageController.ts @@ -1,58 +1,58 @@ -import type { BasicMessageRecord, BasicMessageStorageProps } from '@credo-ts/didcomm' +// import type { DidCommBasicMessageRecord, DidCommBasicMessageStorageProps } from '@credo-ts/didcomm' -import { Request as Req } from 'express' -import { Body, Controller, Example, Get, Path, Post, Route, Tags, Security, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { Request as Req } from 'express' +// import { Body, Controller, Example, Get, Path, Post, Route, Tags, Security, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { SCOPES } from '../../../enums' -import ErrorHandlingService from '../../../errorHandlingService' -import { BasicMessageRecordExample, RecordId } from '../../examples' +// import { SCOPES } from '../../../enums' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { BasicMessageRecordExample, RecordId } from '../../examples' -@Tags('DIDComm - Basic Messages') -@Route('/didcomm/basic-messages') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class BasicMessageController extends Controller { - /** - * Retrieve basic messages by connection id - * - * @param connectionId Connection identifier - * @returns BasicMessageRecord[] - */ - @Example([BasicMessageRecordExample]) - @Get('/:connectionId') - public async getBasicMessages( - @Request() request: Req, - @Path('connectionId') connectionId: RecordId, - ): Promise { - try { - const basicMessageRecords = await request.agent.modules.basicMessages.findAllByQuery({ connectionId }) - this.setStatus(200) - return basicMessageRecords - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Tags('DIDComm - Basic Messages') +// @Route('/didcomm/basic-messages') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class BasicMessageController extends Controller { +// /** +// * Retrieve basic messages by connection id +// * +// * @param connectionId Connection identifier +// * @returns DidCommBasicMessageRecord[] +// */ +// @Example([BasicMessageRecordExample]) +// @Get('/:connectionId') +// public async getBasicMessages( +// @Request() request: Req, +// @Path('connectionId') connectionId: RecordId, +// ): Promise { +// try { +// const basicMessageRecords = await request.agent.modules.basicMessages.findAllByQuery({ connectionId }) +// this.setStatus(200) +// return basicMessageRecords +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Send a basic message to a connection - * - * @param connectionId Connection identifier - * @param content The content of the message - */ - @Example(BasicMessageRecordExample) - @Post('/:connectionId') - public async sendMessage( - @Request() request: Req, - @Path('connectionId') connectionId: RecordId, - @Body() body: Record<'content', string>, - ) { - try { - const basicMessageRecord = await request.agent.modules.basicMessages.sendMessage(connectionId, body.content) - this.setStatus(201) - return basicMessageRecord - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// /** +// * Send a basic message to a connection +// * +// * @param connectionId Connection identifier +// * @param content The content of the message +// */ +// @Example(BasicMessageRecordExample) +// @Post('/:connectionId') +// public async sendMessage( +// @Request() request: Req, +// @Path('connectionId') connectionId: RecordId, +// @Body() body: Record<'content', string>, +// ) { +// try { +// const basicMessageRecord = await request.agent.modules.basicMessages.sendMessage(connectionId, body.content) +// this.setStatus(201) +// return basicMessageRecord +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/didcomm/credentials/CredentialController.ts b/src/controllers/didcomm/credentials/CredentialController.ts index 76f38fb0..8b9b1d57 100644 --- a/src/controllers/didcomm/credentials/CredentialController.ts +++ b/src/controllers/didcomm/credentials/CredentialController.ts @@ -1,325 +1,325 @@ -import type { - PeerDidNumAlgo2CreateOptions, -} from '@credo-ts/core' +// import type { +// PeerDidNumAlgo2CreateOptions, +// } from '@credo-ts/core' -import { - W3cCredentialService, - createPeerDidDocumentFromServices, - PeerDidNumAlgo, -} from '@credo-ts/core' -import { - CredentialExchangeRecordProps, - CredentialProtocolVersionType, - CredentialState, - CredentialRole, - Routing -} from '@credo-ts/didcomm' -import { Request as Req } from 'express' -import { Body, Controller, Get, Path, Post, Route, Tags, Example, Query, Security, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { +// W3cCredentialService, +// createPeerDidDocumentFromServices, +// PeerDidNumAlgo, +// } from '@credo-ts/core' +// import { +// CredentialExchangeRecordProps, +// CredentialProtocolVersionType, +// CredentialState, +// CredentialRole, +// Routing +// } from '@credo-ts/didcomm' +// import { Request as Req } from 'express' +// import { Body, Controller, Get, Path, Post, Route, Tags, Example, Query, Security, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { SCOPES } from '../../../enums' -import ErrorHandlingService from '../../../errorHandlingService' -import { AgentType } from '../../../types' -import { CredentialExchangeRecordExample, RecordId } from '../../examples' -import { - AcceptCredentialRequestOptions, - ProposeCredentialOptions, - AcceptCredentialProposalOptions, - CredentialOfferOptions, - CreateOfferOptions, - AcceptCredential, - CreateOfferOobOptions, - ThreadId, -} from '../../types' -import { OutOfBandController } from '../outofband/OutOfBandController' +// import { SCOPES } from '../../../enums' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { AgentType } from '../../../types' +// import { CredentialExchangeRecordExample, RecordId } from '../../examples' +// import { +// AcceptCredentialRequestOptions, +// ProposeCredentialOptions, +// AcceptCredentialProposalOptions, +// CredentialOfferOptions, +// CreateOfferOptions, +// AcceptCredential, +// CreateOfferOobOptions, +// ThreadId, +// } from '../../types' +// import { OutOfBandController } from '../outofband/OutOfBandController' -@Tags('DIDComm - Credentials') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@Route('/didcomm/credentials') -@injectable() -export class CredentialController extends Controller { - private outOfBandController: OutOfBandController +// @Tags('DIDComm - Credentials') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Route('/didcomm/credentials') +// @injectable() +// export class CredentialController extends Controller { +// private outOfBandController: OutOfBandController - public constructor(outOfBandController: OutOfBandController) { - super() - this.outOfBandController = outOfBandController - } +// public constructor(outOfBandController: OutOfBandController) { +// super() +// this.outOfBandController = outOfBandController +// } - /** - * Retrieve all credential exchange records - * - * @returns CredentialExchangeRecord[] - */ - @Example([CredentialExchangeRecordExample]) - @Get('/') - public async getAllCredentials( - @Request() request: Req, - @Query('threadId') threadId?: ThreadId, - @Query('parentThreadId') parentThreadId?: ThreadId, - @Query('connectionId') connectionId?: RecordId, - @Query('state') state?: CredentialState, - @Query('role') role?: CredentialRole, - ) { - try { - const credentials = await request.agent.modules.credentials.findAllByQuery({ - connectionId, - threadId, - state, - parentThreadId, - role, - }) +// /** +// * Retrieve all credential exchange records +// * +// * @returns CredentialExchangeRecord[] +// */ +// @Example([CredentialExchangeRecordExample]) +// @Get('/') +// public async getAllCredentials( +// @Request() request: Req, +// @Query('threadId') threadId?: ThreadId, +// @Query('parentThreadId') parentThreadId?: ThreadId, +// @Query('connectionId') connectionId?: RecordId, +// @Query('state') state?: CredentialState, +// @Query('role') role?: CredentialRole, +// ) { +// try { +// const credentials = await request.agent.modules.credentials.findAllByQuery({ +// connectionId, +// threadId, +// state, +// parentThreadId, +// role, +// }) - return credentials.map((c) => c.toJSON()) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return credentials.map((c) => c.toJSON()) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - // TODO: Fix W3cCredentialRecordExample from example - // @Example([W3cCredentialRecordExample]) - @Get('/w3c') - public async getAllW3c(@Request() request: Req) { - try { - const w3cCredentialService = await request.agent.dependencyManager.resolve(W3cCredentialService) - const w3cCredentialRecords = await w3cCredentialService.getAllCredentialRecords(request.agent.context) - return w3cCredentialRecords - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// // TODO: Fix W3cCredentialRecordExample from example +// // @Example([W3cCredentialRecordExample]) +// @Get('/w3c') +// public async getAllW3c(@Request() request: Req) { +// try { +// const w3cCredentialService = await request.agent.dependencyManager.resolve(W3cCredentialService) +// const w3cCredentialRecords = await w3cCredentialService.getAllCredentialRecords(request.agent.context) +// return w3cCredentialRecords +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - // TODO: Fix W3cCredentialRecordExample from example - // @Example([W3cCredentialRecordExample]) - @Get('/w3c/:id') - public async getW3cById(@Request() request: Req, @Path('id') id: string) { - try { - const w3cCredentialService = await request.agent.dependencyManager.resolve(W3cCredentialService) - const w3cRecord = await w3cCredentialService.getCredentialRecordById(request.agent.context, id) - return w3cRecord - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// // TODO: Fix W3cCredentialRecordExample from example +// // @Example([W3cCredentialRecordExample]) +// @Get('/w3c/:id') +// public async getW3cById(@Request() request: Req, @Path('id') id: string) { +// try { +// const w3cCredentialService = await request.agent.dependencyManager.resolve(W3cCredentialService) +// const w3cRecord = await w3cCredentialService.getCredentialRecordById(request.agent.context, id) +// return w3cRecord +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Retrieve credential exchange record by credential record id - * - * @param credentialRecordId - * @returns CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Get('/:credentialRecordId') - public async getCredentialById(@Request() request: Req, @Path('credentialRecordId') credentialRecordId: RecordId) { - try { - const credential = await request.agent.modules.credentials.getById(credentialRecordId) - return credential.toJSON() - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Retrieve credential exchange record by credential record id +// * +// * @param credentialRecordId +// * @returns CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Get('/:credentialRecordId') +// public async getCredentialById(@Request() request: Req, @Path('credentialRecordId') credentialRecordId: RecordId) { +// try { +// const credential = await request.agent.modules.credentials.getById(credentialRecordId) +// return credential.toJSON() +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Initiate a new credential exchange as holder by sending a propose credential message - * to the connection with a specified connection id. - * - * @param options - * @returns CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Post('/propose-credential') - public async proposeCredential(@Request() request: Req, @Body() proposeCredentialOptions: ProposeCredentialOptions) { - try { - const credential = await request.agent.modules.credentials.proposeCredential(proposeCredentialOptions) - return credential - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Initiate a new credential exchange as holder by sending a propose credential message +// * to the connection with a specified connection id. +// * +// * @param options +// * @returns CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Post('/propose-credential') +// public async proposeCredential(@Request() request: Req, @Body() proposeCredentialOptions: ProposeCredentialOptions) { +// try { +// const credential = await request.agent.modules.credentials.proposeCredential(proposeCredentialOptions) +// return credential +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a credential proposal as issuer by sending an accept proposal message - * to the connection associated with the credential exchange record. - * - * @param credentialRecordId credential identifier - * @param options - * @returns CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Post('/accept-proposal') - public async acceptProposal( - @Request() request: Req, - @Body() acceptCredentialProposal: AcceptCredentialProposalOptions, - ) { - try { - const credential = await request.agent.modules.credentials.acceptProposal(acceptCredentialProposal) +// /** +// * Accept a credential proposal as issuer by sending an accept proposal message +// * to the connection associated with the credential exchange record. +// * +// * @param credentialRecordId credential identifier +// * @param options +// * @returns CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Post('/accept-proposal') +// public async acceptProposal( +// @Request() request: Req, +// @Body() acceptCredentialProposal: AcceptCredentialProposalOptions, +// ) { +// try { +// const credential = await request.agent.modules.credentials.acceptProposal(acceptCredentialProposal) - return credential - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return credential +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Initiate a new credential exchange as issuer by creating a credential offer - * without specifying a connection id - * - * @param options - * @returns AgentMessage, CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Post('/create-offer') - public async createOffer(@Request() request: Req, @Body() createOfferOptions: CreateOfferOptions) { - try { - const offer = await request.agent.modules.credentials.offerCredential(createOfferOptions) - return offer - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Initiate a new credential exchange as issuer by creating a credential offer +// * without specifying a connection id +// * +// * @param options +// * @returns AgentMessage, CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Post('/create-offer') +// public async createOffer(@Request() request: Req, @Body() createOfferOptions: CreateOfferOptions) { +// try { +// const offer = await request.agent.modules.credentials.offerCredential(createOfferOptions) +// return offer +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - @Post('/create-offer-oob') - public async createOfferOob(@Request() request: Req, @Body() outOfBandOption: CreateOfferOobOptions) { - try { - let invitationDid: string | undefined - let routing: Routing - await this.ensureLinkSecretExists(request.agent) +// @Post('/create-offer-oob') +// public async createOfferOob(@Request() request: Req, @Body() outOfBandOption: CreateOfferOobOptions) { +// try { +// let invitationDid: string | undefined +// let routing: Routing +// await this.ensureLinkSecretExists(request.agent) - if (outOfBandOption?.invitationDid) { - invitationDid = outOfBandOption?.invitationDid - } else { - routing = await request.agent.modules.mediationRecipient.getRouting({}) - const didDocument = createPeerDidDocumentFromServices([ - { - id: 'didcomm', - recipientKeys: [routing.recipientKey], - routingKeys: routing.routingKeys, - serviceEndpoint: routing.endpoints[0], - }, - ]) - const did = await request.agent.dids.create({ - didDocument, - method: 'peer', - options: { - numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, - }, - }) - invitationDid = did.didState.did - } +// if (outOfBandOption?.invitationDid) { +// invitationDid = outOfBandOption?.invitationDid +// } else { +// routing = await request.agent.modules.mediationRecipient.getRouting({}) +// const didDocument = createPeerDidDocumentFromServices([ +// { +// id: 'didcomm', +// recipientKeys: [routing.recipientKey], +// routingKeys: routing.routingKeys, +// serviceEndpoint: routing.endpoints[0], +// }, +// ]) +// const did = await request.agent.dids.create({ +// didDocument, +// method: 'peer', +// options: { +// numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, +// }, +// }) +// invitationDid = did.didState.did +// } - const offerOob = await request.agent.modules.credentials.createOffer({ - protocolVersion: outOfBandOption.protocolVersion as CredentialProtocolVersionType<[]>, - credentialFormats: outOfBandOption.credentialFormats, - autoAcceptCredential: outOfBandOption.autoAcceptCredential, - comment: outOfBandOption.comment, - }) +// const offerOob = await request.agent.modules.credentials.createOffer({ +// protocolVersion: outOfBandOption.protocolVersion as CredentialProtocolVersionType<[]>, +// credentialFormats: outOfBandOption.credentialFormats, +// autoAcceptCredential: outOfBandOption.autoAcceptCredential, +// comment: outOfBandOption.comment, +// }) - const credentialMessage = offerOob.message - const outOfBandRecord = await request.agent.modules.oob.createInvitation({ - label: outOfBandOption.label, - messages: [credentialMessage], - autoAcceptConnection: true, - imageUrl: outOfBandOption?.imageUrl, - goalCode: outOfBandOption?.goalCode, - invitationDid, - }) - return { - invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ - domain: request.agent.modules.didcomm.config.endpoints[0], - }), - invitation: outOfBandRecord.outOfBandInvitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, - }), - outOfBandRecord: outOfBandRecord.toJSON(), - outOfBandRecordId: outOfBandRecord.id, - credentialRequestThId: offerOob.credentialRecord.threadId, - invitationDid: outOfBandOption?.invitationDid ? '' : invitationDid, - } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// const credentialMessage = offerOob.message +// const outOfBandRecord = await request.agent.modules.oob.createInvitation({ +// label: outOfBandOption.label, +// messages: [credentialMessage], +// autoAcceptConnection: true, +// imageUrl: outOfBandOption?.imageUrl, +// goalCode: outOfBandOption?.goalCode, +// invitationDid, +// }) +// return { +// invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ +// domain: request.agent.modules.didcomm.config.endpoints[0], +// }), +// invitation: outOfBandRecord.outOfBandInvitation.toJSON({ +// useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, +// }), +// outOfBandRecord: outOfBandRecord.toJSON(), +// outOfBandRecordId: outOfBandRecord.id, +// credentialRequestThId: offerOob.credentialRecord.threadId, +// invitationDid: outOfBandOption?.invitationDid ? '' : invitationDid, +// } +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a credential offer as holder by sending an accept offer message - * to the connection associated with the credential exchange record. - * - * @param credentialRecordId credential identifier - * @param options - * @returns CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Post('/accept-offer') - public async acceptOffer(@Request() request: Req, @Body() acceptCredentialOfferOptions: CredentialOfferOptions) { - try { - await this.ensureLinkSecretExists(request.agent) - const acceptOffer = await request.agent.modules.credentials.acceptOffer(acceptCredentialOfferOptions) - return acceptOffer - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Accept a credential offer as holder by sending an accept offer message +// * to the connection associated with the credential exchange record. +// * +// * @param credentialRecordId credential identifier +// * @param options +// * @returns CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Post('/accept-offer') +// public async acceptOffer(@Request() request: Req, @Body() acceptCredentialOfferOptions: CredentialOfferOptions) { +// try { +// await this.ensureLinkSecretExists(request.agent) +// const acceptOffer = await request.agent.modules.credentials.acceptOffer(acceptCredentialOfferOptions) +// return acceptOffer +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a credential request as issuer by sending an accept request message - * to the connection associated with the credential exchange record. - * - * @param credentialRecordId credential identifier - * @param options - * @returns CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Post('/accept-request') - public async acceptRequest( - @Request() request: Req, - @Body() acceptCredentialRequestOptions: AcceptCredentialRequestOptions, - ) { - try { - const credential = await request.agent.modules.credentials.acceptRequest(acceptCredentialRequestOptions) - return credential - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Accept a credential request as issuer by sending an accept request message +// * to the connection associated with the credential exchange record. +// * +// * @param credentialRecordId credential identifier +// * @param options +// * @returns CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Post('/accept-request') +// public async acceptRequest( +// @Request() request: Req, +// @Body() acceptCredentialRequestOptions: AcceptCredentialRequestOptions, +// ) { +// try { +// const credential = await request.agent.modules.credentials.acceptRequest(acceptCredentialRequestOptions) +// return credential +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a credential as holder by sending an accept credential message - * to the connection associated with the credential exchange record. - * - * @param options - * @returns CredentialExchangeRecord - */ - @Example(CredentialExchangeRecordExample) - @Post('/accept-credential') - public async acceptCredential(@Request() request: Req, @Body() acceptCredential: AcceptCredential) { - try { - const credential = await request.agent.modules.credentials.acceptCredential(acceptCredential) - return credential - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Accept a credential as holder by sending an accept credential message +// * to the connection associated with the credential exchange record. +// * +// * @param options +// * @returns CredentialExchangeRecord +// */ +// @Example(CredentialExchangeRecordExample) +// @Post('/accept-credential') +// public async acceptCredential(@Request() request: Req, @Body() acceptCredential: AcceptCredential) { +// try { +// const credential = await request.agent.modules.credentials.acceptCredential(acceptCredential) +// return credential +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Return credentialRecord - * - * @param credentialRecordId - * @returns credentialRecord - */ - @Get('/:credentialRecordId/form-data') - public async credentialFormData(@Request() request: Req, @Path('credentialRecordId') credentialRecordId: string) { - try { - const credentialDetails = await request.agent.modules.credentials.getFormatData(credentialRecordId) - return credentialDetails - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Return credentialRecord +// * +// * @param credentialRecordId +// * @returns credentialRecord +// */ +// @Get('/:credentialRecordId/form-data') +// public async credentialFormData(@Request() request: Req, @Path('credentialRecordId') credentialRecordId: string) { +// try { +// const credentialDetails = await request.agent.modules.credentials.getFormatData(credentialRecordId) +// return credentialDetails +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - private async ensureLinkSecretExists(agent: AgentType): Promise { - const linkSecretIds = await agent.modules.anoncreds.getLinkSecretIds() - if (linkSecretIds.length === 0) { - await agent.modules.anoncreds.createLinkSecret() - } - } -} +// private async ensureLinkSecretExists(agent: AgentType): Promise { +// const linkSecretIds = await agent.modules.anoncreds.getLinkSecretIds() +// if (linkSecretIds.length === 0) { +// await agent.modules.anoncreds.createLinkSecret() +// } +// } +// } diff --git a/src/controllers/didcomm/proofs/ProofController.ts b/src/controllers/didcomm/proofs/ProofController.ts index 55b8de31..a4f4a9f9 100644 --- a/src/controllers/didcomm/proofs/ProofController.ts +++ b/src/controllers/didcomm/proofs/ProofController.ts @@ -1,283 +1,283 @@ -import type { - PeerDidNumAlgo2CreateOptions, -} from '@credo-ts/core' +// import type { +// PeerDidNumAlgo2CreateOptions, +// } from '@credo-ts/core' -import { - AcceptProofRequestOptions, - ProofExchangeRecordProps, - ProofsProtocolVersionType, - Routing, -} from '@credo-ts/didcomm' +// import { +// AcceptProofRequestOptions, +// ProofExchangeRecordProps, +// ProofsProtocolVersionType, +// Routing, +// } from '@credo-ts/didcomm' -import { PeerDidNumAlgo, createPeerDidDocumentFromServices } from '@credo-ts/core' -import { Request as Req } from 'express' -import { Body, Controller, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { PeerDidNumAlgo, createPeerDidDocumentFromServices } from '@credo-ts/core' +// import { Request as Req } from 'express' +// import { Body, Controller, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { SCOPES } from '../../../enums' -import ErrorHandlingService from '../../../errorHandlingService' -import { ProofRecordExample, RecordId } from '../../examples' -import { - AcceptProofProposal, - CreateProofRequestOobOptions, - RequestProofOptions, - RequestProofProposalOptions, -} from '../../types' +// import { SCOPES } from '../../../enums' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { ProofRecordExample, RecordId } from '../../examples' +// import { +// AcceptProofProposal, +// CreateProofRequestOobOptions, +// RequestProofOptions, +// RequestProofProposalOptions, +// } from '../../types' -@Tags('DIDComm - Proofs') -@Route('/didcomm/proofs') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class ProofController extends Controller { - /** - * Retrieve all proof records - * - * @param threadId - * @returns ProofRecord[] - */ - @Example([ProofRecordExample]) - @Get('/') - public async getAllProofs(@Request() request: Req, @Query('threadId') threadId?: string) { - try { - const query = threadId ? { threadId } : {} - const proofs = await request.agent.modules.proofs.findAllByQuery(query) +// @Tags('DIDComm - Proofs') +// @Route('/didcomm/proofs') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class ProofController extends Controller { +// /** +// * Retrieve all proof records +// * +// * @param threadId +// * @returns ProofRecord[] +// */ +// @Example([ProofRecordExample]) +// @Get('/') +// public async getAllProofs(@Request() request: Req, @Query('threadId') threadId?: string) { +// try { +// const query = threadId ? { threadId } : {} +// const proofs = await request.agent.modules.proofs.findAllByQuery(query) - return proofs.map((proof) => proof.toJSON()) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return proofs.map((proof) => proof.toJSON()) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Retrieve proof record by proof record id - * - * @param proofRecordId - * @returns ProofRecord - */ - @Get('/:proofRecordId') - @Example(ProofRecordExample) - public async getProofById(@Request() request: Req, @Path('proofRecordId') proofRecordId: RecordId) { - try { - const proof = await request.agent.modules.proofs.getById(proofRecordId) +// /** +// * Retrieve proof record by proof record id +// * +// * @param proofRecordId +// * @returns ProofRecord +// */ +// @Get('/:proofRecordId') +// @Example(ProofRecordExample) +// public async getProofById(@Request() request: Req, @Path('proofRecordId') proofRecordId: RecordId) { +// try { +// const proof = await request.agent.modules.proofs.getById(proofRecordId) - return proof.toJSON() - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return proof.toJSON() +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Initiate a new presentation exchange as prover by sending a presentation proposal request - * to the connection with the specified connection id. - * - * @param proposal - * @returns ProofRecord - */ - @Post('/propose-proof') - @Example(ProofRecordExample) - public async proposeProof(@Request() request: Req, @Body() requestProofProposalOptions: RequestProofProposalOptions) { - try { - const proof = await request.agent.modules.proofs.proposeProof({ - connectionId: requestProofProposalOptions.connectionId, - protocolVersion: 'v1' as ProofsProtocolVersionType<[]>, - proofFormats: requestProofProposalOptions.proofFormats, - comment: requestProofProposalOptions.comment, - autoAcceptProof: requestProofProposalOptions.autoAcceptProof, - goalCode: requestProofProposalOptions.goalCode, - parentThreadId: requestProofProposalOptions.parentThreadId, - }) +// /** +// * Initiate a new presentation exchange as prover by sending a presentation proposal request +// * to the connection with the specified connection id. +// * +// * @param proposal +// * @returns ProofRecord +// */ +// @Post('/propose-proof') +// @Example(ProofRecordExample) +// public async proposeProof(@Request() request: Req, @Body() requestProofProposalOptions: RequestProofProposalOptions) { +// try { +// const proof = await request.agent.modules.proofs.proposeProof({ +// connectionId: requestProofProposalOptions.connectionId, +// protocolVersion: 'v1' as ProofsProtocolVersionType<[]>, +// proofFormats: requestProofProposalOptions.proofFormats, +// comment: requestProofProposalOptions.comment, +// autoAcceptProof: requestProofProposalOptions.autoAcceptProof, +// goalCode: requestProofProposalOptions.goalCode, +// parentThreadId: requestProofProposalOptions.parentThreadId, +// }) - return proof - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return proof +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a presentation proposal as verifier by sending an accept proposal message - * to the connection associated with the proof record. - * - * @param proofRecordId - * @param proposal - * @returns ProofRecord - */ - @Post('/:proofRecordId/accept-proposal') - @Example(ProofRecordExample) - public async acceptProposal(@Request() request: Req, @Body() acceptProposal: AcceptProofProposal) { - try { - const proof = await request.agent.modules.proofs.acceptProposal(acceptProposal) +// /** +// * Accept a presentation proposal as verifier by sending an accept proposal message +// * to the connection associated with the proof record. +// * +// * @param proofRecordId +// * @param proposal +// * @returns ProofRecord +// */ +// @Post('/:proofRecordId/accept-proposal') +// @Example(ProofRecordExample) +// public async acceptProposal(@Request() request: Req, @Body() acceptProposal: AcceptProofProposal) { +// try { +// const proof = await request.agent.modules.proofs.acceptProposal(acceptProposal) - return proof - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return proof +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Creates a presentation request bound to existing connection - */ - @Post('/request-proof') - @Example(ProofRecordExample) - public async requestProof(@Request() request: Req, @Body() requestProofOptions: RequestProofOptions) { - try { - const requestProofPayload = { - connectionId: requestProofOptions.connectionId, - protocolVersion: requestProofOptions.protocolVersion as ProofsProtocolVersionType<[]>, - comment: requestProofOptions.comment, - proofFormats: requestProofOptions.proofFormats, - autoAcceptProof: requestProofOptions.autoAcceptProof, - goalCode: requestProofOptions.goalCode, - parentThreadId: requestProofOptions.parentThreadId, - willConfirm: requestProofOptions.willConfirm, - } - const proof = await request.agent.modules.proofs.requestProof(requestProofPayload) +// /** +// * Creates a presentation request bound to existing connection +// */ +// @Post('/request-proof') +// @Example(ProofRecordExample) +// public async requestProof(@Request() request: Req, @Body() requestProofOptions: RequestProofOptions) { +// try { +// const requestProofPayload = { +// connectionId: requestProofOptions.connectionId, +// protocolVersion: requestProofOptions.protocolVersion as ProofsProtocolVersionType<[]>, +// comment: requestProofOptions.comment, +// proofFormats: requestProofOptions.proofFormats, +// autoAcceptProof: requestProofOptions.autoAcceptProof, +// goalCode: requestProofOptions.goalCode, +// parentThreadId: requestProofOptions.parentThreadId, +// willConfirm: requestProofOptions.willConfirm, +// } +// const proof = await request.agent.modules.proofs.requestProof(requestProofPayload) - return proof - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return proof +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Creates a presentation request not bound to any proposal or existing connection - */ - @Post('create-request-oob') - @Example(ProofRecordExample) - public async createRequest(@Request() request: Req, @Body() createRequestOptions: CreateProofRequestOobOptions) { - try { - let routing: Routing - let invitationDid: string | undefined +// /** +// * Creates a presentation request not bound to any proposal or existing connection +// */ +// @Post('create-request-oob') +// @Example(ProofRecordExample) +// public async createRequest(@Request() request: Req, @Body() createRequestOptions: CreateProofRequestOobOptions) { +// try { +// let routing: Routing +// let invitationDid: string | undefined - if (createRequestOptions?.invitationDid) { - invitationDid = createRequestOptions?.invitationDid - } else { - routing = await request.agent.modules.mediationRecipient.getRouting({}) - const didDocument = createPeerDidDocumentFromServices([ - { - id: 'didcomm', - recipientKeys: [routing.recipientKey], - routingKeys: routing.routingKeys, - serviceEndpoint: routing.endpoints[0], - }, - ]) - const did = await request.agent.dids.create({ - didDocument, - method: 'peer', - options: { - numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, - }, - }) - invitationDid = did.didState.did - } +// if (createRequestOptions?.invitationDid) { +// invitationDid = createRequestOptions?.invitationDid +// } else { +// routing = await request.agent.modules.mediationRecipient.getRouting({}) +// const didDocument = createPeerDidDocumentFromServices([ +// { +// id: 'didcomm', +// recipientKeys: [routing.recipientKey], +// routingKeys: routing.routingKeys, +// serviceEndpoint: routing.endpoints[0], +// }, +// ]) +// const did = await request.agent.dids.create({ +// didDocument, +// method: 'peer', +// options: { +// numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc, +// }, +// }) +// invitationDid = did.didState.did +// } - const proof = await request.agent.modules.proofs.createRequest({ - protocolVersion: createRequestOptions.protocolVersion as ProofsProtocolVersionType<[]>, - proofFormats: createRequestOptions.proofFormats, - goalCode: createRequestOptions.goalCode, - willConfirm: createRequestOptions.willConfirm, - parentThreadId: createRequestOptions.parentThreadId, - autoAcceptProof: createRequestOptions.autoAcceptProof, - comment: createRequestOptions.comment, - }) - const proofMessage = proof.message - const outOfBandRecord = await request.agent.modules.oob.createInvitation({ - label: createRequestOptions.label, - messages: [proofMessage], - autoAcceptConnection: true, - imageUrl: createRequestOptions?.imageUrl, - goalCode: createRequestOptions?.goalCode, - invitationDid, - }) +// const proof = await request.agent.modules.proofs.createRequest({ +// protocolVersion: createRequestOptions.protocolVersion as ProofsProtocolVersionType<[]>, +// proofFormats: createRequestOptions.proofFormats, +// goalCode: createRequestOptions.goalCode, +// willConfirm: createRequestOptions.willConfirm, +// parentThreadId: createRequestOptions.parentThreadId, +// autoAcceptProof: createRequestOptions.autoAcceptProof, +// comment: createRequestOptions.comment, +// }) +// const proofMessage = proof.message +// const outOfBandRecord = await request.agent.modules.oob.createInvitation({ +// label: createRequestOptions.label, +// messages: [proofMessage], +// autoAcceptConnection: true, +// imageUrl: createRequestOptions?.imageUrl, +// goalCode: createRequestOptions?.goalCode, +// invitationDid, +// }) - return { - invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ - domain: request.agent.modules.didcomm.config.endpoints[0], - }), - invitation: outOfBandRecord.outOfBandInvitation.toJSON({ - useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, - }), - outOfBandRecord: outOfBandRecord.toJSON(), - invitationDid: createRequestOptions?.invitationDid ? '' : invitationDid, - proofRecordThId: proof.proofRecord.threadId, - proofMessageId: proof.message.thread?.threadId || proof.message.threadId || proof.message.id, - } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return { +// invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ +// domain: request.agent.modules.didcomm.config.endpoints[0], +// }), +// invitation: outOfBandRecord.outOfBandInvitation.toJSON({ +// useDidSovPrefixWhereAllowed: request.agent.modules.didcomm.config.useDidSovPrefixWhereAllowed, +// }), +// outOfBandRecord: outOfBandRecord.toJSON(), +// invitationDid: createRequestOptions?.invitationDid ? '' : invitationDid, +// proofRecordThId: proof.proofRecord.threadId, +// proofMessageId: proof.message.thread?.threadId || proof.message.threadId || proof.message.id, +// } +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a presentation request as prover by sending an accept request message - * to the connection associated with the proof record. - * - * @param proofRecordId - * @param request - * @returns ProofRecord - */ - @Post('/:proofRecordId/accept-request') - @Example(ProofRecordExample) - public async acceptRequest( - @Request() request: Req, - @Path('proofRecordId') proofRecordId: string, - @Body() - body: { - filterByPresentationPreview?: boolean - filterByNonRevocationRequirements?: boolean - comment?: string - }, - ) { - try { - const requestedCredentials = await request.agent.modules.proofs.selectCredentialsForRequest({ - proofRecordId, - }) +// /** +// * Accept a presentation request as prover by sending an accept request message +// * to the connection associated with the proof record. +// * +// * @param proofRecordId +// * @param request +// * @returns ProofRecord +// */ +// @Post('/:proofRecordId/accept-request') +// @Example(ProofRecordExample) +// public async acceptRequest( +// @Request() request: Req, +// @Path('proofRecordId') proofRecordId: string, +// @Body() +// body: { +// filterByPresentationPreview?: boolean +// filterByNonRevocationRequirements?: boolean +// comment?: string +// }, +// ) { +// try { +// const requestedCredentials = await request.agent.modules.proofs.selectCredentialsForRequest({ +// proofRecordId, +// }) - const acceptProofRequest: AcceptProofRequestOptions = { - proofRecordId, - comment: body.comment, - proofFormats: requestedCredentials.proofFormats, - } +// const acceptProofRequest: AcceptProofRequestOptions = { +// proofRecordId, +// comment: body.comment, +// proofFormats: requestedCredentials.proofFormats, +// } - const proof = await request.agent.modules.proofs.acceptRequest(acceptProofRequest) +// const proof = await request.agent.modules.proofs.acceptRequest(acceptProofRequest) - return proof.toJSON() - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// return proof.toJSON() +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Accept a presentation as prover by sending an accept presentation message - * to the connection associated with the proof record. - * - * @param proofRecordId - * @returns ProofRecord - */ - @Post('/:proofRecordId/accept-presentation') - @Example(ProofRecordExample) - public async acceptPresentation(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { - try { - const proof = await request.agent.modules.proofs.acceptPresentation({ proofRecordId }) - return proof - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Accept a presentation as prover by sending an accept presentation message +// * to the connection associated with the proof record. +// * +// * @param proofRecordId +// * @returns ProofRecord +// */ +// @Post('/:proofRecordId/accept-presentation') +// @Example(ProofRecordExample) +// public async acceptPresentation(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { +// try { +// const proof = await request.agent.modules.proofs.acceptPresentation({ proofRecordId }) +// return proof +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Return proofRecord - * - * @param proofRecordId - * @returns ProofRecord - */ - @Get('/:proofRecordId/form-data') - @Example(ProofRecordExample) - // TODO: Add return type - public async proofFormData(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { - try { - const proof = await request.agent.modules.proofs.getFormatData(proofRecordId) - return proof - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// /** +// * Return proofRecord +// * +// * @param proofRecordId +// * @returns ProofRecord +// */ +// @Get('/:proofRecordId/form-data') +// @Example(ProofRecordExample) +// // TODO: Add return type +// public async proofFormData(@Request() request: Req, @Path('proofRecordId') proofRecordId: string) { +// try { +// const proof = await request.agent.modules.proofs.getFormatData(proofRecordId) +// return proof +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/openid4vc/holder/holder.Controller.ts b/src/controllers/openid4vc/holder/holder.Controller.ts index c071da3a..30f92ad1 100644 --- a/src/controllers/openid4vc/holder/holder.Controller.ts +++ b/src/controllers/openid4vc/holder/holder.Controller.ts @@ -1,97 +1,97 @@ -import { Request as Req } from 'express' -import { Body, Controller, Get, Post, Route, Security, Tags, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { Request as Req } from 'express' +// import { Body, Controller, Get, Post, Route, Security, Tags, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { SCOPES } from '../../../enums/enum' -import { - AuthorizeRequestCredentialOffer, - RequestCredentialBody, - ResolveCredentialOfferBody, - ResolveProofRequest, -} from '../types/holder.types' +// import { SCOPES } from '../../../enums/enum' +// import { +// AuthorizeRequestCredentialOffer, +// RequestCredentialBody, +// ResolveCredentialOfferBody, +// ResolveProofRequest, +// } from '../types/holder.types' -import { holderService } from './holder.service' +// import { holderService } from './holder.service' -@Tags('oid4vc holders') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@Route('openid4vc/holder') -@injectable() -export class HolderController extends Controller { - /** - * Get SdJwt type of credentials - */ - @Get('/sd-jwt-vcs') - public async getSdJwtCredentials(@Request() request: Req) { - return await holderService.getSdJwtCredentials(request) - } +// @Tags('oid4vc holders') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Route('openid4vc/holder') +// @injectable() +// export class HolderController extends Controller { +// /** +// * Get SdJwt type of credentials +// */ +// @Get('/sd-jwt-vcs') +// public async getSdJwtCredentials(@Request() request: Req) { +// return await holderService.getSdJwtCredentials(request) +// } - /** - * Fetch all mso mdoc credentials in wallet - */ - @Get('/mdoc-vcs') - public async getMdocCredentials(@Request() request: Req) { - return await holderService.getMdocCredentials(request) - } +// /** +// * Fetch all mso mdoc credentials in wallet +// */ +// @Get('/mdoc-vcs') +// public async getMdocCredentials(@Request() request: Req) { +// return await holderService.getMdocCredentials(request) +// } - /** - * Decode mso mdoc credential in wallet - */ - @Post('/mdoc-vcs/decode') - public async decodeMdocCredential( - @Request() request: Req, - @Body() - body: { - base64Url: string - }, - ) { - return await holderService.decodeMdocCredential(request, body) - } +// /** +// * Decode mso mdoc credential in wallet +// */ +// @Post('/mdoc-vcs/decode') +// public async decodeMdocCredential( +// @Request() request: Req, +// @Body() +// body: { +// base64Url: string +// }, +// ) { +// return await holderService.decodeMdocCredential(request, body) +// } - /** - * Resolve a credential offer - */ - @Post('resolve-credential-offer') - public async resolveCredOffer(@Request() request: Req, @Body() body: ResolveCredentialOfferBody) { - return await holderService.resolveCredentialOffer(request, body) - } +// /** +// * Resolve a credential offer +// */ +// @Post('resolve-credential-offer') +// public async resolveCredOffer(@Request() request: Req, @Body() body: ResolveCredentialOfferBody) { +// return await holderService.resolveCredentialOffer(request, body) +// } - // /** - // * Initiate an OID4VCI authorization request - // */ - @Post('authorization-request') - public async requestAuthorizationForCredential( - @Request() request: Req, - @Body() body: AuthorizeRequestCredentialOffer, - ) { - return await holderService.requestAuthorizationForCredential(request, body) - } +// // /** +// // * Initiate an OID4VCI authorization request +// // */ +// @Post('authorization-request') +// public async requestAuthorizationForCredential( +// @Request() request: Req, +// @Body() body: AuthorizeRequestCredentialOffer, +// ) { +// return await holderService.requestAuthorizationForCredential(request, body) +// } - /** - * Initiates a token request, then requests credentials from issuer - */ - @Post('request-credential') - public async requestCredential(@Request() request: Req, @Body() body: RequestCredentialBody) { - return await holderService.requestCredential(request, body) - } +// /** +// * Initiates a token request, then requests credentials from issuer +// */ +// @Post('request-credential') +// public async requestCredential(@Request() request: Req, @Body() body: RequestCredentialBody) { +// return await holderService.requestCredential(request, body) +// } - /** - * Resolve a proof request - */ - @Post('resolve-proof-request') - public async resolveProofRequest(@Request() request: Req, @Body() body: ResolveProofRequest) { - return await holderService.resolveProofRequest(request, body) - } +// /** +// * Resolve a proof request +// */ +// @Post('resolve-proof-request') +// public async resolveProofRequest(@Request() request: Req, @Body() body: ResolveProofRequest) { +// return await holderService.resolveProofRequest(request, body) +// } - /** - * Accept a proof request - */ - @Post('accept-proof-request') - public async acceptProofRequest(@Request() request: Req, @Body() body: ResolveProofRequest) { - return await holderService.acceptPresentationRequest(request, body) - } +// /** +// * Accept a proof request +// */ +// @Post('accept-proof-request') +// public async acceptProofRequest(@Request() request: Req, @Body() body: ResolveProofRequest) { +// return await holderService.acceptPresentationRequest(request, body) +// } - @Post('decode-sdjwt') - public async decodeSdJwt(@Request() request: Req, @Body() body: { jwt: string }) { - return await holderService.decodeSdJwt(request, body) - } -} \ No newline at end of file +// @Post('decode-sdjwt') +// public async decodeSdJwt(@Request() request: Req, @Body() body: { jwt: string }) { +// return await holderService.decodeSdJwt(request, body) +// } +// } \ No newline at end of file diff --git a/src/controllers/openid4vc/holder/holder.service.ts b/src/controllers/openid4vc/holder/holder.service.ts index 1d7be42c..bb2adbc5 100644 --- a/src/controllers/openid4vc/holder/holder.service.ts +++ b/src/controllers/openid4vc/holder/holder.service.ts @@ -1,279 +1,280 @@ -import type { - AuthorizeRequestCredentialOffer, - RequestCredentialBody, - ResolveCredentialOfferBody, - ResolveProofRequest, -} from '../types/holder.types' -import type { Agent, DcqlCredentialsForRequest, DcqlQueryResult } from '@credo-ts/core' -import type { - OpenId4VcAuthorizationCodeTokenRequestOptions, - OpenId4VciPreAuthorizedTokenRequestOptions, - OpenId4VciResolvedCredentialOffer, - OpenId4VciTokenRequestOptions, -} from '@credo-ts/openid4vc' +// import type { +// AuthorizeRequestCredentialOffer, +// RequestCredentialBody, +// ResolveCredentialOfferBody, +// ResolveProofRequest, +// } from '../types/holder.types' +// import type { Agent, DcqlCredentialsForRequest, DcqlQueryResult } from '@credo-ts/core' +// import type { +// OpenId4VcAuthorizationCodeTokenRequestOptions, +// OpenId4VciPreAuthorizedTokenRequestOptions, +// OpenId4VciResolvedCredentialOffer, +// OpenId4VciTokenRequestOptions, +// } from '@credo-ts/openid4vc' -import { - DifPresentationExchangeService, - DidKey, - DidJwk, - getJwkFromKey, - Mdoc, - W3cJsonLdVerifiableCredential, - W3cJwtVerifiableCredential, -} from '@credo-ts/core' -import { - OpenId4VciAuthorizationFlow, - authorizationCodeGrantIdentifier, - preAuthorizedCodeGrantIdentifier, -} from '@credo-ts/openid4vc' -import { Request as Req } from 'express' -export class HolderService { - private HOLDER_REDIRECT = process.env.HOLDER_REDIRECT ?? 'http://localhost:4001/redirect' - private HOLDER_CLIENT_ID = process.env.HOLDER_CLIENT_ID ?? 'wallet' +// import { +// DifPresentationExchangeService, +// DidKey, +// DidJwk, +// // getJwkFromKey, +// Mdoc, +// W3cJsonLdVerifiableCredential, +// W3cJwtVerifiableCredential, +// } from '@credo-ts/core' +// import { +// OpenId4VciAuthorizationFlow, +// authorizationCodeGrantIdentifier, +// preAuthorizedCodeGrantIdentifier, +// } from '@credo-ts/openid4vc' +// import { Request as Req } from 'express' +// export class HolderService { +// private HOLDER_REDIRECT = process.env.HOLDER_REDIRECT ?? 'http://localhost:4001/redirect' +// private HOLDER_CLIENT_ID = process.env.HOLDER_CLIENT_ID ?? 'wallet' - public async getSdJwtCredentials(agentReq: Req) { - return await agentReq.agent.sdJwtVc.getAll() - } +// public async getSdJwtCredentials(agentReq: Req) { +// return await agentReq.agent.sdJwtVc.getAll() +// } - public async getMdocCredentials(agentReq: Req) { - return await agentReq.agent.mdoc.getAll() - } +// public async getMdocCredentials(agentReq: Req) { +// return await agentReq.agent.mdoc.getAll() +// } - public async decodeMdocCredential( - agentReq: Req, - options: { - base64Url: string - }, - ) { - const credential = Mdoc.fromBase64Url(options.base64Url) - return { - namespace: credential.issuerSignedNamespaces, - docType: credential.docType, - validityInfo: credential.validityInfo, - issuerSignedCertificateChain: credential.issuerSignedCertificateChain, - } as any - } +// public async decodeMdocCredential( +// agentReq: Req, +// options: { +// base64Url: string +// }, +// ) { +// const credential = Mdoc.fromBase64Url(options.base64Url) +// return { +// namespace: credential.issuerSignedNamespaces, +// docType: credential.docType, +// validityInfo: credential.validityInfo, +// issuerSignedCertificateChain: credential.issuerSignedCertificateChain, +// } as any +// } - public async resolveCredentialOffer(agentReq: Req, body: ResolveCredentialOfferBody) { - return (await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri)) as any - } +// public async resolveCredentialOffer(agentReq: Req, body: ResolveCredentialOfferBody) { +// return (await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer(body.credentialOfferUri)) as any +// } - public async requestAuthorizationForCredential(agentReq: Req, body: AuthorizeRequestCredentialOffer) { - console.log('Requesting authorization for credential offer:', body) - const resolvedCredentialOffer = await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer( - body.credentialOfferUri, - ) - console.log('Resolved credential offer:', resolvedCredentialOffer) - const resolvedAuthorization = await this.initiateAuthorization( - agentReq, - resolvedCredentialOffer, - body.credentialsToRequest, - ) +// public async requestAuthorizationForCredential(agentReq: Req, body: AuthorizeRequestCredentialOffer) { +// console.log('Requesting authorization for credential offer:', body) +// const resolvedCredentialOffer = await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer( +// body.credentialOfferUri, +// ) +// console.log('Resolved credential offer:', resolvedCredentialOffer) +// const resolvedAuthorization = await this.initiateAuthorization( +// agentReq, +// resolvedCredentialOffer, +// body.credentialsToRequest, +// ) - let actionToTake = '' - let authorizationRequestUrl: string | undefined = undefined - let codeVerifier: string | undefined = undefined - console.log('Resolved authorization', resolvedAuthorization) +// let actionToTake = '' +// let authorizationRequestUrl: string | undefined = undefined +// let codeVerifier: string | undefined = undefined +// console.log('Resolved authorization', resolvedAuthorization) - switch (resolvedAuthorization.authorizationFlow) { - case 'Oauth2Redirect': - actionToTake = 'Open the authorizationRequestUrl in your browser.' - authorizationRequestUrl = resolvedAuthorization.authorizationRequestUrl - codeVerifier = resolvedAuthorization.codeVerifier - break - case 'PresentationDuringIssuance': - actionToTake = 'Presentation during issuance not supported yet' - break - case 'PreAuthorized': - if (resolvedCredentialOffer.credentialOfferPayload.grants?.[preAuthorizedCodeGrantIdentifier]?.tx_code) { - actionToTake = 'Ask for txcode from issuer and use it further' - } - break - } +// switch (resolvedAuthorization.authorizationFlow) { +// case 'Oauth2Redirect': +// actionToTake = 'Open the authorizationRequestUrl in your browser.' +// authorizationRequestUrl = resolvedAuthorization.authorizationRequestUrl +// codeVerifier = resolvedAuthorization.codeVerifier +// break +// case 'PresentationDuringIssuance': +// actionToTake = 'Presentation during issuance not supported yet' +// break +// case 'PreAuthorized': +// if (resolvedCredentialOffer.credentialOfferPayload.grants?.[preAuthorizedCodeGrantIdentifier]?.tx_code) { +// actionToTake = 'Ask for txcode from issuer and use it further' +// } +// break +// } - return { actionToTake, authorizationRequestUrl, codeVerifier } as any - } +// return { actionToTake, authorizationRequestUrl, codeVerifier } as any +// } - public async requestCredential(agentReq: Req, body: RequestCredentialBody) { - const resolvedCredentialOffer = await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer( - body.credentialOfferUri, - ) +// public async requestCredential(agentReq: Req, body: RequestCredentialBody) { +// const resolvedCredentialOffer = await agentReq.agent.modules.openId4VcHolderModule.resolveCredentialOffer( +// body.credentialOfferUri, +// ) - let options: OpenId4VciTokenRequestOptions - if (resolvedCredentialOffer.credentialOfferPayload.grants?.[preAuthorizedCodeGrantIdentifier]) { - options = { - resolvedCredentialOffer, - txCode: body.txCode, - code: body.authorizationCode, - } as OpenId4VciPreAuthorizedTokenRequestOptions - } else { - options = { - resolvedCredentialOffer, - code: body.authorizationCode, - clientId: this.HOLDER_CLIENT_ID, - codeVerifier: body.codeVerifier, - redirectUri: this.HOLDER_REDIRECT, - } as OpenId4VcAuthorizationCodeTokenRequestOptions - } +// let options: OpenId4VciTokenRequestOptions +// if (resolvedCredentialOffer.credentialOfferPayload.grants?.[preAuthorizedCodeGrantIdentifier]) { +// options = { +// resolvedCredentialOffer, +// txCode: body.txCode, +// code: body.authorizationCode, +// } as OpenId4VciPreAuthorizedTokenRequestOptions +// } else { +// options = { +// resolvedCredentialOffer, +// code: body.authorizationCode, +// clientId: this.HOLDER_CLIENT_ID, +// codeVerifier: body.codeVerifier, +// redirectUri: this.HOLDER_REDIRECT, +// } as OpenId4VcAuthorizationCodeTokenRequestOptions +// } - return (await this.requestAndStoreCredentials(agentReq, resolvedCredentialOffer, options)) as any - } +// // return (await this.requestAndStoreCredentials(agentReq, resolvedCredentialOffer, options)) as any +// return {} as any +// } - private async requestAndStoreCredentials( - agentReq: Req, - resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, - options: OpenId4VciTokenRequestOptions, - ) { - const tokenResponse = await agentReq.agent.modules.openId4VcHolderModule.requestToken({ ...options }) - const credentialResponse = await agentReq.agent.modules.openId4VcHolderModule.requestCredentials({ - ...options, - credentialConfigurationIds: resolvedCredentialOffer.credentialOfferPayload.credential_configuration_ids, - credentialBindingResolver: async ({ - keyTypes, - supportedDidMethods, - supportsAllDidMethods, - }: { - keyTypes: string[] - supportedDidMethods?: string[] - supportsAllDidMethods?: boolean - }) => { - const key = await agentReq.agent.wallet.createKey({ keyType: keyTypes[0] as any }) - if (supportsAllDidMethods || supportedDidMethods?.includes('did:key')) { - const didKey = new DidKey(key) - return { method: 'did', didUrl: `${didKey.did}#${didKey.key.fingerprint}` } - } - if (supportedDidMethods?.includes('did:jwk')) { - const didJwk = DidJwk.fromJwk(getJwkFromKey(key)) - return { method: 'did', didUrl: `${didJwk.did}#0` } - } - return { method: 'jwk', jwk: getJwkFromKey(key) } - }, - ...tokenResponse, - }) +// // private async requestAndStoreCredentials( +// // agentReq: Req, +// // resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, +// // options: OpenId4VciTokenRequestOptions, +// // ) { +// // const tokenResponse = await agentReq.agent.modules.openId4VcHolderModule.requestToken({ ...options }) +// // const credentialResponse = await agentReq.agent.modules.openId4VcHolderModule.requestCredentials({ +// // ...options, +// // credentialConfigurationIds: resolvedCredentialOffer.credentialOfferPayload.credential_configuration_ids, +// // credentialBindingResolver: async ({ +// // keyTypes, +// // supportedDidMethods, +// // supportsAllDidMethods, +// // }: { +// // keyTypes: string[] +// // supportedDidMethods?: string[] +// // supportsAllDidMethods?: boolean +// // }) => { +// // const key = await agentReq.agent.wallet.createKey({ keyType: keyTypes[0] as any }) +// // if (supportsAllDidMethods || supportedDidMethods?.includes('did:key')) { +// // const didKey = new DidKey(key) +// // return { method: 'did', didUrl: `${didKey.did}#${didKey.key.fingerprint}` } +// // } +// // if (supportedDidMethods?.includes('did:jwk')) { +// // const didJwk = DidJwk.fromJwk(getJwkFromKey(key)) +// // return { method: 'did', didUrl: `${didJwk.did}#0` } +// // } +// // return { method: 'jwk', jwk: getJwkFromKey(key) } +// // }, +// // ...tokenResponse, +// // }) - const storedCredentials = await Promise.all( - credentialResponse.credentials.map(async (response: any) => { - const credential = response.credentials[0] - if (credential instanceof W3cJwtVerifiableCredential || credential instanceof W3cJsonLdVerifiableCredential) { - return await agentReq.agent.w3cCredentials.storeCredential({ credential }) - } - if (credential instanceof Mdoc) { - return await agentReq.agent.mdoc.store(credential) - } - return await agentReq.agent.sdJwtVc.store(credential.compact) - }), - ) +// // const storedCredentials = await Promise.all( +// // credentialResponse.credentials.map(async (response: any) => { +// // const credential = response.credentials[0] +// // if (credential instanceof W3cJwtVerifiableCredential || credential instanceof W3cJsonLdVerifiableCredential) { +// // return await agentReq.agent.w3cCredentials.storeCredential({ credential }) +// // } +// // if (credential instanceof Mdoc) { +// // return await agentReq.agent.mdoc.store(credential) +// // } +// // return await agentReq.agent.sdJwtVc.store(credential.compact) +// // }), +// // ) - return storedCredentials as any - } +// // return storedCredentials as any +// // } - private async initiateAuthorization( - agentReq: Req, - resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, - credentialsToRequest: string[], - ) { - console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) - console.log('Credentials to request:', credentialsToRequest) +// private async initiateAuthorization( +// agentReq: Req, +// resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, +// credentialsToRequest: string[], +// ) { +// console.log('Initiating authorization with resolvedCredentialOffer:', resolvedCredentialOffer) +// console.log('Credentials to request:', credentialsToRequest) - const grants = resolvedCredentialOffer.credentialOfferPayload.grants - console.log('Grants:', grants) +// const grants = resolvedCredentialOffer.credentialOfferPayload.grants +// console.log('Grants:', grants) - // 👉 Handle Pre-Authorized Code Grant - if (grants?.[preAuthorizedCodeGrantIdentifier]) { - const preAuthorizedCode = grants[preAuthorizedCodeGrantIdentifier]['pre-authorized_code'] - return { - authorizationFlow: 'PreAuthorized' as const, - preAuthorizedCode, - } - } +// // 👉 Handle Pre-Authorized Code Grant +// if (grants?.[preAuthorizedCodeGrantIdentifier]) { +// const preAuthorizedCode = grants[preAuthorizedCodeGrantIdentifier]['pre-authorized_code'] +// return { +// authorizationFlow: 'PreAuthorized' as const, +// preAuthorizedCode, +// } +// } - // 👉 Handle Authorization Code Grant - if (grants?.[authorizationCodeGrantIdentifier]) { - console.log('Using authorization code grant flow') +// // 👉 Handle Authorization Code Grant +// if (grants?.[authorizationCodeGrantIdentifier]) { +// console.log('Using authorization code grant flow') - const scope = Object.entries(resolvedCredentialOffer.offeredCredentialConfigurations) - .map(([id, val]) => (credentialsToRequest.includes(id) ? val.scope : undefined)) - .filter((v): v is string => Boolean(v)) +// const scope = Object.entries(resolvedCredentialOffer.offeredCredentialConfigurations) +// .map(([id, val]) => (credentialsToRequest.includes(id) ? val.scope : undefined)) +// .filter((v): v is string => Boolean(v)) - const resolved = await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VciAuthorizationRequest( - resolvedCredentialOffer, - { - clientId: this.HOLDER_CLIENT_ID, - redirectUri: this.HOLDER_REDIRECT, - scope, - }, - ) +// const resolved = await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VciAuthorizationRequest( +// resolvedCredentialOffer, +// { +// clientId: this.HOLDER_CLIENT_ID, +// redirectUri: this.HOLDER_REDIRECT, +// scope, +// }, +// ) - // 👉 Support Presentation During Issuance flow - if (resolved.authorizationFlow === OpenId4VciAuthorizationFlow.PresentationDuringIssuance) { - return { - ...resolved, - authorizationFlow: 'PresentationDuringIssuance' as const, - } - } +// // 👉 Support Presentation During Issuance flow +// if (resolved.authorizationFlow === OpenId4VciAuthorizationFlow.PresentationDuringIssuance) { +// return { +// ...resolved, +// authorizationFlow: 'PresentationDuringIssuance' as const, +// } +// } - return { - ...resolved, - authorizationFlow: 'Oauth2Redirect' as const, - } as any - } +// return { +// ...resolved, +// authorizationFlow: 'Oauth2Redirect' as const, +// } as any +// } - // ❌ Unsupported grant - throw new Error('Unsupported grant type') - } +// // ❌ Unsupported grant +// throw new Error('Unsupported grant type') +// } - public async resolveProofRequest(agentReq: Req, body: ResolveProofRequest) { - return (await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( - body.proofRequestUri, - )) as any - } +// public async resolveProofRequest(agentReq: Req, body: ResolveProofRequest) { +// return (await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( +// body.proofRequestUri, +// )) as any +// } - public async acceptPresentationRequest(agentReq: Req, body: ResolveProofRequest) { - const resolved = await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( - body.proofRequestUri, - ) - console.log('Resolved proof request:', resolved) - // const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) +// public async acceptPresentationRequest(agentReq: Req, body: ResolveProofRequest) { +// const resolved = await agentReq.agent.modules.openId4VcHolderModule.resolveOpenId4VpAuthorizationRequest( +// body.proofRequestUri, +// ) +// console.log('Resolved proof request:', resolved) +// // const presentationExchangeService = agent.dependencyManager.resolve(DifPresentationExchangeService) - if (!resolved.dcql) throw new Error('Missing DCQL on request') - console.log('DCQL query result:', resolved.dcql.queryResult) - // - let dcqlCredentials - try { - dcqlCredentials = await agentReq.agent.modules.openId4VcHolderModule.selectCredentialsForDcqlRequest( - resolved.dcql.queryResult, - ) - console.log('Selected credentials for DCQL request:', dcqlCredentials) - } catch (error) { - console.error('Error selecting credentials for DCQL request:', error) - throw error - } - const submissionResult = await agentReq.agent.modules.openId4VcHolderModule.acceptOpenId4VpAuthorizationRequest({ - authorizationRequestPayload: resolved.authorizationRequestPayload, - dcql: { - credentials: dcqlCredentials as DcqlCredentialsForRequest, - }, - }) - console.log('Presentation submission result:', submissionResult) - return submissionResult.serverResponse - } +// if (!resolved.dcql) throw new Error('Missing DCQL on request') +// console.log('DCQL query result:', resolved.dcql.queryResult) +// // +// let dcqlCredentials +// try { +// dcqlCredentials = await agentReq.agent.modules.openId4VcHolderModule.selectCredentialsForDcqlRequest( +// resolved.dcql.queryResult, +// ) +// console.log('Selected credentials for DCQL request:', dcqlCredentials) +// } catch (error) { +// console.error('Error selecting credentials for DCQL request:', error) +// throw error +// } +// const submissionResult = await agentReq.agent.modules.openId4VcHolderModule.acceptOpenId4VpAuthorizationRequest({ +// authorizationRequestPayload: resolved.authorizationRequestPayload, +// dcql: { +// credentials: dcqlCredentials as DcqlCredentialsForRequest, +// }, +// }) +// console.log('Presentation submission result:', submissionResult) +// return submissionResult.serverResponse +// } - public async decodeSdJwt(agentReq: Req, body: { jwt: string }) { - const sdJwt = agentReq.agent.sdJwtVc.fromCompact(body.jwt) - return sdJwt as any - } +// public async decodeSdJwt(agentReq: Req, body: { jwt: string }) { +// const sdJwt = agentReq.agent.sdJwtVc.fromCompact(body.jwt) +// return sdJwt as any +// } - public async getSelectedCredentialsForRequest( - dcqlQueryResult: DcqlQueryResult, - selectedCredentials: { [credentialQueryId: string]: string }, - ) { - if (!dcqlQueryResult.canBeSatisfied) { - throw new Error( - 'Cannot select the credentials for the dcql query presentation if the request cannot be satisfied', - ) - } - // TODO: Implement logic to select credentials based on selectedCredentials - return {} as any // Placeholder return to avoid errors - } -} -export const holderService = new HolderService() +// public async getSelectedCredentialsForRequest( +// dcqlQueryResult: DcqlQueryResult, +// selectedCredentials: { [credentialQueryId: string]: string }, +// ) { +// if (!dcqlQueryResult.can_be_satisfied) { +// throw new Error( +// 'Cannot select the credentials for the dcql query presentation if the request cannot be satisfied', +// ) +// } +// // TODO: Implement logic to select credentials based on selectedCredentials +// return {} as any // Placeholder return to avoid errors +// } +// } +// export const holderService = new HolderService() diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts index 792e58b4..f49e3d0f 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts @@ -1,107 +1,107 @@ -import { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' -import { Request as Req } from 'express' -import { Body, Controller, Delete, Get, Path, Post, Put, Query, Request, Route, Tags, Security } from 'tsoa' -import { injectable } from 'tsyringe' +// import { OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' +// import { Request as Req } from 'express' +// import { Body, Controller, Delete, Get, Path, Post, Put, Query, Request, Route, Tags, Security } from 'tsoa' +// import { injectable } from 'tsyringe' -import { SCOPES } from '../../../enums' -// eslint-disable-next-line import/order -import ErrorHandlingService from '../../../errorHandlingService' +// import { SCOPES } from '../../../enums' +// // eslint-disable-next-line import/order +// import ErrorHandlingService from '../../../errorHandlingService' -// import { AgentWithRootOrTenant } from '../../types/agent' -import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' +// // import { AgentWithRootOrTenant } from '../../types/agent' +// import { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' -import { issuanceSessionService } from './issuance-sessions.service' +// import { issuanceSessionService } from './issuance-sessions.service' -/** - * Controller for managing OpenID4VC issuance sessions. - * Provides endpoints to create credential offers, retrieve issuance sessions, - * update session metadata, and delete sessions. - */ -@Tags('oid4vc issuance sessions') -@Route('/openid4vc/issuance-sessions') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class IssuanceSessionsController extends Controller { - /** - * Creates a credential offer with the specified credential configurations and authorization type. - */ - @Post('/create-credential-offer') - public async createCredentialOffer(@Request() request: Req, @Body() options: OpenId4VcIssuanceSessionsCreateOffer) { - try { - return await issuanceSessionService.createCredentialOffer(options, request) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Controller for managing OpenID4VC issuance sessions. +// * Provides endpoints to create credential offers, retrieve issuance sessions, +// * update session metadata, and delete sessions. +// */ +// @Tags('oid4vc issuance sessions') +// @Route('/openid4vc/issuance-sessions') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class IssuanceSessionsController extends Controller { +// /** +// * Creates a credential offer with the specified credential configurations and authorization type. +// */ +// @Post('/create-credential-offer') +// public async createCredentialOffer(@Request() request: Req, @Body() options: OpenId4VcIssuanceSessionsCreateOffer) { +// try { +// return await issuanceSessionService.createCredentialOffer(options, request) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Get issuance details by issuance SessionId - */ - @Get('/:issuanceSessionId') - public async getIssuanceSessionsById(@Request() request: Req, @Path('issuanceSessionId') issuanceSessionId: string) { - try { - return await issuanceSessionService.getIssuanceSessionsById(request, issuanceSessionId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Get issuance details by issuance SessionId +// */ +// @Get('/:issuanceSessionId') +// public async getIssuanceSessionsById(@Request() request: Req, @Path('issuanceSessionId') issuanceSessionId: string) { +// try { +// return await issuanceSessionService.getIssuanceSessionsById(request, issuanceSessionId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Fetch all issuance sessions by query - */ - @Get('/') - public async getIssuanceSessionsByQuery( - @Request() request: Req, - @Query() cNonce?: string, - @Query() publicIssuerId?: string, - @Query() preAuthorizedCode?: string, - @Query() state?: OpenId4VcIssuanceSessionState, - @Query() credentialOfferUri?: string, - @Query() authorizationCode?: string, - ) { - try { - return await issuanceSessionService.getIssuanceSessionsByQuery( - request, - cNonce, - publicIssuerId, - preAuthorizedCode, - state, - credentialOfferUri, - authorizationCode, - ) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Fetch all issuance sessions by query +// */ +// @Get('/') +// public async getIssuanceSessionsByQuery( +// @Request() request: Req, +// @Query() cNonce?: string, +// @Query() publicIssuerId?: string, +// @Query() preAuthorizedCode?: string, +// @Query() state?: OpenId4VcIssuanceSessionState, +// @Query() credentialOfferUri?: string, +// @Query() authorizationCode?: string, +// ) { +// try { +// return await issuanceSessionService.getIssuanceSessionsByQuery( +// request, +// cNonce, +// publicIssuerId, +// preAuthorizedCode, +// state, +// credentialOfferUri, +// authorizationCode, +// ) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Update issuance session metadata by session ID - */ - @Put('/:issuanceSessionId') - public async updateSessionById( - @Request() request: Req, - @Path('issuanceSessionId') issuanceSessionId: string, - @Body() metadata: Record, - ) { - try { - return await issuanceSessionService.updateSessionIssuanceMetadataById(request, issuanceSessionId, metadata) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Update issuance session metadata by session ID +// */ +// @Put('/:issuanceSessionId') +// public async updateSessionById( +// @Request() request: Req, +// @Path('issuanceSessionId') issuanceSessionId: string, +// @Body() metadata: Record, +// ) { +// try { +// return await issuanceSessionService.updateSessionIssuanceMetadataById(request, issuanceSessionId, metadata) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Delete issuance session by session ID - */ - @Delete('/:issuanceSessionId') - public async deleteIssuanceSessionById( - @Request() request: Req, - @Path('issuanceSessionId') issuanceSessionId: string, - ) { - try { - await issuanceSessionService.deleteById(request, issuanceSessionId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// /** +// * Delete issuance session by session ID +// */ +// @Delete('/:issuanceSessionId') +// public async deleteIssuanceSessionById( +// @Request() request: Req, +// @Path('issuanceSessionId') issuanceSessionId: string, +// ) { +// try { +// await issuanceSessionService.deleteById(request, issuanceSessionId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts index e45755a3..ffd2cf17 100644 --- a/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts +++ b/src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts @@ -1,138 +1,138 @@ -import type { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' -import type { Request as Req } from 'express' - -import { type OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' -import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository' - -import { SignerMethod } from '../../../enums/enum' -import { BadRequestError, NotFoundError } from '../../../errors/errors' - -class IssuanceSessionsService { - public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { - const { credentials, publicIssuerId } = options - - const issuer = await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) - - const mappedCredentials = credentials.map((cred) => { - const supported = issuer.credentialConfigurationsSupported[cred.credentialSupportedId] - if (!supported) { - throw new Error(`CredentialSupportedId '${cred.credentialSupportedId}' is not supported by issuer`) - } - if (supported.format !== cred.format) { - throw new Error( - `Format mismatch for '${cred.credentialSupportedId}': expected '${supported.format}', got '${cred.format}'`, - ) - } - - // must have signing options - if (!cred.signerOptions?.method) { - throw new BadRequestError( - `signerOptions must be provided and allowed methods are ${Object.values(SignerMethod).join(', ')}`, - ) - } - - if (cred.signerOptions.method == SignerMethod.Did && !cred.signerOptions.did) { - throw new BadRequestError( - `For ${cred.credentialSupportedId} : did must be present inside signerOptions if SignerMethod is 'did' `, - ) - } - - if (cred.signerOptions.method === SignerMethod.X5c && !cred.signerOptions.x5c) { - throw new BadRequestError( - `For ${cred.credentialSupportedId} : x5c must be present inside signerOptions if SignerMethod is 'x5c' `, - ) - } - - const currentVct = cred.payload && 'vct' in cred.payload ? cred.payload.vct : undefined - return { - ...cred, - payload: { - ...cred.payload, - vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), - }, - } - }) - - options.issuanceMetadata ||= {} - - options.issuanceMetadata.credentials = mappedCredentials - - const { credentialOffer, issuanceSession } = await agentReq.agent.modules.openId4VcIssuer.createCredentialOffer({ - issuerId: publicIssuerId, - issuanceMetadata: options.issuanceMetadata, - offeredCredentials: credentials.map((c) => c.credentialSupportedId), - preAuthorizedCodeFlowConfig: options.preAuthorizedCodeFlowConfig, - authorizationCodeFlowConfig: options.authorizationCodeFlowConfig, - }) - - return { credentialOffer, issuanceSession } - } - - public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { - return agentReq.agent.modules.openId4VcIssuer.getIssuanceSessionById(sessionId) - } - - public async getIssuanceSessionsByQuery( - agentReq: Req, - cNonce?: string, - publicIssuerId?: string, - preAuthorizedCode?: string, - state?: OpenId4VcIssuanceSessionState, - credentialOfferUri?: string, - authorizationCode?: string, - ) { - const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) - const issuanceSessions = await issuanceSessionRepository.findByQuery(agentReq.agent.context, { - cNonce, - issuerId: publicIssuerId, - preAuthorizedCode, - state, - credentialOfferUri, - authorizationCode, - }) - - return issuanceSessions - } - - /** - * update an existing issuance session metadata, useful for mobile edge - * agents that will scan QR codes to notify the system of their - * wallet user id - * - * @param issuerAgent - * @param sessionId - * @param metadata - * @returns the updated issuance session record - */ - public async updateSessionIssuanceMetadataById(agentReq: Req, sessionId: string, metadata: Record) { - const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) - - const record = await issuanceSessionRepository.findById(agentReq.agent.context, sessionId) - - if (!record) { - throw new NotFoundError(`Issuance session with id ${sessionId} not found`) - } - - record.issuanceMetadata = { - ...record.issuanceMetadata, - ...metadata, - } - - await issuanceSessionRepository.update(agentReq.agent.context, record) - - return record - } - - /** - * deletes ann issuance session by id - * - * @param sessionId - * @param issuerAgent - */ - public async deleteById(agentReq: Req, sessionId: string): Promise { - const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) - await issuanceSessionRepository.deleteById(agentReq.agent.context, sessionId) - } -} - -export const issuanceSessionService = new IssuanceSessionsService() +// import type { OpenId4VcIssuanceSessionsCreateOffer } from '../types/issuer.types' +// import type { Request as Req } from 'express' + +// import { type OpenId4VcIssuanceSessionState } from '@credo-ts/openid4vc' +// import { OpenId4VcIssuanceSessionRepository } from '@credo-ts/openid4vc' + +// import { SignerMethod } from '../../../enums/enum' +// import { BadRequestError, NotFoundError } from '../../../errors/errors' + +// class IssuanceSessionsService { +// public async createCredentialOffer(options: OpenId4VcIssuanceSessionsCreateOffer, agentReq: Req) { +// const { credentials, publicIssuerId } = options + +// const issuer = await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) + +// const mappedCredentials = credentials.map((cred) => { +// const supported = issuer.credentialConfigurationsSupported[cred.credentialSupportedId] +// if (!supported) { +// throw new Error(`CredentialSupportedId '${cred.credentialSupportedId}' is not supported by issuer`) +// } +// if (supported.format !== cred.format) { +// throw new Error( +// `Format mismatch for '${cred.credentialSupportedId}': expected '${supported.format}', got '${cred.format}'`, +// ) +// } + +// // must have signing options +// if (!cred.signerOptions?.method) { +// throw new BadRequestError( +// `signerOptions must be provided and allowed methods are ${Object.values(SignerMethod).join(', ')}`, +// ) +// } + +// if (cred.signerOptions.method == SignerMethod.Did && !cred.signerOptions.did) { +// throw new BadRequestError( +// `For ${cred.credentialSupportedId} : did must be present inside signerOptions if SignerMethod is 'did' `, +// ) +// } + +// if (cred.signerOptions.method === SignerMethod.X5c && !cred.signerOptions.x5c) { +// throw new BadRequestError( +// `For ${cred.credentialSupportedId} : x5c must be present inside signerOptions if SignerMethod is 'x5c' `, +// ) +// } + +// const currentVct = cred.payload && 'vct' in cred.payload ? cred.payload.vct : undefined +// return { +// ...cred, +// payload: { +// ...cred.payload, +// vct: currentVct ?? (typeof supported.vct === 'string' ? supported.vct : undefined), +// }, +// } +// }) + +// options.issuanceMetadata ||= {} + +// options.issuanceMetadata.credentials = mappedCredentials + +// const { credentialOffer, issuanceSession } = await agentReq.agent.modules.openId4VcIssuer.createCredentialOffer({ +// issuerId: publicIssuerId, +// issuanceMetadata: options.issuanceMetadata, +// offeredCredentials: credentials.map((c) => c.credentialSupportedId), +// preAuthorizedCodeFlowConfig: options.preAuthorizedCodeFlowConfig, +// authorizationCodeFlowConfig: options.authorizationCodeFlowConfig, +// }) + +// return { credentialOffer, issuanceSession } +// } + +// public async getIssuanceSessionsById(agentReq: Req, sessionId: string) { +// return agentReq.agent.modules.openId4VcIssuer.getIssuanceSessionById(sessionId) +// } + +// public async getIssuanceSessionsByQuery( +// agentReq: Req, +// cNonce?: string, +// publicIssuerId?: string, +// preAuthorizedCode?: string, +// state?: OpenId4VcIssuanceSessionState, +// credentialOfferUri?: string, +// authorizationCode?: string, +// ) { +// const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) +// const issuanceSessions = await issuanceSessionRepository.findByQuery(agentReq.agent.context, { +// cNonce, +// issuerId: publicIssuerId, +// preAuthorizedCode, +// state, +// credentialOfferUri, +// authorizationCode, +// }) + +// return issuanceSessions +// } + +// /** +// * update an existing issuance session metadata, useful for mobile edge +// * agents that will scan QR codes to notify the system of their +// * wallet user id +// * +// * @param issuerAgent +// * @param sessionId +// * @param metadata +// * @returns the updated issuance session record +// */ +// public async updateSessionIssuanceMetadataById(agentReq: Req, sessionId: string, metadata: Record) { +// const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) + +// const record = await issuanceSessionRepository.findById(agentReq.agent.context, sessionId) + +// if (!record) { +// throw new NotFoundError(`Issuance session with id ${sessionId} not found`) +// } + +// record.issuanceMetadata = { +// ...record.issuanceMetadata, +// ...metadata, +// } + +// await issuanceSessionRepository.update(agentReq.agent.context, record) + +// return record +// } + +// /** +// * deletes ann issuance session by id +// * +// * @param sessionId +// * @param issuerAgent +// */ +// public async deleteById(agentReq: Req, sessionId: string): Promise { +// const issuanceSessionRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuanceSessionRepository) +// await issuanceSessionRepository.deleteById(agentReq.agent.context, sessionId) +// } +// } + +// export const issuanceSessionService = new IssuanceSessionsService() diff --git a/src/controllers/openid4vc/issuers/issuer.Controller.ts b/src/controllers/openid4vc/issuers/issuer.Controller.ts index cfd49d6b..149ed0b8 100644 --- a/src/controllers/openid4vc/issuers/issuer.Controller.ts +++ b/src/controllers/openid4vc/issuers/issuer.Controller.ts @@ -1,108 +1,108 @@ -import { - Controller, - Delete, - Get, - Post, - Put, - Route, - Tags, - Path, - Query, - Body, - Security, - Request, - Example -} from 'tsoa' -import { injectable } from 'tsyringe' +// import { +// Controller, +// Delete, +// Get, +// Post, +// Put, +// Route, +// Tags, +// Path, +// Query, +// Body, +// Security, +// Request, +// Example +// } from 'tsoa' +// import { injectable } from 'tsyringe' -import ErrorHandlingService from '../../../errorHandlingService' -import { CreateIssuerOptions, UpdateIssuerRecordOptions } from '../types/issuer.types' -import { Request as Req } from 'express' +// import ErrorHandlingService from '../../../errorHandlingService' +// import { CreateIssuerOptions, UpdateIssuerRecordOptions } from '../types/issuer.types' +// import { Request as Req } from 'express' -import { issuerService } from './issuer.service' -import { SCOPES } from '../../../enums' -import { OpenId4VcUpdateIssuerRecordOptionsExample } from '../examples/issuer.examples' -@Route('/openid4vc/issuer') -@Tags('oid4vc issuers') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class IssuerController extends Controller { - /** - * Creates an issuer with issuer metadata. - */ - @Post() - @Example( - OpenId4VcUpdateIssuerRecordOptionsExample.withScope.value - ) - public async createIssuer(@Request() request: Req, @Body() createIssuerOptions: CreateIssuerOptions) { - try { - return await issuerService.createIssuerAgent(request, createIssuerOptions) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// import { issuerService } from './issuer.service' +// import { SCOPES } from '../../../enums' +// import { OpenId4VcUpdateIssuerRecordOptionsExample } from '../examples/issuer.examples' +// @Route('/openid4vc/issuer') +// @Tags('oid4vc issuers') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class IssuerController extends Controller { +// /** +// * Creates an issuer with issuer metadata. +// */ +// @Post() +// @Example( +// OpenId4VcUpdateIssuerRecordOptionsExample.withScope.value +// ) +// public async createIssuer(@Request() request: Req, @Body() createIssuerOptions: CreateIssuerOptions) { +// try { +// return await issuerService.createIssuerAgent(request, createIssuerOptions) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Updates issuer metadata for a given publicIssuerId. - */ - @Put('{publicIssuerId}') - public async updateIssuerMetadata( - @Request() request: Req, - @Path() publicIssuerId: string, - @Body() updateIssuerRecordOptions: UpdateIssuerRecordOptions, - ) { - try { - return await issuerService.updateIssuerMetadata(request, publicIssuerId, updateIssuerRecordOptions) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Updates issuer metadata for a given publicIssuerId. +// */ +// @Put('{publicIssuerId}') +// public async updateIssuerMetadata( +// @Request() request: Req, +// @Path() publicIssuerId: string, +// @Body() updateIssuerRecordOptions: UpdateIssuerRecordOptions, +// ) { +// try { +// return await issuerService.updateIssuerMetadata(request, publicIssuerId, updateIssuerRecordOptions) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Returns metadata for a specific issuer. - */ - @Get('{issuerId}/metadata') - public async getIssuerAgentMetaData(@Request() request: Req, @Path() issuerId: string) { - try { - return await issuerService.getIssuerAgentMetaData(request, issuerId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Returns metadata for a specific issuer. +// */ +// @Get('{issuerId}/metadata') +// public async getIssuerAgentMetaData(@Request() request: Req, @Path() issuerId: string) { +// try { +// return await issuerService.getIssuerAgentMetaData(request, issuerId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Query issuers by optional publicIssuerId. - */ - @Get() - public async getIssuersByQuery(@Request() request: Req, @Query() publicIssuerId?: string) { - try { - return await issuerService.getIssuersByQuery(request, publicIssuerId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Query issuers by optional publicIssuerId. +// */ +// @Get() +// public async getIssuersByQuery(@Request() request: Req, @Query() publicIssuerId?: string) { +// try { +// return await issuerService.getIssuersByQuery(request, publicIssuerId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Returns a specific issuer by publicIssuerId. - */ - @Get('{publicIssuerId}') - public async getIssuer(@Request() request: Req, @Path() publicIssuerId: string) { - try { - return await issuerService.getIssuer(request, publicIssuerId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Returns a specific issuer by publicIssuerId. +// */ +// @Get('{publicIssuerId}') +// public async getIssuer(@Request() request: Req, @Path() publicIssuerId: string) { +// try { +// return await issuerService.getIssuer(request, publicIssuerId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Deletes a specific issuer by record id. - */ - @Delete('{id}') - public async deleteIssuer(@Request() request: Req, @Path() id: string): Promise { - try { - await issuerService.deleteIssuer(request, id) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// /** +// * Deletes a specific issuer by record id. +// */ +// @Delete('{id}') +// public async deleteIssuer(@Request() request: Req, @Path() id: string): Promise { +// try { +// await issuerService.deleteIssuer(request, id) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/openid4vc/issuers/issuer.service.ts b/src/controllers/openid4vc/issuers/issuer.service.ts index aff9f7fb..f1552097 100644 --- a/src/controllers/openid4vc/issuers/issuer.service.ts +++ b/src/controllers/openid4vc/issuers/issuer.service.ts @@ -1,57 +1,57 @@ -import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' -import type { Agent } from '@credo-ts/core' -import { Request as Req } from 'express' - -import { OpenId4VcIssuerRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository' - -export class IssuerService { - public async createIssuerAgent( - agentReq: Req, - createIssuerOptions: any, //TODO: Replace with OpenId4VciCreateIssuerOptions, - ) { - const issuerRecord = await agentReq.agent.modules.openId4VcIssuer.createIssuer(createIssuerOptions) - const issuerMetadata = await agentReq.agent.modules.openId4VcIssuer.getIssuerMetadata(issuerRecord.issuerId) - // eslint-disable-next-line no-console - console.log(`\nIssuer URL: ${issuerMetadata.credentialIssuer.credential_issuer}`) - return issuerRecord - } - - public async updateIssuerMetadata( - agentReq: Req, - publicIssuerId: string, - updateIssuerRecordOptions: any, // TODO: Replace with OpenId4VcUpdateIssuerRecordOptions - ) { - await agentReq.agent.modules.openId4VcIssuer.updateIssuerMetadata({ - issuerId: publicIssuerId, - ...updateIssuerRecordOptions, - }) - return await this.getIssuer(agentReq, publicIssuerId) - } - - public async getIssuersByQuery( - agentReq: Req, - publicIssuerId?: string, - ) { - const repository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) - return await repository.findByQuery(agentReq.agent.context, { issuerId: publicIssuerId }) - } - - public async getIssuer(agentReq:Req , publicIssuerId: string) { - return await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) - } - - public async deleteIssuer(agentReq: Req, issuerId: string) { - const repository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) - await repository.deleteById(agentReq.agent.context, issuerId) - } - - public async getIssuerAgentMetaData( - agentReq: Req, - issuerId: string, - ) { - // return await agent.modules.openId4VcIssuer.getIssuerMetadata(issuerId) - return 0 - } -} - -export const issuerService = new IssuerService() +// import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' +// import type { Agent } from '@credo-ts/core' +// // import { OpenId4VcIssuerRepository } from '@credo-ts/openid4vc/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs' +// import { Request as Req } from 'express' + + +// export class IssuerService { +// public async createIssuerAgent( +// agentReq: Req, +// createIssuerOptions: any, //TODO: Replace with OpenId4VciCreateIssuerOptions, +// ) { +// const issuerRecord = await agentReq.agent.modules.openId4VcIssuer.createIssuer(createIssuerOptions) +// const issuerMetadata = await agentReq.agent.modules.openId4VcIssuer.getIssuerMetadata(issuerRecord.issuerId) +// // eslint-disable-next-line no-console +// console.log(`\nIssuer URL: ${issuerMetadata.credentialIssuer.credential_issuer}`) +// return issuerRecord +// } + +// public async updateIssuerMetadata( +// agentReq: Req, +// publicIssuerId: string, +// updateIssuerRecordOptions: any, // TODO: Replace with OpenId4VcUpdateIssuerRecordOptions +// ) { +// await agentReq.agent.modules.openId4VcIssuer.updateIssuerMetadata({ +// issuerId: publicIssuerId, +// ...updateIssuerRecordOptions, +// }) +// return await this.getIssuer(agentReq, publicIssuerId) +// } + +// public async getIssuersByQuery( +// agentReq: Req, +// publicIssuerId?: string, +// ) { +// const repository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) +// return await repository.findByQuery(agentReq.agent.context, { issuerId: publicIssuerId }) +// } + +// public async getIssuer(agentReq:Req , publicIssuerId: string) { +// return await agentReq.agent.modules.openId4VcIssuer.getIssuerByIssuerId(publicIssuerId) +// } + +// public async deleteIssuer(agentReq: Req, issuerId: string) { +// const repository = agentReq.agent.dependencyManager.resolve(OpenId4VcIssuerRepository) +// await repository.deleteById(agentReq.agent.context, issuerId) +// } + +// public async getIssuerAgentMetaData( +// agentReq: Req, +// issuerId: string, +// ) { +// // return await agent.modules.openId4VcIssuer.getIssuerMetadata(issuerId) +// return 0 +// } +// } + +// export const issuerService = new IssuerService() diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts index 20d47555..83dd01c6 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts @@ -1,87 +1,87 @@ -import { Agent } from '@credo-ts/core' -import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' -import { Controller, Get, Path, Query, Route, Request, Security, Tags, Post, Body } from 'tsoa' -import { injectable } from 'tsyringe' -import ErrorHandlingService from '../../../errorHandlingService' +// import { Agent } from '@credo-ts/core' +// import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' +// import { Controller, Get, Path, Query, Route, Request, Security, Tags, Post, Body } from 'tsoa' +// import { injectable } from 'tsyringe' +// import ErrorHandlingService from '../../../errorHandlingService' -import { verificationSessionService } from './verification-sessions.service' -import { SCOPES } from '../../../enums' -import { Request as Req } from 'express' -import { CreateAuthorizationRequest } from '../types/verifier.types' +// import { verificationSessionService } from './verification-sessions.service' +// import { SCOPES } from '../../../enums' +// import { Request as Req } from 'express' +// import { CreateAuthorizationRequest } from '../types/verifier.types' -@Tags('oid4vc verification sessions') -@Route('/openid4vc/verification-sessions') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@injectable() -export class VerificationSessionsController extends Controller { - /** - * Create an authorization request, acting as a Relying Party (RP) - */ - @Post('/create-presentation-request') - public async createProofRequest( - @Request() request: Req, - @Body() createAuthorizationRequest: CreateAuthorizationRequest, - ) { - try { - return await verificationSessionService.createProofRequest(request, createAuthorizationRequest) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// @Tags('oid4vc verification sessions') +// @Route('/openid4vc/verification-sessions') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @injectable() +// export class VerificationSessionsController extends Controller { +// /** +// * Create an authorization request, acting as a Relying Party (RP) +// */ +// @Post('/create-presentation-request') +// public async createProofRequest( +// @Request() request: Req, +// @Body() createAuthorizationRequest: CreateAuthorizationRequest, +// ) { +// try { +// return await verificationSessionService.createProofRequest(request, createAuthorizationRequest) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Retrieve all verification session records - */ - @Get('/') - public async getAllVerificationSessions( - @Request() request: Req, - @Query('publicVerifierId') publicVerifierId?: string, - @Query('payloadState') payloadState?: string, - @Query('state') state?: OpenId4VcVerificationSessionState, - @Query('authorizationRequestUri') authorizationRequestUri?: string, - @Query('nonce') nonce?: string, - ) { - try { - return await verificationSessionService.findVerificationSessionsByQuery( - request, - publicVerifierId, - payloadState, - state, - authorizationRequestUri, - nonce, - ) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// /** +// * Retrieve all verification session records +// */ +// @Get('/') +// public async getAllVerificationSessions( +// @Request() request: Req, +// @Query('publicVerifierId') publicVerifierId?: string, +// @Query('payloadState') payloadState?: string, +// @Query('state') state?: OpenId4VcVerificationSessionState, +// @Query('authorizationRequestUri') authorizationRequestUri?: string, +// @Query('nonce') nonce?: string, +// ) { +// try { +// return await verificationSessionService.findVerificationSessionsByQuery( +// request, +// publicVerifierId, +// payloadState, +// state, +// authorizationRequestUri, +// nonce, +// ) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Get verification session by ID - */ - @Get('/:verificationSessionId') - public async getVerificationSessionsById( - @Request() request: Req, - @Path('verificationSessionId') verificationSessionId: string, - ) { - try { - return await verificationSessionService.getVerificationSessionsById(request, verificationSessionId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } - // TODO: Uncomment when the method is implemented: There was a problem resolving type of 'IDTokenPayload'. - // /** - // * Get verification response by verification Session ID - // */ - @Get('/response/:verificationSessionId') - public async getVerifiedAuthorizationResponse( - @Request() request: Req, - @Path('verificationSessionId') verificationSessionId: string, - ) { - try { - return await verificationSessionService.getVerifiedAuthorizationResponse(request, verificationSessionId) - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// /** +// * Get verification session by ID +// */ +// @Get('/:verificationSessionId') +// public async getVerificationSessionsById( +// @Request() request: Req, +// @Path('verificationSessionId') verificationSessionId: string, +// ) { +// try { +// return await verificationSessionService.getVerificationSessionsById(request, verificationSessionId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// // TODO: Uncomment when the method is implemented: There was a problem resolving type of 'IDTokenPayload'. +// // /** +// // * Get verification response by verification Session ID +// // */ +// @Get('/response/:verificationSessionId') +// public async getVerifiedAuthorizationResponse( +// @Request() request: Req, +// @Path('verificationSessionId') verificationSessionId: string, +// ) { +// try { +// return await verificationSessionService.getVerifiedAuthorizationResponse(request, verificationSessionId) +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts index ffa49c0c..1a648246 100644 --- a/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts +++ b/src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts @@ -1,207 +1,209 @@ -import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' - -import { - Agent, - ClaimFormat, - DidKey, - JsonEncoder, - JsonTransformer, - Jwt, - MdocDeviceResponse, - RecordNotFoundError, - TypedArrayEncoder, - W3cJsonLdVerifiablePresentation, - W3cJwtVerifiablePresentation, - X509Service, -} from '@credo-ts/core' -import { OpenId4VcIssuerX5c, OpenId4VcJwtIssuerDid, OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' -import { injectable } from 'tsyringe' -import { Request as Req } from 'express' -import { SignerMethod } from '../../../enums' -import { CreateAuthorizationRequest, ResponseModeEnum } from '../types/verifier.types' - -// import { CreateAuthorizationRequest } from '../types/verifier.types' - -@injectable() -class VerificationSessionsService { - public async createProofRequest(agentReq: Req, dto: CreateAuthorizationRequest) { - try { - let requestSigner - if (dto.requestSigner.method === SignerMethod.Did) { - requestSigner = dto.requestSigner as OpenId4VcJwtIssuerDid - - const didToResolve = dto.requestSigner?.didUrl - if (!didToResolve) { - throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)') - } - - const didDocument = await agentReq.agent.dids.resolveDidDocument(didToResolve) - - let verifierDidUrl: string | undefined = undefined - if (didDocument.verificationMethod?.[0]?.id) { - verifierDidUrl = didDocument.verificationMethod[0].id - } - - if (!verifierDidUrl) { - throw new Error('No matching verification method found on verifier DID document') - } - - if (!requestSigner.didUrl || !String(requestSigner.didUrl).includes('#')) { - requestSigner.didUrl = verifierDidUrl - } - - requestSigner = { method: 'did', didUrl: verifierDidUrl } as any - } else { - requestSigner = dto.requestSigner as OpenId4VcIssuerX5c - - const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { - encodedCertificate: requestSigner.x5c[0], - }) - requestSigner.issuer = parsedCertificate.sanUriNames[0] - } - - if (!requestSigner) { - } else if (requestSigner.method === 'did') { - } - const options: any = { - requestSigner, - verifierId: dto.verifierId, - } - - if(dto.responseMode === ResponseModeEnum.DC_API || ResponseModeEnum.DC_API_JWT){ - options.expectedOrigins = dto.expectedOrigins - } - - if (dto.responseMode) options.responseMode = dto.responseMode - if (dto.presentationExchange) { - options.presentationExchange = dto.presentationExchange - } else if (dto.dcql) { - options.dcql = dto.dcql - } - - return (await agentReq.agent.modules.openId4VcVerifier.createAuthorizationRequest(options)) as any - } catch (error) { - throw error - } - } - - public async findVerificationSessionsByQuery( - agentReq: Req, - publicVerifierId?: string, - payloadState?: string, - state?: OpenId4VcVerificationSessionState, - authorizationRequestUri?: string, - nonce?: string, - ) { - return await agentReq.agent.modules.openId4VcVerifier.findVerificationSessionsByQuery({ - verifierId: publicVerifierId, - payloadState, - state, - authorizationRequestUri, - nonce, - }) - } - - public async getVerificationSessionsById(agentReq: Req, verificationSessionId: string) { - return await agentReq.agent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) - } - - public async getVerifiedAuthorizationResponse(request: Req, verificationSessionId: string) { - const verificationSession = - await request.agent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) - const verified = await request.agent.modules.openId4VcVerifier.getVerifiedAuthorizationResponse( - verificationSession.id, - ) - console.log(verified.presentationExchange?.presentations) - console.log(verified.dcql?.presentationResult) - - const presentations = await Promise.all( - (verified.presentationExchange?.presentations ?? Object.values(verified.dcql?.presentations ?? {})) - .flat() - .map(async (presentation) => { - if (presentation instanceof W3cJsonLdVerifiablePresentation) { - return { - pretty: presentation.toJson(), - encoded: presentation.toJson(), - } - } - - if (presentation instanceof W3cJwtVerifiablePresentation) { - return { - pretty: JsonTransformer.toJSON(presentation.presentation), - encoded: presentation.serializedJwt, - } - } - - if (presentation instanceof MdocDeviceResponse) { - return { - pretty: JsonTransformer.toJSON({ - documents: presentation.documents.map((doc) => ({ - doctype: doc.docType, - alg: doc.alg, - base64Url: doc.base64Url, - validityInfo: doc.validityInfo, - deviceSignedNamespaces: doc.deviceSignedNamespaces, - issuerSignedNamespaces: Object.entries(doc.issuerSignedNamespaces).map( - ([nameSpace, nameSpacEntries]) => [ - nameSpace, - Object.entries(nameSpacEntries).map(([key, value]) => - value instanceof Uint8Array - ? [`base64:${key}`, `data:image/jpeg;base64,${TypedArrayEncoder.toBase64(value)}`] - : [key, value], - ), - ], - ), - })), - }), - encoded: presentation.base64Url, - } - } - - // if ( - // presentation instanceof W3cV2JwtVerifiablePresentation || - // presentation instanceof W3cV2SdJwtVerifiablePresentation - // ) { - // throw new Error('W3C V2 presentations are not supported yet') - // } - - return { - pretty: { - ...presentation, - compact: undefined, - }, - encoded: presentation.compact, - } - }) ?? [], - ) - - const dcqlSubmission = verified.dcql - ? Object.keys(verified.dcql.presentations).map((key, index) => ({ - queryCredentialId: key, - presentationIndex: index, - })) - : undefined - - console.log('presentations', presentations) - - return { - verificationSessionId: verificationSession.id, - responseStatus: verificationSession.state, - error: verificationSession.errorMessage, - //authorizationRequest, - - presentations: presentations, - - submission: verified.presentationExchange?.submission, - definition: verified.presentationExchange?.definition, - transactionDataSubmission: verified.transactionData, - - // dcqlQuery, - dcqlSubmission: verified.dcql - ? { ...verified.dcql.presentationResult, vpTokenMapping: dcqlSubmission } - : undefined, - } as any - } -} - -export const verificationSessionService = new VerificationSessionsService() +// import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../cliAgent' + +// import { +// Agent, +// ClaimFormat, +// DidKey, +// JsonEncoder, +// JsonTransformer, +// Jwt, +// Mdoc, +// MdocDeviceResponse, +// RecordNotFoundError, +// TypedArrayEncoder, +// W3cJsonLdVerifiablePresentation, +// W3cJwtVerifiablePresentation, +// W3cPresentation, +// X509Service, +// } from '@credo-ts/core' +// import { OpenId4VcJwtIssuerDid, OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc' +// import { injectable } from 'tsyringe' +// import { Request as Req } from 'express' +// import { SignerMethod } from '../../../enums' +// import { CreateAuthorizationRequest, OpenId4VcIssuerX5c, ResponseModeEnum } from '../types/verifier.types' + +// // import { CreateAuthorizationRequest } from '../types/verifier.types' + +// @injectable() +// class VerificationSessionsService { +// public async createProofRequest(agentReq: Req, dto: CreateAuthorizationRequest) { +// try { +// let requestSigner +// if (dto.requestSigner.method === SignerMethod.Did) { +// requestSigner = dto.requestSigner as OpenId4VcJwtIssuerDid + +// const didToResolve = dto.requestSigner?.didUrl +// if (!didToResolve) { +// throw new Error('No DID provided to resolve (neither requestSigner.didUrl nor verifierDid present)') +// } + +// const didDocument = await agentReq.agent.dids.resolveDidDocument(didToResolve) + +// let verifierDidUrl: string | undefined = undefined +// if (didDocument.verificationMethod?.[0]?.id) { +// verifierDidUrl = didDocument.verificationMethod[0].id +// } + +// if (!verifierDidUrl) { +// throw new Error('No matching verification method found on verifier DID document') +// } + +// if (!requestSigner.didUrl || !String(requestSigner.didUrl).includes('#')) { +// requestSigner.didUrl = verifierDidUrl +// } + +// requestSigner = { method: 'did', didUrl: verifierDidUrl } as any +// } else { +// requestSigner = dto.requestSigner as OpenId4VcIssuerX5c + +// const parsedCertificate = X509Service.parseCertificate(agentReq.agent.context, { +// encodedCertificate: requestSigner.x5c[0], +// }) +// requestSigner.issuer = parsedCertificate.sanUriNames[0] +// } + +// if (!requestSigner) { +// } else if (requestSigner.method === 'did') { +// } +// const options: any = { +// requestSigner, +// verifierId: dto.verifierId, +// } + +// if(dto.responseMode === ResponseModeEnum.DC_API || ResponseModeEnum.DC_API_JWT){ +// options.expectedOrigins = dto.expectedOrigins +// } + +// if (dto.responseMode) options.responseMode = dto.responseMode +// if (dto.presentationExchange) { +// options.presentationExchange = dto.presentationExchange +// } else if (dto.dcql) { +// options.dcql = dto.dcql +// } + +// return (await agentReq.agent.modules.openId4VcVerifier.createAuthorizationRequest(options)) as any +// } catch (error) { +// throw error +// } +// } + +// public async findVerificationSessionsByQuery( +// agentReq: Req, +// publicVerifierId?: string, +// payloadState?: string, +// state?: OpenId4VcVerificationSessionState, +// authorizationRequestUri?: string, +// nonce?: string, +// ) { +// return await agentReq.agent.modules.openId4VcVerifier.findVerificationSessionsByQuery({ +// verifierId: publicVerifierId, +// payloadState, +// state, +// authorizationRequestUri, +// nonce, +// }) +// } + +// public async getVerificationSessionsById(agentReq: Req, verificationSessionId: string) { +// return await agentReq.agent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) +// } + +// public async getVerifiedAuthorizationResponse(request: Req, verificationSessionId: string) { +// const verificationSession = +// await request.agent.modules.openId4VcVerifier.getVerificationSessionById(verificationSessionId) +// const verified = await request.agent.modules.openId4VcVerifier.getVerifiedAuthorizationResponse( +// verificationSession.id, +// ) +// console.log(verified.presentationExchange?.presentations) +// console.log(verified.dcql?.presentationResult) + +// const presentations = await Promise.all( +// (verified.presentationExchange?.presentations ?? Object.values(verified.dcql?.presentations ?? {})) +// .flat() +// .map(async (presentation: { toJson: () => any; presentation: W3cPresentation; serializedJwt: any; documents: Mdoc[]; base64Url: any; compact: any }) => { +// if (presentation instanceof W3cJsonLdVerifiablePresentation) { +// return { +// pretty: presentation.toJson(), +// encoded: presentation.toJson(), +// } +// } + +// if (presentation instanceof W3cJwtVerifiablePresentation) { +// return { +// pretty: JsonTransformer.toJSON(presentation.presentation), +// encoded: presentation.serializedJwt, +// } +// } + +// if (presentation instanceof MdocDeviceResponse) { +// return { +// pretty: JsonTransformer.toJSON({ +// documents: presentation.documents.map((doc) => ({ +// doctype: doc.docType, +// alg: doc.alg, +// base64Url: doc.base64Url, +// validityInfo: doc.validityInfo, +// deviceSignedNamespaces: doc.deviceSignedNamespaces, +// issuerSignedNamespaces: Object.entries(doc.issuerSignedNamespaces).map( +// ([nameSpace, nameSpacEntries]) => [ +// nameSpace, +// Object.entries(nameSpacEntries).map(([key, value]) => +// value instanceof Uint8Array +// ? [`base64:${key}`, `data:image/jpeg;base64,${TypedArrayEncoder.toBase64(value)}`] +// : [key, value], +// ), +// ], +// ), +// })), +// }), +// encoded: presentation.base64Url, +// } +// } + +// // if ( +// // presentation instanceof W3cV2JwtVerifiablePresentation || +// // presentation instanceof W3cV2SdJwtVerifiablePresentation +// // ) { +// // throw new Error('W3C V2 presentations are not supported yet') +// // } + +// return { +// pretty: { +// ...presentation, +// compact: undefined, +// }, +// encoded: presentation.compact, +// } +// }) ?? [], +// ) + +// const dcqlSubmission = verified.dcql +// ? Object.keys(verified.dcql.presentations).map((key, index) => ({ +// queryCredentialId: key, +// presentationIndex: index, +// })) +// : undefined + +// console.log('presentations', presentations) + +// return { +// verificationSessionId: verificationSession.id, +// responseStatus: verificationSession.state, +// error: verificationSession.errorMessage, +// //authorizationRequest, + +// presentations: presentations, + +// submission: verified.presentationExchange?.submission, +// definition: verified.presentationExchange?.definition, +// transactionDataSubmission: verified.transactionData, + +// // dcqlQuery, +// dcqlSubmission: verified.dcql +// ? { ...verified.dcql.presentationResult, vpTokenMapping: dcqlSubmission } +// : undefined, +// } as any +// } +// } + +// export const verificationSessionService = new VerificationSessionsService() diff --git a/src/controllers/openid4vc/verifiers/verifier.Controller.ts b/src/controllers/openid4vc/verifiers/verifier.Controller.ts index 21266961..3dd6006e 100644 --- a/src/controllers/openid4vc/verifiers/verifier.Controller.ts +++ b/src/controllers/openid4vc/verifiers/verifier.Controller.ts @@ -1,64 +1,64 @@ -import { SCOPES } from '../../../enums' -import { Body, Delete, Get, Path, Post, Put, Query, Route, Request, Security, Tags } from 'tsoa' -import { Request as Req } from 'express' +// import { SCOPES } from '../../../enums' +// import { Body, Delete, Get, Path, Post, Put, Query, Route, Request, Security, Tags } from 'tsoa' +// import { Request as Req } from 'express' -import { OpenId4VcSiopCreateVerifierOptions, OpenId4VcUpdateVerifierRecordOptions } from '../types/verifier.types' -import { VerifierService } from '../verifiers/verifier.service' +// import { OpenId4VcSiopCreateVerifierOptions, OpenId4VcUpdateVerifierRecordOptions } from '../types/verifier.types' +// import { VerifierService } from '../verifiers/verifier.service' -@Tags('oid4vc verifiers') -@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) -@Route('openid4vc/verifier') -export class VerifierController { - private verifierService: VerifierService +// @Tags('oid4vc verifiers') +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Route('openid4vc/verifier') +// export class VerifierController { +// private verifierService: VerifierService - public constructor() { - this.verifierService = new VerifierService() - } +// public constructor() { +// this.verifierService = new VerifierService() +// } - /** - * Create a new verifier and store the verifier record - */ - @Post('/') - public async createVerifier(@Request() request: Req, @Body() options: OpenId4VcSiopCreateVerifierOptions) { - return await this.verifierService.createVerifier(request, options) - } +// /** +// * Create a new verifier and store the verifier record +// */ +// @Post('/') +// public async createVerifier(@Request() request: Req, @Body() options: OpenId4VcSiopCreateVerifierOptions) { +// return await this.verifierService.createVerifier(request, options) +// } - /** - * Update verifier metadata - */ - @Put('{publicVerifierId}') - public async updateVerifierMetadata( - @Request() request: Req, - @Path('publicVerifierId') publicVerifierId: string, - @Body() verifierRecordOptions: OpenId4VcUpdateVerifierRecordOptions, - ) { - return await this.verifierService.updateVerifierMetadata(request, { - verifierId: publicVerifierId, - clientMetadata: verifierRecordOptions.clientMetadata, - }) - } +// /** +// * Update verifier metadata +// */ +// @Put('{publicVerifierId}') +// public async updateVerifierMetadata( +// @Request() request: Req, +// @Path('publicVerifierId') publicVerifierId: string, +// @Body() verifierRecordOptions: OpenId4VcUpdateVerifierRecordOptions, +// ) { +// return await this.verifierService.updateVerifierMetadata(request, { +// verifierId: publicVerifierId, +// clientMetadata: verifierRecordOptions.clientMetadata, +// }) +// } - /** - * Get verifiers by query - */ - @Get('/') - public async getVerifiersByQuery(@Request() request: Req, @Query() publicVerifierId?: string) { - return await this.verifierService.getVerifiersByQuery(request, publicVerifierId) - } +// /** +// * Get verifiers by query +// */ +// @Get('/') +// public async getVerifiersByQuery(@Request() request: Req, @Query() publicVerifierId?: string) { +// return await this.verifierService.getVerifiersByQuery(request, publicVerifierId) +// } - /** - * Get single verifier by ID - */ - @Get('{publicVerifierId}') - public async getVerifier(@Request() request: Req, @Path('publicVerifierId') publicVerifierId: string) { - return await this.verifierService.getVerifier(request, publicVerifierId) - } +// /** +// * Get single verifier by ID +// */ +// @Get('{publicVerifierId}') +// public async getVerifier(@Request() request: Req, @Path('publicVerifierId') publicVerifierId: string) { +// return await this.verifierService.getVerifier(request, publicVerifierId) +// } - /** - * Delete verifier by ID - */ - @Delete('{verifierId}') - public async deleteVerifier(@Request() request: Req, @Path('verifierId') verifierId: string): Promise { - await this.verifierService.deleteVerifier(request, verifierId) - } -} +// /** +// * Delete verifier by ID +// */ +// @Delete('{verifierId}') +// public async deleteVerifier(@Request() request: Req, @Path('verifierId') verifierId: string): Promise { +// await this.verifierService.deleteVerifier(request, verifierId) +// } +// } diff --git a/src/controllers/openid4vc/verifiers/verifier.service.ts b/src/controllers/openid4vc/verifiers/verifier.service.ts index 3a4d696c..9bb29c12 100644 --- a/src/controllers/openid4vc/verifiers/verifier.service.ts +++ b/src/controllers/openid4vc/verifiers/verifier.service.ts @@ -1,57 +1,57 @@ -import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../../src/cliAgent' -import type { Agent } from '@credo-ts/core' -import type { OpenId4VcUpdateVerifierRecordOptions } from '@credo-ts/openid4vc' - -import { OpenId4VcVerifierRepository } from '@credo-ts/openid4vc' -import { OpenId4VcSiopCreateVerifierOptions } from '../types/verifier.types' -import { Request as Req } from 'express' - -export class VerifierService { - public async createVerifier( - agentReq: Req, - options: OpenId4VcSiopCreateVerifierOptions, - ) { - const verifierRecord = await agentReq.agent.modules.openId4VcVerifier.createVerifier(options) - return verifierRecord - } - - public async updateVerifierMetadata( - agentReq: Req, - options: OpenId4VcUpdateVerifierRecordOptions, - ) { - // console.log(`Updating verifier ${options.verifierId}`) - - await agentReq.agent.modules.openId4VcVerifier.updateVerifierMetadata(options) - const verifierRecord = await this.getVerifier(agentReq, options.verifierId) - return verifierRecord - } - - public async getVerifiersByQuery( - agentReq: Req, - publicVerifierId?: string, - ) { - const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) - const verifiers = await verifierRepository.findByQuery(agentReq.agent.context, { - verifierId: publicVerifierId, - }) - - return verifiers - } - - public async getVerifier( - agentReq: Req, - publicVerifierId: string, - ) { - return await agentReq.agent.modules.openId4VcVerifier.getVerifierByVerifierId(publicVerifierId) - } - - public async deleteVerifier( - agentReq: Req, - publicVerifierId: string, - ) { - const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) - await verifierRepository.deleteById(agentReq.agent.context, publicVerifierId) - } -} - -export const issuerService = new VerifierService() +// import type { RestAgentModules, RestMultiTenantAgentModules } from '../../../../src/cliAgent' +// import type { Agent } from '@credo-ts/core' +// import type { OpenId4VcUpdateVerifierRecordOptions } from '@credo-ts/openid4vc' + +// import { OpenId4VcVerifierRepository } from '@credo-ts/openid4vc' +// import { OpenId4VcSiopCreateVerifierOptions } from '../types/verifier.types' +// import { Request as Req } from 'express' + +// export class VerifierService { +// public async createVerifier( +// agentReq: Req, +// options: OpenId4VcSiopCreateVerifierOptions, +// ) { +// const verifierRecord = await agentReq.agent.modules.openId4VcVerifier.createVerifier(options) +// return verifierRecord +// } + +// public async updateVerifierMetadata( +// agentReq: Req, +// options: OpenId4VcUpdateVerifierRecordOptions, +// ) { +// // console.log(`Updating verifier ${options.verifierId}`) + +// await agentReq.agent.modules.openId4VcVerifier.updateVerifierMetadata(options) +// const verifierRecord = await this.getVerifier(agentReq, options.verifierId) +// return verifierRecord +// } + +// public async getVerifiersByQuery( +// agentReq: Req, +// publicVerifierId?: string, +// ) { +// const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) +// const verifiers = await verifierRepository.findByQuery(agentReq.agent.context, { +// verifierId: publicVerifierId, +// }) + +// return verifiers +// } + +// public async getVerifier( +// agentReq: Req, +// publicVerifierId: string, +// ) { +// return await agentReq.agent.modules.openId4VcVerifier.getVerifierByVerifierId(publicVerifierId) +// } + +// public async deleteVerifier( +// agentReq: Req, +// publicVerifierId: string, +// ) { +// const verifierRepository = agentReq.agent.dependencyManager.resolve(OpenId4VcVerifierRepository) +// await verifierRepository.deleteById(agentReq.agent.context, publicVerifierId) +// } +// } + +// export const issuerService = new VerifierService() diff --git a/src/controllers/polygon/PolygonController.ts b/src/controllers/polygon/PolygonController.ts index edcc46cb..e889e2b7 100644 --- a/src/controllers/polygon/PolygonController.ts +++ b/src/controllers/polygon/PolygonController.ts @@ -1,146 +1,146 @@ -import type { SchemaMetadata } from '../types' +// import type { SchemaMetadata } from '../types' -import { generateSecp256k1KeyPair } from '@ayanworks/credo-polygon-w3c-module' -import { DidOperation, DidOperationOptions } from '@ayanworks/credo-polygon-w3c-module/build/ledger' -import { Request as Req } from 'express' -import * as fs from 'fs' -import { Route, Tags, Security, Controller, Post, Body, Get, Path, Request } from 'tsoa' -import { injectable } from 'tsyringe' +// import { generateSecp256k1KeyPair } from '@ayanworks/credo-polygon-w3c-module' +// // import { DidOperation, DidOperationOptions } from '@ayanworks/credo-polygon-w3c-module' +// import { Request as Req } from 'express' +// import * as fs from 'fs' +// import { Route, Tags, Security, Controller, Post, Body, Get, Path, Request } from 'tsoa' +// import { injectable } from 'tsyringe' -import { CredentialEnum, SCOPES } from '../../enums' -import ErrorHandlingService from '../../errorHandlingService' -import { BadRequestError, UnprocessableEntityError } from '../../errors' +// import { CredentialEnum, SCOPES } from '../../enums' +// import ErrorHandlingService from '../../errorHandlingService' +// import { BadRequestError, UnprocessableEntityError } from '../../errors' -@Tags('Polygon') -@Route('/polygon') -@injectable() -export class Polygon extends Controller { - /** - * Create Secp256k1 key pair for polygon DID - * - * @returns Secp256k1KeyPair - */ - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT, SCOPES.MULTITENANT_BASE_AGENT]) - @Post('create-keys') - public async createKeyPair(): Promise<{ - privateKey: string - publicKeyBase58: string - address: string - }> { - try { - return await generateSecp256k1KeyPair() - } catch (error) { - // Handle the error here - throw ErrorHandlingService.handle(error) - } - } +// @Tags('Polygon') +// @Route('/polygon') +// @injectable() +// export class Polygon extends Controller { +// /** +// * Create Secp256k1 key pair for polygon DID +// * +// * @returns Secp256k1KeyPair +// */ +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT, SCOPES.MULTITENANT_BASE_AGENT]) +// @Post('create-keys') +// public async createKeyPair(): Promise<{ +// privateKey: string +// publicKeyBase58: string +// address: string +// }> { +// try { +// return await generateSecp256k1KeyPair() +// } catch (error) { +// // Handle the error here +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Create polygon based W3C schema - * - * @returns Schema JSON - */ - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) - @Post('create-schema') - public async createSchema( - @Request() request: Req, - @Body() - createSchemaRequest: { - did: string - schemaName: string - schema: Record - }, - ): Promise { - try { - const { did, schemaName, schema } = createSchemaRequest - if (!did || !schemaName || !schema) { - throw new BadRequestError('One or more parameters are empty or undefined.') - } +// /** +// * Create polygon based W3C schema +// * +// * @returns Schema JSON +// */ +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Post('create-schema') +// public async createSchema( +// @Request() request: Req, +// @Body() +// createSchemaRequest: { +// did: string +// schemaName: string +// schema: Record +// }, +// ): Promise { +// try { +// const { did, schemaName, schema } = createSchemaRequest +// if (!did || !schemaName || !schema) { +// throw new BadRequestError('One or more parameters are empty or undefined.') +// } - const schemaResponse = await request.agent.modules.polygon.createSchema({ - did, - schemaName, - schema, - }) - if (schemaResponse.schemaState?.state === CredentialEnum.Failed) { - const reason = schemaResponse.schemaState?.reason?.toLowerCase() - if (reason && reason.includes('insufficient') && reason.includes('funds')) { - throw new UnprocessableEntityError( - 'Insufficient funds to the address, Please add funds to perform this operation', - ) - } else { - throw new Error(schemaResponse.schemaState?.reason) - } - } - const schemaServerConfig = fs.readFileSync('config.json', 'utf-8') - const configJson = JSON.parse(schemaServerConfig) - if (!configJson.schemaFileServerURL) { - throw new Error('Please provide valid schema file server URL') - } +// const schemaResponse = await request.agent.modules.polygon.createSchema({ +// did, +// schemaName, +// schema, +// }) +// if (schemaResponse.schemaState?.state === CredentialEnum.Failed) { +// const reason = schemaResponse.schemaState?.reason?.toLowerCase() +// if (reason && reason.includes('insufficient') && reason.includes('funds')) { +// throw new UnprocessableEntityError( +// 'Insufficient funds to the address, Please add funds to perform this operation', +// ) +// } else { +// throw new Error(schemaResponse.schemaState?.reason) +// } +// } +// const schemaServerConfig = fs.readFileSync('config.json', 'utf-8') +// const configJson = JSON.parse(schemaServerConfig) +// if (!configJson.schemaFileServerURL) { +// throw new Error('Please provide valid schema file server URL') +// } - if (!schemaResponse?.schemaId) { - throw new BadRequestError('Error in getting schema response or Invalid schema response') - } - const schemaPayload: SchemaMetadata = { - schemaUrl: configJson.schemaFileServerURL + schemaResponse?.schemaId, - did: schemaResponse?.did, - schemaId: schemaResponse?.schemaId, - schemaTxnHash: schemaResponse?.resourceTxnHash, - } - return schemaPayload - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// if (!schemaResponse?.schemaId) { +// throw new BadRequestError('Error in getting schema response or Invalid schema response') +// } +// const schemaPayload: SchemaMetadata = { +// schemaUrl: configJson.schemaFileServerURL + schemaResponse?.schemaId, +// did: schemaResponse?.did, +// schemaId: schemaResponse?.schemaId, +// schemaTxnHash: schemaResponse?.resourceTxnHash, +// } +// return schemaPayload +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } - /** - * Estimate transaction - * - * @returns Transaction Object - */ - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT, SCOPES.MULTITENANT_BASE_AGENT]) - @Post('estimate-transaction') - public async estimateTransaction( - @Request() request: Req, - @Body() - estimateTransactionRequest: DidOperationOptions, - ): Promise { - try { - const { operation } = estimateTransactionRequest +// // /** +// // * Estimate transaction +// // * +// // * @returns Transaction Object +// // */ +// // @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT, SCOPES.MULTITENANT_BASE_AGENT]) +// // @Post('estimate-transaction') +// // public async estimateTransaction( +// // @Request() request: Req, +// // @Body() +// // estimateTransactionRequest: DidOperationOptions, +// // ): Promise { +// // try { +// // const { operation } = estimateTransactionRequest - if (!(operation in DidOperation)) { - throw new BadRequestError('Invalid method parameter!') - } - if (operation === DidOperation.Create) { - return request.agent.modules.polygon.estimateFeeForDidOperation({ operation }) - } else if (operation === DidOperation.Update) { - return request.agent.modules.polygon.estimateFeeForDidOperation({ ...estimateTransactionRequest }) - } - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } +// // if (!(operation in DidOperation)) { +// // throw new BadRequestError('Invalid method parameter!') +// // } +// // if (operation === DidOperation.Create) { +// // return request.agent.modules.polygon.estimateFeeForDidOperation({ operation }) +// // } else if (operation === DidOperation.Update) { +// // return request.agent.modules.polygon.estimateFeeForDidOperation({ ...estimateTransactionRequest }) +// // } +// // } catch (error) { +// // throw ErrorHandlingService.handle(error) +// // } +// // } - /** - * Fetch schema details - * - * @returns Schema Object - */ - @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) - @Get(':did/:schemaId') - public async getSchemaById( - @Request() request: Req, - @Path('did') did: string, - @Path('schemaId') schemaId: string, - ): Promise { - try { - if (!did || !schemaId) { - throw new BadRequestError('Missing or invalid parameters.') - } - const schemaDetails = await request.agent.modules.polygon.getSchemaById(did, schemaId) - return schemaDetails - } catch (error) { - throw ErrorHandlingService.handle(error) - } - } -} +// /** +// * Fetch schema details +// * +// * @returns Schema Object +// */ +// @Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT]) +// @Get(':did/:schemaId') +// public async getSchemaById( +// @Request() request: Req, +// @Path('did') did: string, +// @Path('schemaId') schemaId: string, +// ): Promise { +// try { +// if (!did || !schemaId) { +// throw new BadRequestError('Missing or invalid parameters.') +// } +// const schemaDetails = await request.agent.modules.polygon.getSchemaById(did, schemaId) +// return schemaDetails +// } catch (error) { +// throw ErrorHandlingService.handle(error) +// } +// } +// } diff --git a/src/controllers/types.ts b/src/controllers/types.ts index 32005d73..3c9737cf 100644 --- a/src/controllers/types.ts +++ b/src/controllers/types.ts @@ -1,13 +1,12 @@ import type { RecordId } from './examples' import type { CustomHandshakeProtocol } from '../enums' -import type { AnonCredsCredentialDefinitionRecord, AnonCredsDidCommCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' +import type { AnonCredsDidCommCredentialFormat, LegacyIndyCredentialFormat } from '@credo-ts/anoncreds' import type { DidResolutionMetadata, DidDocumentMetadata, DidRegistrationExtraOptions, DidDocument, DidRegistrationSecretOptions, - InitConfig, DidResolutionOptions, JsonObject, W3cJsonLdVerifyCredentialOptions, @@ -16,7 +15,6 @@ import type { W3cCredential, W3cCredentialSubject, X509CertificateIssuerAndSubjectOptions, - X509CreateCertificateOptions, SingleOrArray, } from '@credo-ts/core' @@ -36,8 +34,7 @@ import type { DidCommAttachment, } from '@credo-ts/didcomm' import type { DIDDocument } from 'did-resolver' -import { KeyType } from '@credo-ts/core/build/crypto/webcrypto/types.mjs' -import { LinkedDataProofOptions } from '@credo-ts/core/build/modules/vc/data-integrity/models/LinkedDataProof.mjs' +import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' export type CustomTenantConfig = {label: string} & { connectionImageUrl?: string @@ -206,7 +203,7 @@ export interface ReceiveInvitationByUrlProps extends ReceiveOutOfBandInvitationP export interface AcceptInvitationConfig { autoAcceptConnection?: boolean reuseConnection?: boolean - label?: string + label: string alias?: string imageUrl?: string mediatorId?: string @@ -295,7 +292,8 @@ export interface ResolvedDid { } export interface DidCreate { - keyType?: KeyType + // FIXME: Check type + keyType?: KeyAlgorithm seed?: string domain?: string method: string @@ -398,7 +396,8 @@ export type ThreadId = string export type SignDataOptions = { data: string - keyType: KeyType + // FIXME: Check type + keyType: any publicKeyBase58: string did?: string method?: string @@ -406,7 +405,8 @@ export type SignDataOptions = { export type VerifyDataOptions = { data: string - keyType: KeyType + // FIXME: Check type + keyType: any publicKeyBase58: string signature: string } @@ -425,7 +425,8 @@ export interface credentialPayloadToSign { } export interface SafeW3cJsonLdVerifyCredentialOptions extends W3cJsonLdVerifyCredentialOptions { // Ommited due to issues with TSOA - proof: SingleOrArray | DataIntegrityProofOptions> + // FIXME: Check type + proof: SingleOrArray } export type ExtensibleW3cCredentialSubject = W3cCredentialSubject & { @@ -448,7 +449,8 @@ export type DisclosureFrame = { export interface BasicX509CreateCertificateConfig extends X509CertificateIssuerAndSubjectOptions { - keyType: KeyType; + // FIXME: Check type + keyType: any; issuerAlternativeNameURL: string; } @@ -464,5 +466,6 @@ export interface X509ImportCertificateOptionsDto { */ privateKey?: string; - keyType: KeyType; + // FIXME: Check type + keyType: any; } \ No newline at end of file diff --git a/src/controllers/x509/x509.service.ts b/src/controllers/x509/x509.service.ts index 94d7d7a6..8e0ca051 100644 --- a/src/controllers/x509/x509.service.ts +++ b/src/controllers/x509/x509.service.ts @@ -1,12 +1,12 @@ -import type { X509CreateCertificateOptionsDto } from './x509.types' + import type { BasicX509CreateCertificateConfig, X509ImportCertificateOptionsDto } from '../types' -import type { CredoError, Key } from '@credo-ts/core' +import type { CredoError } from '@credo-ts/core' import type { Request as Req } from 'express' +import { transformPrivateKeyToPrivateJwk, transformSeedToPrivateJwk } from '@credo-ts/askar' import { - KeyType, + Kms, TypedArrayEncoder, - WalletKeyExistsError, X509Certificate, X509ExtendedKeyUsage, X509KeyUsage, @@ -14,10 +14,14 @@ import { X509Service, type Agent, } from '@credo-ts/core' +import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' -import { generateSecretKey, getCertificateValidityForSystem } from '../../utils/helpers' +import { keyAlgorithmToCurve } from '../../utils/constant' +import { generateSecretKey, getCertificateValidityForSystem, getTypeFromCurve } from '../../utils/helpers' import { pemToRawEd25519PrivateKey } from './crypto-util' +import { type X509CreateCertificateOptionsDto } from './x509.types' +import { error } from 'console' class x509Service { public async createSelfSignedDCS(createX509Options: BasicX509CreateCertificateConfig, agentReq: Req) { @@ -27,7 +31,7 @@ class x509Service { const AGENT_HOST = createX509Options.issuerAlternativeNameURL const AGENT_DNS = AGENT_HOST.replace('https://', '') const selfSignedx509certificate = await X509Service.createCertificate(agent.context, { - authorityKey: authorityKey, //createX509Options.subjectKey, + authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKey.publicJwk), //createX509Options.subjectKey, issuer: { countryName: createX509Options.countryName, commonName: createX509Options.commonName }, validity: getCertificateValidityForSystem(false), extensions: { @@ -45,8 +49,6 @@ class x509Service { ], }, issuerAlternativeName: { - // biome-ignore lint/style/noNonNullAssertion: - //name: rootCertificate.issuerAlternativeNames!, name: [ { type: 'dns', value: AGENT_DNS }, { type: 'url', value: AGENT_HOST }, @@ -79,41 +81,56 @@ class x509Service { let authorityKeyID, subjectPublicKeyID - agent.config.logger.debug(`createCertificate options:`, options) + agent.config.logger.debug(`createCertificate options:`, options) + if (options.authorityKey && options?.authorityKey?.seed) { - authorityKeyID = await agent.context.wallet.createKey({ - keyType: options.authorityKey.keyType ?? KeyType.P256, - seed: TypedArrayEncoder.fromString(options.authorityKey.seed), - }) + const { privateJwk } = transformSeedToPrivateJwk({ + type: getTypeFromCurve(options.authorityKey.keyType ?? 'P-256'), + seed: TypedArrayEncoder.fromString(options.authorityKey!.seed!), + }) + + const { publicJwk } = await agent.kms.importKey({ privateJwk }) + authorityKeyID = publicJwk } else { - authorityKeyID = await agent.context.wallet.createKey({ - keyType: KeyType.P256, - }) + const { publicJwk } = await agent.kms.createKey({ + type: getTypeFromCurve(options.authorityKey?.keyType ?? 'P-256') + }) + authorityKeyID = publicJwk } if (options.subjectPublicKey) { if (options?.subjectPublicKey?.seed) { - subjectPublicKeyID = await agent.context.wallet.createKey({ - keyType: options.subjectPublicKey.keyType ?? KeyType.P256, - seed: TypedArrayEncoder.fromString(options.subjectPublicKey.seed), + const importedKey = await agentReq.agent.kms.importKey({ + privateJwk: transformSeedToPrivateJwk({ + seed: TypedArrayEncoder.fromString(options.subjectPublicKey.seed), + type: getTypeFromCurve(options.subjectPublicKey?.keyType ?? 'P-256'), + }).privateJwk, }) + + subjectPublicKeyID = importedKey.publicJwk + } else { - subjectPublicKeyID = await agent.context.wallet.createKey({ - keyType: KeyType.P256, + const { keyId, publicJwk } = await agent.kms.createKey({ + type: getTypeFromCurve(options.subjectPublicKey?.keyType ?? 'P-256') }) + subjectPublicKeyID = publicJwk } } + agent.config.logger.info('This is subjectPublicKeyID', subjectPublicKeyID) + const certificate = await agent.x509.createCertificate({ - authorityKey: authorityKeyID as Key, - subjectPublicKey: (subjectPublicKeyID as Key) ?? undefined, + // authorityKey: authorityKeyID as Key, + authorityKey: Kms.PublicJwk.fromPublicJwk(authorityKeyID), + // subjectPublicKey: Kms.PublicJwk.fromPublicJwk(subjectPublicKeyID!), serialNumber: options.serialNumber, issuer: options.issuer, extensions: options.extensions, subject: options.subject, validity: options.validity, }) + agent.config.logger.info("Result") const issuerCertificate = certificate.toString('base64') return { publicCertificateBase64: issuerCertificate } @@ -129,35 +146,38 @@ class x509Service { const parsedCertificate = X509Service.parseCertificate(agent.context, { encodedCertificate: options.certificate, }) - const issuerCertficicate = parsedCertificate.toString('base64') + const issuerCertificate = parsedCertificate.toString('base64') try { - const documentSignerKey = await agent.wallet.createKey({ - privateKey: privateKey, - keyType: options.keyType, + const keyTypeInfo = getTypeFromCurve(options.keyType) + const { privateJwk } = transformPrivateKeyToPrivateJwk({ + type: keyTypeInfo, + privateKey, }) + const key = await agent.kms.importKey({ + privateJwk, + }) if ( - parsedCertificate.publicKey.keyType !== options.keyType || - !Buffer.from(parsedCertificate.publicKey.publicKey).equals(Buffer.from(documentSignerKey.publicKey)) + parsedCertificate.publicJwk.publicKey.kty !== keyTypeInfo.kty || + !parsedCertificate.publicJwk.equals(Kms.PublicJwk.fromPublicJwk(key.publicJwk)) ) { throw new Error(`Key mismatched in provided X509_CERTIFICATE to import`) } - console.log(`Keys matched with certificate`) + agent.config.logger.info(`Keys matched with certificate`) } catch (error) { + agent.config.logger.error(`Error caught`) + // If the key already exists, we assume the self-signed certificate is already created - if (error instanceof WalletKeyExistsError) { - console.error( - `key already exists while importing certificate ${JSON.stringify(parsedCertificate.privateKey)}`, - parsedCertificate.privateKey, - ) + if (error instanceof Kms.KeyManagementKeyExistsError) { + console.error( 'key already exists while importing certificate') } else { agent.config.logger.error(`${JSON.stringify(error)}`) throw error } } - return { issuerCertficicate } + return { issuerCertificate } } public addTrustedCertificate( @@ -167,7 +187,7 @@ class x509Service { }, ) { const agent = agentReq.agent - return agent.x509.addTrustedCertificate(options.certificate) + return agent.x509.config.addTrustedCertificate(options.certificate) } public getTrustedCertificates(agentReq: Req) { @@ -201,18 +221,22 @@ class x509Service { export const x509ServiceT = new x509Service() -export async function createKey(agent: Agent, keyType: KeyType) { +export async function createKey(agent: Agent, keyType: KeyAlgorithm) { try { - const seed = await generateSecretKey(keyType === KeyType.P256 ? 64 : 32) + const seed = await generateSecretKey(keyType === KeyAlgorithm.EcSecp256r1 ? 64 : 32) agent.config.logger.debug(`createKey: got seed ${seed}`) - const authorityKey = await agent.wallet.createKey({ - keyType: keyType, - seed: TypedArrayEncoder.fromString(seed), + const normalizedCurve = keyAlgorithmToCurve[keyType] + if (!normalizedCurve) throw new Error('Unspported key type for method importKey') + const importedKey = await agent.kms.importKey({ + privateJwk: transformSeedToPrivateJwk({ + seed: TypedArrayEncoder.fromString(seed), + type: getTypeFromCurve(normalizedCurve), + }).privateJwk, }) - return authorityKey + return importedKey } catch (error) { agent.config.logger.debug(`Error while creating authorityKey`, { message: (error as CredoError).message }) throw error diff --git a/src/controllers/x509/x509.types.ts b/src/controllers/x509/x509.types.ts index 45eca35c..311f6697 100644 --- a/src/controllers/x509/x509.types.ts +++ b/src/controllers/x509/x509.types.ts @@ -1,7 +1,10 @@ -import type { KeyType, X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' +import type { X509ExtendedKeyUsage, X509KeyUsage } from '@credo-ts/core' +import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' import { Extension, Example } from 'tsoa' +import { DidMethod } from '../../enums/enum' + // Enum remains the same export enum GeneralNameType { DNS = 'dns', @@ -31,7 +34,8 @@ export interface AuthorityAndSubjectKeyDto { * @example "p256" * @description Type of the key used for signing the X.509 Certificate (default is p256) */ - keyType?: KeyType + // FIXME: Check type + keyType?: Curve } export interface NameDto { @@ -202,3 +206,61 @@ export interface X509CreateCertificateOptionsDto { validity?: ValidityDto extensions?: X509CertificateExtensionsOptionsDto } + +export type OkpCurve = 'Ed25519' | 'X25519' +export type EcCurve = 'P-256' | 'P-384' | 'P-521' | 'secp256k1' + +export type OkpType = { + kty: 'OKP' + crv: 'Ed25519' | 'X25519' +} + +export type EcType = { + kty: 'EC' + crv: 'P-256' | 'P-384' | 'P-521' | 'secp256k1' +} + +export type Curve = 'Ed25519' | 'X25519' | 'P-256' | 'P-384' | 'P-521' | 'secp256k1' + +export enum RsaModulusLength { + RSA_2048 = 2048, + RSA_3072 = 3072, + RSA_4096 = 4096, +} + +export type KmsCreateKeyTypeAssymetric = + | { + kty: 'OKP' + crv: 'Ed25519' | 'X25519' + } + | { + kty: 'EC' + crv: 'P-256' | 'P-384' | 'P-521' | 'secp256k1' + } + +export const supportedKeyTypesDID: Record = { + [DidMethod.Indy]: [{ kty: 'OKP', crv: 'Ed25519' }], + + [DidMethod.Peer]: [ + { kty: 'OKP', crv: 'Ed25519' }, + { kty: 'OKP', crv: 'X25519' }, + ], + + [DidMethod.Key]: [ + { kty: 'OKP', crv: 'Ed25519' }, + { kty: 'OKP', crv: 'X25519' }, + { kty: 'EC', crv: 'P-256' }, + { kty: 'EC', crv: 'P-384' }, + { kty: 'EC', crv: 'P-521' }, + { kty: 'EC', crv: 'secp256k1' }, + ], + + [DidMethod.Web]: [ + { kty: 'OKP', crv: 'Ed25519' }, + { kty: 'OKP', crv: 'X25519' }, + { kty: 'EC', crv: 'P-256' }, + { kty: 'EC', crv: 'secp256k1' }, + ], + + [DidMethod.Polygon]: [{ kty: 'EC', crv: 'secp256k1' }], +} diff --git a/src/enums/enum.ts b/src/enums/enum.ts index 16ee0de1..b58196a2 100644 --- a/src/enums/enum.ts +++ b/src/enums/enum.ts @@ -97,4 +97,13 @@ export enum SCOPES { export enum SignerMethod { Did = 'did', X5c = 'x5c', -} \ No newline at end of file +} +export enum KeyAlgorithmCurve { + Ed25519 = 'Ed25519', + X25519 = 'X25519', + P256 = 'P-256', + P384 = 'P-384', + P521 = 'P-521', + secp256k1 = 'secp256k1', + Bls12381G2 = 'bls12381g2', +} diff --git a/src/events/WebSocketEvents.ts b/src/events/WebSocketEvents.ts index 1e968775..358ca800 100644 --- a/src/events/WebSocketEvents.ts +++ b/src/events/WebSocketEvents.ts @@ -1,6 +1,6 @@ -import WebSocket from 'ws' +import {Server} from 'ws' -export const sendWebSocketEvent = async (server: WebSocket.Server, data: unknown) => { +export const sendWebSocketEvent = async (server: Server, data: unknown) => { server.clients.forEach((client) => { if (client.readyState === WebSocket.OPEN) { typeof data === 'string' ? client.send(data) : client.send(JSON.stringify(data)) diff --git a/src/index.ts b/src/index.ts index bd27e821..1a1547d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,12 +4,12 @@ import type { ServerConfig } from './utils/ServerConfig' import type { Agent } from '@credo-ts/core' import type { Socket } from 'net' -import { Server } from 'ws' +import { WebSocketServer } from 'ws' import { setupServer } from './server' export const startServer = async (agent: Agent, config: ServerConfig) => { - const socketServer = config.socketServer ?? new Server({ noServer: true }) + const socketServer = config.socketServer ?? new WebSocketServer({ noServer: true }) const app = await setupServer(agent, { ...config, socketServer }) const server = app.listen(config.port) diff --git a/src/routes/routes.ts b/src/routes/routes.ts deleted file mode 100644 index ad89c3b4..00000000 --- a/src/routes/routes.ts +++ /dev/null @@ -1,6095 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import type { TsoaRoute } from '@tsoa/runtime'; -import { fetchMiddlewares, ExpressTemplateService } from '@tsoa/runtime'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { X509Controller } from './../controllers/x509/x509.Controller'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { Polygon } from './../controllers/polygon/PolygonController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { EndorserTransactionController } from './../controllers/anoncreds/endorser-transaction/EndorserTransactionController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { DidController } from './../controllers/did/DidController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { SchemaController } from './../controllers/anoncreds/schema/SchemaController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { CredentialDefinitionController } from './../controllers/anoncreds/cred-def/CredentialDefinitionController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { AgentController } from './../controllers/agent/AgentController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { QuestionAnswerController } from './../controllers/didcomm/question-answer/QuestionAnswerController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { ProofController } from './../controllers/didcomm/proofs/ProofController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { OutOfBandController } from './../controllers/didcomm/outofband/OutOfBandController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { CredentialController } from './../controllers/didcomm/credentials/CredentialController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { ConnectionController } from './../controllers/didcomm/connections/ConnectionController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { BasicMessageController } from './../controllers/didcomm/basic-messages/BasicMessageController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { MultiTenancyController } from './../controllers/multi-tenancy/MultiTenancyController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { IssuanceSessionsController } from './../controllers/openid4vc/issuance-sessions/issuance-sessions.Controller'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { IssuerController } from './../controllers/openid4vc/issuers/issuer.Controller'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { VerificationSessionsController } from './../controllers/openid4vc/verifier-sessions/verification-sessions.Controller'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { HolderController } from './../controllers/openid4vc/holder/holder.Controller'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { VerifierController } from './../controllers/openid4vc/verifiers/verifier.Controller'; -import { expressAuthentication } from './../authentication'; -// @ts-ignore - no great way to install types from subpackage -import { iocContainer } from './../utils/tsyringeTsoaIocContainer'; -import type { IocContainer, IocContainerFactory } from '@tsoa/runtime'; -import type { Request as ExRequest, Response as ExResponse, RequestHandler, Router } from 'express'; - -const expressAuthenticationRecasted = expressAuthentication as (req: ExRequest, securityName: string, scopes?: string[], res?: ExResponse) => Promise; - - -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - -const models: TsoaRoute.Models = { - "KeyType": { - "dataType": "refEnum", - "enums": ["ed25519","bls12381g1g2","bls12381g1","bls12381g2","x25519","p256","p384","p521","k256"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AuthorityAndSubjectKeyDto": { - "dataType": "refObject", - "properties": { - "seed": {"dataType":"string"}, - "publicKeyBase58": {"dataType":"string"}, - "keyType": {"ref":"KeyType"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509CertificateIssuerAndSubjectOptionsDto": { - "dataType": "refObject", - "properties": { - "countryName": {"dataType":"string"}, - "stateOrProvinceName": {"dataType":"string"}, - "organizationalUnit": {"dataType":"string"}, - "commonName": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ValidityDto": { - "dataType": "refObject", - "properties": { - "notBefore": {"dataType":"datetime"}, - "notAfter": {"dataType":"datetime"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509KeyUsage": { - "dataType": "refEnum", - "enums": [1,2,4,8,16,32,64,128,256], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "KeyUsageDto": { - "dataType": "refObject", - "properties": { - "usages": {"dataType":"array","array":{"dataType":"refEnum","ref":"X509KeyUsage"},"required":true}, - "markAsCritical": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509ExtendedKeyUsage": { - "dataType": "refEnum", - "enums": ["1.3.6.1.5.5.7.3.1","1.3.6.1.5.5.7.3.2","1.3.6.1.5.5.7.3.3","1.3.6.1.5.5.7.3.4","1.3.6.1.5.5.7.3.8","1.3.6.1.5.5.7.3.9","1.0.18013.5.1.2"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ExtendedKeyUsageDto": { - "dataType": "refObject", - "properties": { - "usages": {"dataType":"array","array":{"dataType":"refEnum","ref":"X509ExtendedKeyUsage"},"required":true}, - "markAsCritical": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AuthorityAndSubjectKeyIdentifierDto": { - "dataType": "refObject", - "properties": { - "include": {"dataType":"boolean","required":true}, - "markAsCritical": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GeneralNameType": { - "dataType": "refEnum", - "enums": ["dns","dn","email","guid","ip","url","upn","id"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "NameDto": { - "dataType": "refObject", - "properties": { - "type": {"ref":"GeneralNameType","required":true}, - "value": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "NameListDto": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"array","array":{"dataType":"refObject","ref":"NameDto"},"required":true}, - "markAsCritical": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "BasicConstraintsDto": { - "dataType": "refObject", - "properties": { - "ca": {"dataType":"boolean","required":true}, - "pathLenConstraint": {"dataType":"double"}, - "markAsCritical": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CrlDistributionPointsDto": { - "dataType": "refObject", - "properties": { - "urls": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "markAsCritical": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509CertificateExtensionsOptionsDto": { - "dataType": "refObject", - "properties": { - "keyUsage": {"ref":"KeyUsageDto"}, - "extendedKeyUsage": {"ref":"ExtendedKeyUsageDto"}, - "authorityKeyIdentifier": {"ref":"AuthorityAndSubjectKeyIdentifierDto"}, - "subjectKeyIdentifier": {"ref":"AuthorityAndSubjectKeyIdentifierDto"}, - "issuerAlternativeName": {"ref":"NameListDto"}, - "subjectAlternativeName": {"ref":"NameListDto"}, - "basicConstraints": {"ref":"BasicConstraintsDto"}, - "crlDistributionPoints": {"ref":"CrlDistributionPointsDto"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509CreateCertificateOptionsDto": { - "dataType": "refObject", - "properties": { - "authorityKey": {"ref":"AuthorityAndSubjectKeyDto"}, - "subjectPublicKey": {"ref":"AuthorityAndSubjectKeyDto"}, - "serialNumber": {"dataType":"string"}, - "issuer": {"dataType":"union","subSchemas":[{"ref":"X509CertificateIssuerAndSubjectOptionsDto"},{"dataType":"string"}],"required":true}, - "subject": {"dataType":"union","subSchemas":[{"ref":"X509CertificateIssuerAndSubjectOptionsDto"},{"dataType":"string"}]}, - "validity": {"ref":"ValidityDto"}, - "extensions": {"ref":"X509CertificateExtensionsOptionsDto"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509ImportCertificateOptionsDto": { - "dataType": "refObject", - "properties": { - "certificate": {"dataType":"string","required":true}, - "privateKey": {"dataType":"string"}, - "keyType": {"ref":"KeyType","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Uint8Array": { - "dataType": "refObject", - "properties": { - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Key": { - "dataType": "refObject", - "properties": { - "publicKey": {"ref":"Uint8Array","required":true}, - "keyType": {"ref":"KeyType","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "X509Certificate": { - "dataType": "refObject", - "properties": { - "publicKey": {"ref":"Key","required":true}, - "privateKey": {"ref":"Uint8Array"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.unknown_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"any"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperation.Create": { - "dataType": "refEnum", - "enums": ["createDID"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateDidOperationOptions": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"serviceEndpoint":{"dataType":"string"},"operation":{"ref":"DidOperation.Create","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperation.Update": { - "dataType": "refEnum", - "enums": ["updateDIDDoc"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.any_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"any"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidDocument": { - "dataType": "refAlias", - "type": {"ref":"Record_string.any_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "UpdateDidOperationOptions": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"did":{"dataType":"string","required":true},"didDocument":{"ref":"DidDocument","required":true},"operation":{"ref":"DidOperation.Update","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperation.Deactivate": { - "dataType": "refEnum", - "enums": ["deactivate"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DeactivateDidOperationOptions": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"did":{"dataType":"string","required":true},"operation":{"ref":"DidOperation.Deactivate","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperation.AddResource": { - "dataType": "refEnum", - "enums": ["addResource"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AddResourceDidOperationOptions": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"did":{"dataType":"string","required":true},"resource":{"dataType":"object","required":true},"resourceId":{"dataType":"string","required":true},"operation":{"ref":"DidOperation.AddResource","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperationOptions": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"CreateDidOperationOptions"},{"ref":"UpdateDidOperationOptions"},{"ref":"DeactivateDidOperationOptions"},{"ref":"AddResourceDidOperationOptions"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "EndorserTransaction": { - "dataType": "refObject", - "properties": { - "transaction": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"Record_string.unknown_"}],"required":true}, - "endorserDid": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidRegistrationSecretOptions": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperationStateWait": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["wait"],"required":true}, - "did": {"dataType":"string"}, - "secret": {"ref":"DidRegistrationSecretOptions"}, - "didDocument": {"ref":"DidDocument"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperationStateActionBase": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["action"],"required":true}, - "action": {"dataType":"string","required":true}, - "did": {"dataType":"string"}, - "secret": {"ref":"DidRegistrationSecretOptions"}, - "didDocument": {"ref":"DidDocument"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperationStateFinished": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["finished"],"required":true}, - "did": {"dataType":"string","required":true}, - "secret": {"ref":"DidRegistrationSecretOptions"}, - "didDocument": {"ref":"DidDocument","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidOperationStateFailed": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["failed"],"required":true}, - "did": {"dataType":"string"}, - "secret": {"ref":"DidRegistrationSecretOptions"}, - "didDocument": {"ref":"DidDocument"}, - "reason": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidRegistrationMetadata": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidResolutionMetadata": { - "dataType": "refObject", - "properties": { - "contentType": {"dataType":"string"}, - "error": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["invalidDid"]},{"dataType":"enum","enums":["notFound"]},{"dataType":"enum","enums":["representationNotSupported"]},{"dataType":"enum","enums":["unsupportedDidMethod"]},{"dataType":"string"}]}, - "message": {"dataType":"string"}, - "servedFromCache": {"dataType":"boolean"}, - "servedFromDidRecord": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidCreateResult_DidOperationStateActionBase_": { - "dataType": "refObject", - "properties": { - "jobId": {"dataType":"string"}, - "didState": {"dataType":"union","subSchemas":[{"ref":"DidOperationStateWait"},{"ref":"DidOperationStateActionBase"},{"ref":"DidOperationStateFinished"},{"ref":"DidOperationStateFailed"}],"required":true}, - "didRegistrationMetadata": {"ref":"DidRegistrationMetadata","required":true}, - "didDocumentMetadata": {"ref":"DidResolutionMetadata","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidNymTransaction": { - "dataType": "refObject", - "properties": { - "did": {"dataType":"string","required":true}, - "nymRequest": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsSchema": { - "dataType": "refObject", - "properties": { - "issuerId": {"dataType":"string","required":true}, - "name": {"dataType":"string","required":true}, - "version": {"dataType":"string","required":true}, - "attrNames": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterSchemaReturnStateWait": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["wait"],"required":true}, - "schema": {"ref":"AnonCredsSchema"}, - "schemaId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterSchemaReturnStateAction": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["action"],"required":true}, - "action": {"dataType":"string","required":true}, - "schema": {"ref":"AnonCredsSchema","required":true}, - "schemaId": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterSchemaReturnStateFinished": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["finished"],"required":true}, - "schema": {"ref":"AnonCredsSchema","required":true}, - "schemaId": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterSchemaReturnStateFailed": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["failed"],"required":true}, - "reason": {"dataType":"string","required":true}, - "schema": {"ref":"AnonCredsSchema"}, - "schemaId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsCredentialDefinition": { - "dataType": "refObject", - "properties": { - "issuerId": {"dataType":"string","required":true}, - "schemaId": {"dataType":"string","required":true}, - "type": {"dataType":"enum","enums":["CL"],"required":true}, - "tag": {"dataType":"string","required":true}, - "value": {"dataType":"nestedObjectLiteral","nestedProperties":{"revocation":{"dataType":"any"},"primary":{"ref":"Record_string.unknown_","required":true}},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterCredentialDefinitionReturnStateWait": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["wait"],"required":true}, - "credentialDefinition": {"ref":"AnonCredsCredentialDefinition"}, - "credentialDefinitionId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterCredentialDefinitionReturnStateAction": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["action"],"required":true}, - "action": {"dataType":"string","required":true}, - "credentialDefinitionId": {"dataType":"string","required":true}, - "credentialDefinition": {"ref":"AnonCredsCredentialDefinition","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterCredentialDefinitionReturnStateFinished": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["finished"],"required":true}, - "credentialDefinition": {"ref":"AnonCredsCredentialDefinition","required":true}, - "credentialDefinitionId": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterCredentialDefinitionReturnStateFailed": { - "dataType": "refObject", - "properties": { - "state": {"dataType":"enum","enums":["failed"],"required":true}, - "reason": {"dataType":"string","required":true}, - "credentialDefinition": {"ref":"AnonCredsCredentialDefinition"}, - "credentialDefinitionId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "WriteTransaction": { - "dataType": "refObject", - "properties": { - "endorsedTransaction": {"dataType":"string","required":true}, - "endorserDid": {"dataType":"string"}, - "schema": {"dataType":"nestedObjectLiteral","nestedProperties":{"attributes":{"dataType":"array","array":{"dataType":"string"},"required":true},"version":{"dataType":"string","required":true},"name":{"dataType":"string","required":true},"issuerId":{"dataType":"string","required":true}}}, - "credentialDefinition": {"dataType":"nestedObjectLiteral","nestedProperties":{"type":{"dataType":"string","required":true},"value":{"dataType":"any","required":true},"tag":{"dataType":"string","required":true},"issuerId":{"dataType":"string","required":true},"schemaId":{"dataType":"string","required":true}}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DIDDocumentMetadata": { - "dataType": "refObject", - "properties": { - "created": {"dataType":"string"}, - "updated": {"dataType":"string"}, - "deactivated": {"dataType":"boolean"}, - "versionId": {"dataType":"string"}, - "nextUpdate": {"dataType":"string"}, - "nextVersionId": {"dataType":"string"}, - "equivalentId": {"dataType":"string"}, - "canonicalId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Did": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidCreate": { - "dataType": "refObject", - "properties": { - "keyType": {"ref":"KeyType"}, - "seed": {"dataType":"string"}, - "domain": {"dataType":"string"}, - "method": {"dataType":"string","required":true}, - "network": {"dataType":"string"}, - "did": {"dataType":"string"}, - "role": {"dataType":"string"}, - "endorserDid": {"dataType":"string"}, - "didDocument": {"ref":"DidDocument"}, - "privatekey": {"dataType":"string"}, - "endpoint": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsResolutionMetadata": { - "dataType": "refObject", - "properties": { - "error": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["invalid"]},{"dataType":"enum","enums":["notFound"]},{"dataType":"enum","enums":["unsupportedAnonCredsMethod"]},{"dataType":"string"}]}, - "message": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredoExtensible": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GetSchemaReturn": { - "dataType": "refObject", - "properties": { - "schema": {"ref":"AnonCredsSchema"}, - "schemaId": {"dataType":"string","required":true}, - "resolutionMetadata": {"ref":"AnonCredsResolutionMetadata","required":true}, - "schemaMetadata": {"ref":"CredoExtensible","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SchemaId": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterSchemaReturn": { - "dataType": "refObject", - "properties": { - "jobId": {"dataType":"string"}, - "schemaState": {"dataType":"union","subSchemas":[{"ref":"RegisterSchemaReturnStateWait"},{"ref":"RegisterSchemaReturnStateAction"},{"ref":"RegisterSchemaReturnStateFinished"},{"ref":"RegisterSchemaReturnStateFailed"}],"required":true}, - "schemaMetadata": {"ref":"CredoExtensible","required":true}, - "registrationMetadata": {"ref":"CredoExtensible","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateSchemaInput": { - "dataType": "refObject", - "properties": { - "issuerId": {"dataType":"string","required":true}, - "name": {"dataType":"string","required":true}, - "version": {"dataType":"string","required":true}, - "attributes": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "endorse": {"dataType":"boolean"}, - "endorserDid": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GetCredentialDefinitionReturn": { - "dataType": "refObject", - "properties": { - "credentialDefinition": {"ref":"AnonCredsCredentialDefinition"}, - "credentialDefinitionId": {"dataType":"string","required":true}, - "resolutionMetadata": {"ref":"AnonCredsResolutionMetadata","required":true}, - "credentialDefinitionMetadata": {"ref":"CredoExtensible","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialDefinitionId": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RegisterCredentialDefinitionReturn": { - "dataType": "refObject", - "properties": { - "jobId": {"dataType":"string"}, - "credentialDefinitionState": {"dataType":"union","subSchemas":[{"ref":"RegisterCredentialDefinitionReturnStateWait"},{"ref":"RegisterCredentialDefinitionReturnStateAction"},{"ref":"RegisterCredentialDefinitionReturnStateFinished"},{"ref":"RegisterCredentialDefinitionReturnStateFailed"}],"required":true}, - "credentialDefinitionMetadata": {"ref":"CredoExtensible","required":true}, - "registrationMetadata": {"ref":"CredoExtensible","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AgentInfo": { - "dataType": "refObject", - "properties": { - "label": {"dataType":"string","required":true}, - "endpoints": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "isInitialized": {"dataType":"boolean","required":true}, - "publicDid": {"dataType":"void","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AgentToken": { - "dataType": "refObject", - "properties": { - "token": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "VerifyDataOptions": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"signature":{"dataType":"string","required":true},"publicKeyBase58":{"dataType":"string","required":true},"keyType":{"ref":"KeyType","required":true},"data":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cCredentialRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JsonObject": { - "dataType": "refObject", - "properties": { - }, - "additionalProperties": {"ref":"JsonValue"}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JsonValue": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"double"},{"dataType":"boolean"},{"dataType":"enum","enums":[null]},{"ref":"JsonObject"},{"ref":"JsonArray"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JsonArray": { - "dataType": "refAlias", - "type": {"dataType":"array","array":{"dataType":"refAlias","ref":"JsonValue"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cIssuer": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cCredentialSubject": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string"}, - "claims": {"ref":"Record_string.unknown_"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SingleOrArray_W3cCredentialSubject_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"W3cCredentialSubject"},{"dataType":"array","array":{"dataType":"refObject","ref":"W3cCredentialSubject"}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cCredentialSchema": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "type": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SingleOrArray_W3cCredentialSchema_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"W3cCredentialSchema"},{"dataType":"array","array":{"dataType":"refObject","ref":"W3cCredentialSchema"}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cCredentialStatus": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "type": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cCredential": { - "dataType": "refObject", - "properties": { - "context": {"dataType":"array","array":{"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"JsonObject"}]},"required":true}, - "id": {"dataType":"string"}, - "type": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "issuer": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"W3cIssuer"}],"required":true}, - "issuanceDate": {"dataType":"string","required":true}, - "expirationDate": {"dataType":"string"}, - "credentialSubject": {"ref":"SingleOrArray_W3cCredentialSubject_","required":true}, - "credentialSchema": {"ref":"SingleOrArray_W3cCredentialSchema_"}, - "credentialStatus": {"ref":"W3cCredentialStatus"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_W3cJsonLdSignCredentialOptions.Exclude_keyofW3cJsonLdSignCredentialOptions.format__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"credential":{"ref":"W3cCredential","required":true},"proofType":{"dataType":"string","required":true},"proofPurpose":{"dataType":"any"},"created":{"dataType":"string"},"verificationMethod":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_W3cJsonLdSignCredentialOptions.format_": { - "dataType": "refAlias", - "type": {"ref":"Pick_W3cJsonLdSignCredentialOptions.Exclude_keyofW3cJsonLdSignCredentialOptions.format__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CustomW3cJsonLdSignCredentialOptions": { - "dataType": "refAlias", - "type": {"dataType":"intersection","subSchemas":[{"ref":"Omit_W3cJsonLdSignCredentialOptions.format_"},{"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"any"}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SignDataOptions": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"method":{"dataType":"string"},"did":{"dataType":"string"},"publicKeyBase58":{"dataType":"string","required":true},"keyType":{"ref":"KeyType","required":true},"data":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Partial_W3cCredentialValidations_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Error": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string","required":true}, - "message": {"dataType":"string","required":true}, - "stack": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cVerifyResult_W3cCredentialValidations_": { - "dataType": "refObject", - "properties": { - "isValid": {"dataType":"boolean","required":true}, - "validations": {"ref":"Partial_W3cCredentialValidations_","required":true}, - "error": {"ref":"Error"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cVerifyCredentialResult": { - "dataType": "refAlias", - "type": {"ref":"W3cVerifyResult_W3cCredentialValidations_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_LinkedDataProofOptions.Exclude_keyofLinkedDataProofOptions.cryptosuite__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"proofPurpose":{"dataType":"string","required":true},"created":{"dataType":"string","required":true},"verificationMethod":{"dataType":"string","required":true},"type":{"dataType":"string","required":true},"domain":{"dataType":"string"},"challenge":{"dataType":"string"},"jws":{"dataType":"string"},"proofValue":{"dataType":"string"},"nonce":{"dataType":"string"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_LinkedDataProofOptions.cryptosuite_": { - "dataType": "refAlias", - "type": {"ref":"Pick_LinkedDataProofOptions.Exclude_keyofLinkedDataProofOptions.cryptosuite__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DataIntegrityProofOptions": { - "dataType": "refObject", - "properties": { - "type": {"dataType":"string","required":true}, - "cryptosuite": {"dataType":"string","required":true}, - "verificationMethod": {"dataType":"string","required":true}, - "proofPurpose": {"dataType":"string","required":true}, - "domain": {"dataType":"string"}, - "challenge": {"dataType":"string"}, - "nonce": {"dataType":"string"}, - "created": {"dataType":"string"}, - "expires": {"dataType":"string"}, - "proofValue": {"dataType":"string"}, - "previousProof": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SingleOrArray_Omit_LinkedDataProofOptions.cryptosuite_-or-DataIntegrityProofOptions_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"union","subSchemas":[{"ref":"Omit_LinkedDataProofOptions.cryptosuite_"},{"ref":"DataIntegrityProofOptions"}]},{"dataType":"array","array":{"dataType":"union","subSchemas":[{"ref":"Omit_LinkedDataProofOptions.cryptosuite_"},{"ref":"DataIntegrityProofOptions"}]}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "LinkedDataProof": { - "dataType": "refObject", - "properties": { - "type": {"dataType":"string","required":true}, - "proofPurpose": {"dataType":"string","required":true}, - "verificationMethod": {"dataType":"string","required":true}, - "created": {"dataType":"string","required":true}, - "domain": {"dataType":"string"}, - "challenge": {"dataType":"string"}, - "jws": {"dataType":"string"}, - "proofValue": {"dataType":"string"}, - "nonce": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DataIntegrityProof": { - "dataType": "refObject", - "properties": { - "type": {"dataType":"string","required":true}, - "cryptosuite": {"dataType":"string","required":true}, - "proofPurpose": {"dataType":"string","required":true}, - "verificationMethod": {"dataType":"string","required":true}, - "domain": {"dataType":"string"}, - "challenge": {"dataType":"string"}, - "nonce": {"dataType":"string"}, - "created": {"dataType":"string"}, - "expires": {"dataType":"string"}, - "proofValue": {"dataType":"string"}, - "previousProof": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SingleOrArray_LinkedDataProof-or-DataIntegrityProof_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"union","subSchemas":[{"ref":"LinkedDataProof"},{"ref":"DataIntegrityProof"}]},{"dataType":"array","array":{"dataType":"union","subSchemas":[{"ref":"LinkedDataProof"},{"ref":"DataIntegrityProof"}]}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cJsonLdVerifiableCredential": { - "dataType": "refObject", - "properties": { - "context": {"dataType":"array","array":{"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"JsonObject"}]},"required":true}, - "id": {"dataType":"string"}, - "type": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "issuer": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"W3cIssuer"}],"required":true}, - "issuanceDate": {"dataType":"string","required":true}, - "expirationDate": {"dataType":"string"}, - "credentialSubject": {"ref":"SingleOrArray_W3cCredentialSubject_","required":true}, - "credentialSchema": {"ref":"SingleOrArray_W3cCredentialSchema_"}, - "credentialStatus": {"ref":"W3cCredentialStatus"}, - "proof": {"ref":"SingleOrArray_LinkedDataProof-or-DataIntegrityProof_","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProofPurpose": { - "dataType": "refAlias", - "type": {"dataType":"any","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SafeW3cJsonLdVerifyCredentialOptions": { - "dataType": "refObject", - "properties": { - "credential": {"ref":"W3cJsonLdVerifiableCredential","required":true}, - "verifyCredentialStatus": {"dataType":"boolean"}, - "proofPurpose": {"ref":"ProofPurpose"}, - "proof": {"ref":"SingleOrArray_Omit_LinkedDataProofOptions.cryptosuite_-or-DataIntegrityProofOptions_","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "QuestionAnswerRole": { - "dataType": "refEnum", - "enums": ["questioner","responder"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "QuestionAnswerState": { - "dataType": "refEnum", - "enums": ["question-sent","question-received","answer-received","answer-sent"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RecordId": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ValidResponse": { - "dataType": "refObject", - "properties": { - "text": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_response.string_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"response":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProofExchangeRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AutoAcceptProof": { - "dataType": "refEnum", - "enums": ["always","contentApproved","never"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RequestProofProposalOptions": { - "dataType": "refObject", - "properties": { - "connectionId": {"dataType":"string","required":true}, - "proofFormats": {"dataType":"any","required":true}, - "goalCode": {"dataType":"string"}, - "parentThreadId": {"dataType":"string"}, - "autoAcceptProof": {"ref":"AutoAcceptProof"}, - "comment": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AcceptProofProposal": { - "dataType": "refObject", - "properties": { - "proofRecordId": {"dataType":"string","required":true}, - "proofFormats": {"dataType":"any","required":true}, - "comment": {"dataType":"string"}, - "autoAcceptProof": {"ref":"AutoAcceptProof"}, - "goalCode": {"dataType":"string"}, - "willConfirm": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RequestProofOptions": { - "dataType": "refObject", - "properties": { - "connectionId": {"dataType":"string","required":true}, - "protocolVersion": {"dataType":"string","required":true}, - "proofFormats": {"dataType":"any","required":true}, - "comment": {"dataType":"string","required":true}, - "autoAcceptProof": {"ref":"AutoAcceptProof","required":true}, - "goalCode": {"dataType":"string"}, - "parentThreadId": {"dataType":"string"}, - "willConfirm": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "PlaintextMessage": { - "dataType": "refObject", - "properties": { - "@type": {"dataType":"string","required":true}, - "@id": {"dataType":"string","required":true}, - "~thread": {"dataType":"nestedObjectLiteral","nestedProperties":{"pthid":{"dataType":"string"},"thid":{"dataType":"string"}}}, - }, - "additionalProperties": {"dataType":"any"}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateProofRequestOobOptions": { - "dataType": "refObject", - "properties": { - "protocolVersion": {"dataType":"string","required":true}, - "proofFormats": {"dataType":"any","required":true}, - "goalCode": {"dataType":"string"}, - "parentThreadId": {"dataType":"string"}, - "willConfirm": {"dataType":"boolean"}, - "autoAcceptProof": {"ref":"AutoAcceptProof"}, - "comment": {"dataType":"string"}, - "label": {"dataType":"string"}, - "imageUrl": {"dataType":"string"}, - "recipientKey": {"dataType":"string"}, - "invitationDid": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.proposal_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.request_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.presentation_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GetProofFormatDataReturn__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"presentation":{"ref":"ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.presentation_"},"request":{"ref":"ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.request_"},"proposal":{"ref":"ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.proposal_"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "HandshakeProtocol": { - "dataType": "refEnum", - "enums": ["https://didcomm.org/didexchange/1.x","https://didcomm.org/connections/1.x"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AgentMessage": { - "dataType": "refAlias", - "type": {"ref":"PlaintextMessage","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Routing": { - "dataType": "refObject", - "properties": { - "endpoints": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "recipientKey": {"ref":"Key","required":true}, - "routingKeys": {"dataType":"array","array":{"dataType":"refObject","ref":"Key"},"required":true}, - "mediatorId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"header":{"ref":"Record_string.unknown_","required":true},"signature":{"dataType":"string","required":true},"protected":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_JwsGeneralFormat.payload_": { - "dataType": "refAlias", - "type": {"ref":"Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JwsDetachedFormat": { - "dataType": "refAlias", - "type": {"ref":"Omit_JwsGeneralFormat.payload_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JwsFlattenedDetachedFormat": { - "dataType": "refObject", - "properties": { - "signatures": {"dataType":"array","array":{"dataType":"refAlias","ref":"JwsDetachedFormat"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AttachmentData": { - "dataType": "refObject", - "properties": { - "base64": {"dataType":"string"}, - "json": {"ref":"JsonValue"}, - "links": {"dataType":"array","array":{"dataType":"string"}}, - "jws": {"dataType":"union","subSchemas":[{"ref":"JwsDetachedFormat"},{"ref":"JwsFlattenedDetachedFormat"}]}, - "sha256": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Attachment": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "description": {"dataType":"string"}, - "filename": {"dataType":"string"}, - "mimeType": {"dataType":"string"}, - "lastmodTime": {"dataType":"datetime"}, - "byteCount": {"dataType":"double"}, - "data": {"ref":"AttachmentData","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateInvitationOptions": { - "dataType": "refObject", - "properties": { - "label": {"dataType":"string"}, - "alias": {"dataType":"string"}, - "imageUrl": {"dataType":"string"}, - "goalCode": {"dataType":"string"}, - "goal": {"dataType":"string"}, - "handshake": {"dataType":"boolean"}, - "handshakeProtocols": {"dataType":"array","array":{"dataType":"refEnum","ref":"HandshakeProtocol"}}, - "messages": {"dataType":"array","array":{"dataType":"refAlias","ref":"AgentMessage"}}, - "multiUseInvitation": {"dataType":"boolean"}, - "autoAcceptConnection": {"dataType":"boolean"}, - "routing": {"ref":"Routing"}, - "appendedAttachments": {"dataType":"array","array":{"dataType":"refObject","ref":"Attachment"}}, - "invitationDid": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RecipientKeyOption": { - "dataType": "refObject", - "properties": { - "recipientKey": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"alias":{"dataType":"string"},"label":{"dataType":"string"},"imageUrl":{"dataType":"string"},"multiUseInvitation":{"dataType":"boolean"},"autoAcceptConnection":{"dataType":"boolean"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_CreateLegacyInvitationConfig.routing_": { - "dataType": "refAlias", - "type": {"ref":"Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OutOfBandRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CustomHandshakeProtocol": { - "dataType": "refEnum", - "enums": ["https://didcomm.org/didexchange/1.1","https://didcomm.org/connections/1.0"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SingleOrArray_string-or-Record_string.unknown__": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"Record_string.unknown_"}]},{"dataType":"array","array":{"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"Record_string.unknown_"}]}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OutOfBandDidCommService": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "serviceEndpoint": {"dataType":"string","required":true}, - "type": {"dataType":"string","required":true}, - "recipientKeys": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "routingKeys": {"dataType":"array","array":{"dataType":"string"}}, - "accept": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OutOfBandInvitationSchema": { - "dataType": "refObject", - "properties": { - "@id": {"dataType":"string"}, - "@type": {"dataType":"string","required":true}, - "label": {"dataType":"string","required":true}, - "goalCode": {"dataType":"string"}, - "goal": {"dataType":"string"}, - "accept": {"dataType":"array","array":{"dataType":"string"}}, - "handshake_protocols": {"dataType":"array","array":{"dataType":"refEnum","ref":"CustomHandshakeProtocol"}}, - "services": {"dataType":"array","array":{"dataType":"union","subSchemas":[{"ref":"OutOfBandDidCommService"},{"dataType":"string"}]},"required":true}, - "imageUrl": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"alias":{"dataType":"string"},"label":{"dataType":"string"},"imageUrl":{"dataType":"string"},"autoAcceptConnection":{"dataType":"boolean"},"autoAcceptInvitation":{"dataType":"boolean"},"reuseConnection":{"dataType":"boolean"},"acceptInvitationTimeoutMs":{"dataType":"double"},"ourDid":{"dataType":"string"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_ReceiveOutOfBandInvitationConfig.routing_": { - "dataType": "refAlias", - "type": {"ref":"Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ReceiveInvitationProps": { - "dataType": "refObject", - "properties": { - "alias": {"dataType":"string"}, - "label": {"dataType":"string"}, - "imageUrl": {"dataType":"string"}, - "autoAcceptConnection": {"dataType":"boolean"}, - "autoAcceptInvitation": {"dataType":"boolean"}, - "reuseConnection": {"dataType":"boolean"}, - "acceptInvitationTimeoutMs": {"dataType":"double"}, - "ourDid": {"dataType":"string"}, - "invitation": {"ref":"OutOfBandInvitationSchema","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ReceiveInvitationByUrlProps": { - "dataType": "refObject", - "properties": { - "alias": {"dataType":"string"}, - "label": {"dataType":"string"}, - "imageUrl": {"dataType":"string"}, - "autoAcceptConnection": {"dataType":"boolean"}, - "autoAcceptInvitation": {"dataType":"boolean"}, - "reuseConnection": {"dataType":"boolean"}, - "acceptInvitationTimeoutMs": {"dataType":"double"}, - "ourDid": {"dataType":"string"}, - "invitationUrl": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AcceptInvitationConfig": { - "dataType": "refObject", - "properties": { - "autoAcceptConnection": {"dataType":"boolean"}, - "reuseConnection": {"dataType":"boolean"}, - "label": {"dataType":"string"}, - "alias": {"dataType":"string"}, - "imageUrl": {"dataType":"string"}, - "mediatorId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ThreadId": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialState": { - "dataType": "refEnum", - "enums": ["proposal-sent","proposal-received","offer-sent","offer-received","declined","request-sent","request-received","credential-issued","credential-received","done","abandoned"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialRole": { - "dataType": "refEnum", - "enums": ["issuer","holder"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialExchangeRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProtocolVersion": { - "dataType": "refEnum", - "enums": ["v1","v2"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialPreviewAttributeOptions": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string","required":true}, - "mimeType": {"dataType":"string"}, - "value": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "LinkedAttachment": { - "dataType": "refObject", - "properties": { - "attributeName": {"dataType":"string","required":true}, - "attachment": {"ref":"Attachment","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_AnonCredsProposeCredentialFormat.Exclude_keyofAnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"schemaId":{"dataType":"string"},"schemaName":{"dataType":"string"},"schemaVersion":{"dataType":"string"},"credentialDefinitionId":{"dataType":"string"},"attributes":{"dataType":"array","array":{"dataType":"refObject","ref":"CredentialPreviewAttributeOptions"}},"linkedAttachments":{"dataType":"array","array":{"dataType":"refObject","ref":"LinkedAttachment"}},"schemaIssuerDid":{"dataType":"string"},"issuerDid":{"dataType":"string"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_AnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId_": { - "dataType": "refAlias", - "type": {"ref":"Pick_AnonCredsProposeCredentialFormat.Exclude_keyofAnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "LegacyIndyProposeCredentialFormat": { - "dataType": "refAlias", - "type": {"ref":"Omit_AnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "W3cIssuerOptions": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SingleOrArray_JsonObject_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"JsonObject"},{"dataType":"array","array":{"dataType":"refObject","ref":"JsonObject"}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JsonCredential": { - "dataType": "refObject", - "properties": { - "@context": {"dataType":"union","subSchemas":[{"dataType":"array","array":{"dataType":"string"}},{"ref":"JsonObject"}],"required":true}, - "id": {"dataType":"string"}, - "type": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "issuer": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"W3cIssuerOptions"}],"required":true}, - "issuanceDate": {"dataType":"string","required":true}, - "expirationDate": {"dataType":"string"}, - "credentialSubject": {"ref":"SingleOrArray_JsonObject_","required":true}, - "prettyVc": {"dataType":"any"}, - }, - "additionalProperties": {"dataType":"any"}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JsonLdCredentialDetailFormat": { - "dataType": "refObject", - "properties": { - "credential": {"ref":"JsonCredential","required":true}, - "options": {"dataType":"nestedObjectLiteral","nestedProperties":{"proofType":{"dataType":"string","required":true},"proofPurpose":{"dataType":"string","required":true}},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsProposeCredentialFormat": { - "dataType": "refObject", - "properties": { - "schemaIssuerId": {"dataType":"string"}, - "schemaId": {"dataType":"string"}, - "schemaName": {"dataType":"string"}, - "schemaVersion": {"dataType":"string"}, - "credentialDefinitionId": {"dataType":"string"}, - "issuerId": {"dataType":"string"}, - "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialPreviewAttributeOptions"}}, - "linkedAttachments": {"dataType":"array","array":{"dataType":"refObject","ref":"LinkedAttachment"}}, - "schemaIssuerDid": {"dataType":"string"}, - "issuerDid": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatPayload_CredentialFormatType-Array.createProposal_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"LegacyIndyProposeCredentialFormat"},"jsonld":{"ref":"JsonLdCredentialDetailFormat"},"anoncreds":{"ref":"AnonCredsProposeCredentialFormat"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AutoAcceptCredential": { - "dataType": "refEnum", - "enums": ["always","contentApproved","never"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProposeCredentialOptions": { - "dataType": "refObject", - "properties": { - "protocolVersion": {"ref":"ProtocolVersion","required":true}, - "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormatType-Array.createProposal_","required":true}, - "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, - "comment": {"dataType":"string"}, - "connectionId": {"ref":"RecordId","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsAcceptProposalFormat": { - "dataType": "refObject", - "properties": { - "credentialDefinitionId": {"dataType":"string"}, - "revocationRegistryDefinitionId": {"dataType":"string"}, - "revocationRegistryIndex": {"dataType":"double"}, - "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialPreviewAttributeOptions"}}, - "linkedAttachments": {"dataType":"array","array":{"dataType":"refObject","ref":"LinkedAttachment"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.never_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "EmptyObject": { - "dataType": "refAlias", - "type": {"ref":"Record_string.never_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatPayload_CredentialFormats.acceptProposal_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsAcceptProposalFormat"},"jsonld":{"ref":"EmptyObject"},"anoncreds":{"ref":"AnonCredsAcceptProposalFormat"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AcceptCredentialProposalOptions": { - "dataType": "refObject", - "properties": { - "credentialRecordId": {"dataType":"string","required":true}, - "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormats.acceptProposal_"}, - "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, - "comment": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsOfferCredentialFormat": { - "dataType": "refObject", - "properties": { - "credentialDefinitionId": {"dataType":"string","required":true}, - "revocationRegistryDefinitionId": {"dataType":"string"}, - "revocationRegistryIndex": {"dataType":"double"}, - "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialPreviewAttributeOptions"},"required":true}, - "linkedAttachments": {"dataType":"array","array":{"dataType":"refObject","ref":"LinkedAttachment"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatPayload_CredentialFormats.createOffer_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsOfferCredentialFormat"},"jsonld":{"ref":"JsonLdCredentialDetailFormat"},"anoncreds":{"ref":"AnonCredsOfferCredentialFormat"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateOfferOptions": { - "dataType": "refObject", - "properties": { - "protocolVersion": {"ref":"ProtocolVersion","required":true}, - "connectionId": {"ref":"RecordId","required":true}, - "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormats.createOffer_","required":true}, - "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, - "comment": {"dataType":"string"}, - "goalCode": {"dataType":"string"}, - "goal": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatPayload_CredentialFormatType-Array.createOffer_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsOfferCredentialFormat"},"jsonld":{"ref":"JsonLdCredentialDetailFormat"},"anoncreds":{"ref":"AnonCredsOfferCredentialFormat"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateOfferOobOptions": { - "dataType": "refObject", - "properties": { - "protocolVersion": {"dataType":"string","required":true}, - "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormatType-Array.createOffer_","required":true}, - "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, - "comment": {"dataType":"string"}, - "goalCode": {"dataType":"string"}, - "parentThreadId": {"dataType":"string"}, - "willConfirm": {"dataType":"boolean"}, - "label": {"dataType":"string"}, - "imageUrl": {"dataType":"string"}, - "recipientKey": {"dataType":"string"}, - "invitationDid": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsAcceptOfferFormat": { - "dataType": "refObject", - "properties": { - "linkSecretId": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatPayload_CredentialFormats.acceptOffer_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsAcceptOfferFormat"},"jsonld":{"ref":"EmptyObject"},"anoncreds":{"ref":"AnonCredsAcceptOfferFormat"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialOfferOptions": { - "dataType": "refObject", - "properties": { - "credentialRecordId": {"ref":"RecordId","required":true}, - "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormats.acceptOffer_"}, - "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, - "comment": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AnonCredsAcceptRequestFormat": { - "dataType": "refAlias", - "type": {"ref":"Record_string.never_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JsonLdAcceptRequestFormat": { - "dataType": "refObject", - "properties": { - "verificationMethod": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatPayload_CredentialFormats.acceptRequest_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"AnonCredsAcceptRequestFormat"},"jsonld":{"ref":"JsonLdAcceptRequestFormat"},"anoncreds":{"ref":"AnonCredsAcceptRequestFormat"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AcceptCredentialRequestOptions": { - "dataType": "refObject", - "properties": { - "credentialRecordId": {"ref":"RecordId","required":true}, - "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormats.acceptRequest_"}, - "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, - "comment": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AcceptCredential": { - "dataType": "refObject", - "properties": { - "credentialRecordId": {"ref":"RecordId","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.proposal_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.offer_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.request_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.credential_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GetCredentialFormatDataReturn__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"credential":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.credential_"},"request":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.request_"},"offerAttributes":{"dataType":"array","array":{"dataType":"refObject","ref":"CredentialPreviewAttributeOptions"}},"offer":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.offer_"},"proposal":{"ref":"CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.proposal_"},"proposalAttributes":{"dataType":"array","array":{"dataType":"refObject","ref":"CredentialPreviewAttributeOptions"}}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DidExchangeState": { - "dataType": "refEnum", - "enums": ["start","invitation-sent","invitation-received","request-sent","request-received","response-sent","response-received","abandoned","completed"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ConnectionRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "BasicMessageRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_content.string_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"content":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_InitConfig.label_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "KeyDerivationMethod": { - "dataType": "refEnum", - "enums": ["ARGON2I_MOD","ARGON2I_INT","RAW"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_WalletConfig.id-or-key-or-keyDerivationMethod_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"key":{"dataType":"string","required":true},"id":{"dataType":"string","required":true},"keyDerivationMethod":{"ref":"KeyDerivationMethod"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "TenantConfig": { - "dataType": "refAlias", - "type": {"dataType":"intersection","subSchemas":[{"ref":"Pick_InitConfig.label_"},{"dataType":"nestedObjectLiteral","nestedProperties":{"walletConfig":{"ref":"Pick_WalletConfig.id-or-key-or-keyDerivationMethod_","required":true}}}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "MetadataValue": { - "dataType": "refAlias", - "type": {"ref":"Record_string.any_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "MetadataBase": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"MetadataValue"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Metadata____": { - "dataType": "refObject", - "properties": { - "data": {"ref":"MetadataBase","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string","required":true},"connectionImageUrl":{"dataType":"string"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Omit_CustomTenantConfig.walletConfig_": { - "dataType": "refAlias", - "type": {"ref":"Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateTenantOptions": { - "dataType": "refObject", - "properties": { - "config": {"ref":"Omit_CustomTenantConfig.walletConfig_","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcIssuanceSessionRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.boolean_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.boolean-or-Record_string.boolean__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"union","subSchemas":[{"dataType":"boolean"},{"ref":"Record_string.boolean_"}]},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VciCredentialFormatProfile": { - "dataType": "refEnum", - "enums": ["jwt_vc_json","jwt_vc_json-ld","ldp_vc","vc+sd-jwt","mso_mdoc"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SignerMethod": { - "dataType": "refEnum", - "enums": ["did","x5c"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VciOfferSdJwtCredential": { - "dataType": "refObject", - "properties": { - "credentialSupportedId": {"dataType":"string","required":true}, - "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, - "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, - "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"vct":{"dataType":"string"}},"additionalProperties":{"dataType":"any"},"required":true}, - "disclosureFrame": {"ref":"Record_string.boolean-or-Record_string.boolean__"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Partial_ValidityInfo_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"signed":{"dataType":"datetime"},"validFrom":{"dataType":"datetime"},"validUntil":{"dataType":"datetime"},"expectedUpdate":{"dataType":"datetime"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.Record_string.unknown__": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"Record_string.unknown_"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "MdocNameSpaces": { - "dataType": "refAlias", - "type": {"ref":"Record_string.Record_string.unknown__","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VciOfferMdocCredential": { - "dataType": "refObject", - "properties": { - "credentialSupportedId": {"dataType":"string","required":true}, - "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, - "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, - "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"namespaces":{"ref":"MdocNameSpaces","required":true},"validityInfo":{"ref":"Partial_ValidityInfo_"},"docType":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["org.iso.18013.5.1.mDL"]},{"dataType":"intersection","subSchemas":[{"dataType":"string"},{"dataType":"nestedObjectLiteral","nestedProperties":{}}]}],"required":true}},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VciOfferW3cCredential": { - "dataType": "refObject", - "properties": { - "credentialSupportedId": {"dataType":"string","required":true}, - "format": {"ref":"OpenId4VciCredentialFormatProfile","required":true}, - "signerOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"x5c":{"dataType":"array","array":{"dataType":"string"}},"did":{"dataType":"string"},"method":{"ref":"SignerMethod","required":true}},"required":true}, - "payload": {"dataType":"nestedObjectLiteral","nestedProperties":{"credential":{"ref":"W3cCredential","required":true},"verificationMethod":{"dataType":"string","required":true}},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcIssuanceSessionsCreateOffer": { - "dataType": "refObject", - "properties": { - "publicIssuerId": {"dataType":"string","required":true}, - "credentials": {"dataType":"array","array":{"dataType":"union","subSchemas":[{"ref":"OpenId4VciOfferSdJwtCredential"},{"ref":"OpenId4VciOfferMdocCredential"},{"ref":"OpenId4VciOfferW3cCredential"}]},"required":true}, - "authorizationCodeFlowConfig": {"dataType":"nestedObjectLiteral","nestedProperties":{"issuerState":{"dataType":"string"},"requirePresentationDuringIssuance":{"dataType":"boolean"},"authorizationServerUrl":{"dataType":"string","required":true}}}, - "preAuthorizedCodeFlowConfig": {"dataType":"nestedObjectLiteral","nestedProperties":{"authorizationServerUrl":{"dataType":"string","required":true},"txCode":{"dataType":"nestedObjectLiteral","nestedProperties":{"input_mode":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["numeric"]},{"dataType":"enum","enums":["text"]}]},"length":{"dataType":"double"},"description":{"dataType":"string"}}},"preAuthorizedCode":{"dataType":"string"}}}, - "issuanceMetadata": {"ref":"Record_string.unknown_"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcIssuanceSessionState": { - "dataType": "refEnum", - "enums": ["OfferCreated","OfferUriRetrieved","AuthorizationInitiated","AuthorizationGranted","AccessTokenRequested","AccessTokenCreated","CredentialRequestReceived","CredentialsPartiallyIssued","Completed","Error"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcIssuerRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Logo": { - "dataType": "refObject", - "properties": { - "uri": {"dataType":"string"}, - "alt_text": {"dataType":"string"}, - }, - "additionalProperties": {"dataType":"any"}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialDisplay": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "locale": {"dataType":"string"}, - "logo": {"ref":"Logo"}, - }, - "additionalProperties": {"dataType":"any"}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AuthorizationServerClientAuth": { - "dataType": "refObject", - "properties": { - "clientId": {"dataType":"string","required":true}, - "clientSecret": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AuthorizationServerConfig": { - "dataType": "refObject", - "properties": { - "issuer": {"dataType":"string","required":true}, - "clientAuthentication": {"ref":"AuthorizationServerClientAuth"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ProofTypeConfig": { - "dataType": "refObject", - "properties": { - "proof_signing_alg_values_supported": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.ProofTypeConfig_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"ProofTypeConfig"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialDefinition": { - "dataType": "refObject", - "properties": { - "type": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": {"dataType":"any"}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialConfigurationDisplay": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string","required":true}, - "locale": {"dataType":"string"}, - "logo": {"ref":"Logo"}, - "description": {"dataType":"string"}, - "background_color": {"dataType":"string"}, - "background_image": {"ref":"Logo"}, - "text_color": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialConfigurationSupportedWithFormats": { - "dataType": "refObject", - "properties": { - "format": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["vc+sd-jwt"]},{"dataType":"enum","enums":["mso_mdoc"]},{"dataType":"enum","enums":["jwt_vc_json"]},{"dataType":"string"}],"required":true}, - "vct": {"dataType":"string"}, - "doctype": {"dataType":"string"}, - "scope": {"dataType":"string"}, - "claims": {"dataType":"any"}, - "cryptographic_binding_methods_supported": {"dataType":"array","array":{"dataType":"string"}}, - "credential_signing_alg_values_supported": {"dataType":"array","array":{"dataType":"string"}}, - "proof_types_supported": {"ref":"Record_string.ProofTypeConfig_"}, - "credential_definition": {"ref":"CredentialDefinition"}, - "display": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialConfigurationDisplay"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Record_string.CredentialConfigurationSupportedWithFormats_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"CredentialConfigurationSupportedWithFormats"},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "BatchCredentialIssuanceOptions": { - "dataType": "refObject", - "properties": { - "batchSize": {"dataType":"double","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateIssuerOptions": { - "dataType": "refObject", - "properties": { - "issuerId": {"dataType":"string"}, - "accessTokenSignerKeyType": {"dataType":"string"}, - "display": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialDisplay"}}, - "authorizationServerConfigs": {"dataType":"array","array":{"dataType":"refObject","ref":"AuthorizationServerConfig"}}, - "dpopSigningAlgValuesSupported": {"dataType":"array","array":{"dataType":"string"}}, - "credentialConfigurationsSupported": {"ref":"Record_string.CredentialConfigurationSupportedWithFormats_","required":true}, - "batchCredentialIssuance": {"ref":"BatchCredentialIssuanceOptions"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "UpdateIssuerRecordOptions": { - "dataType": "refObject", - "properties": { - "display": {"dataType":"array","array":{"dataType":"refObject","ref":"CredentialDisplay"}}, - "dpopSigningAlgValuesSupported": {"dataType":"array","array":{"dataType":"string"}}, - "credentialConfigurationsSupported": {"ref":"Record_string.CredentialConfigurationSupportedWithFormats_","required":true}, - "batchCredentialIssuance": {"ref":"BatchCredentialIssuanceOptions"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "JwtObject": { - "dataType": "refObject", - "properties": { - "alg": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "LdpObject": { - "dataType": "refObject", - "properties": { - "proof_type": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DiObject": { - "dataType": "refObject", - "properties": { - "proof_type": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "cryptosuite": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SdJwtObject": { - "dataType": "refObject", - "properties": { - "undefined": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "MsoMdocObject": { - "dataType": "refObject", - "properties": { - "alg": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Format": { - "dataType": "refObject", - "properties": { - "jwt": {"ref":"JwtObject"}, - "jwt_vc": {"ref":"JwtObject"}, - "jwt_vc_json": {"ref":"JwtObject"}, - "jwt_vp": {"ref":"JwtObject"}, - "jwt_vp_json": {"ref":"JwtObject"}, - "ldp": {"ref":"LdpObject"}, - "ldp_vc": {"ref":"LdpObject"}, - "ldp_vp": {"ref":"LdpObject"}, - "di": {"ref":"DiObject"}, - "di_vc": {"ref":"DiObject"}, - "di_vp": {"ref":"DiObject"}, - "undefined": {"ref":"SdJwtObject"}, - "mso_mdoc": {"ref":"MsoMdocObject"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Issuance": { - "dataType": "refObject", - "properties": { - "manifest": {"dataType":"string"}, - }, - "additionalProperties": {"dataType":"union","subSchemas":[{"dataType":"any"},{"dataType":"any"}]}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Optionality": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["required"]},{"dataType":"enum","enums":["preferred"]}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Directives": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["required"]},{"dataType":"enum","enums":["allowed"]},{"dataType":"enum","enums":["disallowed"]}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "PdStatus": { - "dataType": "refObject", - "properties": { - "directive": {"ref":"Directives"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Statuses": { - "dataType": "refObject", - "properties": { - "active": {"ref":"PdStatus"}, - "suspended": {"ref":"PdStatus"}, - "revoked": {"ref":"PdStatus"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OneOfNumberStringBoolean": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"boolean"},{"dataType":"double"},{"dataType":"string"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OneOfNumberString": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"double"},{"dataType":"string"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "FilterV2": { - "dataType": "refObject", - "properties": { - "const": {"ref":"OneOfNumberStringBoolean"}, - "enum": {"dataType":"array","array":{"dataType":"refAlias","ref":"OneOfNumberStringBoolean"}}, - "exclusiveMinimum": {"ref":"OneOfNumberString"}, - "exclusiveMaximum": {"ref":"OneOfNumberString"}, - "format": {"dataType":"string"}, - "formatMaximum": {"dataType":"string"}, - "formatMinimum": {"dataType":"string"}, - "formatExclusiveMaximum": {"dataType":"string"}, - "formatExclusiveMinimum": {"dataType":"string"}, - "minLength": {"dataType":"double"}, - "maxLength": {"dataType":"double"}, - "minimum": {"ref":"OneOfNumberString"}, - "maximum": {"ref":"OneOfNumberString"}, - "not": {"dataType":"object"}, - "pattern": {"dataType":"string"}, - "type": {"dataType":"string"}, - "contains": {"ref":"FilterV2"}, - "items": {"ref":"FilterV2Items"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "FilterV2Items": { - "dataType": "refObject", - "properties": { - "const": {"ref":"OneOfNumberStringBoolean"}, - "enum": {"dataType":"array","array":{"dataType":"refAlias","ref":"OneOfNumberStringBoolean"}}, - "exclusiveMinimum": {"ref":"OneOfNumberString"}, - "exclusiveMaximum": {"ref":"OneOfNumberString"}, - "format": {"dataType":"string"}, - "formatMaximum": {"dataType":"string"}, - "formatMinimum": {"dataType":"string"}, - "formatExclusiveMaximum": {"dataType":"string"}, - "formatExclusiveMinimum": {"dataType":"string"}, - "minLength": {"dataType":"double"}, - "maxLength": {"dataType":"double"}, - "minimum": {"ref":"OneOfNumberString"}, - "maximum": {"ref":"OneOfNumberString"}, - "not": {"dataType":"object"}, - "pattern": {"dataType":"string"}, - "type": {"dataType":"string"}, - "contains": {"ref":"FilterV2"}, - "items": {"ref":"FilterV2Items"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "FieldV2": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string"}, - "path": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "purpose": {"dataType":"string"}, - "filter": {"ref":"FilterV2"}, - "predicate": {"ref":"Optionality"}, - "intent_to_retain": {"dataType":"boolean"}, - "name": {"dataType":"string"}, - "optional": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "HolderSubject": { - "dataType": "refObject", - "properties": { - "field_id": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "directive": {"ref":"Optionality","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ConstraintsV2": { - "dataType": "refObject", - "properties": { - "limit_disclosure": {"ref":"Optionality"}, - "statuses": {"ref":"Statuses"}, - "fields": {"dataType":"array","array":{"dataType":"refObject","ref":"FieldV2"}}, - "subject_is_issuer": {"ref":"Optionality"}, - "is_holder": {"dataType":"array","array":{"dataType":"refObject","ref":"HolderSubject"}}, - "same_subject": {"dataType":"array","array":{"dataType":"refObject","ref":"HolderSubject"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "InputDescriptorV2Model": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "name": {"dataType":"string"}, - "purpose": {"dataType":"string"}, - "format": {"ref":"Format"}, - "group": {"dataType":"array","array":{"dataType":"string"}}, - "issuance": {"dataType":"array","array":{"dataType":"refObject","ref":"Issuance"}}, - "constraints": {"ref":"ConstraintsV2","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Rules": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["all"]},{"dataType":"enum","enums":["pick"]}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SubmissionRequirement": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "purpose": {"dataType":"string"}, - "rule": {"ref":"Rules","required":true}, - "count": {"dataType":"double"}, - "min": {"dataType":"double"}, - "max": {"dataType":"double"}, - "from": {"dataType":"string"}, - "from_nested": {"dataType":"array","array":{"dataType":"refObject","ref":"SubmissionRequirement"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "InputDescriptorV2": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "name": {"dataType":"string"}, - "purpose": {"dataType":"string"}, - "format": {"ref":"Format"}, - "group": {"dataType":"array","array":{"dataType":"string"}}, - "issuance": {"dataType":"array","array":{"dataType":"refObject","ref":"Issuance"}}, - "constraints": {"ref":"ConstraintsV2","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "PresentationDefinitionV2": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "name": {"dataType":"string"}, - "purpose": {"dataType":"string"}, - "format": {"ref":"Format"}, - "submission_requirements": {"dataType":"array","array":{"dataType":"refObject","ref":"SubmissionRequirement"}}, - "input_descriptors": {"dataType":"array","array":{"dataType":"refObject","ref":"InputDescriptorV2"},"required":true}, - "frame": {"dataType":"object"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DifPresentationExchangeDefinitionV2Model": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "name": {"dataType":"string"}, - "purpose": {"dataType":"string"}, - "format": {"ref":"Format"}, - "submission_requirements": {"dataType":"array","array":{"dataType":"any"}}, - "input_descriptors": {"dataType":"array","array":{"dataType":"refObject","ref":"InputDescriptorV2Model"},"required":true}, - "frame": {"dataType":"object"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "PresentationDefinition": { - "dataType": "refObject", - "properties": { - "definition": {"ref":"DifPresentationExchangeDefinitionV2Model","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DcqlClaim": { - "dataType": "refObject", - "properties": { - "path": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "intent_to_retain": {"dataType":"boolean"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DcqlCredential": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "format": {"dataType":"string","required":true}, - "meta": {"ref":"Record_string.any_"}, - "require_cryptographic_holder_binding": {"dataType":"boolean"}, - "claims": {"dataType":"array","array":{"dataType":"refObject","ref":"DcqlClaim"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DcqlQuery": { - "dataType": "refObject", - "properties": { - "combine": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["all"]},{"dataType":"enum","enums":["any"]}]}, - "credentials": {"dataType":"array","array":{"dataType":"refObject","ref":"DcqlCredential"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DcqlDefinition": { - "dataType": "refObject", - "properties": { - "query": {"ref":"DcqlQuery","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResponseModeEnum": { - "dataType": "refEnum", - "enums": ["direct_post","direct_post.jwt","dc_api","dc_api.jwt"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcJwtIssuerDid": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"didUrl":{"dataType":"string","required":true},"method":{"dataType":"enum","enums":["did"],"required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcIssuerX5c": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"alg":{"dataType":"string"},"x5c":{"dataType":"array","array":{"dataType":"string"},"required":true},"issuer":{"dataType":"string"},"method":{"dataType":"enum","enums":["x5c"],"required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CreateAuthorizationRequest": { - "dataType": "refObject", - "properties": { - "verifierId": {"dataType":"string","required":true}, - "presentationExchange": {"ref":"PresentationDefinition"}, - "dcql": {"dataType":"union","subSchemas":[{"dataType":"string"},{"ref":"DcqlDefinition"}]}, - "responseMode": {"ref":"ResponseModeEnum"}, - "requestSigner": {"dataType":"union","subSchemas":[{"ref":"OpenId4VcJwtIssuerDid"},{"ref":"OpenId4VcIssuerX5c"}],"required":true}, - "expectedOrigins": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcVerificationSessionRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcVerificationSessionState": { - "dataType": "refEnum", - "enums": ["RequestCreated","RequestUriRetrieved","ResponseVerified","Error"], - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "SdJwtVcRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "MdocRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResolveCredentialOfferBody": { - "dataType": "refObject", - "properties": { - "credentialOfferUri": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "AuthorizeRequestCredentialOffer": { - "dataType": "refObject", - "properties": { - "credentialOfferUri": {"dataType":"string","required":true}, - "credentialsToRequest": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RequestCredentialBody": { - "dataType": "refObject", - "properties": { - "credentialOfferUri": {"dataType":"string","required":true}, - "credentialsToRequest": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "authorizationCode": {"dataType":"string"}, - "codeVerifier": {"dataType":"string"}, - "txCode": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResolveProofRequest": { - "dataType": "refObject", - "properties": { - "proofRequestUri": {"dataType":"string","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcVerifierRecord": { - "dataType": "refAlias", - "type": {"ref":"Record_string.unknown_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcSiopVerifierClientMetadata": { - "dataType": "refObject", - "properties": { - "client_name": {"dataType":"string"}, - "logo_uri": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcSiopCreateVerifierOptions": { - "dataType": "refObject", - "properties": { - "verifierId": {"dataType":"string"}, - "clientMetadata": {"ref":"OpenId4VcSiopVerifierClientMetadata"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OpenId4VcUpdateVerifierRecordOptions": { - "dataType": "refObject", - "properties": { - "verifierId": {"dataType":"string"}, - "clientMetadata": {"ref":"OpenId4VcSiopVerifierClientMetadata"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -}; -const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true}); - -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - - - -export function RegisterRoutes(app: Router) { - - // ########################################################################################################### - // NOTE: If you do not see routes for all of your controllers in this file, then you might not have informed tsoa of where to look - // Please look into the "controllerPathGlobs" config option described in the readme: https://github.com/lukeautry/tsoa - // ########################################################################################################### - - - - const argsX509Controller_createX509Certificate: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createX509Options: {"in":"body","name":"createX509Options","required":true,"ref":"X509CreateCertificateOptionsDto"}, - }; - app.post('/x509', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(X509Controller)), - ...(fetchMiddlewares(X509Controller.prototype.createX509Certificate)), - - async function X509Controller_createX509Certificate(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsX509Controller_createX509Certificate, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(X509Controller); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createX509Certificate', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsX509Controller_ImportX509Certificates: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - importX509Options: {"in":"body","name":"importX509Options","required":true,"ref":"X509ImportCertificateOptionsDto"}, - }; - app.post('/x509/import', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(X509Controller)), - ...(fetchMiddlewares(X509Controller.prototype.ImportX509Certificates)), - - async function X509Controller_ImportX509Certificates(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsX509Controller_ImportX509Certificates, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(X509Controller); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'ImportX509Certificates', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsX509Controller_addTrustedCertificate: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - options: {"in":"body","name":"options","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"certificate":{"dataType":"string","required":true}}}, - }; - app.post('/x509/trusted', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(X509Controller)), - ...(fetchMiddlewares(X509Controller.prototype.addTrustedCertificate)), - - async function X509Controller_addTrustedCertificate(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsX509Controller_addTrustedCertificate, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(X509Controller); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'addTrustedCertificate', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsX509Controller_getTrustedCertificates: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.get('/x509/trusted', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(X509Controller)), - ...(fetchMiddlewares(X509Controller.prototype.getTrustedCertificates)), - - async function X509Controller_getTrustedCertificates(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsX509Controller_getTrustedCertificates, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(X509Controller); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getTrustedCertificates', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsX509Controller_decodeCertificate: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - options: {"in":"body","name":"options","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"certificate":{"dataType":"string","required":true}}}, - }; - app.post('/x509/decode', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(X509Controller)), - ...(fetchMiddlewares(X509Controller.prototype.decodeCertificate)), - - async function X509Controller_decodeCertificate(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsX509Controller_decodeCertificate, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(X509Controller); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'decodeCertificate', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsPolygon_createKeyPair: Record = { - }; - app.post('/polygon/create-keys', - authenticateMiddleware([{"jwt":["tenant","dedicated","Basewallet"]}]), - ...(fetchMiddlewares(Polygon)), - ...(fetchMiddlewares(Polygon.prototype.createKeyPair)), - - async function Polygon_createKeyPair(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsPolygon_createKeyPair, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(Polygon); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createKeyPair', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsPolygon_createSchema: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createSchemaRequest: {"in":"body","name":"createSchemaRequest","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"schema":{"ref":"Record_string.unknown_","required":true},"schemaName":{"dataType":"string","required":true},"did":{"dataType":"string","required":true}}}, - }; - app.post('/polygon/create-schema', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(Polygon)), - ...(fetchMiddlewares(Polygon.prototype.createSchema)), - - async function Polygon_createSchema(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsPolygon_createSchema, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(Polygon); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createSchema', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsPolygon_estimateTransaction: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - estimateTransactionRequest: {"in":"body","name":"estimateTransactionRequest","required":true,"ref":"DidOperationOptions"}, - }; - app.post('/polygon/estimate-transaction', - authenticateMiddleware([{"jwt":["tenant","dedicated","Basewallet"]}]), - ...(fetchMiddlewares(Polygon)), - ...(fetchMiddlewares(Polygon.prototype.estimateTransaction)), - - async function Polygon_estimateTransaction(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsPolygon_estimateTransaction, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(Polygon); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'estimateTransaction', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsPolygon_getSchemaById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - did: {"in":"path","name":"did","required":true,"dataType":"string"}, - schemaId: {"in":"path","name":"schemaId","required":true,"dataType":"string"}, - }; - app.get('/polygon/:did/:schemaId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(Polygon)), - ...(fetchMiddlewares(Polygon.prototype.getSchemaById)), - - async function Polygon_getSchemaById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsPolygon_getSchemaById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(Polygon); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getSchemaById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsEndorserTransactionController_endorserTransaction: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - endorserTransaction: {"in":"body","name":"endorserTransaction","required":true,"ref":"EndorserTransaction"}, - }; - app.post('/anoncreds/transactions/endorse', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(EndorserTransactionController)), - ...(fetchMiddlewares(EndorserTransactionController.prototype.endorserTransaction)), - - async function EndorserTransactionController_endorserTransaction(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsEndorserTransactionController_endorserTransaction, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(EndorserTransactionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'endorserTransaction', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsEndorserTransactionController_didNymTransaction: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - didNymTransaction: {"in":"body","name":"didNymTransaction","required":true,"ref":"DidNymTransaction"}, - }; - app.post('/anoncreds/transactions/set-endorser-role', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(EndorserTransactionController)), - ...(fetchMiddlewares(EndorserTransactionController.prototype.didNymTransaction)), - - async function EndorserTransactionController_didNymTransaction(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsEndorserTransactionController_didNymTransaction, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(EndorserTransactionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'didNymTransaction', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsEndorserTransactionController_writeSchemaAndCredDefOnLedger: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - writeTransaction: {"in":"body","name":"writeTransaction","required":true,"ref":"WriteTransaction"}, - }; - app.post('/anoncreds/transactions/write', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(EndorserTransactionController)), - ...(fetchMiddlewares(EndorserTransactionController.prototype.writeSchemaAndCredDefOnLedger)), - - async function EndorserTransactionController_writeSchemaAndCredDefOnLedger(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsEndorserTransactionController_writeSchemaAndCredDefOnLedger, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(EndorserTransactionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'writeSchemaAndCredDefOnLedger', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsDidController_getDidRecordByDid: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - did: {"in":"path","name":"did","required":true,"ref":"Did"}, - }; - app.get('/dids/:did', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(DidController)), - ...(fetchMiddlewares(DidController.prototype.getDidRecordByDid)), - - async function DidController_getDidRecordByDid(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsDidController_getDidRecordByDid, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DidController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getDidRecordByDid', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsDidController_writeDid: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createDidOptions: {"in":"body","name":"createDidOptions","required":true,"ref":"DidCreate"}, - }; - app.post('/dids/write', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(DidController)), - ...(fetchMiddlewares(DidController.prototype.writeDid)), - - async function DidController_writeDid(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsDidController_writeDid, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DidController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'writeDid', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsDidController_getDids: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.get('/dids', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(DidController)), - ...(fetchMiddlewares(DidController.prototype.getDids)), - - async function DidController_getDids(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsDidController_getDids, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DidController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getDids', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsSchemaController_getSchemaById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - schemaId: {"in":"path","name":"schemaId","required":true,"ref":"SchemaId"}, - }; - app.get('/anoncreds/schemas/:schemaId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(SchemaController)), - ...(fetchMiddlewares(SchemaController.prototype.getSchemaById)), - - async function SchemaController_getSchemaById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsSchemaController_getSchemaById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(SchemaController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getSchemaById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsSchemaController_createSchema: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - schema: {"in":"body","name":"schema","required":true,"ref":"CreateSchemaInput"}, - }; - app.post('/anoncreds/schemas', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(SchemaController)), - ...(fetchMiddlewares(SchemaController.prototype.createSchema)), - - async function SchemaController_createSchema(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsSchemaController_createSchema, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(SchemaController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createSchema', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialDefinitionController_getCredentialDefinitionById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - credentialDefinitionId: {"in":"path","name":"credentialDefinitionId","required":true,"ref":"CredentialDefinitionId"}, - }; - app.get('/anoncreds/credential-definitions/:credentialDefinitionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialDefinitionController)), - ...(fetchMiddlewares(CredentialDefinitionController.prototype.getCredentialDefinitionById)), - - async function CredentialDefinitionController_getCredentialDefinitionById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialDefinitionController_getCredentialDefinitionById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialDefinitionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getCredentialDefinitionById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialDefinitionController_createCredentialDefinition: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - credentialDefinitionRequest: {"in":"body","name":"credentialDefinitionRequest","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"endorserDid":{"dataType":"string"},"endorse":{"dataType":"boolean"},"tag":{"dataType":"string","required":true},"schemaId":{"ref":"SchemaId","required":true},"issuerId":{"dataType":"string","required":true}}}, - }; - app.post('/anoncreds/credential-definitions', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialDefinitionController)), - ...(fetchMiddlewares(CredentialDefinitionController.prototype.createCredentialDefinition)), - - async function CredentialDefinitionController_createCredentialDefinition(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialDefinitionController_createCredentialDefinition, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialDefinitionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createCredentialDefinition', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsAgentController_getAgentInfo: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.get('/agent', - authenticateMiddleware([{"jwt":["tenant","dedicated","Basewallet"]}]), - ...(fetchMiddlewares(AgentController)), - ...(fetchMiddlewares(AgentController.prototype.getAgentInfo)), - - async function AgentController_getAgentInfo(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsAgentController_getAgentInfo, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AgentController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAgentInfo', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsAgentController_getAgentToken: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.post('/agent/token', - authenticateMiddleware([{"apiKey":[]}]), - ...(fetchMiddlewares(AgentController)), - ...(fetchMiddlewares(AgentController.prototype.getAgentToken)), - - async function AgentController_getAgentToken(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsAgentController_getAgentToken, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AgentController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAgentToken', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsAgentController_deleteWallet: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.delete('/agent/wallet', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(AgentController)), - ...(fetchMiddlewares(AgentController.prototype.deleteWallet)), - - async function AgentController_deleteWallet(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsAgentController_deleteWallet, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AgentController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteWallet', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsAgentController_verify: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"ref":"VerifyDataOptions"}, - }; - app.post('/agent/verify', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(AgentController)), - ...(fetchMiddlewares(AgentController.prototype.verify)), - - async function AgentController_verify(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsAgentController_verify, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AgentController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'verify', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsAgentController_signCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - storeCredential: {"in":"query","name":"storeCredential","required":true,"dataType":"boolean"}, - dataTypeToSign: {"in":"query","name":"dataTypeToSign","required":true,"dataType":"union","subSchemas":[{"dataType":"enum","enums":["rawData"]},{"dataType":"enum","enums":["jsonLd"]}]}, - data: {"in":"body","name":"data","required":true,"dataType":"union","subSchemas":[{"ref":"CustomW3cJsonLdSignCredentialOptions"},{"ref":"SignDataOptions"},{"dataType":"any"}]}, - }; - app.post('/agent/credential/sign', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(AgentController)), - ...(fetchMiddlewares(AgentController.prototype.signCredential)), - - async function AgentController_signCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsAgentController_signCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AgentController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'signCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsAgentController_verifyCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - credentialToVerify: {"in":"body","name":"credentialToVerify","required":true,"dataType":"union","subSchemas":[{"ref":"SafeW3cJsonLdVerifyCredentialOptions"},{"dataType":"any"}]}, - }; - app.post('/agent/credential/verify', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(AgentController)), - ...(fetchMiddlewares(AgentController.prototype.verifyCredential)), - - async function AgentController_verifyCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsAgentController_verifyCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(AgentController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'verifyCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsQuestionAnswerController_getQuestionAnswerRecords: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"query","name":"connectionId","dataType":"string"}, - role: {"in":"query","name":"role","ref":"QuestionAnswerRole"}, - state: {"in":"query","name":"state","ref":"QuestionAnswerState"}, - threadId: {"in":"query","name":"threadId","dataType":"string"}, - }; - app.get('/didcomm/question-answer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(QuestionAnswerController)), - ...(fetchMiddlewares(QuestionAnswerController.prototype.getQuestionAnswerRecords)), - - async function QuestionAnswerController_getQuestionAnswerRecords(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsQuestionAnswerController_getQuestionAnswerRecords, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(QuestionAnswerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getQuestionAnswerRecords', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsQuestionAnswerController_sendQuestion: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - config: {"in":"body","name":"config","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"detail":{"dataType":"string"},"validResponses":{"dataType":"array","array":{"dataType":"refObject","ref":"ValidResponse"},"required":true},"question":{"dataType":"string","required":true}}}, - }; - app.post('/didcomm/question-answer/question/:connectionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(QuestionAnswerController)), - ...(fetchMiddlewares(QuestionAnswerController.prototype.sendQuestion)), - - async function QuestionAnswerController_sendQuestion(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsQuestionAnswerController_sendQuestion, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(QuestionAnswerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'sendQuestion', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsQuestionAnswerController_sendAnswer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - id: {"in":"path","name":"id","required":true,"ref":"RecordId"}, - body: {"in":"body","name":"body","required":true,"ref":"Record_response.string_"}, - }; - app.post('/didcomm/question-answer/answer/:id', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(QuestionAnswerController)), - ...(fetchMiddlewares(QuestionAnswerController.prototype.sendAnswer)), - - async function QuestionAnswerController_sendAnswer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsQuestionAnswerController_sendAnswer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(QuestionAnswerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'sendAnswer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsQuestionAnswerController_getQuestionAnswerRecordById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - id: {"in":"path","name":"id","required":true,"ref":"RecordId"}, - }; - app.get('/didcomm/question-answer/:id', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(QuestionAnswerController)), - ...(fetchMiddlewares(QuestionAnswerController.prototype.getQuestionAnswerRecordById)), - - async function QuestionAnswerController_getQuestionAnswerRecordById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsQuestionAnswerController_getQuestionAnswerRecordById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(QuestionAnswerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getQuestionAnswerRecordById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_getAllProofs: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - threadId: {"in":"query","name":"threadId","dataType":"string"}, - }; - app.get('/didcomm/proofs', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.getAllProofs)), - - async function ProofController_getAllProofs(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_getAllProofs, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAllProofs', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_getProofById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - proofRecordId: {"in":"path","name":"proofRecordId","required":true,"ref":"RecordId"}, - }; - app.get('/didcomm/proofs/:proofRecordId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.getProofById)), - - async function ProofController_getProofById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_getProofById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getProofById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_proposeProof: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - requestProofProposalOptions: {"in":"body","name":"requestProofProposalOptions","required":true,"ref":"RequestProofProposalOptions"}, - }; - app.post('/didcomm/proofs/propose-proof', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.proposeProof)), - - async function ProofController_proposeProof(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_proposeProof, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'proposeProof', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_acceptProposal: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - acceptProposal: {"in":"body","name":"acceptProposal","required":true,"ref":"AcceptProofProposal"}, - }; - app.post('/didcomm/proofs/:proofRecordId/accept-proposal', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.acceptProposal)), - - async function ProofController_acceptProposal(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_acceptProposal, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptProposal', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_requestProof: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - requestProofOptions: {"in":"body","name":"requestProofOptions","required":true,"ref":"RequestProofOptions"}, - }; - app.post('/didcomm/proofs/request-proof', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.requestProof)), - - async function ProofController_requestProof(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_requestProof, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'requestProof', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_createRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createRequestOptions: {"in":"body","name":"createRequestOptions","required":true,"ref":"CreateProofRequestOobOptions"}, - }; - app.post('/didcomm/proofs/create-request-oob', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.createRequest)), - - async function ProofController_createRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_createRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_acceptRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - proofRecordId: {"in":"path","name":"proofRecordId","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"comment":{"dataType":"string"},"filterByNonRevocationRequirements":{"dataType":"boolean"},"filterByPresentationPreview":{"dataType":"boolean"}}}, - }; - app.post('/didcomm/proofs/:proofRecordId/accept-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.acceptRequest)), - - async function ProofController_acceptRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_acceptRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_acceptPresentation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - proofRecordId: {"in":"path","name":"proofRecordId","required":true,"dataType":"string"}, - }; - app.post('/didcomm/proofs/:proofRecordId/accept-presentation', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.acceptPresentation)), - - async function ProofController_acceptPresentation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_acceptPresentation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptPresentation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsProofController_proofFormData: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - proofRecordId: {"in":"path","name":"proofRecordId","required":true,"dataType":"string"}, - }; - app.get('/didcomm/proofs/:proofRecordId/form-data', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ProofController)), - ...(fetchMiddlewares(ProofController.prototype.proofFormData)), - - async function ProofController_proofFormData(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsProofController_proofFormData, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProofController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'proofFormData', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_getAllOutOfBandRecords: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - invitationId: {"in":"query","name":"invitationId","ref":"RecordId"}, - }; - app.get('/didcomm/oob', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.getAllOutOfBandRecords)), - - async function OutOfBandController_getAllOutOfBandRecords(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_getAllOutOfBandRecords, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAllOutOfBandRecords', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_getOutOfBandRecordById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - outOfBandId: {"in":"path","name":"outOfBandId","required":true,"ref":"RecordId"}, - }; - app.get('/didcomm/oob/:outOfBandId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.getOutOfBandRecordById)), - - async function OutOfBandController_getOutOfBandRecordById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_getOutOfBandRecordById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getOutOfBandRecordById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_createInvitation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - config: {"in":"body","name":"config","required":true,"dataType":"intersection","subSchemas":[{"ref":"CreateInvitationOptions"},{"ref":"RecipientKeyOption"}]}, - }; - app.post('/didcomm/oob/create-invitation', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.createInvitation)), - - async function OutOfBandController_createInvitation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_createInvitation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createInvitation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_createLegacyInvitation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - config: {"in":"body","name":"config","dataType":"intersection","subSchemas":[{"ref":"Omit_CreateLegacyInvitationConfig.routing_"},{"ref":"RecipientKeyOption"}]}, - }; - app.post('/didcomm/oob/create-legacy-invitation', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.createLegacyInvitation)), - - async function OutOfBandController_createLegacyInvitation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_createLegacyInvitation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createLegacyInvitation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_createLegacyConnectionlessInvitation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - config: {"in":"body","name":"config","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"routing":{"ref":"Routing"},"domain":{"dataType":"string","required":true},"message":{"ref":"Record_string.unknown_","required":true},"recordId":{"dataType":"string","required":true}}}, - }; - app.post('/didcomm/oob/create-legacy-connectionless-invitation', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.createLegacyConnectionlessInvitation)), - - async function OutOfBandController_createLegacyConnectionlessInvitation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_createLegacyConnectionlessInvitation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createLegacyConnectionlessInvitation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_receiveInvitation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - invitationRequest: {"in":"body","name":"invitationRequest","required":true,"ref":"ReceiveInvitationProps"}, - }; - app.post('/didcomm/oob/receive-invitation', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.receiveInvitation)), - - async function OutOfBandController_receiveInvitation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_receiveInvitation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'receiveInvitation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_receiveInvitationFromUrl: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - invitationRequest: {"in":"body","name":"invitationRequest","required":true,"ref":"ReceiveInvitationByUrlProps"}, - }; - app.post('/didcomm/oob/receive-invitation-url', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.receiveInvitationFromUrl)), - - async function OutOfBandController_receiveInvitationFromUrl(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_receiveInvitationFromUrl, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'receiveInvitationFromUrl', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_acceptInvitation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - outOfBandId: {"in":"path","name":"outOfBandId","required":true,"ref":"RecordId"}, - acceptInvitationConfig: {"in":"body","name":"acceptInvitationConfig","required":true,"ref":"AcceptInvitationConfig"}, - }; - app.post('/didcomm/oob/:outOfBandId/accept-invitation', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.acceptInvitation)), - - async function OutOfBandController_acceptInvitation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_acceptInvitation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptInvitation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsOutOfBandController_deleteOutOfBandRecord: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - outOfBandId: {"in":"path","name":"outOfBandId","required":true,"ref":"RecordId"}, - }; - app.delete('/didcomm/oob/:outOfBandId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(OutOfBandController)), - ...(fetchMiddlewares(OutOfBandController.prototype.deleteOutOfBandRecord)), - - async function OutOfBandController_deleteOutOfBandRecord(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsOutOfBandController_deleteOutOfBandRecord, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OutOfBandController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteOutOfBandRecord', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_getAllCredentials: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - threadId: {"in":"query","name":"threadId","ref":"ThreadId"}, - parentThreadId: {"in":"query","name":"parentThreadId","ref":"ThreadId"}, - connectionId: {"in":"query","name":"connectionId","ref":"RecordId"}, - state: {"in":"query","name":"state","ref":"CredentialState"}, - role: {"in":"query","name":"role","ref":"CredentialRole"}, - }; - app.get('/didcomm/credentials', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.getAllCredentials)), - - async function CredentialController_getAllCredentials(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_getAllCredentials, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAllCredentials', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_getAllW3c: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.get('/didcomm/credentials/w3c', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.getAllW3c)), - - async function CredentialController_getAllW3c(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_getAllW3c, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAllW3c', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_getW3cById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - id: {"in":"path","name":"id","required":true,"dataType":"string"}, - }; - app.get('/didcomm/credentials/w3c/:id', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.getW3cById)), - - async function CredentialController_getW3cById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_getW3cById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getW3cById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_getCredentialById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, - }; - app.get('/didcomm/credentials/:credentialRecordId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.getCredentialById)), - - async function CredentialController_getCredentialById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_getCredentialById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getCredentialById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_proposeCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - proposeCredentialOptions: {"in":"body","name":"proposeCredentialOptions","required":true,"ref":"ProposeCredentialOptions"}, - }; - app.post('/didcomm/credentials/propose-credential', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.proposeCredential)), - - async function CredentialController_proposeCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_proposeCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'proposeCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_acceptProposal: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - acceptCredentialProposal: {"in":"body","name":"acceptCredentialProposal","required":true,"ref":"AcceptCredentialProposalOptions"}, - }; - app.post('/didcomm/credentials/accept-proposal', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.acceptProposal)), - - async function CredentialController_acceptProposal(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_acceptProposal, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptProposal', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_createOffer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createOfferOptions: {"in":"body","name":"createOfferOptions","required":true,"ref":"CreateOfferOptions"}, - }; - app.post('/didcomm/credentials/create-offer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.createOffer)), - - async function CredentialController_createOffer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_createOffer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createOffer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_createOfferOob: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - outOfBandOption: {"in":"body","name":"outOfBandOption","required":true,"ref":"CreateOfferOobOptions"}, - }; - app.post('/didcomm/credentials/create-offer-oob', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.createOfferOob)), - - async function CredentialController_createOfferOob(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_createOfferOob, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createOfferOob', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_acceptOffer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - acceptCredentialOfferOptions: {"in":"body","name":"acceptCredentialOfferOptions","required":true,"ref":"CredentialOfferOptions"}, - }; - app.post('/didcomm/credentials/accept-offer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.acceptOffer)), - - async function CredentialController_acceptOffer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_acceptOffer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptOffer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_acceptRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - acceptCredentialRequestOptions: {"in":"body","name":"acceptCredentialRequestOptions","required":true,"ref":"AcceptCredentialRequestOptions"}, - }; - app.post('/didcomm/credentials/accept-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.acceptRequest)), - - async function CredentialController_acceptRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_acceptRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_acceptCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - acceptCredential: {"in":"body","name":"acceptCredential","required":true,"ref":"AcceptCredential"}, - }; - app.post('/didcomm/credentials/accept-credential', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.acceptCredential)), - - async function CredentialController_acceptCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_acceptCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsCredentialController_credentialFormData: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"dataType":"string"}, - }; - app.get('/didcomm/credentials/:credentialRecordId/form-data', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(CredentialController)), - ...(fetchMiddlewares(CredentialController.prototype.credentialFormData)), - - async function CredentialController_credentialFormData(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsCredentialController_credentialFormData, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(CredentialController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'credentialFormData', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsConnectionController_getAllConnections: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - outOfBandId: {"in":"query","name":"outOfBandId","dataType":"string"}, - alias: {"in":"query","name":"alias","dataType":"string"}, - state: {"in":"query","name":"state","ref":"DidExchangeState"}, - myDid: {"in":"query","name":"myDid","dataType":"string"}, - theirDid: {"in":"query","name":"theirDid","dataType":"string"}, - theirLabel: {"in":"query","name":"theirLabel","dataType":"string"}, - }; - app.get('/didcomm/connections', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ConnectionController)), - ...(fetchMiddlewares(ConnectionController.prototype.getAllConnections)), - - async function ConnectionController_getAllConnections(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsConnectionController_getAllConnections, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ConnectionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAllConnections', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsConnectionController_getConnectionById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - }; - app.get('/didcomm/connections/:connectionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ConnectionController)), - ...(fetchMiddlewares(ConnectionController.prototype.getConnectionById)), - - async function ConnectionController_getConnectionById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsConnectionController_getConnectionById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ConnectionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getConnectionById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsConnectionController_deleteConnection: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - }; - app.delete('/didcomm/connections/:connectionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ConnectionController)), - ...(fetchMiddlewares(ConnectionController.prototype.deleteConnection)), - - async function ConnectionController_deleteConnection(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsConnectionController_deleteConnection, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ConnectionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteConnection', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsConnectionController_acceptRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - }; - app.post('/didcomm/connections/:connectionId/accept-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ConnectionController)), - ...(fetchMiddlewares(ConnectionController.prototype.acceptRequest)), - - async function ConnectionController_acceptRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsConnectionController_acceptRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ConnectionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsConnectionController_acceptResponse: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - }; - app.post('/didcomm/connections/:connectionId/accept-response', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(ConnectionController)), - ...(fetchMiddlewares(ConnectionController.prototype.acceptResponse)), - - async function ConnectionController_acceptResponse(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsConnectionController_acceptResponse, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ConnectionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptResponse', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsConnectionController_getInvitation: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - invitationId: {"in":"path","name":"invitationId","required":true,"dataType":"string"}, - }; - app.get('/didcomm/url/:invitationId', - ...(fetchMiddlewares(ConnectionController)), - ...(fetchMiddlewares(ConnectionController.prototype.getInvitation)), - - async function ConnectionController_getInvitation(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsConnectionController_getInvitation, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ConnectionController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getInvitation', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsBasicMessageController_getBasicMessages: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - }; - app.get('/didcomm/basic-messages/:connectionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(BasicMessageController)), - ...(fetchMiddlewares(BasicMessageController.prototype.getBasicMessages)), - - async function BasicMessageController_getBasicMessages(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsBasicMessageController_getBasicMessages, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(BasicMessageController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getBasicMessages', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsBasicMessageController_sendMessage: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, - body: {"in":"body","name":"body","required":true,"ref":"Record_content.string_"}, - }; - app.post('/didcomm/basic-messages/:connectionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(BasicMessageController)), - ...(fetchMiddlewares(BasicMessageController.prototype.sendMessage)), - - async function BasicMessageController_sendMessage(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsBasicMessageController_sendMessage, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(BasicMessageController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'sendMessage', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsMultiTenancyController_createTenant: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createTenantOptions: {"in":"body","name":"createTenantOptions","required":true,"ref":"CreateTenantOptions"}, - }; - app.post('/multi-tenancy/create-tenant', - authenticateMiddleware([{"jwt":["Basewallet"]}]), - ...(fetchMiddlewares(MultiTenancyController)), - ...(fetchMiddlewares(MultiTenancyController.prototype.createTenant)), - - async function MultiTenancyController_createTenant(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsMultiTenancyController_createTenant, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(MultiTenancyController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createTenant', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsMultiTenancyController_getTenantToken: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - tenantId: {"in":"path","name":"tenantId","required":true,"dataType":"string"}, - notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, - internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, - }; - app.post('/multi-tenancy/get-token/:tenantId', - authenticateMiddleware([{"jwt":["Basewallet"]}]), - ...(fetchMiddlewares(MultiTenancyController)), - ...(fetchMiddlewares(MultiTenancyController.prototype.getTenantToken)), - - async function MultiTenancyController_getTenantToken(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsMultiTenancyController_getTenantToken, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(MultiTenancyController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getTenantToken', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsMultiTenancyController_getTenantById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - tenantId: {"in":"path","name":"tenantId","required":true,"dataType":"string"}, - notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, - internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, - }; - app.get('/multi-tenancy/:tenantId', - authenticateMiddleware([{"jwt":["Basewallet"]}]), - ...(fetchMiddlewares(MultiTenancyController)), - ...(fetchMiddlewares(MultiTenancyController.prototype.getTenantById)), - - async function MultiTenancyController_getTenantById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsMultiTenancyController_getTenantById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(MultiTenancyController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getTenantById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsMultiTenancyController_deleteTenantById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - tenantId: {"in":"path","name":"tenantId","required":true,"dataType":"string"}, - notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, - internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, - }; - app.delete('/multi-tenancy/:tenantId', - authenticateMiddleware([{"jwt":["Basewallet"]}]), - ...(fetchMiddlewares(MultiTenancyController)), - ...(fetchMiddlewares(MultiTenancyController.prototype.deleteTenantById)), - - async function MultiTenancyController_deleteTenantById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsMultiTenancyController_deleteTenantById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(MultiTenancyController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteTenantById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuanceSessionsController_createCredentialOffer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - options: {"in":"body","name":"options","required":true,"ref":"OpenId4VcIssuanceSessionsCreateOffer"}, - }; - app.post('/openid4vc/issuance-sessions/create-credential-offer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuanceSessionsController)), - ...(fetchMiddlewares(IssuanceSessionsController.prototype.createCredentialOffer)), - - async function IssuanceSessionsController_createCredentialOffer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuanceSessionsController_createCredentialOffer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuanceSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createCredentialOffer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuanceSessionsController_getIssuanceSessionsById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - issuanceSessionId: {"in":"path","name":"issuanceSessionId","required":true,"dataType":"string"}, - }; - app.get('/openid4vc/issuance-sessions/:issuanceSessionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuanceSessionsController)), - ...(fetchMiddlewares(IssuanceSessionsController.prototype.getIssuanceSessionsById)), - - async function IssuanceSessionsController_getIssuanceSessionsById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuanceSessionsController_getIssuanceSessionsById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuanceSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getIssuanceSessionsById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuanceSessionsController_getIssuanceSessionsByQuery: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - cNonce: {"in":"query","name":"cNonce","dataType":"string"}, - publicIssuerId: {"in":"query","name":"publicIssuerId","dataType":"string"}, - preAuthorizedCode: {"in":"query","name":"preAuthorizedCode","dataType":"string"}, - state: {"in":"query","name":"state","ref":"OpenId4VcIssuanceSessionState"}, - credentialOfferUri: {"in":"query","name":"credentialOfferUri","dataType":"string"}, - authorizationCode: {"in":"query","name":"authorizationCode","dataType":"string"}, - }; - app.get('/openid4vc/issuance-sessions', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuanceSessionsController)), - ...(fetchMiddlewares(IssuanceSessionsController.prototype.getIssuanceSessionsByQuery)), - - async function IssuanceSessionsController_getIssuanceSessionsByQuery(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuanceSessionsController_getIssuanceSessionsByQuery, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuanceSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getIssuanceSessionsByQuery', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuanceSessionsController_updateSessionById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - issuanceSessionId: {"in":"path","name":"issuanceSessionId","required":true,"dataType":"string"}, - metadata: {"in":"body","name":"metadata","required":true,"ref":"Record_string.unknown_"}, - }; - app.put('/openid4vc/issuance-sessions/:issuanceSessionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuanceSessionsController)), - ...(fetchMiddlewares(IssuanceSessionsController.prototype.updateSessionById)), - - async function IssuanceSessionsController_updateSessionById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuanceSessionsController_updateSessionById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuanceSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'updateSessionById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuanceSessionsController_deleteIssuanceSessionById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - issuanceSessionId: {"in":"path","name":"issuanceSessionId","required":true,"dataType":"string"}, - }; - app.delete('/openid4vc/issuance-sessions/:issuanceSessionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuanceSessionsController)), - ...(fetchMiddlewares(IssuanceSessionsController.prototype.deleteIssuanceSessionById)), - - async function IssuanceSessionsController_deleteIssuanceSessionById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuanceSessionsController_deleteIssuanceSessionById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuanceSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteIssuanceSessionById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuerController_createIssuer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createIssuerOptions: {"in":"body","name":"createIssuerOptions","required":true,"ref":"CreateIssuerOptions"}, - }; - app.post('/openid4vc/issuer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuerController)), - ...(fetchMiddlewares(IssuerController.prototype.createIssuer)), - - async function IssuerController_createIssuer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuerController_createIssuer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createIssuer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuerController_updateIssuerMetadata: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicIssuerId: {"in":"path","name":"publicIssuerId","required":true,"dataType":"string"}, - updateIssuerRecordOptions: {"in":"body","name":"updateIssuerRecordOptions","required":true,"ref":"UpdateIssuerRecordOptions"}, - }; - app.put('/openid4vc/issuer/:publicIssuerId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuerController)), - ...(fetchMiddlewares(IssuerController.prototype.updateIssuerMetadata)), - - async function IssuerController_updateIssuerMetadata(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuerController_updateIssuerMetadata, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'updateIssuerMetadata', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuerController_getIssuerAgentMetaData: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - issuerId: {"in":"path","name":"issuerId","required":true,"dataType":"string"}, - }; - app.get('/openid4vc/issuer/:issuerId/metadata', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuerController)), - ...(fetchMiddlewares(IssuerController.prototype.getIssuerAgentMetaData)), - - async function IssuerController_getIssuerAgentMetaData(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuerController_getIssuerAgentMetaData, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getIssuerAgentMetaData', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuerController_getIssuersByQuery: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicIssuerId: {"in":"query","name":"publicIssuerId","dataType":"string"}, - }; - app.get('/openid4vc/issuer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuerController)), - ...(fetchMiddlewares(IssuerController.prototype.getIssuersByQuery)), - - async function IssuerController_getIssuersByQuery(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuerController_getIssuersByQuery, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getIssuersByQuery', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuerController_getIssuer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicIssuerId: {"in":"path","name":"publicIssuerId","required":true,"dataType":"string"}, - }; - app.get('/openid4vc/issuer/:publicIssuerId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuerController)), - ...(fetchMiddlewares(IssuerController.prototype.getIssuer)), - - async function IssuerController_getIssuer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuerController_getIssuer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getIssuer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsIssuerController_deleteIssuer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - id: {"in":"path","name":"id","required":true,"dataType":"string"}, - }; - app.delete('/openid4vc/issuer/:id', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(IssuerController)), - ...(fetchMiddlewares(IssuerController.prototype.deleteIssuer)), - - async function IssuerController_deleteIssuer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsIssuerController_deleteIssuer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteIssuer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerificationSessionsController_createProofRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - createAuthorizationRequest: {"in":"body","name":"createAuthorizationRequest","required":true,"ref":"CreateAuthorizationRequest"}, - }; - app.post('/openid4vc/verification-sessions/create-presentation-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerificationSessionsController)), - ...(fetchMiddlewares(VerificationSessionsController.prototype.createProofRequest)), - - async function VerificationSessionsController_createProofRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerificationSessionsController_createProofRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerificationSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createProofRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerificationSessionsController_getAllVerificationSessions: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicVerifierId: {"in":"query","name":"publicVerifierId","dataType":"string"}, - payloadState: {"in":"query","name":"payloadState","dataType":"string"}, - state: {"in":"query","name":"state","ref":"OpenId4VcVerificationSessionState"}, - authorizationRequestUri: {"in":"query","name":"authorizationRequestUri","dataType":"string"}, - nonce: {"in":"query","name":"nonce","dataType":"string"}, - }; - app.get('/openid4vc/verification-sessions', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerificationSessionsController)), - ...(fetchMiddlewares(VerificationSessionsController.prototype.getAllVerificationSessions)), - - async function VerificationSessionsController_getAllVerificationSessions(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerificationSessionsController_getAllVerificationSessions, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerificationSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getAllVerificationSessions', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerificationSessionsController_getVerificationSessionsById: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - verificationSessionId: {"in":"path","name":"verificationSessionId","required":true,"dataType":"string"}, - }; - app.get('/openid4vc/verification-sessions/:verificationSessionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerificationSessionsController)), - ...(fetchMiddlewares(VerificationSessionsController.prototype.getVerificationSessionsById)), - - async function VerificationSessionsController_getVerificationSessionsById(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerificationSessionsController_getVerificationSessionsById, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerificationSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getVerificationSessionsById', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerificationSessionsController_getVerifiedAuthorizationResponse: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - verificationSessionId: {"in":"path","name":"verificationSessionId","required":true,"dataType":"string"}, - }; - app.get('/openid4vc/verification-sessions/response/:verificationSessionId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerificationSessionsController)), - ...(fetchMiddlewares(VerificationSessionsController.prototype.getVerifiedAuthorizationResponse)), - - async function VerificationSessionsController_getVerifiedAuthorizationResponse(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerificationSessionsController_getVerifiedAuthorizationResponse, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerificationSessionsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getVerifiedAuthorizationResponse', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_getSdJwtCredentials: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.get('/openid4vc/holder/sd-jwt-vcs', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.getSdJwtCredentials)), - - async function HolderController_getSdJwtCredentials(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_getSdJwtCredentials, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getSdJwtCredentials', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_getMdocCredentials: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - app.get('/openid4vc/holder/mdoc-vcs', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.getMdocCredentials)), - - async function HolderController_getMdocCredentials(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_getMdocCredentials, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getMdocCredentials', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_decodeMdocCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"base64Url":{"dataType":"string","required":true}}}, - }; - app.post('/openid4vc/holder/mdoc-vcs/decode', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.decodeMdocCredential)), - - async function HolderController_decodeMdocCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_decodeMdocCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'decodeMdocCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_resolveCredOffer: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"ref":"ResolveCredentialOfferBody"}, - }; - app.post('/openid4vc/holder/resolve-credential-offer', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.resolveCredOffer)), - - async function HolderController_resolveCredOffer(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_resolveCredOffer, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'resolveCredOffer', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_requestAuthorizationForCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"ref":"AuthorizeRequestCredentialOffer"}, - }; - app.post('/openid4vc/holder/authorization-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.requestAuthorizationForCredential)), - - async function HolderController_requestAuthorizationForCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_requestAuthorizationForCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'requestAuthorizationForCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_requestCredential: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"ref":"RequestCredentialBody"}, - }; - app.post('/openid4vc/holder/request-credential', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.requestCredential)), - - async function HolderController_requestCredential(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_requestCredential, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'requestCredential', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_resolveProofRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, - }; - app.post('/openid4vc/holder/resolve-proof-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.resolveProofRequest)), - - async function HolderController_resolveProofRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_resolveProofRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'resolveProofRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_acceptProofRequest: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"ref":"ResolveProofRequest"}, - }; - app.post('/openid4vc/holder/accept-proof-request', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.acceptProofRequest)), - - async function HolderController_acceptProofRequest(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_acceptProofRequest, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'acceptProofRequest', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsHolderController_decodeSdJwt: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - body: {"in":"body","name":"body","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"jwt":{"dataType":"string","required":true}}}, - }; - app.post('/openid4vc/holder/decode-sdjwt', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(HolderController)), - ...(fetchMiddlewares(HolderController.prototype.decodeSdJwt)), - - async function HolderController_decodeSdJwt(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsHolderController_decodeSdJwt, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(HolderController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'decodeSdJwt', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerifierController_createVerifier: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - options: {"in":"body","name":"options","required":true,"ref":"OpenId4VcSiopCreateVerifierOptions"}, - }; - app.post('/openid4vc/verifier', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerifierController)), - ...(fetchMiddlewares(VerifierController.prototype.createVerifier)), - - async function VerifierController_createVerifier(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerifierController_createVerifier, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerifierController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'createVerifier', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerifierController_updateVerifierMetadata: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicVerifierId: {"in":"path","name":"publicVerifierId","required":true,"dataType":"string"}, - verifierRecordOptions: {"in":"body","name":"verifierRecordOptions","required":true,"ref":"OpenId4VcUpdateVerifierRecordOptions"}, - }; - app.put('/openid4vc/verifier/:publicVerifierId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerifierController)), - ...(fetchMiddlewares(VerifierController.prototype.updateVerifierMetadata)), - - async function VerifierController_updateVerifierMetadata(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerifierController_updateVerifierMetadata, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerifierController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'updateVerifierMetadata', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerifierController_getVerifiersByQuery: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicVerifierId: {"in":"query","name":"publicVerifierId","dataType":"string"}, - }; - app.get('/openid4vc/verifier', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerifierController)), - ...(fetchMiddlewares(VerifierController.prototype.getVerifiersByQuery)), - - async function VerifierController_getVerifiersByQuery(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerifierController_getVerifiersByQuery, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerifierController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getVerifiersByQuery', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerifierController_getVerifier: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - publicVerifierId: {"in":"path","name":"publicVerifierId","required":true,"dataType":"string"}, - }; - app.get('/openid4vc/verifier/:publicVerifierId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerifierController)), - ...(fetchMiddlewares(VerifierController.prototype.getVerifier)), - - async function VerifierController_getVerifier(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerifierController_getVerifier, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerifierController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'getVerifier', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - const argsVerifierController_deleteVerifier: Record = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - verifierId: {"in":"path","name":"verifierId","required":true,"dataType":"string"}, - }; - app.delete('/openid4vc/verifier/:verifierId', - authenticateMiddleware([{"jwt":["tenant","dedicated"]}]), - ...(fetchMiddlewares(VerifierController)), - ...(fetchMiddlewares(VerifierController.prototype.deleteVerifier)), - - async function VerifierController_deleteVerifier(request: ExRequest, response: ExResponse, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = templateService.getValidatedArgs({ args: argsVerifierController_deleteVerifier, request, response }); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(VerifierController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - await templateService.apiHandler({ - methodName: 'deleteVerifier', - controller, - response, - next, - validatedArgs, - successStatus: undefined, - }); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - function authenticateMiddleware(security: TsoaRoute.Security[] = []) { - return async function runAuthenticationMiddleware(request: any, response: any, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - // keep track of failed auth attempts so we can hand back the most - // recent one. This behavior was previously existing so preserving it - // here - const failedAttempts: any[] = []; - const pushAndRethrow = (error: any) => { - failedAttempts.push(error); - throw error; - }; - - const secMethodOrPromises: Promise[] = []; - for (const secMethod of security) { - if (Object.keys(secMethod).length > 1) { - const secMethodAndPromises: Promise[] = []; - - for (const name in secMethod) { - secMethodAndPromises.push( - expressAuthenticationRecasted(request, name, secMethod[name], response) - .catch(pushAndRethrow) - ); - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - secMethodOrPromises.push(Promise.all(secMethodAndPromises) - .then(users => { return users[0]; })); - } else { - for (const name in secMethod) { - secMethodOrPromises.push( - expressAuthenticationRecasted(request, name, secMethod[name], response) - .catch(pushAndRethrow) - ); - } - } - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - try { - request['user'] = await Promise.any(secMethodOrPromises); - - // Response was sent in middleware, abort - if (response.writableEnded) { - return; - } - - next(); - } - catch(err) { - // Show most recent error as response - const error = failedAttempts.pop(); - error.status = error.status || 401; - - // Response was sent in middleware, abort - if (response.writableEnded) { - return; - } - next(error); - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - } - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -} - -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 1e13eb1f..41ebc7e3 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -7,17 +7,23 @@ "requestBodies": {}, "responses": {}, "schemas": { - "KeyType": { + "KeyAlgorithm": { "enum": [ - "ed25519", - "bls12381g1g2", + "a128gcm", + "a256gcm", + "a128cbchs256", + "a256cbchs512", + "a128kw", + "a256kw", "bls12381g1", "bls12381g2", + "c20p", + "xc20p", + "ed25519", "x25519", + "k256", "p256", - "p384", - "p521", - "k256" + "p384" ], "type": "string" }, @@ -32,7 +38,7 @@ "example": "3yPQbnk6WwLgX8K3JZ4t7vBnJ8XqY2mMpRcD9fNvGtHw" }, "keyType": { - "$ref": "#/components/schemas/KeyType", + "$ref": "#/components/schemas/KeyAlgorithm", "example": "p256" } }, @@ -355,9 +361,7 @@ "privateKey": { "type": "string" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - } + "keyType": {} }, "required": [ "certificate", @@ -366,409 +370,436 @@ "type": "object", "additionalProperties": false }, - "Uint8Array": { - "description": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "PublicJwk": { "properties": {}, "type": "object", "additionalProperties": false }, - "Key": { - "properties": { - "publicKey": { - "$ref": "#/components/schemas/Uint8Array" - }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - } - }, - "required": [ - "publicKey", - "keyType" - ], + "Uint8Array": { + "description": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "properties": {}, "type": "object", "additionalProperties": false }, + "AnyUint8Array": { + "$ref": "#/components/schemas/Uint8Array" + }, "X509Certificate": { "properties": { - "publicKey": { - "$ref": "#/components/schemas/Key" + "publicJwk": { + "$ref": "#/components/schemas/PublicJwk" }, "privateKey": { - "$ref": "#/components/schemas/Uint8Array" + "$ref": "#/components/schemas/AnyUint8Array" } }, "required": [ - "publicKey" + "publicJwk" ], "type": "object", "additionalProperties": false }, - "Record_string.unknown_": { - "properties": {}, - "additionalProperties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "DidOperation.Create": { + "QuestionAnswerRole": { "enum": [ - "createDID" + "questioner", + "responder" ], "type": "string" }, - "CreateDidOperationOptions": { - "properties": { - "serviceEndpoint": { - "type": "string" - }, - "operation": { - "$ref": "#/components/schemas/DidOperation.Create" - } - }, - "required": [ - "operation" - ], - "type": "object" - }, - "DidOperation.Update": { + "QuestionAnswerState": { + "description": "QuestionAnswer states inferred from RFC 0113.", "enum": [ - "updateDIDDoc" + "question-sent", + "question-received", + "answer-received", + "answer-sent" ], "type": "string" }, - "Record_string.any_": { + "Record_string.unknown_": { "properties": {}, - "additionalProperties": {}, "type": "object", "description": "Construct a type with a set of properties K of type T" }, - "DidDocument": { - "$ref": "#/components/schemas/Record_string.any_" + "RecordId": { + "type": "string", + "example": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" }, - "UpdateDidOperationOptions": { + "ValidResponse": { "properties": { - "did": { + "text": { "type": "string" - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - }, - "operation": { - "$ref": "#/components/schemas/DidOperation.Update" } }, "required": [ - "did", - "didDocument", - "operation" + "text" ], - "type": "object" + "type": "object", + "additionalProperties": false }, - "DidOperation.Deactivate": { - "enum": [ - "deactivate" + "Record_response.string_": { + "properties": { + "response": { + "type": "string" + } + }, + "required": [ + "response" ], - "type": "string" + "type": "object", + "description": "Construct a type with a set of properties K of type T" }, - "DeactivateDidOperationOptions": { + "DidCommPlaintextMessage": { "properties": { - "did": { + "@type": { + "type": "string" + }, + "@id": { "type": "string" }, - "operation": { - "$ref": "#/components/schemas/DidOperation.Deactivate" + "~thread": { + "properties": { + "pthid": { + "type": "string" + }, + "thid": { + "type": "string" + } + }, + "type": "object" } }, "required": [ - "did", - "operation" + "@type", + "@id" ], - "type": "object" + "type": "object", + "additionalProperties": {} }, - "DidOperation.AddResource": { + "DidCommHandshakeProtocol": { + "description": "Enum values should be sorted based on order of preference. Values will be\nincluded in this order when creating out of band invitations.", "enum": [ - "addResource" + "https://didcomm.org/didexchange/1.x", + "https://didcomm.org/connections/1.x" ], "type": "string" }, - "AddResourceDidOperationOptions": { + "DidCommMessage": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" + }, + "PublicJwk_Ed25519PublicJwk_": { + "properties": {}, + "type": "object", + "additionalProperties": false + }, + "DidCommRouting": { "properties": { - "did": { - "type": "string" + "endpoints": { + "items": { + "type": "string" + }, + "type": "array" }, - "resource": { - "additionalProperties": false, - "type": "object" + "recipientKey": { + "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" }, - "resourceId": { - "type": "string" + "routingKeys": { + "items": { + "$ref": "#/components/schemas/PublicJwk_Ed25519PublicJwk_" + }, + "type": "array" }, - "operation": { - "$ref": "#/components/schemas/DidOperation.AddResource" + "mediatorId": { + "type": "string" } }, "required": [ - "did", - "resource", - "resourceId", - "operation" + "endpoints", + "recipientKey", + "routingKeys" ], - "type": "object" + "type": "object", + "additionalProperties": false }, - "DidOperationOptions": { + "JsonValue": { "anyOf": [ { - "$ref": "#/components/schemas/CreateDidOperationOptions" + "type": "string" }, { - "$ref": "#/components/schemas/UpdateDidOperationOptions" + "type": "number", + "format": "double" }, { - "$ref": "#/components/schemas/DeactivateDidOperationOptions" + "type": "boolean" }, { - "$ref": "#/components/schemas/AddResourceDidOperationOptions" - } - ] - }, - "EndorserTransaction": { - "properties": { - "transaction": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.unknown_" - } - ] + "$ref": "#/components/schemas/JsonObject" }, - "endorserDid": { - "type": "string" + { + "$ref": "#/components/schemas/JsonArray" } - }, - "required": [ - "transaction", - "endorserDid" ], + "nullable": true + }, + "JsonObject": { + "properties": {}, "type": "object", - "additionalProperties": false + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + } }, - "DidRegistrationSecretOptions": { - "$ref": "#/components/schemas/Record_string.unknown_" + "JsonArray": { + "items": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "array" }, - "DidOperationStateWait": { + "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { "properties": { - "state": { - "type": "string", - "enum": [ - "wait" - ], - "nullable": false - }, - "did": { - "type": "string" + "header": { + "$ref": "#/components/schemas/Record_string.unknown_", + "description": "unprotected header" }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "signature": { + "type": "string", + "description": "Base64url encoded signature" }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "protected": { + "type": "string", + "description": "Base64url encoded protected header" } }, "required": [ - "state" + "header", + "signature", + "protected" ], "type": "object", - "additionalProperties": false + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_JwsGeneralFormat.payload_": { + "$ref": "#/components/schemas/Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "JwsDetachedFormat": { + "$ref": "#/components/schemas/Omit_JwsGeneralFormat.payload_" }, - "DidOperationStateActionBase": { + "JwsFlattenedDetachedFormat": { "properties": { - "state": { - "type": "string", - "enum": [ - "action" - ], - "nullable": false - }, - "action": { - "type": "string" - }, - "did": { - "type": "string" - }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "signatures": { + "items": { + "$ref": "#/components/schemas/JwsDetachedFormat" + }, + "type": "array" } }, "required": [ - "state", - "action" + "signatures" ], "type": "object", "additionalProperties": false }, - "DidOperationStateFinished": { + "DidCommAttachmentData": { + "description": "A JSON object that gives access to the actual content of the attachment", "properties": { - "state": { + "base64": { "type": "string", - "enum": [ - "finished" - ], - "nullable": false + "description": "Base64-encoded data, when representing arbitrary content inline instead of via links. Optional." }, - "did": { - "type": "string" + "json": { + "$ref": "#/components/schemas/JsonValue", + "description": "Directly embedded JSON data, when representing content inline instead of via links, and when the content is natively conveyable as JSON. Optional." }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "links": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of zero or more locations at which the content may be fetched. Optional." }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "jws": { + "anyOf": [ + { + "$ref": "#/components/schemas/JwsDetachedFormat" + }, + { + "$ref": "#/components/schemas/JwsFlattenedDetachedFormat" + } + ], + "description": "A JSON Web Signature over the content of the attachment. Optional." + }, + "sha256": { + "type": "string", + "description": "The hash of the content. Optional." } }, - "required": [ - "state", - "did", - "didDocument" - ], "type": "object", "additionalProperties": false }, - "DidOperationStateFailed": { + "DidCommAttachment": { + "description": "Represents DIDComm attachment\nhttps://github.com/hyperledger/aries-rfcs/blob/master/concepts/0017-attachments/README.md", "properties": { - "state": { - "type": "string", - "enum": [ - "failed" - ], - "nullable": false - }, - "did": { + "id": { "type": "string" }, - "secret": { - "$ref": "#/components/schemas/DidRegistrationSecretOptions" + "description": { + "type": "string", + "description": "An optional human-readable description of the content." }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "filename": { + "type": "string", + "description": "A hint about the name that might be used if this attachment is persisted as a file. It is not required, and need not be unique. If this field is present and mime-type is not, the extension on the filename may be used to infer a MIME type." }, - "reason": { - "type": "string" - } + "mimeType": { + "type": "string", + "description": "Describes the MIME type of the attached content. Optional but recommended." + }, + "lastmodTime": { + "type": "string", + "format": "date-time", + "description": "A hint about when the content in this attachment was last modified." + }, + "byteCount": { + "type": "number", + "format": "double", + "description": "Optional, and mostly relevant when content is included by reference instead of by value. Lets the receiver guess how expensive it will be, in time, bandwidth, and storage, to fully fetch the attachment." + }, + "data": { + "$ref": "#/components/schemas/DidCommAttachmentData" + } }, "required": [ - "state", - "reason" + "id", + "data" ], "type": "object", "additionalProperties": false }, - "DidRegistrationMetadata": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "DidResolutionMetadata": { + "CreateInvitationOptions": { "properties": { - "contentType": { + "label": { "type": "string" }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "invalidDid", - "notFound", - "representationNotSupported", - "unsupportedDidMethod" - ] - } - ] + "alias": { + "type": "string" }, - "message": { + "imageUrl": { "type": "string" }, - "servedFromCache": { - "type": "boolean", - "description": "Whether the did document was served from the cache" + "goalCode": { + "type": "string" }, - "servedFromDidRecord": { - "type": "boolean", - "description": "Whether the did document was served from a local did record" + "goal": { + "type": "string" + }, + "handshake": { + "type": "boolean" + }, + "handshakeProtocols": { + "items": { + "$ref": "#/components/schemas/DidCommHandshakeProtocol" + }, + "type": "array" + }, + "messages": { + "items": { + "$ref": "#/components/schemas/DidCommMessage" + }, + "type": "array" + }, + "multiUseInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "routing": { + "$ref": "#/components/schemas/DidCommRouting" + }, + "appendedAttachments": { + "items": { + "$ref": "#/components/schemas/DidCommAttachment" + }, + "type": "array" + }, + "invitationDid": { + "type": "string" } }, "type": "object", "additionalProperties": false }, - "DidCreateResult_DidOperationStateActionBase_": { + "RecipientKeyOption": { "properties": { - "jobId": { + "recipientKey": { "type": "string" - }, - "didState": { + } + }, + "type": "object", + "additionalProperties": false + }, + "DidCommOutOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "CustomHandshakeProtocol": { + "enum": [ + "https://didcomm.org/didexchange/1.1", + "https://didcomm.org/connections/1.0" + ], + "type": "string" + }, + "SingleOrArray_string-or-Record_string.unknown__": { + "anyOf": [ + { "anyOf": [ { - "$ref": "#/components/schemas/DidOperationStateWait" - }, - { - "$ref": "#/components/schemas/DidOperationStateActionBase" - }, - { - "$ref": "#/components/schemas/DidOperationStateFinished" + "type": "string" }, { - "$ref": "#/components/schemas/DidOperationStateFailed" + "$ref": "#/components/schemas/Record_string.unknown_" } ] }, - "didRegistrationMetadata": { - "$ref": "#/components/schemas/DidRegistrationMetadata" - }, - "didDocumentMetadata": { - "$ref": "#/components/schemas/DidResolutionMetadata" + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/Record_string.unknown_" + } + ] + }, + "type": "array" } - }, - "required": [ - "didState", - "didRegistrationMetadata", - "didDocumentMetadata" - ], - "type": "object", - "additionalProperties": false + ] }, - "DidNymTransaction": { + "OutOfBandDidCommService": { "properties": { - "did": { + "id": { "type": "string" }, - "nymRequest": { - "type": "string" - } - }, - "required": [ - "did", - "nymRequest" - ], - "type": "object", - "additionalProperties": false - }, - "AnonCredsSchema": { - "properties": { - "issuerId": { + "serviceEndpoint": { "type": "string" }, - "name": { + "type": { "type": "string" }, - "version": { - "type": "string" + "recipientKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "routingKeys": { + "items": { + "type": "string" + }, + "type": "array" }, - "attrNames": { + "accept": { "items": { "type": "string" }, @@ -776,318 +807,265 @@ } }, "required": [ - "issuerId", - "name", - "version", - "attrNames" + "id", + "serviceEndpoint", + "type", + "recipientKeys" ], "type": "object", "additionalProperties": false }, - "RegisterSchemaReturnStateWait": { + "OutOfBandInvitationSchema": { "properties": { - "state": { - "type": "string", - "enum": [ - "wait" - ], - "nullable": false - }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "@id": { + "type": "string" }, - "schemaId": { + "@type": { "type": "string" - } - }, - "required": [ - "state" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterSchemaReturnStateAction": { - "properties": { - "state": { - "type": "string", - "enum": [ - "action" - ], - "nullable": false }, - "action": { + "label": { "type": "string" }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "goalCode": { + "type": "string" }, - "schemaId": { + "goal": { "type": "string" - } - }, - "required": [ - "state", - "action", - "schema", - "schemaId" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterSchemaReturnStateFinished": { - "properties": { - "state": { - "type": "string", - "enum": [ - "finished" - ], - "nullable": false }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "accept": { + "items": { + "type": "string" + }, + "type": "array" + }, + "handshake_protocols": { + "items": { + "$ref": "#/components/schemas/CustomHandshakeProtocol" + }, + "type": "array" + }, + "services": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OutOfBandDidCommService" + }, + { + "type": "string" + } + ] + }, + "type": "array" }, - "schemaId": { + "imageUrl": { "type": "string" } }, "required": [ - "state", - "schema", - "schemaId" + "@type", + "label", + "services" ], "type": "object", "additionalProperties": false }, - "RegisterSchemaReturnStateFailed": { + "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { "properties": { - "state": { - "type": "string", - "enum": [ - "failed" - ], - "nullable": false + "alias": { + "type": "string" }, - "reason": { + "label": { + "type": "string" + }, + "imageUrl": { "type": "string" }, - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" }, - "schemaId": { + "ourDid": { "type": "string" } }, "required": [ - "state", - "reason" + "label" ], "type": "object", - "additionalProperties": false + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_ReceiveOutOfBandInvitationConfig.routing_": { + "$ref": "#/components/schemas/Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__", + "description": "Construct a type with the properties of T except for those in type K." }, - "AnonCredsCredentialDefinition": { + "ReceiveInvitationProps": { "properties": { - "issuerId": { + "alias": { "type": "string" }, - "schemaId": { + "label": { "type": "string" }, - "type": { - "type": "string", - "enum": [ - "CL" - ], - "nullable": false - }, - "tag": { + "imageUrl": { "type": "string" }, - "value": { - "properties": { - "revocation": {}, - "primary": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "primary" - ], - "type": "object" - } - }, - "required": [ - "issuerId", - "schemaId", - "type", - "tag", - "value" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterCredentialDefinitionReturnStateWait": { - "properties": { - "state": { - "type": "string", - "enum": [ - "wait" - ], - "nullable": false + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" }, - "credentialDefinitionId": { + "ourDid": { "type": "string" + }, + "invitation": { + "$ref": "#/components/schemas/OutOfBandInvitationSchema" } }, "required": [ - "state" + "label", + "invitation" ], "type": "object", "additionalProperties": false }, - "RegisterCredentialDefinitionReturnStateAction": { + "ReceiveInvitationByUrlProps": { "properties": { - "state": { - "type": "string", - "enum": [ - "action" - ], - "nullable": false + "alias": { + "type": "string" }, - "action": { + "label": { "type": "string" }, - "credentialDefinitionId": { + "imageUrl": { "type": "string" }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" - } - }, - "required": [ - "state", - "action", - "credentialDefinitionId", - "credentialDefinition" - ], - "type": "object", - "additionalProperties": false - }, - "RegisterCredentialDefinitionReturnStateFinished": { - "properties": { - "state": { - "type": "string", - "enum": [ - "finished" - ], - "nullable": false + "autoAcceptInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "acceptInvitationTimeoutMs": { + "type": "number", + "format": "double" }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + "ourDid": { + "type": "string" }, - "credentialDefinitionId": { + "invitationUrl": { "type": "string" } }, "required": [ - "state", - "credentialDefinition", - "credentialDefinitionId" + "label", + "invitationUrl" ], "type": "object", "additionalProperties": false }, - "RegisterCredentialDefinitionReturnStateFailed": { + "AcceptInvitationConfig": { "properties": { - "state": { - "type": "string", - "enum": [ - "failed" - ], - "nullable": false + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "label": { + "type": "string" }, - "reason": { + "alias": { "type": "string" }, - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" + "imageUrl": { + "type": "string" }, - "credentialDefinitionId": { + "mediatorId": { "type": "string" } }, "required": [ - "state", - "reason" + "label" ], "type": "object", "additionalProperties": false }, - "WriteTransaction": { + "DidCommDidExchangeState": { + "description": "Connection states as defined in RFC 0023.", + "enum": [ + "start", + "invitation-sent", + "invitation-received", + "request-sent", + "request-received", + "response-sent", + "response-received", + "abandoned", + "completed" + ], + "type": "string" + }, + "DidCommConnectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "Record_string.any_": { + "properties": {}, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "DidResolutionMetadata": { "properties": { - "endorsedTransaction": { - "type": "string" - }, - "endorserDid": { + "contentType": { "type": "string" }, - "schema": { - "properties": { - "attributes": { - "items": { - "type": "string" - }, - "type": "array" - }, - "version": { - "type": "string" - }, - "name": { + "error": { + "anyOf": [ + { "type": "string" }, - "issuerId": { - "type": "string" + { + "type": "string", + "enum": [ + "invalidDid", + "notFound", + "representationNotSupported", + "unsupportedDidMethod" + ] } - }, - "required": [ - "attributes", - "version", - "name", - "issuerId" - ], - "type": "object" + ] }, - "credentialDefinition": { - "properties": { - "type": { - "type": "string" - }, - "value": {}, - "tag": { - "type": "string" - }, - "issuerId": { - "type": "string" - }, - "schemaId": { - "type": "string" - } - }, - "required": [ - "type", - "value", - "tag", - "issuerId", - "schemaId" - ], - "type": "object" + "message": { + "type": "string" + }, + "servedFromCache": { + "type": "boolean", + "description": "Whether the did document was served from the cache" + }, + "servedFromDidRecord": { + "type": "boolean", + "description": "Whether the did document was served from a local did record" } }, - "required": [ - "endorsedTransaction" - ], "type": "object", "additionalProperties": false }, @@ -1126,10 +1104,13 @@ "type": "string", "example": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" }, + "DidDocument": { + "$ref": "#/components/schemas/Record_string.any_" + }, "DidCreate": { "properties": { "keyType": { - "$ref": "#/components/schemas/KeyType" + "$ref": "#/components/schemas/KeyAlgorithm" }, "seed": { "type": "string" @@ -1171,288 +1152,272 @@ "DidRecord": { "$ref": "#/components/schemas/Record_string.unknown_" }, - "AnonCredsResolutionMetadata": { + "AgentInfo": { "properties": { - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "invalid", - "notFound", - "unsupportedAnonCredsMethod" - ] - } - ] - }, - "message": { + "label": { "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "CredoExtensible": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "GetSchemaReturn": { - "properties": { - "schema": { - "$ref": "#/components/schemas/AnonCredsSchema" }, - "schemaId": { - "type": "string" + "endpoints": { + "items": { + "type": "string" + }, + "type": "array" }, - "resolutionMetadata": { - "$ref": "#/components/schemas/AnonCredsResolutionMetadata" + "isInitialized": { + "type": "boolean" }, - "schemaMetadata": { - "$ref": "#/components/schemas/CredoExtensible" - } + "publicDid": {} }, "required": [ - "schemaId", - "resolutionMetadata", - "schemaMetadata" + "label", + "endpoints", + "isInitialized", + "publicDid" ], "type": "object", "additionalProperties": false }, - "SchemaId": { - "type": "string", - "example": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0" - }, - "RegisterSchemaReturn": { + "AgentToken": { "properties": { - "jobId": { + "token": { "type": "string" - }, - "schemaState": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateWait" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateAction" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFailed" - } - ] - }, - "schemaMetadata": { - "$ref": "#/components/schemas/CredoExtensible" - }, - "registrationMetadata": { - "$ref": "#/components/schemas/CredoExtensible" } }, "required": [ - "schemaState", - "schemaMetadata", - "registrationMetadata" + "token" ], "type": "object", "additionalProperties": false }, - "CreateSchemaInput": { + "Partial_W3cCredentialValidations_": { + "properties": {}, + "type": "object", + "description": "Make all properties in T optional" + }, + "Error": { "properties": { - "issuerId": { - "type": "string" - }, "name": { "type": "string" }, - "version": { + "message": { "type": "string" }, - "attributes": { - "items": { - "type": "string" - }, - "type": "array" - }, - "endorse": { - "type": "boolean" - }, - "endorserDid": { + "stack": { "type": "string" } }, "required": [ - "issuerId", "name", - "version", - "attributes" + "message" ], "type": "object", "additionalProperties": false }, - "GetCredentialDefinitionReturn": { + "W3cVerifyResult_W3cCredentialValidations_": { "properties": { - "credentialDefinition": { - "$ref": "#/components/schemas/AnonCredsCredentialDefinition" - }, - "credentialDefinitionId": { - "type": "string" + "isValid": { + "type": "boolean", + "description": "Whether the verification as a whole is valid. This means that\nall validations inside the validations object should have passed." }, - "resolutionMetadata": { - "$ref": "#/components/schemas/AnonCredsResolutionMetadata" + "validations": { + "$ref": "#/components/schemas/Partial_W3cCredentialValidations_", + "description": "Validations that have been performed" }, - "credentialDefinitionMetadata": { - "$ref": "#/components/schemas/CredoExtensible" + "error": { + "$ref": "#/components/schemas/Error", + "description": "Error that was caught during verification not related to\nany of the specific validations that are performed" } }, "required": [ - "credentialDefinitionId", - "resolutionMetadata", - "credentialDefinitionMetadata" + "isValid", + "validations" ], "type": "object", "additionalProperties": false }, - "CredentialDefinitionId": { - "type": "string", - "example": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag" + "W3cVerifyCredentialResult": { + "$ref": "#/components/schemas/W3cVerifyResult_W3cCredentialValidations_" }, - "RegisterCredentialDefinitionReturn": { + "DataIntegrityProofOptions": { "properties": { - "jobId": { + "type": { "type": "string" }, - "credentialDefinitionState": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateWait" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateAction" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFinished" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFailed" - } - ] + "cryptosuite": { + "type": "string" + }, + "verificationMethod": { + "type": "string" + }, + "proofPurpose": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "challenge": { + "type": "string" + }, + "nonce": { + "type": "string" + }, + "created": { + "type": "string" + }, + "expires": { + "type": "string" }, - "credentialDefinitionMetadata": { - "$ref": "#/components/schemas/CredoExtensible" + "proofValue": { + "type": "string" }, - "registrationMetadata": { - "$ref": "#/components/schemas/CredoExtensible" + "previousProof": { + "type": "string" } }, "required": [ - "credentialDefinitionState", - "credentialDefinitionMetadata", - "registrationMetadata" + "type", + "cryptosuite", + "verificationMethod", + "proofPurpose" ], "type": "object", "additionalProperties": false }, - "AgentInfo": { - "properties": { - "label": { - "type": "string" + "SingleOrArray_any-or-DataIntegrityProofOptions_": { + "anyOf": [ + { + "anyOf": [ + {}, + { + "$ref": "#/components/schemas/DataIntegrityProofOptions" + } + ] }, - "endpoints": { + { "items": { - "type": "string" + "anyOf": [ + {}, + { + "$ref": "#/components/schemas/DataIntegrityProofOptions" + } + ] }, "type": "array" - }, - "isInitialized": { - "type": "boolean" - }, - "publicDid": {} - }, - "required": [ - "label", - "endpoints", - "isInitialized", - "publicDid" - ], - "type": "object", - "additionalProperties": false + } + ] }, - "AgentToken": { + "LinkedDataProof": { + "description": "Linked Data Proof", "properties": { - "token": { + "type": { + "type": "string" + }, + "proofPurpose": { + "type": "string" + }, + "verificationMethod": { + "type": "string" + }, + "created": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "challenge": { + "type": "string" + }, + "jws": { + "type": "string" + }, + "proofValue": { + "type": "string" + }, + "nonce": { "type": "string" } }, "required": [ - "token" + "type", + "proofPurpose", + "verificationMethod", + "created" ], "type": "object", "additionalProperties": false }, - "VerifyDataOptions": { + "DataIntegrityProof": { + "description": "Linked Data Proof", "properties": { - "signature": { + "type": { "type": "string" }, - "publicKeyBase58": { + "cryptosuite": { "type": "string" }, - "keyType": { - "$ref": "#/components/schemas/KeyType" + "proofPurpose": { + "type": "string" }, - "data": { + "verificationMethod": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "challenge": { + "type": "string" + }, + "nonce": { + "type": "string" + }, + "created": { + "type": "string" + }, + "expires": { + "type": "string" + }, + "proofValue": { + "type": "string" + }, + "previousProof": { "type": "string" } }, "required": [ - "signature", - "publicKeyBase58", - "keyType", - "data" + "type", + "cryptosuite", + "proofPurpose", + "verificationMethod" ], - "type": "object" - }, - "W3cCredentialRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "JsonObject": { - "properties": {}, "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - } + "additionalProperties": false }, - "JsonValue": { + "SingleOrArray_LinkedDataProof-or-DataIntegrityProof_": { "anyOf": [ { - "type": "string" - }, - { - "type": "number", - "format": "double" - }, - { - "type": "boolean" - }, - { - "$ref": "#/components/schemas/JsonObject" + "anyOf": [ + { + "$ref": "#/components/schemas/LinkedDataProof" + }, + { + "$ref": "#/components/schemas/DataIntegrityProof" + } + ] }, { - "$ref": "#/components/schemas/JsonArray" + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/LinkedDataProof" + }, + { + "$ref": "#/components/schemas/DataIntegrityProof" + } + ] + }, + "type": "array" } - ], - "nullable": true - }, - "JsonArray": { - "items": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "array" + ] }, "W3cIssuer": { "properties": { @@ -1536,7 +1501,7 @@ "type": "object", "additionalProperties": false }, - "W3cCredential": { + "W3cJsonLdVerifiableCredential": { "properties": { "context": { "items": { @@ -1584,6 +1549,9 @@ }, "credentialStatus": { "$ref": "#/components/schemas/W3cCredentialStatus" + }, + "proof": { + "$ref": "#/components/schemas/SingleOrArray_LinkedDataProof-or-DataIntegrityProof_" } }, "required": [ @@ -1591,7418 +1559,150 @@ "type", "issuer", "issuanceDate", - "credentialSubject" + "credentialSubject", + "proof" ], "type": "object", "additionalProperties": false }, - "Pick_W3cJsonLdSignCredentialOptions.Exclude_keyofW3cJsonLdSignCredentialOptions.format__": { + "ProofPurpose": {}, + "SafeW3cJsonLdVerifyCredentialOptions": { "properties": { "credential": { - "$ref": "#/components/schemas/W3cCredential", - "description": "The credential to be signed." + "$ref": "#/components/schemas/W3cJsonLdVerifiableCredential" }, - "proofType": { - "type": "string", - "description": "The proofType to be used for signing the credential.\n\nMust be a valid Linked Data Signature suite." + "verifyCredentialStatus": { + "type": "boolean", + "description": "Whether to verify the credentialStatus, if present." }, - "proofPurpose": {}, - "created": { - "type": "string" + "proofPurpose": { + "$ref": "#/components/schemas/ProofPurpose" }, - "verificationMethod": { - "type": "string", - "description": "URI of the verificationMethod to be used for signing the credential.\n\nMust be a valid did url pointing to a key." + "proof": { + "$ref": "#/components/schemas/SingleOrArray_any-or-DataIntegrityProofOptions_" } }, "required": [ "credential", - "proofType", - "verificationMethod" + "proof" ], "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "Omit_W3cJsonLdSignCredentialOptions.format_": { - "$ref": "#/components/schemas/Pick_W3cJsonLdSignCredentialOptions.Exclude_keyofW3cJsonLdSignCredentialOptions.format__", - "description": "Construct a type with the properties of T except for those in type K." - }, - "CustomW3cJsonLdSignCredentialOptions": { - "allOf": [ - { - "$ref": "#/components/schemas/Omit_W3cJsonLdSignCredentialOptions.format_" - }, - { - "properties": {}, - "additionalProperties": {}, - "type": "object" - } - ] + "additionalProperties": false }, - "SignDataOptions": { + "TenantConfig": { "properties": { - "method": { - "type": "string" - }, - "did": { - "type": "string" - }, - "publicKeyBase58": { - "type": "string" - }, - "keyType": { - "$ref": "#/components/schemas/KeyType" - }, - "data": { + "label": { "type": "string" } }, "required": [ - "publicKeyBase58", - "keyType", - "data" + "label" ], "type": "object" }, - "Partial_W3cCredentialValidations_": { - "properties": {}, - "type": "object", - "description": "Make all properties in T optional" + "MetadataValue": { + "$ref": "#/components/schemas/Record_string.any_" }, - "Error": { - "properties": { - "name": { - "type": "string" - }, - "message": { - "type": "string" - }, - "stack": { - "type": "string" - } + "MetadataBase": { + "properties": {}, + "additionalProperties": { + "$ref": "#/components/schemas/MetadataValue" }, - "required": [ - "name", - "message" - ], - "type": "object", - "additionalProperties": false + "type": "object" }, - "W3cVerifyResult_W3cCredentialValidations_": { + "Metadata____": { + "description": "Metadata access class to get, set (create and update), add (append to a record) and delete metadata on any record.\n\nset will override the previous value if it already exists\n\nnote: To add persistence to these records, you have to update the record in the correct repository", "properties": { - "isValid": { - "type": "boolean", - "description": "Whether the verification as a whole is valid. This means that\nall validations inside the validations object should have passed." - }, - "validations": { - "$ref": "#/components/schemas/Partial_W3cCredentialValidations_", - "description": "Validations that have been performed" - }, - "error": { - "$ref": "#/components/schemas/Error", - "description": "Error that was caught during verification not related to\nany of the specific validations that are performed" + "data": { + "$ref": "#/components/schemas/MetadataBase" } }, "required": [ - "isValid", - "validations" + "data" ], "type": "object", "additionalProperties": false }, - "W3cVerifyCredentialResult": { - "$ref": "#/components/schemas/W3cVerifyResult_W3cCredentialValidations_" - }, - "Pick_LinkedDataProofOptions.Exclude_keyofLinkedDataProofOptions.cryptosuite__": { + "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { "properties": { - "proofPurpose": { - "type": "string" - }, - "created": { - "type": "string" - }, - "verificationMethod": { - "type": "string" - }, - "type": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "challenge": { - "type": "string" - }, - "jws": { - "type": "string" - }, - "proofValue": { + "label": { "type": "string" }, - "nonce": { + "connectionImageUrl": { "type": "string" } }, "required": [ - "proofPurpose", - "created", - "verificationMethod", - "type" + "label" ], "type": "object", "description": "From T, pick a set of properties whose keys are in the union K" }, - "Omit_LinkedDataProofOptions.cryptosuite_": { - "$ref": "#/components/schemas/Pick_LinkedDataProofOptions.Exclude_keyofLinkedDataProofOptions.cryptosuite__", + "Omit_CustomTenantConfig.walletConfig_": { + "$ref": "#/components/schemas/Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__", "description": "Construct a type with the properties of T except for those in type K." }, - "DataIntegrityProofOptions": { - "properties": { - "type": { - "type": "string" - }, - "cryptosuite": { - "type": "string" - }, - "verificationMethod": { - "type": "string" - }, - "proofPurpose": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "challenge": { - "type": "string" - }, - "nonce": { - "type": "string" - }, - "created": { - "type": "string" - }, - "expires": { - "type": "string" - }, - "proofValue": { - "type": "string" - }, - "previousProof": { - "type": "string" - } - }, - "required": [ - "type", - "cryptosuite", - "verificationMethod", - "proofPurpose" - ], - "type": "object", - "additionalProperties": false - }, - "SingleOrArray_Omit_LinkedDataProofOptions.cryptosuite_-or-DataIntegrityProofOptions_": { - "anyOf": [ - { - "anyOf": [ - { - "$ref": "#/components/schemas/Omit_LinkedDataProofOptions.cryptosuite_" - }, - { - "$ref": "#/components/schemas/DataIntegrityProofOptions" - } - ] - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Omit_LinkedDataProofOptions.cryptosuite_" - }, - { - "$ref": "#/components/schemas/DataIntegrityProofOptions" - } - ] - }, - "type": "array" - } - ] - }, - "LinkedDataProof": { - "description": "Linked Data Proof", - "properties": { - "type": { - "type": "string" - }, - "proofPurpose": { - "type": "string" - }, - "verificationMethod": { - "type": "string" - }, - "created": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "challenge": { - "type": "string" - }, - "jws": { - "type": "string" - }, - "proofValue": { - "type": "string" - }, - "nonce": { - "type": "string" - } - }, - "required": [ - "type", - "proofPurpose", - "verificationMethod", - "created" - ], - "type": "object", - "additionalProperties": false - }, - "DataIntegrityProof": { - "description": "Linked Data Proof", + "CreateTenantOptions": { "properties": { - "type": { - "type": "string" - }, - "cryptosuite": { - "type": "string" - }, - "proofPurpose": { - "type": "string" - }, - "verificationMethod": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "challenge": { - "type": "string" - }, - "nonce": { - "type": "string" - }, - "created": { - "type": "string" - }, - "expires": { - "type": "string" - }, - "proofValue": { - "type": "string" - }, - "previousProof": { - "type": "string" + "config": { + "$ref": "#/components/schemas/Omit_CustomTenantConfig.walletConfig_" } }, "required": [ - "type", - "cryptosuite", - "proofPurpose", - "verificationMethod" + "config" ], "type": "object", "additionalProperties": false + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "Authorization", + "in": "header" }, - "SingleOrArray_LinkedDataProof-or-DataIntegrityProof_": { - "anyOf": [ - { - "anyOf": [ - { - "$ref": "#/components/schemas/LinkedDataProof" - }, - { - "$ref": "#/components/schemas/DataIntegrityProof" - } - ] - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/LinkedDataProof" - }, - { - "$ref": "#/components/schemas/DataIntegrityProof" - } - ] - }, - "type": "array" - } - ] - }, - "W3cJsonLdVerifiableCredential": { - "properties": { - "context": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/JsonObject" - } - ] - }, - "type": "array" - }, - "id": { - "type": "string" - }, - "type": { - "items": { - "type": "string" - }, - "type": "array" - }, - "issuer": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/W3cIssuer" - } - ] - }, - "issuanceDate": { - "type": "string" - }, - "expirationDate": { - "type": "string" - }, - "credentialSubject": { - "$ref": "#/components/schemas/SingleOrArray_W3cCredentialSubject_" - }, - "credentialSchema": { - "$ref": "#/components/schemas/SingleOrArray_W3cCredentialSchema_" - }, - "credentialStatus": { - "$ref": "#/components/schemas/W3cCredentialStatus" - }, - "proof": { - "$ref": "#/components/schemas/SingleOrArray_LinkedDataProof-or-DataIntegrityProof_" - } - }, - "required": [ - "context", - "type", - "issuer", - "issuanceDate", - "credentialSubject", - "proof" - ], - "type": "object", - "additionalProperties": false - }, - "ProofPurpose": {}, - "SafeW3cJsonLdVerifyCredentialOptions": { - "properties": { - "credential": { - "$ref": "#/components/schemas/W3cJsonLdVerifiableCredential" - }, - "verifyCredentialStatus": { - "type": "boolean", - "description": "Whether to verify the credentialStatus, if present." - }, - "proofPurpose": { - "$ref": "#/components/schemas/ProofPurpose" - }, - "proof": { - "$ref": "#/components/schemas/SingleOrArray_Omit_LinkedDataProofOptions.cryptosuite_-or-DataIntegrityProofOptions_" - } - }, - "required": [ - "credential", - "proof" - ], - "type": "object", - "additionalProperties": false - }, - "QuestionAnswerRole": { - "enum": [ - "questioner", - "responder" - ], - "type": "string" - }, - "QuestionAnswerState": { - "description": "QuestionAnswer states inferred from RFC 0113.", - "enum": [ - "question-sent", - "question-received", - "answer-received", - "answer-sent" - ], - "type": "string" - }, - "RecordId": { - "type": "string", - "example": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" - }, - "ValidResponse": { - "properties": { - "text": { - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object", - "additionalProperties": false - }, - "Record_response.string_": { - "properties": { - "response": { - "type": "string" - } - }, - "required": [ - "response" - ], - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "ProofExchangeRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "AutoAcceptProof": { - "description": "Typing of the state for auto acceptance", - "enum": [ - "always", - "contentApproved", - "never" - ], - "type": "string" - }, - "RequestProofProposalOptions": { - "properties": { - "connectionId": { - "type": "string" - }, - "proofFormats": {}, - "goalCode": { - "type": "string" - }, - "parentThreadId": { - "type": "string" - }, - "autoAcceptProof": { - "$ref": "#/components/schemas/AutoAcceptProof" - }, - "comment": { - "type": "string" - } - }, - "required": [ - "connectionId", - "proofFormats" - ], - "type": "object", - "additionalProperties": false - }, - "AcceptProofProposal": { - "properties": { - "proofRecordId": { - "type": "string" - }, - "proofFormats": {}, - "comment": { - "type": "string" - }, - "autoAcceptProof": { - "$ref": "#/components/schemas/AutoAcceptProof" - }, - "goalCode": { - "type": "string" - }, - "willConfirm": { - "type": "boolean" - } - }, - "required": [ - "proofRecordId", - "proofFormats" - ], - "type": "object", - "additionalProperties": false - }, - "RequestProofOptions": { - "properties": { - "connectionId": { - "type": "string" - }, - "protocolVersion": { - "type": "string" - }, - "proofFormats": {}, - "comment": { - "type": "string" - }, - "autoAcceptProof": { - "$ref": "#/components/schemas/AutoAcceptProof" - }, - "goalCode": { - "type": "string" - }, - "parentThreadId": { - "type": "string" - }, - "willConfirm": { - "type": "boolean" - } - }, - "required": [ - "connectionId", - "protocolVersion", - "proofFormats", - "comment", - "autoAcceptProof" - ], - "type": "object", - "additionalProperties": false - }, - "PlaintextMessage": { - "properties": { - "@type": { - "type": "string" - }, - "@id": { - "type": "string" - }, - "~thread": { - "properties": { - "pthid": { - "type": "string" - }, - "thid": { - "type": "string" - } - }, - "type": "object" - } - }, - "required": [ - "@type", - "@id" - ], - "type": "object", - "additionalProperties": {} - }, - "CreateProofRequestOobOptions": { - "properties": { - "protocolVersion": { - "type": "string" - }, - "proofFormats": {}, - "goalCode": { - "type": "string" - }, - "parentThreadId": { - "type": "string" - }, - "willConfirm": { - "type": "boolean" - }, - "autoAcceptProof": { - "$ref": "#/components/schemas/AutoAcceptProof" - }, - "comment": { - "type": "string" - }, - "label": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "recipientKey": { - "type": "string" - }, - "invitationDid": { - "type": "string" - } - }, - "required": [ - "protocolVersion", - "proofFormats" - ], - "type": "object", - "additionalProperties": false - }, - "ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.proposal_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of ProofFormat interfaces and a message\n\nFor an indy offer, this resolves to the proof request format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#proof-request-format" - }, - "ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.request_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of ProofFormat interfaces and a message\n\nFor an indy offer, this resolves to the proof request format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#proof-request-format" - }, - "ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.presentation_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of ProofFormat interfaces and a message\n\nFor an indy offer, this resolves to the proof request format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#proof-request-format" - }, - "GetProofFormatDataReturn__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array_": { - "properties": { - "presentation": { - "$ref": "#/components/schemas/ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.presentation_" - }, - "request": { - "$ref": "#/components/schemas/ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.request_" - }, - "proposal": { - "$ref": "#/components/schemas/ProofFormatDataMessagePayload__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array.proposal_" - } - }, - "type": "object" - }, - "HandshakeProtocol": { - "description": "Enum values should be sorted based on order of preference. Values will be\nincluded in this order when creating out of band invitations.", - "enum": [ - "https://didcomm.org/didexchange/1.x", - "https://didcomm.org/connections/1.x" - ], - "type": "string" - }, - "AgentMessage": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "Routing": { - "properties": { - "endpoints": { - "items": { - "type": "string" - }, - "type": "array" - }, - "recipientKey": { - "$ref": "#/components/schemas/Key" - }, - "routingKeys": { - "items": { - "$ref": "#/components/schemas/Key" - }, - "type": "array" - }, - "mediatorId": { - "type": "string" - } - }, - "required": [ - "endpoints", - "recipientKey", - "routingKeys" - ], - "type": "object", - "additionalProperties": false - }, - "Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__": { - "properties": { - "header": { - "$ref": "#/components/schemas/Record_string.unknown_", - "description": "unprotected header" - }, - "signature": { - "type": "string", - "description": "Base64url encoded signature" - }, - "protected": { - "type": "string", - "description": "Base64url encoded protected header" - } - }, - "required": [ - "header", - "signature", - "protected" - ], - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "Omit_JwsGeneralFormat.payload_": { - "$ref": "#/components/schemas/Pick_JwsGeneralFormat.Exclude_keyofJwsGeneralFormat.payload__", - "description": "Construct a type with the properties of T except for those in type K." - }, - "JwsDetachedFormat": { - "$ref": "#/components/schemas/Omit_JwsGeneralFormat.payload_" - }, - "JwsFlattenedDetachedFormat": { - "properties": { - "signatures": { - "items": { - "$ref": "#/components/schemas/JwsDetachedFormat" - }, - "type": "array" - } - }, - "required": [ - "signatures" - ], - "type": "object", - "additionalProperties": false - }, - "AttachmentData": { - "description": "A JSON object that gives access to the actual content of the attachment", - "properties": { - "base64": { - "type": "string", - "description": "Base64-encoded data, when representing arbitrary content inline instead of via links. Optional." - }, - "json": { - "$ref": "#/components/schemas/JsonValue", - "description": "Directly embedded JSON data, when representing content inline instead of via links, and when the content is natively conveyable as JSON. Optional." - }, - "links": { - "items": { - "type": "string" - }, - "type": "array", - "description": "A list of zero or more locations at which the content may be fetched. Optional." - }, - "jws": { - "anyOf": [ - { - "$ref": "#/components/schemas/JwsDetachedFormat" - }, - { - "$ref": "#/components/schemas/JwsFlattenedDetachedFormat" - } - ], - "description": "A JSON Web Signature over the content of the attachment. Optional." - }, - "sha256": { - "type": "string", - "description": "The hash of the content. Optional." - } - }, - "type": "object", - "additionalProperties": false - }, - "Attachment": { - "description": "Represents DIDComm attachment\nhttps://github.com/hyperledger/aries-rfcs/blob/master/concepts/0017-attachments/README.md", - "properties": { - "id": { - "type": "string" - }, - "description": { - "type": "string", - "description": "An optional human-readable description of the content." - }, - "filename": { - "type": "string", - "description": "A hint about the name that might be used if this attachment is persisted as a file. It is not required, and need not be unique. If this field is present and mime-type is not, the extension on the filename may be used to infer a MIME type." - }, - "mimeType": { - "type": "string", - "description": "Describes the MIME type of the attached content. Optional but recommended." - }, - "lastmodTime": { - "type": "string", - "format": "date-time", - "description": "A hint about when the content in this attachment was last modified." - }, - "byteCount": { - "type": "number", - "format": "double", - "description": "Optional, and mostly relevant when content is included by reference instead of by value. Lets the receiver guess how expensive it will be, in time, bandwidth, and storage, to fully fetch the attachment." - }, - "data": { - "$ref": "#/components/schemas/AttachmentData" - } - }, - "required": [ - "id", - "data" - ], - "type": "object", - "additionalProperties": false - }, - "CreateInvitationOptions": { - "properties": { - "label": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "goalCode": { - "type": "string" - }, - "goal": { - "type": "string" - }, - "handshake": { - "type": "boolean" - }, - "handshakeProtocols": { - "items": { - "$ref": "#/components/schemas/HandshakeProtocol" - }, - "type": "array" - }, - "messages": { - "items": { - "$ref": "#/components/schemas/AgentMessage" - }, - "type": "array" - }, - "multiUseInvitation": { - "type": "boolean" - }, - "autoAcceptConnection": { - "type": "boolean" - }, - "routing": { - "$ref": "#/components/schemas/Routing" - }, - "appendedAttachments": { - "items": { - "$ref": "#/components/schemas/Attachment" - }, - "type": "array" - }, - "invitationDid": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "RecipientKeyOption": { - "properties": { - "recipientKey": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__": { - "properties": { - "alias": { - "type": "string" - }, - "label": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "multiUseInvitation": { - "type": "boolean" - }, - "autoAcceptConnection": { - "type": "boolean" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "Omit_CreateLegacyInvitationConfig.routing_": { - "$ref": "#/components/schemas/Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__", - "description": "Construct a type with the properties of T except for those in type K." - }, - "OutOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "CustomHandshakeProtocol": { - "enum": [ - "https://didcomm.org/didexchange/1.1", - "https://didcomm.org/connections/1.0" - ], - "type": "string" - }, - "SingleOrArray_string-or-Record_string.unknown__": { - "anyOf": [ - { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.unknown_" - } - ] - }, - { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.unknown_" - } - ] - }, - "type": "array" - } - ] - }, - "OutOfBandDidCommService": { - "properties": { - "id": { - "type": "string" - }, - "serviceEndpoint": { - "type": "string" - }, - "type": { - "type": "string" - }, - "recipientKeys": { - "items": { - "type": "string" - }, - "type": "array" - }, - "routingKeys": { - "items": { - "type": "string" - }, - "type": "array" - }, - "accept": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "id", - "serviceEndpoint", - "type", - "recipientKeys" - ], - "type": "object", - "additionalProperties": false - }, - "OutOfBandInvitationSchema": { - "properties": { - "@id": { - "type": "string" - }, - "@type": { - "type": "string" - }, - "label": { - "type": "string" - }, - "goalCode": { - "type": "string" - }, - "goal": { - "type": "string" - }, - "accept": { - "items": { - "type": "string" - }, - "type": "array" - }, - "handshake_protocols": { - "items": { - "$ref": "#/components/schemas/CustomHandshakeProtocol" - }, - "type": "array" - }, - "services": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OutOfBandDidCommService" - }, - { - "type": "string" - } - ] - }, - "type": "array" - }, - "imageUrl": { - "type": "string" - } - }, - "required": [ - "@type", - "label", - "services" - ], - "type": "object", - "additionalProperties": false - }, - "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { - "properties": { - "alias": { - "type": "string" - }, - "label": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "autoAcceptConnection": { - "type": "boolean" - }, - "autoAcceptInvitation": { - "type": "boolean" - }, - "reuseConnection": { - "type": "boolean" - }, - "acceptInvitationTimeoutMs": { - "type": "number", - "format": "double" - }, - "ourDid": { - "type": "string" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "Omit_ReceiveOutOfBandInvitationConfig.routing_": { - "$ref": "#/components/schemas/Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__", - "description": "Construct a type with the properties of T except for those in type K." - }, - "ReceiveInvitationProps": { - "properties": { - "alias": { - "type": "string" - }, - "label": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "autoAcceptConnection": { - "type": "boolean" - }, - "autoAcceptInvitation": { - "type": "boolean" - }, - "reuseConnection": { - "type": "boolean" - }, - "acceptInvitationTimeoutMs": { - "type": "number", - "format": "double" - }, - "ourDid": { - "type": "string" - }, - "invitation": { - "$ref": "#/components/schemas/OutOfBandInvitationSchema" - } - }, - "required": [ - "invitation" - ], - "type": "object", - "additionalProperties": false - }, - "ReceiveInvitationByUrlProps": { - "properties": { - "alias": { - "type": "string" - }, - "label": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "autoAcceptConnection": { - "type": "boolean" - }, - "autoAcceptInvitation": { - "type": "boolean" - }, - "reuseConnection": { - "type": "boolean" - }, - "acceptInvitationTimeoutMs": { - "type": "number", - "format": "double" - }, - "ourDid": { - "type": "string" - }, - "invitationUrl": { - "type": "string" - } - }, - "required": [ - "invitationUrl" - ], - "type": "object", - "additionalProperties": false - }, - "AcceptInvitationConfig": { - "properties": { - "autoAcceptConnection": { - "type": "boolean" - }, - "reuseConnection": { - "type": "boolean" - }, - "label": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "mediatorId": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "ThreadId": { - "type": "string", - "example": "ea4e5e69-fc04-465a-90d2-9f8ff78aa71d" - }, - "CredentialState": { - "description": "Issue Credential states as defined in RFC 0036 and RFC 0453", - "enum": [ - "proposal-sent", - "proposal-received", - "offer-sent", - "offer-received", - "declined", - "request-sent", - "request-received", - "credential-issued", - "credential-received", - "done", - "abandoned" - ], - "type": "string" - }, - "CredentialRole": { - "enum": [ - "issuer", - "holder" - ], - "type": "string" - }, - "CredentialExchangeRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "ProtocolVersion": { - "enum": [ - "v1", - "v2" - ], - "type": "string" - }, - "CredentialPreviewAttributeOptions": { - "properties": { - "name": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "type": "object", - "additionalProperties": false - }, - "LinkedAttachment": { - "properties": { - "attributeName": { - "type": "string", - "description": "The name that will be used to generate the linked credential" - }, - "attachment": { - "$ref": "#/components/schemas/Attachment", - "description": "The attachment that needs to be linked to the credential" - } - }, - "required": [ - "attributeName", - "attachment" - ], - "type": "object", - "additionalProperties": false - }, - "Pick_AnonCredsProposeCredentialFormat.Exclude_keyofAnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId__": { - "properties": { - "schemaId": { - "type": "string" - }, - "schemaName": { - "type": "string" - }, - "schemaVersion": { - "type": "string" - }, - "credentialDefinitionId": { - "type": "string" - }, - "attributes": { - "items": { - "$ref": "#/components/schemas/CredentialPreviewAttributeOptions" - }, - "type": "array" - }, - "linkedAttachments": { - "items": { - "$ref": "#/components/schemas/LinkedAttachment" - }, - "type": "array" - }, - "schemaIssuerDid": { - "type": "string" - }, - "issuerDid": { - "type": "string" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "Omit_AnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId_": { - "$ref": "#/components/schemas/Pick_AnonCredsProposeCredentialFormat.Exclude_keyofAnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId__", - "description": "Construct a type with the properties of T except for those in type K." - }, - "LegacyIndyProposeCredentialFormat": { - "$ref": "#/components/schemas/Omit_AnonCredsProposeCredentialFormat.schemaIssuerId-or-issuerId_", - "description": "This defines the module payload for calling CredentialsApi.createProposal\nor CredentialsApi.negotiateOffer\n\nNOTE: This doesn't include the `issuerId` and `schemaIssuerId` properties that are present in the newer format." - }, - "W3cIssuerOptions": { - "description": "TODO: check how to support arbitrary data in class", - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object", - "additionalProperties": false - }, - "SingleOrArray_JsonObject_": { - "anyOf": [ - { - "$ref": "#/components/schemas/JsonObject" - }, - { - "items": { - "$ref": "#/components/schemas/JsonObject" - }, - "type": "array" - } - ] - }, - "JsonCredential": { - "properties": { - "@context": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/JsonObject" - } - ] - }, - "id": { - "type": "string" - }, - "type": { - "items": { - "type": "string" - }, - "type": "array" - }, - "issuer": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/W3cIssuerOptions" - } - ] - }, - "issuanceDate": { - "type": "string" - }, - "expirationDate": { - "type": "string" - }, - "credentialSubject": { - "$ref": "#/components/schemas/SingleOrArray_JsonObject_" - }, - "prettyVc": {} - }, - "required": [ - "@context", - "type", - "issuer", - "issuanceDate", - "credentialSubject" - ], - "type": "object", - "additionalProperties": {} - }, - "JsonLdCredentialDetailFormat": { - "description": "Format for creating a jsonld proposal, offer or request.", - "properties": { - "credential": { - "$ref": "#/components/schemas/JsonCredential" - }, - "options": { - "properties": { - "proofType": { - "type": "string" - }, - "proofPurpose": { - "type": "string" - } - }, - "required": [ - "proofType", - "proofPurpose" - ], - "type": "object" - } - }, - "required": [ - "credential", - "options" - ], - "type": "object", - "additionalProperties": false - }, - "AnonCredsProposeCredentialFormat": { - "description": "This defines the module payload for calling CredentialsApi.createProposal\nor CredentialsApi.negotiateOffer", - "properties": { - "schemaIssuerId": { - "type": "string" - }, - "schemaId": { - "type": "string" - }, - "schemaName": { - "type": "string" - }, - "schemaVersion": { - "type": "string" - }, - "credentialDefinitionId": { - "type": "string" - }, - "issuerId": { - "type": "string" - }, - "attributes": { - "items": { - "$ref": "#/components/schemas/CredentialPreviewAttributeOptions" - }, - "type": "array" - }, - "linkedAttachments": { - "items": { - "$ref": "#/components/schemas/LinkedAttachment" - }, - "type": "array" - }, - "schemaIssuerDid": { - "type": "string" - }, - "issuerDid": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "CredentialFormatPayload_CredentialFormatType-Array.createProposal_": { - "properties": { - "indy": { - "$ref": "#/components/schemas/LegacyIndyProposeCredentialFormat" - }, - "jsonld": { - "$ref": "#/components/schemas/JsonLdCredentialDetailFormat" - }, - "anoncreds": { - "$ref": "#/components/schemas/AnonCredsProposeCredentialFormat" - } - }, - "type": "object", - "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" - }, - "AutoAcceptCredential": { - "description": "Typing of the state for auto acceptance", - "enum": [ - "always", - "contentApproved", - "never" - ], - "type": "string" - }, - "ProposeCredentialOptions": { - "properties": { - "protocolVersion": { - "$ref": "#/components/schemas/ProtocolVersion" - }, - "credentialFormats": { - "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormatType-Array.createProposal_" - }, - "autoAcceptCredential": { - "$ref": "#/components/schemas/AutoAcceptCredential" - }, - "comment": { - "type": "string" - }, - "connectionId": { - "$ref": "#/components/schemas/RecordId" - } - }, - "required": [ - "protocolVersion", - "credentialFormats", - "connectionId" - ], - "type": "object", - "additionalProperties": false - }, - "AnonCredsAcceptProposalFormat": { - "description": "This defines the module payload for calling CredentialsApi.acceptProposal", - "properties": { - "credentialDefinitionId": { - "type": "string" - }, - "revocationRegistryDefinitionId": { - "type": "string" - }, - "revocationRegistryIndex": { - "type": "number", - "format": "double" - }, - "attributes": { - "items": { - "$ref": "#/components/schemas/CredentialPreviewAttributeOptions" - }, - "type": "array" - }, - "linkedAttachments": { - "items": { - "$ref": "#/components/schemas/LinkedAttachment" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": false - }, - "Record_string.never_": { - "properties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "EmptyObject": { - "$ref": "#/components/schemas/Record_string.never_" - }, - "CredentialFormatPayload_CredentialFormats.acceptProposal_": { - "properties": { - "indy": { - "$ref": "#/components/schemas/AnonCredsAcceptProposalFormat" - }, - "jsonld": { - "$ref": "#/components/schemas/EmptyObject" - }, - "anoncreds": { - "$ref": "#/components/schemas/AnonCredsAcceptProposalFormat" - } - }, - "type": "object", - "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" - }, - "AcceptCredentialProposalOptions": { - "properties": { - "credentialRecordId": { - "type": "string" - }, - "credentialFormats": { - "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormats.acceptProposal_" - }, - "autoAcceptCredential": { - "$ref": "#/components/schemas/AutoAcceptCredential" - }, - "comment": { - "type": "string" - } - }, - "required": [ - "credentialRecordId" - ], - "type": "object", - "additionalProperties": false - }, - "AnonCredsOfferCredentialFormat": { - "description": "This defines the module payload for calling CredentialsApi.offerCredential\nor CredentialsApi.negotiateProposal", - "properties": { - "credentialDefinitionId": { - "type": "string" - }, - "revocationRegistryDefinitionId": { - "type": "string" - }, - "revocationRegistryIndex": { - "type": "number", - "format": "double" - }, - "attributes": { - "items": { - "$ref": "#/components/schemas/CredentialPreviewAttributeOptions" - }, - "type": "array" - }, - "linkedAttachments": { - "items": { - "$ref": "#/components/schemas/LinkedAttachment" - }, - "type": "array" - } - }, - "required": [ - "credentialDefinitionId", - "attributes" - ], - "type": "object", - "additionalProperties": false - }, - "CredentialFormatPayload_CredentialFormats.createOffer_": { - "properties": { - "indy": { - "$ref": "#/components/schemas/AnonCredsOfferCredentialFormat" - }, - "jsonld": { - "$ref": "#/components/schemas/JsonLdCredentialDetailFormat" - }, - "anoncreds": { - "$ref": "#/components/schemas/AnonCredsOfferCredentialFormat" - } - }, - "type": "object", - "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" - }, - "CreateOfferOptions": { - "properties": { - "protocolVersion": { - "$ref": "#/components/schemas/ProtocolVersion" - }, - "connectionId": { - "$ref": "#/components/schemas/RecordId" - }, - "credentialFormats": { - "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormats.createOffer_" - }, - "autoAcceptCredential": { - "$ref": "#/components/schemas/AutoAcceptCredential" - }, - "comment": { - "type": "string" - }, - "goalCode": { - "type": "string" - }, - "goal": { - "type": "string" - } - }, - "required": [ - "protocolVersion", - "connectionId", - "credentialFormats" - ], - "type": "object", - "additionalProperties": false - }, - "CredentialFormatPayload_CredentialFormatType-Array.createOffer_": { - "properties": { - "indy": { - "$ref": "#/components/schemas/AnonCredsOfferCredentialFormat" - }, - "jsonld": { - "$ref": "#/components/schemas/JsonLdCredentialDetailFormat" - }, - "anoncreds": { - "$ref": "#/components/schemas/AnonCredsOfferCredentialFormat" - } - }, - "type": "object", - "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" - }, - "CreateOfferOobOptions": { - "properties": { - "protocolVersion": { - "type": "string" - }, - "credentialFormats": { - "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormatType-Array.createOffer_" - }, - "autoAcceptCredential": { - "$ref": "#/components/schemas/AutoAcceptCredential" - }, - "comment": { - "type": "string" - }, - "goalCode": { - "type": "string" - }, - "parentThreadId": { - "type": "string" - }, - "willConfirm": { - "type": "boolean" - }, - "label": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "recipientKey": { - "type": "string" - }, - "invitationDid": { - "type": "string" - } - }, - "required": [ - "protocolVersion", - "credentialFormats" - ], - "type": "object", - "additionalProperties": false - }, - "AnonCredsAcceptOfferFormat": { - "description": "This defines the module payload for calling CredentialsApi.acceptOffer. No options are available for this\nmethod, so it's an empty object", - "properties": { - "linkSecretId": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "CredentialFormatPayload_CredentialFormats.acceptOffer_": { - "properties": { - "indy": { - "$ref": "#/components/schemas/AnonCredsAcceptOfferFormat" - }, - "jsonld": { - "$ref": "#/components/schemas/EmptyObject" - }, - "anoncreds": { - "$ref": "#/components/schemas/AnonCredsAcceptOfferFormat" - } - }, - "type": "object", - "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" - }, - "CredentialOfferOptions": { - "properties": { - "credentialRecordId": { - "$ref": "#/components/schemas/RecordId" - }, - "credentialFormats": { - "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormats.acceptOffer_" - }, - "autoAcceptCredential": { - "$ref": "#/components/schemas/AutoAcceptCredential" - }, - "comment": { - "type": "string" - } - }, - "required": [ - "credentialRecordId" - ], - "type": "object", - "additionalProperties": false - }, - "AnonCredsAcceptRequestFormat": { - "$ref": "#/components/schemas/Record_string.never_", - "description": "This defines the module payload for calling CredentialsApi.acceptRequest. No options are available for this\nmethod, so it's an empty object" - }, - "JsonLdAcceptRequestFormat": { - "description": "Format for accepting a jsonld credential request. Optionally allows the verification\nmethod to use to sign the credential.", - "properties": { - "verificationMethod": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "CredentialFormatPayload_CredentialFormats.acceptRequest_": { - "properties": { - "indy": { - "$ref": "#/components/schemas/AnonCredsAcceptRequestFormat" - }, - "jsonld": { - "$ref": "#/components/schemas/JsonLdAcceptRequestFormat" - }, - "anoncreds": { - "$ref": "#/components/schemas/AnonCredsAcceptRequestFormat" - } - }, - "type": "object", - "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" - }, - "AcceptCredentialRequestOptions": { - "properties": { - "credentialRecordId": { - "$ref": "#/components/schemas/RecordId" - }, - "credentialFormats": { - "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormats.acceptRequest_" - }, - "autoAcceptCredential": { - "$ref": "#/components/schemas/AutoAcceptCredential" - }, - "comment": { - "type": "string" - } - }, - "required": [ - "credentialRecordId" - ], - "type": "object", - "additionalProperties": false - }, - "AcceptCredential": { - "properties": { - "credentialRecordId": { - "$ref": "#/components/schemas/RecordId" - } - }, - "required": [ - "credentialRecordId" - ], - "type": "object", - "additionalProperties": false - }, - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.proposal_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of CredentialFormat interfaces and a message\n\nFor an indy offer, this resolves to the cred abstract format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#cred-abstract-format" - }, - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.offer_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of CredentialFormat interfaces and a message\n\nFor an indy offer, this resolves to the cred abstract format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#cred-abstract-format" - }, - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.request_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of CredentialFormat interfaces and a message\n\nFor an indy offer, this resolves to the cred abstract format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#cred-abstract-format" - }, - "CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.credential_": { - "properties": {}, - "type": "object", - "description": "Get the format data payload for a specific message from a list of CredentialFormat interfaces and a message\n\nFor an indy offer, this resolves to the cred abstract format as defined here:\nhttps://github.com/hyperledger/aries-rfcs/tree/b3a3942ef052039e73cd23d847f42947f8287da2/features/0592-indy-attachments#cred-abstract-format" - }, - "GetCredentialFormatDataReturn__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array_": { - "properties": { - "credential": { - "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.credential_" - }, - "request": { - "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.request_" - }, - "offerAttributes": { - "items": { - "$ref": "#/components/schemas/CredentialPreviewAttributeOptions" - }, - "type": "array" - }, - "offer": { - "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.offer_" - }, - "proposal": { - "$ref": "#/components/schemas/CredentialFormatDataMessagePayload__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array.proposal_" - }, - "proposalAttributes": { - "items": { - "$ref": "#/components/schemas/CredentialPreviewAttributeOptions" - }, - "type": "array" - } - }, - "type": "object", - "description": "Get format data return value. Each key holds a mapping of credential format key to format data." - }, - "DidExchangeState": { - "description": "Connection states as defined in RFC 0023.", - "enum": [ - "start", - "invitation-sent", - "invitation-received", - "request-sent", - "request-received", - "response-sent", - "response-received", - "abandoned", - "completed" - ], - "type": "string" - }, - "ConnectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "BasicMessageRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "Record_content.string_": { - "properties": { - "content": { - "type": "string" - } - }, - "required": [ - "content" - ], - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "Pick_InitConfig.label_": { - "properties": { - "label": { - "type": "string", - "description": "Agent public endpoints, sorted by priority (higher priority first)" - } - }, - "required": [ - "label" - ], - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "KeyDerivationMethod": { - "enum": [ - "ARGON2I_MOD", - "ARGON2I_INT", - "RAW" - ], - "type": "string" - }, - "Pick_WalletConfig.id-or-key-or-keyDerivationMethod_": { - "properties": { - "key": { - "type": "string" - }, - "id": { - "type": "string" - }, - "keyDerivationMethod": { - "$ref": "#/components/schemas/KeyDerivationMethod" - } - }, - "required": [ - "key", - "id" - ], - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "TenantConfig": { - "allOf": [ - { - "$ref": "#/components/schemas/Pick_InitConfig.label_" - }, - { - "properties": { - "walletConfig": { - "$ref": "#/components/schemas/Pick_WalletConfig.id-or-key-or-keyDerivationMethod_" - } - }, - "required": [ - "walletConfig" - ], - "type": "object" - } - ] - }, - "MetadataValue": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "MetadataBase": { - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/MetadataValue" - }, - "type": "object" - }, - "Metadata____": { - "description": "Metadata access class to get, set (create and update), add (append to a record) and delete metadata on any record.\n\nset will override the previous value if it already exists\n\nnote: To add persistence to these records, you have to update the record in the correct repository", - "properties": { - "data": { - "$ref": "#/components/schemas/MetadataBase" - } - }, - "required": [ - "data" - ], - "type": "object", - "additionalProperties": false - }, - "Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__": { - "properties": { - "label": { - "type": "string", - "description": "Agent public endpoints, sorted by priority (higher priority first)" - }, - "connectionImageUrl": { - "type": "string" - } - }, - "required": [ - "label" - ], - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "Omit_CustomTenantConfig.walletConfig_": { - "$ref": "#/components/schemas/Pick_CustomTenantConfig.Exclude_keyofCustomTenantConfig.walletConfig__", - "description": "Construct a type with the properties of T except for those in type K." - }, - "CreateTenantOptions": { - "properties": { - "config": { - "$ref": "#/components/schemas/Omit_CustomTenantConfig.walletConfig_" - } - }, - "required": [ - "config" - ], - "type": "object", - "additionalProperties": false - }, - "OpenId4VcIssuanceSessionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "Record_string.boolean_": { - "properties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "Record_string.boolean-or-Record_string.boolean__": { - "properties": {}, - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/components/schemas/Record_string.boolean_" - } - ] - }, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "OpenId4VciCredentialFormatProfile": { - "enum": [ - "jwt_vc_json", - "jwt_vc_json-ld", - "ldp_vc", - "vc+sd-jwt", - "mso_mdoc" - ], - "type": "string" - }, - "SignerMethod": { - "enum": [ - "did", - "x5c" - ], - "type": "string" - }, - "OpenId4VciOfferSdJwtCredential": { - "properties": { - "credentialSupportedId": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" - }, - "signerOptions": { - "properties": { - "x5c": { - "items": { - "type": "string" - }, - "type": "array" - }, - "did": { - "type": "string" - }, - "method": { - "$ref": "#/components/schemas/SignerMethod" - } - }, - "required": [ - "method" - ], - "type": "object" - }, - "payload": { - "properties": { - "vct": { - "type": "string" - } - }, - "additionalProperties": {}, - "type": "object" - }, - "disclosureFrame": { - "$ref": "#/components/schemas/Record_string.boolean-or-Record_string.boolean__" - } - }, - "required": [ - "credentialSupportedId", - "format", - "signerOptions", - "payload" - ], - "type": "object", - "additionalProperties": false - }, - "Partial_ValidityInfo_": { - "properties": { - "signed": { - "type": "string", - "format": "date-time" - }, - "validFrom": { - "type": "string", - "format": "date-time" - }, - "validUntil": { - "type": "string", - "format": "date-time" - }, - "expectedUpdate": { - "type": "string", - "format": "date-time" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Record_string.Record_string.unknown__": { - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "MdocNameSpaces": { - "$ref": "#/components/schemas/Record_string.Record_string.unknown__" - }, - "OpenId4VciOfferMdocCredential": { - "properties": { - "credentialSupportedId": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" - }, - "signerOptions": { - "properties": { - "x5c": { - "items": { - "type": "string" - }, - "type": "array" - }, - "did": { - "type": "string" - }, - "method": { - "$ref": "#/components/schemas/SignerMethod" - } - }, - "required": [ - "method" - ], - "type": "object" - }, - "payload": { - "properties": { - "namespaces": { - "$ref": "#/components/schemas/MdocNameSpaces" - }, - "validityInfo": { - "$ref": "#/components/schemas/Partial_ValidityInfo_" - }, - "docType": { - "anyOf": [ - { - "allOf": [ - { - "type": "string" - }, - { - "properties": {}, - "type": "object" - } - ] - }, - { - "type": "string", - "enum": [ - "org.iso.18013.5.1.mDL" - ] - } - ] - } - }, - "required": [ - "namespaces", - "docType" - ], - "type": "object" - } - }, - "required": [ - "credentialSupportedId", - "format", - "signerOptions", - "payload" - ], - "type": "object", - "additionalProperties": false - }, - "OpenId4VciOfferW3cCredential": { - "properties": { - "credentialSupportedId": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/OpenId4VciCredentialFormatProfile" - }, - "signerOptions": { - "properties": { - "x5c": { - "items": { - "type": "string" - }, - "type": "array" - }, - "did": { - "type": "string" - }, - "method": { - "$ref": "#/components/schemas/SignerMethod" - } - }, - "required": [ - "method" - ], - "type": "object" - }, - "payload": { - "properties": { - "credential": { - "$ref": "#/components/schemas/W3cCredential" - }, - "verificationMethod": { - "type": "string" - } - }, - "required": [ - "credential", - "verificationMethod" - ], - "type": "object" - } - }, - "required": [ - "credentialSupportedId", - "format", - "signerOptions", - "payload" - ], - "type": "object", - "additionalProperties": false - }, - "OpenId4VcIssuanceSessionsCreateOffer": { - "properties": { - "publicIssuerId": { - "type": "string" - }, - "credentials": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenId4VciOfferSdJwtCredential" - }, - { - "$ref": "#/components/schemas/OpenId4VciOfferMdocCredential" - }, - { - "$ref": "#/components/schemas/OpenId4VciOfferW3cCredential" - } - ] - }, - "type": "array" - }, - "authorizationCodeFlowConfig": { - "properties": { - "issuerState": { - "type": "string" - }, - "requirePresentationDuringIssuance": { - "type": "boolean" - }, - "authorizationServerUrl": { - "type": "string" - } - }, - "required": [ - "authorizationServerUrl" - ], - "type": "object" - }, - "preAuthorizedCodeFlowConfig": { - "properties": { - "authorizationServerUrl": { - "type": "string" - }, - "txCode": { - "properties": { - "input_mode": { - "type": "string", - "enum": [ - "numeric", - "text" - ] - }, - "length": { - "type": "number", - "format": "double" - }, - "description": { - "type": "string" - } - }, - "type": "object" - }, - "preAuthorizedCode": { - "type": "string" - } - }, - "required": [ - "authorizationServerUrl" - ], - "type": "object" - }, - "issuanceMetadata": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "publicIssuerId", - "credentials" - ], - "type": "object", - "additionalProperties": false - }, - "OpenId4VcIssuanceSessionState": { - "enum": [ - "OfferCreated", - "OfferUriRetrieved", - "AuthorizationInitiated", - "AuthorizationGranted", - "AccessTokenRequested", - "AccessTokenCreated", - "CredentialRequestReceived", - "CredentialsPartiallyIssued", - "Completed", - "Error" - ], - "type": "string" - }, - "OpenId4VcIssuerRecord": { - "$ref": "#/components/schemas/Record_string.unknown_", - "description": "For OID4VC you need to expose metadata files. Each issuer needs to host this metadata. This is not the case for DIDComm where we can just have one /didcomm endpoint.\nSo we create a record per openid issuer/verifier that you want, and each tenant can create multiple issuers/verifiers which have different endpoints\nand metadata files" - }, - "Logo": { - "properties": { - "uri": { - "type": "string" - }, - "alt_text": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": {} - }, - "CredentialDisplay": { - "properties": { - "name": { - "type": "string" - }, - "locale": { - "type": "string" - }, - "logo": { - "$ref": "#/components/schemas/Logo" - } - }, - "type": "object", - "additionalProperties": {} - }, - "AuthorizationServerClientAuth": { - "properties": { - "clientId": { - "type": "string" - }, - "clientSecret": { - "type": "string" - } - }, - "required": [ - "clientId", - "clientSecret" - ], - "type": "object", - "additionalProperties": false - }, - "AuthorizationServerConfig": { - "properties": { - "issuer": { - "type": "string" - }, - "clientAuthentication": { - "$ref": "#/components/schemas/AuthorizationServerClientAuth" - } - }, - "required": [ - "issuer" - ], - "type": "object", - "additionalProperties": false - }, - "ProofTypeConfig": { - "properties": { - "proof_signing_alg_values_supported": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "proof_signing_alg_values_supported" - ], - "type": "object", - "additionalProperties": false - }, - "Record_string.ProofTypeConfig_": { - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/ProofTypeConfig" - }, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "CredentialDefinition": { - "properties": { - "type": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "type" - ], - "type": "object", - "additionalProperties": {} - }, - "CredentialConfigurationDisplay": { - "properties": { - "name": { - "type": "string" - }, - "locale": { - "type": "string" - }, - "logo": { - "$ref": "#/components/schemas/Logo" - }, - "description": { - "type": "string" - }, - "background_color": { - "type": "string" - }, - "background_image": { - "$ref": "#/components/schemas/Logo" - }, - "text_color": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object", - "additionalProperties": false - }, - "CredentialConfigurationSupportedWithFormats": { - "properties": { - "format": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "vc+sd-jwt", - "mso_mdoc", - "jwt_vc_json" - ] - } - ] - }, - "vct": { - "type": "string" - }, - "doctype": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "claims": {}, - "cryptographic_binding_methods_supported": { - "items": { - "type": "string" - }, - "type": "array" - }, - "credential_signing_alg_values_supported": { - "items": { - "type": "string" - }, - "type": "array" - }, - "proof_types_supported": { - "$ref": "#/components/schemas/Record_string.ProofTypeConfig_" - }, - "credential_definition": { - "$ref": "#/components/schemas/CredentialDefinition" - }, - "display": { - "items": { - "$ref": "#/components/schemas/CredentialConfigurationDisplay" - }, - "type": "array" - } - }, - "required": [ - "format" - ], - "type": "object", - "additionalProperties": false - }, - "Record_string.CredentialConfigurationSupportedWithFormats_": { - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/CredentialConfigurationSupportedWithFormats" - }, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "BatchCredentialIssuanceOptions": { - "properties": { - "batchSize": { - "type": "number", - "format": "double" - } - }, - "required": [ - "batchSize" - ], - "type": "object", - "additionalProperties": false - }, - "CreateIssuerOptions": { - "properties": { - "issuerId": { - "type": "string" - }, - "accessTokenSignerKeyType": { - "type": "string" - }, - "display": { - "items": { - "$ref": "#/components/schemas/CredentialDisplay" - }, - "type": "array" - }, - "authorizationServerConfigs": { - "items": { - "$ref": "#/components/schemas/AuthorizationServerConfig" - }, - "type": "array" - }, - "dpopSigningAlgValuesSupported": { - "items": { - "type": "string" - }, - "type": "array" - }, - "credentialConfigurationsSupported": { - "$ref": "#/components/schemas/Record_string.CredentialConfigurationSupportedWithFormats_" - }, - "batchCredentialIssuance": { - "$ref": "#/components/schemas/BatchCredentialIssuanceOptions" - } - }, - "required": [ - "credentialConfigurationsSupported" - ], - "type": "object", - "additionalProperties": false - }, - "UpdateIssuerRecordOptions": { - "properties": { - "display": { - "items": { - "$ref": "#/components/schemas/CredentialDisplay" - }, - "type": "array" - }, - "dpopSigningAlgValuesSupported": { - "items": { - "type": "string" - }, - "type": "array" - }, - "credentialConfigurationsSupported": { - "$ref": "#/components/schemas/Record_string.CredentialConfigurationSupportedWithFormats_" - }, - "batchCredentialIssuance": { - "$ref": "#/components/schemas/BatchCredentialIssuanceOptions" - } - }, - "required": [ - "credentialConfigurationsSupported" - ], - "type": "object", - "additionalProperties": false - }, - "JwtObject": { - "properties": { - "alg": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "alg" - ], - "type": "object", - "additionalProperties": false - }, - "LdpObject": { - "properties": { - "proof_type": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "proof_type" - ], - "type": "object", - "additionalProperties": false - }, - "DiObject": { - "properties": { - "proof_type": { - "items": { - "type": "string" - }, - "type": "array" - }, - "cryptosuite": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "proof_type", - "cryptosuite" - ], - "type": "object", - "additionalProperties": false - }, - "SdJwtObject": { - "properties": { - "undefined": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": false - }, - "MsoMdocObject": { - "properties": { - "alg": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "alg" - ], - "type": "object", - "additionalProperties": false - }, - "Format": { - "properties": { - "jwt": { - "$ref": "#/components/schemas/JwtObject" - }, - "jwt_vc": { - "$ref": "#/components/schemas/JwtObject" - }, - "jwt_vc_json": { - "$ref": "#/components/schemas/JwtObject" - }, - "jwt_vp": { - "$ref": "#/components/schemas/JwtObject" - }, - "jwt_vp_json": { - "$ref": "#/components/schemas/JwtObject" - }, - "ldp": { - "$ref": "#/components/schemas/LdpObject" - }, - "ldp_vc": { - "$ref": "#/components/schemas/LdpObject" - }, - "ldp_vp": { - "$ref": "#/components/schemas/LdpObject" - }, - "di": { - "$ref": "#/components/schemas/DiObject" - }, - "di_vc": { - "$ref": "#/components/schemas/DiObject" - }, - "di_vp": { - "$ref": "#/components/schemas/DiObject" - }, - "undefined": { - "$ref": "#/components/schemas/SdJwtObject" - }, - "mso_mdoc": { - "$ref": "#/components/schemas/MsoMdocObject" - } - }, - "type": "object", - "additionalProperties": false - }, - "Issuance": { - "properties": { - "manifest": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": {} - }, - "Optionality": { - "type": "string", - "enum": [ - "required", - "preferred" - ] - }, - "Directives": { - "type": "string", - "enum": [ - "required", - "allowed", - "disallowed" - ] - }, - "PdStatus": { - "properties": { - "directive": { - "$ref": "#/components/schemas/Directives" - } - }, - "type": "object", - "additionalProperties": false - }, - "Statuses": { - "properties": { - "active": { - "$ref": "#/components/schemas/PdStatus" - }, - "suspended": { - "$ref": "#/components/schemas/PdStatus" - }, - "revoked": { - "$ref": "#/components/schemas/PdStatus" - } - }, - "type": "object", - "additionalProperties": false - }, - "OneOfNumberStringBoolean": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "number", - "format": "double" - }, - { - "type": "string" - } - ] - }, - "OneOfNumberString": { - "anyOf": [ - { - "type": "number", - "format": "double" - }, - { - "type": "string" - } - ] - }, - "FilterV2": { - "properties": { - "const": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" - }, - "enum": { - "items": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" - }, - "type": "array" - }, - "exclusiveMinimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "exclusiveMaximum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "format": { - "type": "string" - }, - "formatMaximum": { - "type": "string" - }, - "formatMinimum": { - "type": "string" - }, - "formatExclusiveMaximum": { - "type": "string" - }, - "formatExclusiveMinimum": { - "type": "string" - }, - "minLength": { - "type": "number", - "format": "double" - }, - "maxLength": { - "type": "number", - "format": "double" - }, - "minimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "maximum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "not": { - "additionalProperties": false, - "type": "object" - }, - "pattern": { - "type": "string" - }, - "type": { - "type": "string" - }, - "contains": { - "$ref": "#/components/schemas/FilterV2" - }, - "items": { - "$ref": "#/components/schemas/FilterV2Items" - } - }, - "type": "object", - "additionalProperties": false - }, - "FilterV2Items": { - "properties": { - "const": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" - }, - "enum": { - "items": { - "$ref": "#/components/schemas/OneOfNumberStringBoolean" - }, - "type": "array" - }, - "exclusiveMinimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "exclusiveMaximum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "format": { - "type": "string" - }, - "formatMaximum": { - "type": "string" - }, - "formatMinimum": { - "type": "string" - }, - "formatExclusiveMaximum": { - "type": "string" - }, - "formatExclusiveMinimum": { - "type": "string" - }, - "minLength": { - "type": "number", - "format": "double" - }, - "maxLength": { - "type": "number", - "format": "double" - }, - "minimum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "maximum": { - "$ref": "#/components/schemas/OneOfNumberString" - }, - "not": { - "additionalProperties": false, - "type": "object" - }, - "pattern": { - "type": "string" - }, - "type": { - "type": "string" - }, - "contains": { - "$ref": "#/components/schemas/FilterV2" - }, - "items": { - "$ref": "#/components/schemas/FilterV2Items" - } - }, - "type": "object", - "additionalProperties": false - }, - "FieldV2": { - "properties": { - "id": { - "type": "string" - }, - "path": { - "items": { - "type": "string" - }, - "type": "array" - }, - "purpose": { - "type": "string" - }, - "filter": { - "$ref": "#/components/schemas/FilterV2" - }, - "predicate": { - "$ref": "#/components/schemas/Optionality" - }, - "intent_to_retain": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "optional": { - "type": "boolean" - } - }, - "required": [ - "path" - ], - "type": "object", - "additionalProperties": false - }, - "HolderSubject": { - "properties": { - "field_id": { - "items": { - "type": "string" - }, - "type": "array" - }, - "directive": { - "$ref": "#/components/schemas/Optionality" - } - }, - "required": [ - "field_id", - "directive" - ], - "type": "object", - "additionalProperties": false - }, - "ConstraintsV2": { - "properties": { - "limit_disclosure": { - "$ref": "#/components/schemas/Optionality" - }, - "statuses": { - "$ref": "#/components/schemas/Statuses" - }, - "fields": { - "items": { - "$ref": "#/components/schemas/FieldV2" - }, - "type": "array" - }, - "subject_is_issuer": { - "$ref": "#/components/schemas/Optionality" - }, - "is_holder": { - "items": { - "$ref": "#/components/schemas/HolderSubject" - }, - "type": "array" - }, - "same_subject": { - "items": { - "$ref": "#/components/schemas/HolderSubject" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": false - }, - "InputDescriptorV2Model": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/Format" - }, - "group": { - "items": { - "type": "string" - }, - "type": "array" - }, - "issuance": { - "items": { - "$ref": "#/components/schemas/Issuance" - }, - "type": "array" - }, - "constraints": { - "$ref": "#/components/schemas/ConstraintsV2" - } - }, - "required": [ - "id", - "constraints" - ], - "type": "object", - "additionalProperties": false - }, - "Rules": { - "type": "string", - "enum": [ - "all", - "pick" - ] - }, - "SubmissionRequirement": { - "properties": { - "name": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "rule": { - "$ref": "#/components/schemas/Rules" - }, - "count": { - "type": "number", - "format": "double" - }, - "min": { - "type": "number", - "format": "double" - }, - "max": { - "type": "number", - "format": "double" - }, - "from": { - "type": "string" - }, - "from_nested": { - "items": { - "$ref": "#/components/schemas/SubmissionRequirement" - }, - "type": "array" - } - }, - "required": [ - "rule" - ], - "type": "object", - "additionalProperties": false - }, - "InputDescriptorV2": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/Format" - }, - "group": { - "items": { - "type": "string" - }, - "type": "array" - }, - "issuance": { - "items": { - "$ref": "#/components/schemas/Issuance" - }, - "type": "array" - }, - "constraints": { - "$ref": "#/components/schemas/ConstraintsV2" - } - }, - "required": [ - "id", - "constraints" - ], - "type": "object", - "additionalProperties": false - }, - "PresentationDefinitionV2": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/Format" - }, - "submission_requirements": { - "items": { - "$ref": "#/components/schemas/SubmissionRequirement" - }, - "type": "array" - }, - "input_descriptors": { - "items": { - "$ref": "#/components/schemas/InputDescriptorV2" - }, - "type": "array" - }, - "frame": { - "additionalProperties": false, - "type": "object" - } - }, - "required": [ - "id", - "input_descriptors" - ], - "type": "object", - "additionalProperties": false - }, - "DifPresentationExchangeDefinitionV2Model": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "format": { - "$ref": "#/components/schemas/Format" - }, - "submission_requirements": { - "items": {}, - "type": "array" - }, - "input_descriptors": { - "items": { - "$ref": "#/components/schemas/InputDescriptorV2Model" - }, - "type": "array" - }, - "frame": { - "additionalProperties": false, - "type": "object" - } - }, - "required": [ - "id", - "input_descriptors" - ], - "type": "object", - "additionalProperties": false - }, - "PresentationDefinition": { - "properties": { - "definition": { - "$ref": "#/components/schemas/DifPresentationExchangeDefinitionV2Model" - } - }, - "required": [ - "definition" - ], - "type": "object", - "additionalProperties": false - }, - "DcqlClaim": { - "properties": { - "path": { - "items": { - "type": "string" - }, - "type": "array" - }, - "intent_to_retain": { - "type": "boolean" - } - }, - "required": [ - "path" - ], - "type": "object", - "additionalProperties": false - }, - "DcqlCredential": { - "properties": { - "id": { - "type": "string" - }, - "format": { - "type": "string" - }, - "meta": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "require_cryptographic_holder_binding": { - "type": "boolean" - }, - "claims": { - "items": { - "$ref": "#/components/schemas/DcqlClaim" - }, - "type": "array" - } - }, - "required": [ - "id", - "format", - "claims" - ], - "type": "object", - "additionalProperties": false - }, - "DcqlQuery": { - "properties": { - "combine": { - "type": "string", - "enum": [ - "all", - "any" - ] - }, - "credentials": { - "items": { - "$ref": "#/components/schemas/DcqlCredential" - }, - "type": "array" - } - }, - "required": [ - "credentials" - ], - "type": "object", - "additionalProperties": false - }, - "DcqlDefinition": { - "properties": { - "query": { - "$ref": "#/components/schemas/DcqlQuery" - } - }, - "required": [ - "query" - ], - "type": "object", - "additionalProperties": false - }, - "ResponseModeEnum": { - "enum": [ - "direct_post", - "direct_post.jwt", - "dc_api", - "dc_api.jwt" - ], - "type": "string" - }, - "OpenId4VcJwtIssuerDid": { - "properties": { - "didUrl": { - "type": "string" - }, - "method": { - "type": "string", - "enum": [ - "did" - ], - "nullable": false - } - }, - "required": [ - "didUrl", - "method" - ], - "type": "object" - }, - "OpenId4VcIssuerX5c": { - "properties": { - "alg": { - "type": "string" - }, - "x5c": { - "items": { - "type": "string" - }, - "type": "array" - }, - "issuer": { - "type": "string" - }, - "method": { - "type": "string", - "enum": [ - "x5c" - ], - "nullable": false - } - }, - "required": [ - "x5c", - "method" - ], - "type": "object" - }, - "CreateAuthorizationRequest": { - "properties": { - "verifierId": { - "type": "string" - }, - "presentationExchange": { - "$ref": "#/components/schemas/PresentationDefinition" - }, - "dcql": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/DcqlDefinition" - } - ] - }, - "responseMode": { - "$ref": "#/components/schemas/ResponseModeEnum" - }, - "requestSigner": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenId4VcJwtIssuerDid" - }, - { - "$ref": "#/components/schemas/OpenId4VcIssuerX5c" - } - ] - }, - "expectedOrigins": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "verifierId", - "requestSigner" - ], - "type": "object", - "additionalProperties": false - }, - "OpenId4VcVerificationSessionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "OpenId4VcVerificationSessionState": { - "enum": [ - "RequestCreated", - "RequestUriRetrieved", - "ResponseVerified", - "Error" - ], - "type": "string" - }, - "SdJwtVcRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "MdocRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "ResolveCredentialOfferBody": { - "properties": { - "credentialOfferUri": { - "type": "string" - } - }, - "required": [ - "credentialOfferUri" - ], - "type": "object", - "additionalProperties": false - }, - "AuthorizeRequestCredentialOffer": { - "properties": { - "credentialOfferUri": { - "type": "string" - }, - "credentialsToRequest": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "credentialOfferUri", - "credentialsToRequest" - ], - "type": "object", - "additionalProperties": false - }, - "RequestCredentialBody": { - "properties": { - "credentialOfferUri": { - "type": "string" - }, - "credentialsToRequest": { - "items": { - "type": "string" - }, - "type": "array" - }, - "authorizationCode": { - "type": "string" - }, - "codeVerifier": { - "type": "string" - }, - "txCode": { - "type": "string" - } - }, - "required": [ - "credentialOfferUri", - "credentialsToRequest" - ], - "type": "object", - "additionalProperties": false - }, - "ResolveProofRequest": { - "properties": { - "proofRequestUri": { - "type": "string" - } - }, - "required": [ - "proofRequestUri" - ], - "type": "object", - "additionalProperties": false - }, - "OpenId4VcVerifierRecord": { - "$ref": "#/components/schemas/Record_string.unknown_", - "description": "For OID4VC you need to expos metadata files. Each issuer needs to host this metadata. This is not the case for DIDComm where we can just have one /didcomm endpoint.\nSo we create a record per openid issuer/verifier that you want, and each tenant can create multiple issuers/verifiers which have different endpoints\nand metadata files" - }, - "OpenId4VcSiopVerifierClientMetadata": { - "properties": { - "client_name": { - "type": "string" - }, - "logo_uri": { - "type": "string" - } - }, - "type": "object", - "additionalProperties": false - }, - "OpenId4VcSiopCreateVerifierOptions": { - "properties": { - "verifierId": { - "type": "string" - }, - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" - } - }, - "type": "object", - "additionalProperties": false - }, - "OpenId4VcUpdateVerifierRecordOptions": { - "properties": { - "verifierId": { - "type": "string" - }, - "clientMetadata": { - "$ref": "#/components/schemas/OpenId4VcSiopVerifierClientMetadata" - } - }, - "type": "object", - "additionalProperties": false - } - }, - "securitySchemes": { - "apiKey": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - }, - "jwt": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - } - } - }, - "info": { - "title": "credo-controller", - "version": "2.0.0", - "description": "Rest endpoint wrapper for using your agent over HTTP", - "license": { - "name": "Apache-2.0" - }, - "contact": {} - }, - "paths": { - "/x509": { - "post": { - "operationId": "CreateX509Certificate", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "publicCertificateBase64": { - "type": "string" - } - }, - "required": [ - "publicCertificateBase64" - ], - "type": "object" - } - } - } - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509CreateCertificateOptionsDto" - } - } - } - } - } - }, - "/x509/import": { - "post": { - "operationId": "ImportX509Certificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "issuerCertficicate": { - "type": "string" - } - }, - "required": [ - "issuerCertficicate" - ], - "type": "object" - } - } - } - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" - } - } - } - } - } - }, - "/x509/trusted": { - "post": { - "operationId": "AddTrustedCertificate", - "responses": { - "204": { - "description": "No content" - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } - } - } - } - }, - "get": { - "operationId": "GetTrustedCertificates", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - } - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/x509/decode": { - "post": { - "operationId": "DecodeCertificate", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/X509Certificate" - } - } - } - } - }, - "tags": [ - "x509" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "certificate": { - "type": "string" - } - }, - "required": [ - "certificate" - ], - "type": "object" - } - } - } - } - } - }, - "/polygon/create-keys": { - "post": { - "operationId": "CreateKeyPair", - "responses": { - "200": { - "description": "Secp256k1KeyPair", - "content": { - "application/json": { - "schema": { - "properties": { - "address": { - "type": "string" - }, - "publicKeyBase58": { - "type": "string" - }, - "privateKey": { - "type": "string" - } - }, - "required": [ - "address", - "publicKeyBase58", - "privateKey" - ], - "type": "object" - } - } - } - } - }, - "description": "Create Secp256k1 key pair for polygon DID", - "tags": [ - "Polygon" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated", - "Basewallet" - ] - } - ], - "parameters": [] - } - }, - "/polygon/create-schema": { - "post": { - "operationId": "CreateSchema", - "responses": { - "200": { - "description": "Schema JSON", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Create polygon based W3C schema", - "tags": [ - "Polygon" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "schemaName": { - "type": "string" - }, - "did": { - "type": "string" - } - }, - "required": [ - "schema", - "schemaName", - "did" - ], - "type": "object" - } - } - } - } - } - }, - "/polygon/estimate-transaction": { - "post": { - "operationId": "EstimateTransaction", - "responses": { - "200": { - "description": "Transaction Object", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Estimate transaction", - "tags": [ - "Polygon" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated", - "Basewallet" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidOperationOptions" - } - } - } - } - } - }, - "/polygon/{did}/{schemaId}": { - "get": { - "operationId": "GetSchemaById", - "responses": { - "200": { - "description": "Schema Object", - "content": { - "application/json": { - "schema": {} - } - } - } - }, - "description": "Fetch schema details", - "tags": [ - "Polygon" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "did", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "schemaId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/anoncreds/transactions/endorse": { - "post": { - "operationId": "EndorserTransaction", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "signedTransaction": { - "type": "string" - } - }, - "required": [ - "signedTransaction" - ], - "type": "object" - } - } - } - } - }, - "tags": [ - "Anoncreds - EndorserTransaction" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndorserTransaction" - } - } - } - } - } - }, - "/anoncreds/transactions/set-endorser-role": { - "post": { - "operationId": "DidNymTransaction", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidCreateResult_DidOperationStateActionBase_" - } - } - } - } - }, - "tags": [ - "Anoncreds - EndorserTransaction" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidNymTransaction" - } - } - } - } - } - }, - "/anoncreds/transactions/write": { - "post": { - "operationId": "WriteSchemaAndCredDefOnLedger", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateWait" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateAction" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFailed" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateWait" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateAction" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFinished" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFailed" - } - ] - } - } - } - } - }, - "tags": [ - "Anoncreds - EndorserTransaction" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WriteTransaction" - } - } - } - } - } - }, - "/dids/{did}": { - "get": { - "operationId": "GetDidRecordByDid", - "responses": { - "200": { - "description": "DidResolutionResult", - "content": { - "application/json": { - "schema": { - "properties": { - "didDocumentMetadata": { - "$ref": "#/components/schemas/DIDDocumentMetadata" - }, - "didResolutionMetadata": { - "$ref": "#/components/schemas/DidResolutionMetadata" - }, - "didDocument": { - "$ref": "#/components/schemas/Record_string.any_" - } - }, - "required": [ - "didDocumentMetadata", - "didResolutionMetadata", - "didDocument" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "didDocument": { - "@context": [ - "https://w3id.org/did/v1", - "https://w3id.org/security/suites/ed25519-2018/v1", - "https://w3id.org/security/suites/x25519-2019/v1" - ], - "id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", - "verificationMethod": [ - { - "id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", - "type": "Ed25519VerificationKey2018", - "controller": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", - "publicKeyBase58": "6fioC1zcDPyPEL19pXRS2E4iJ46zH7xP6uSgAaPdwDrx" - } - ], - "authentication": [ - "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" - ], - "assertionMethod": [ - "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" - ], - "capabilityInvocation": [ - "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" - ], - "capabilityDelegation": [ - "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" - ], - "keyAgreement": [ - { - "id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6LSrdqo4M24WRDJj1h2hXxgtDTyzjjKCiyapYVgrhwZAySn", - "type": "X25519KeyAgreementKey2019", - "controller": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", - "publicKeyBase58": "FxfdY3DCQxVZddKGAtSjZdFW9bCCW7oRwZn1NFJ2Tbg2" - } - ] - }, - "didDocumentMetadata": {}, - "didResolutionMetadata": { - "contentType": "application/did+ld+json" - } - } - } - } - } - } - } - }, - "description": "Resolves did and returns did resolution result", - "tags": [ - "Dids" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Decentralized Identifier", - "in": "path", - "name": "did", - "required": true, - "schema": { - "$ref": "#/components/schemas/Did" - } - } - ] - } - }, - "/dids/write": { - "post": { - "operationId": "WriteDid", - "responses": { - "200": { - "description": "DidResolutionResult", - "content": { - "application/json": { - "schema": {}, - "examples": { - "Example 1": { - "value": { - "did": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", - "didDocument": { - "@context": [ - "https://w3id.org/did/v1", - "https://w3id.org/security/suites/ed25519-2018/v1" - ], - "id": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", - "verificationMethod": [ - { - "id": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey", - "type": "Ed25519VerificationKey2018", - "controller": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", - "publicKeyBase58": "BapLDK4dEY88vWcQgNbpAPVVP4r3CHs4MvShmmhqkxXM" - } - ], - "authentication": [ - "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey" - ] - } - } - } - } - } - } - } - }, - "description": "Did nym registration", - "tags": [ - "Dids" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidCreate" - } - } - } - } - } - }, - "/dids": { - "get": { - "operationId": "GetDids", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/DidRecord" - }, - "type": "array" - } - } - } - } - }, - "tags": [ - "Dids" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/anoncreds/schemas/{schemaId}": { - "get": { - "operationId": "GetSchemaById", - "responses": { - "200": { - "description": "get schema by Id", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetSchemaReturn" - }, - "examples": { - "Example 1": { - "value": { - "ver": "1.0", - "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", - "name": "schema", - "version": "1.0", - "attrNames": [ - "string" - ], - "seqNo": 351936 - } - } - } - } - } - } - }, - "description": "Get schema by schemaId", - "tags": [ - "Anoncreds - Schemas" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "schemaId", - "required": true, - "schema": { - "$ref": "#/components/schemas/SchemaId" - } - } - ] - } - }, - "/anoncreds/schemas": { - "post": { - "operationId": "CreateSchema", - "responses": { - "200": { - "description": "get schema", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterSchemaReturn" - }, - { - "$ref": "#/components/schemas/RegisterSchemaReturnStateFinished" - } - ] - }, - "examples": { - "Example 1": { - "value": { - "state": "finished", - "schema": { - "issuerId": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", - "name": "Test Schema", - "version": "1.0.0", - "attrNames": [ - "Name", - "Age" - ] - }, - "schemaId": "LRCUFcizUL74AGgLqdJHK7:2:Test Schema:1.0.0" - } - } - } - } - } - } - }, - "description": "Create schema", - "tags": [ - "Anoncreds - Schemas" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSchemaInput" - } - } - } - } - } - }, - "/anoncreds/credential-definitions/{credentialDefinitionId}": { - "get": { - "operationId": "GetCredentialDefinitionById", - "responses": { - "200": { - "description": "CredDef", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetCredentialDefinitionReturn" - }, - "examples": { - "Example 1": { - "value": { - "ver": "1.0", - "id": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag", - "schemaId": "351936", - "type": "CL", - "tag": "definition", - "value": { - "primary": { - "n": "string", - "s": "string", - "r": { - "master_secret": "string", - "string": "string" - }, - "rctxt": "string", - "z": "string" - }, - "revocation": { - "g": "1 string", - "g_dash": "string", - "h": "string", - "h0": "string", - "h1": "string", - "h2": "string", - "htilde": "string", - "h_cap": "string", - "u": "string", - "pk": "string", - "y": "string" - } - } - } - } - } - } - } - } - }, - "description": "Retrieve credential definition by credential definition id", - "tags": [ - "Anoncreds - Credential Definitions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "credentialDefinitionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/CredentialDefinitionId" - } - } - ] - } - }, - "/anoncreds/credential-definitions": { - "post": { - "operationId": "CreateCredentialDefinition", - "responses": { - "200": { - "description": "CredDef", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturn" - }, - { - "$ref": "#/components/schemas/RegisterCredentialDefinitionReturnStateFinished" - } - ] - }, - "examples": { - "Example 1": { - "value": { - "ver": "1.0", - "id": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag", - "schemaId": "351936", - "type": "CL", - "tag": "definition", - "value": { - "primary": { - "n": "string", - "s": "string", - "r": { - "master_secret": "string", - "string": "string" - }, - "rctxt": "string", - "z": "string" - }, - "revocation": { - "g": "1 string", - "g_dash": "string", - "h": "string", - "h0": "string", - "h1": "string", - "h2": "string", - "htilde": "string", - "h_cap": "string", - "u": "string", - "pk": "string", - "y": "string" - } - } - } - } - } - } - } - }, - "202": { - "description": "Wait for action to complete" - } - }, - "description": "Creates a new credential definition.", - "tags": [ - "Anoncreds - Credential Definitions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "endorserDid": { - "type": "string" - }, - "endorse": { - "type": "boolean" - }, - "tag": { - "type": "string" - }, - "schemaId": { - "$ref": "#/components/schemas/SchemaId" - }, - "issuerId": { - "type": "string" - } - }, - "required": [ - "tag", - "schemaId", - "issuerId" - ], - "type": "object" - } - } - } - } - } - }, - "/agent": { - "get": { - "operationId": "GetAgentInfo", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentInfo" - } - } - } - } - }, - "description": "Retrieve basic agent information", - "tags": [ - "Agent" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated", - "Basewallet" - ] - } - ], - "parameters": [] - } - }, - "/agent/token": { - "post": { - "operationId": "GetAgentToken", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentToken" - } - } - } - } - }, - "description": "Retrieve agent token", - "tags": [ - "Agent" - ], - "security": [ - { - "apiKey": [] - } - ], - "parameters": [] - } - }, - "/agent/wallet": { - "delete": { - "operationId": "DeleteWallet", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Delete wallet", - "tags": [ - "Agent" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/agent/verify": { - "post": { - "operationId": "Verify", - "responses": { - "200": { - "description": "isValidSignature - true if signature is valid, false otherwise", - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - } - }, - "description": "Verify data using a key", - "tags": [ - "Agent" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VerifyDataOptions" - } - } - } - } - } - }, - "/agent/credential/sign": { - "post": { - "operationId": "SignCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.any_" - }, - { - "$ref": "#/components/schemas/W3cCredentialRecord" - } - ] - } - } - } - } - }, - "tags": [ - "Agent" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "storeCredential", - "required": true, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "dataTypeToSign", - "required": true, - "schema": { - "type": "string", - "enum": [ - "rawData", - "jsonLd" - ] - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/CustomW3cJsonLdSignCredentialOptions" - }, - { - "$ref": "#/components/schemas/SignDataOptions" - }, - {} - ] - } - } - } - } - } - }, - "/agent/credential/verify": { - "post": { - "operationId": "VerifyCredential", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/W3cVerifyCredentialResult" - } - } - } - } - }, - "tags": [ - "Agent" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" - }, - {} - ] - } - } - } - } - } - }, - "/didcomm/question-answer": { - "get": { - "operationId": "GetQuestionAnswerRecords", - "responses": { - "200": { - "description": "QuestionAnswerRecord[]", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" - } - } - } - } - }, - "description": "Retrieve question and answer records by query", - "tags": [ - "DIDComm - Question Answer" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "query", - "name": "connectionId", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Role of the question", - "in": "query", - "name": "role", - "required": false, - "schema": { - "$ref": "#/components/schemas/QuestionAnswerRole" - } - }, - { - "description": "State of the question", - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/QuestionAnswerState" - } - }, - { - "description": "Thread identifier", - "in": "query", - "name": "threadId", - "required": false, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/question-answer/question/{connectionId}": { - "post": { - "operationId": "SendQuestion", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": {} - } - } - } - } - }, - "description": "Send a question to a connection", - "tags": [ - "DIDComm - Question Answer" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "detail": { - "type": "string" - }, - "validResponses": { - "items": { - "$ref": "#/components/schemas/ValidResponse" - }, - "type": "array" - }, - "question": { - "type": "string" - } - }, - "required": [ - "validResponses", - "question" - ], - "type": "object" - } - } - } - } - } - }, - "/didcomm/question-answer/answer/{id}": { - "post": { - "operationId": "SendAnswer", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - } - } - } - }, - "description": "Send a answer to question", - "tags": [ - "DIDComm - Question Answer" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "The id of the question answer record", - "in": "path", - "name": "id", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_response.string_" - } - } - } - } - } - }, - "/didcomm/question-answer/{id}": { - "get": { - "operationId": "GetQuestionAnswerRecordById", - "responses": { - "200": { - "description": "ConnectionRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - } - } - } - }, - "description": "Retrieve question answer record by id", - "tags": [ - "DIDComm - Question Answer" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/proofs": { - "get": { - "operationId": "GetAllProofs", - "responses": { - "200": { - "description": "ProofRecord[]", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" - }, - "examples": { - "Example 1": { - "value": [ - { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - ] - } - } - } - } - } - }, - "description": "Retrieve all proof records", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "threadId", - "required": false, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/proofs/{proofRecordId}": { - "get": { - "operationId": "GetProofById", - "responses": { - "200": { - "description": "ProofRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Retrieve proof record by proof record id", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "proofRecordId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/proofs/propose-proof": { - "post": { - "operationId": "ProposeProof", - "responses": { - "200": { - "description": "ProofRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProofExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Initiate a new presentation exchange as prover by sending a presentation proposal request\nto the connection with the specified connection id.", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RequestProofProposalOptions" - } - } - } - } - } - }, - "/didcomm/proofs/{proofRecordId}/accept-proposal": { - "post": { - "operationId": "AcceptProposal", - "responses": { - "200": { - "description": "ProofRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProofExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a presentation proposal as verifier by sending an accept proposal message\nto the connection associated with the proof record.", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptProofProposal" - } - } - } - } - } - }, - "/didcomm/proofs/request-proof": { - "post": { - "operationId": "RequestProof", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProofExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Creates a presentation request bound to existing connection", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RequestProofOptions" - } - } - } - } - } - }, - "/didcomm/proofs/create-request-oob": { - "post": { - "operationId": "CreateRequest", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "proofMessageId": { - "type": "string" - }, - "proofRecordThId": { - "type": "string" - }, - "invitationDid": { - "type": "string" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "invitationUrl": { - "type": "string" - } - }, - "required": [ - "proofMessageId", - "proofRecordThId", - "invitationDid", - "outOfBandRecord", - "invitation", - "invitationUrl" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Creates a presentation request not bound to any proposal or existing connection", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateProofRequestOobOptions" - } - } - } - } - } - }, - "/didcomm/proofs/{proofRecordId}/accept-request": { - "post": { - "operationId": "AcceptRequest", - "responses": { - "200": { - "description": "ProofRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a presentation request as prover by sending an accept request message\nto the connection associated with the proof record.", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "proofRecordId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "comment": { - "type": "string" - }, - "filterByNonRevocationRequirements": { - "type": "boolean" - }, - "filterByPresentationPreview": { - "type": "boolean" - } - }, - "type": "object" - } - } - } - } - } - }, - "/didcomm/proofs/{proofRecordId}/accept-presentation": { - "post": { - "operationId": "AcceptPresentation", - "responses": { - "200": { - "description": "ProofRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProofExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a presentation as prover by sending an accept presentation message\nto the connection associated with the proof record.", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "proofRecordId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/proofs/{proofRecordId}/form-data": { - "get": { - "operationId": "ProofFormData", - "responses": { - "200": { - "description": "ProofRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetProofFormatDataReturn__40_LegacyIndyProofFormat-or-AnonCredsProofFormat-or-DifPresentationExchangeProofFormat_41_-Array_" - }, - "examples": { - "Example 1": { - "value": { - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", - "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7", - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Return proofRecord", - "tags": [ - "DIDComm - Proofs" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "proofRecordId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/oob": { - "get": { - "operationId": "GetAllOutOfBandRecords", - "responses": { - "200": { - "description": "OutOfBandRecord[]", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" - }, - "examples": { - "Example 1": { - "value": [ - { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - } - ] - } - } - } - } - } - }, - "description": "Retrieve all out of band records", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "invitation identifier", - "in": "query", - "name": "invitationId", - "required": false, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/oob/{outOfBandId}": { - "get": { - "operationId": "GetOutOfBandRecordById", - "responses": { - "200": { - "description": "OutOfBandRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - } - } - } - } - } - } - }, - "description": "Retrieve an out of band record by id", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - }, - "delete": { - "operationId": "DeleteOutOfBandRecord", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Deletes an out of band record from the repository.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "description": "Record identifier", - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/oob/create-invitation": { - "post": { - "operationId": "CreateInvitation", - "responses": { - "200": { - "description": "Out of band record", - "content": { - "application/json": { - "schema": { - "properties": { - "invitationDid": { - "type": "string" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "invitationUrl": { - "type": "string" - } - }, - "required": [ - "invitationDid", - "outOfBandRecord", - "invitation", - "invitationUrl" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "invitationUrl": "string", - "invitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "outOfBandRecord": { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - } - } - } - } - } - } - } - }, - "description": "Creates an outbound out-of-band record containing out-of-band invitation message defined in\nAries RFC 0434: Out-of-Band Protocol 1.1.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "description": "configuration of how out-of-band invitation should be created", - "required": true, - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/CreateInvitationOptions" - }, - { - "$ref": "#/components/schemas/RecipientKeyOption" - } - ], - "description": "configuration of how out-of-band invitation should be created" - } - } - } - } - } - }, - "/didcomm/oob/create-legacy-invitation": { - "post": { - "operationId": "CreateLegacyInvitation", - "responses": { - "200": { - "description": "out-of-band record and invitation", - "content": { - "application/json": { - "schema": { - "properties": { - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "invitationUrl": { - "type": "string" - }, - "recipientKey": { - "type": "string" - } - }, - "required": [ - "outOfBandRecord", - "invitation", - "invitationUrl" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "invitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "outOfBandRecord": { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - } - } - } - } - } - } - } - }, - "description": "Creates an outbound out-of-band record in the same way how `createInvitation` method does it,\nbut it also converts out-of-band invitation message to an \"legacy\" invitation message defined\nin RFC 0160: Connection Protocol and returns it together with out-of-band record.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "description": "configuration of how a invitation should be created", - "required": false, - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/Omit_CreateLegacyInvitationConfig.routing_" - }, - { - "$ref": "#/components/schemas/RecipientKeyOption" - } - ], - "description": "configuration of how a invitation should be created" - } - } - } - } - } - }, - "/didcomm/oob/create-legacy-connectionless-invitation": { - "post": { - "operationId": "CreateLegacyConnectionlessInvitation", - "responses": { - "200": { - "description": "a message and a invitationUrl", - "content": { - "application/json": { - "schema": { - "properties": { - "outOfBandRecord": { - "$ref": "#/components/schemas/OutOfBandRecord" - }, - "invitationUrl": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/AgentMessage" - } - }, - "required": [ - "outOfBandRecord", - "invitationUrl", - "message" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "message": { - "@id": "eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00", - "@type": "https://didcomm.org/connections/1.0/invitation" - }, - "invitationUrl": "http://example.com/invitation_url" - } - } - } - } - } - } - }, - "description": "Creates a new connectionless legacy invitation.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "description": "configuration of how a connection invitation should be created", - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "routing": { - "$ref": "#/components/schemas/Routing" - }, - "domain": { - "type": "string" - }, - "message": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "recordId": { - "type": "string" - } - }, - "required": [ - "domain", - "message", - "recordId" - ], - "type": "object", - "description": "configuration of how a connection invitation should be created" - } - } - } - } - } - }, - "/didcomm/oob/receive-invitation": { - "post": { - "operationId": "ReceiveInvitation", - "responses": { - "200": { - "description": "out-of-band record and connection record if one has been created.", - "content": { - "application/json": { - "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "outOfBandRecord": { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - }, - "connectionRecord": { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } - } - } - } - } - } - } - }, - "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceiveInvitationProps" - } - } - } - } - } - }, - "/didcomm/oob/receive-invitation-url": { - "post": { - "operationId": "ReceiveInvitationFromUrl", - "responses": { - "200": { - "description": "out-of-band record and connection record if one has been created.", - "content": { - "application/json": { - "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "outOfBandRecord": { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - }, - "connectionRecord": { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } - } - } - } - } - } - } - }, - "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" - } - } - } - } - } - }, - "/didcomm/oob/{outOfBandId}/accept-invitation": { - "post": { - "operationId": "AcceptInvitation", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "connectionRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - }, - "required": [ - "connectionRecord", - "outOfBandRecord" - ], - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "outOfBandRecord": { - "_tags": { - "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", - "state": "await-response", - "role": "sender", - "recipientKeyFingerprints": [ - "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" - ] - }, - "outOfBandInvitation": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", - "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", - "label": "Aries Test Agent", - "accept": [ - "didcomm/aip1", - "didcomm/aip2;env=rfc19" - ], - "handshake_protocols": [ - "https://didcomm.org/didexchange/1.0", - "https://didcomm.org/connections/1.0" - ], - "services": [ - { - "id": "#inline-0", - "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", - "type": "did-communication", - "recipientKeys": [ - "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" - ], - "routingKeys": [] - } - ] - }, - "metadata": {}, - "id": "42a95528-0e30-4f86-a462-0efb02178b53", - "createdAt": "2022-01-01T00:00:00.000Z", - "reusable": false - }, - "connectionRecord": { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } - } - } - } - } - } - } - }, - "description": "Accept a connection invitation as invitee (by sending a connection request message) for the connection with the specified connection id.\nThis is not needed when auto accepting of connections is enabled.", - "tags": [ - "DIDComm - Out Of Band" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "outOfBandId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptInvitationConfig" - } - } - } - } - } - }, - "/didcomm/credentials": { - "get": { - "operationId": "GetAllCredentials", - "responses": { - "200": { - "description": "CredentialExchangeRecord[]", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" - }, - "examples": { - "Example 1": { - "value": [ - { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - ] - } - } - } - } - } - }, - "description": "Retrieve all credential exchange records", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "threadId", - "required": false, - "schema": { - "$ref": "#/components/schemas/ThreadId" - } - }, - { - "in": "query", - "name": "parentThreadId", - "required": false, - "schema": { - "$ref": "#/components/schemas/ThreadId" - } - }, - { - "in": "query", - "name": "connectionId", - "required": false, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - }, - { - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/CredentialState" - } - }, - { - "in": "query", - "name": "role", - "required": false, - "schema": { - "$ref": "#/components/schemas/CredentialRole" - } - } - ] - } - }, - "/didcomm/credentials/w3c": { - "get": { - "operationId": "GetAllW3c", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/W3cCredentialRecord" - }, - "type": "array" - } - } - } - } - }, - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [] - } - }, - "/didcomm/credentials/w3c/{id}": { - "get": { - "operationId": "GetW3cById", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/W3cCredentialRecord" - } - } - } - } - }, - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/credentials/{credentialRecordId}": { - "get": { - "operationId": "GetCredentialById", - "responses": { - "200": { - "description": "CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Retrieve credential exchange record by credential record id", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "credentialRecordId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] - } - }, - "/didcomm/credentials/propose-credential": { - "post": { - "operationId": "ProposeCredential", - "responses": { - "200": { - "description": "CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Initiate a new credential exchange as holder by sending a propose credential message\nto the connection with a specified connection id.", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProposeCredentialOptions" - } - } - } - } - } - }, - "/didcomm/credentials/accept-proposal": { - "post": { - "operationId": "AcceptProposal", - "responses": { - "200": { - "description": "CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a credential proposal as issuer by sending an accept proposal message\nto the connection associated with the credential exchange record.", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptCredentialProposalOptions" - } - } - } - } - } - }, - "/didcomm/credentials/create-offer": { - "post": { - "operationId": "CreateOffer", - "responses": { - "200": { - "description": "AgentMessage, CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Initiate a new credential exchange as issuer by creating a credential offer\nwithout specifying a connection id", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOfferOptions" - } - } - } - } - } - }, - "/didcomm/credentials/create-offer-oob": { - "post": { - "operationId": "CreateOfferOob", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "properties": { - "invitationDid": { - "type": "string" - }, - "credentialRequestThId": { - "type": "string" - }, - "outOfBandRecordId": { - "type": "string" - }, - "outOfBandRecord": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "invitation": { - "$ref": "#/components/schemas/PlaintextMessage" - }, - "invitationUrl": { - "type": "string" - } - }, - "required": [ - "invitationDid", - "credentialRequestThId", - "outOfBandRecordId", - "outOfBandRecord", - "invitation", - "invitationUrl" - ], - "type": "object" - } - } - } - } - }, - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOfferOobOptions" - } - } - } - } - } - }, - "/didcomm/credentials/accept-offer": { - "post": { - "operationId": "AcceptOffer", - "responses": { - "200": { - "description": "CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialOfferOptions" - } - } - } - } - } - }, - "/didcomm/credentials/accept-request": { - "post": { - "operationId": "AcceptRequest", - "responses": { - "200": { - "description": "CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptCredentialRequestOptions" - } - } - } - } + "jwt": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" } + } + }, + "info": { + "title": "credo-controller", + "version": "2.0.0", + "description": "Rest endpoint wrapper for using your agent over HTTP", + "license": { + "name": "Apache-2.0" }, - "/didcomm/credentials/accept-credential": { + "contact": {} + }, + "paths": { + "/x509": { "post": { - "operationId": "AcceptCredential", - "responses": { - "200": { - "description": "CredentialExchangeRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialExchangeRecord" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "state": "offer-sent", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" - }, - "metadata": { - "_internal/indyCredential": { - "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", - "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" - } - }, - "credentials": [], - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", - "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", - "credentialAttributes": [], - "protocolVersion": "v1" - } - } - } - } - } - } - }, - "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptCredential" - } - } - } - } - } - }, - "/didcomm/credentials/{credentialRecordId}/form-data": { - "get": { - "operationId": "CredentialFormData", - "responses": { - "200": { - "description": "credentialRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetCredentialFormatDataReturn__40_LegacyIndyCredentialFormat-or-JsonLdCredentialFormat-or-AnonCredsCredentialFormat_41_-Array_" - } - } - } - } - }, - "description": "Return credentialRecord", - "tags": [ - "DIDComm - Credentials" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "credentialRecordId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/connections": { - "get": { - "operationId": "GetAllConnections", - "responses": { - "200": { - "description": "ConnectionRecord[]", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "type": "array" - }, - "examples": { - "Example 1": { - "value": [ - { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } - ] - } - } - } - } - } - }, - "description": "Retrieve all connections records", - "tags": [ - "DIDComm - Connections" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "outOfBandId", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Alias", - "in": "query", - "name": "alias", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Connection state", - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/DidExchangeState" - } - }, - { - "description": "My DID", - "in": "query", - "name": "myDid", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Their DID", - "in": "query", - "name": "theirDid", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Their label", - "in": "query", - "name": "theirLabel", - "required": false, - "schema": { - "type": "string" - } - } - ] - } - }, - "/didcomm/connections/{connectionId}": { - "get": { - "operationId": "GetConnectionById", + "operationId": "CreateX509Certificate", "responses": { "200": { - "description": "ConnectionRecord", + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + "properties": { + "publicCertificateBase64": { + "type": "string" } - } + }, + "required": [ + "publicCertificateBase64" + ], + "type": "object" } } } } }, - "description": "Retrieve connection record by connection id", "tags": [ - "DIDComm - Connections" + "x509" ], "security": [ { @@ -9012,28 +1712,44 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/X509CreateCertificateOptionsDto" + } } } - ] - }, - "delete": { - "operationId": "DeleteConnection", + } + } + }, + "/x509/import": { + "post": { + "operationId": "ImportX509Certificates", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "properties": { + "issuerCertficicate": { + "type": "string" + } + }, + "required": [ + "issuerCertficicate" + ], + "type": "object" + } + } + } } }, - "description": "Deletes a connection record from the connection repository.", "tags": [ - "DIDComm - Connections" + "x509" ], "security": [ { @@ -9043,56 +1759,29 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/X509ImportCertificateOptionsDto" + } } } - ] + } } }, - "/didcomm/connections/{connectionId}/accept-request": { + "/x509/trusted": { "post": { - "operationId": "AcceptRequest", + "operationId": "AddTrustedCertificate", "responses": { - "200": { - "description": "ConnectionRecord", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } - } - } - } - } + "204": { + "description": "No content" } }, - "description": "Accept a connection request as inviter by sending a connection response message\nfor the connection with the specified connection id.\n\nThis is not needed when auto accepting of connection is enabled.", "tags": [ - "DIDComm - Connections" + "x509" ], "security": [ { @@ -9102,56 +1791,45 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "certificate": { + "type": "string" + } + }, + "required": [ + "certificate" + ], + "type": "object" + } } } - ] - } - }, - "/didcomm/connections/{connectionId}/accept-response": { - "post": { - "operationId": "AcceptResponse", + } + }, + "get": { + "operationId": "GetTrustedCertificates", "responses": { "200": { - "description": "ConnectionRecord", + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "examples": { - "Example 1": { - "value": { - "_tags": { - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", - "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" - }, - "metadata": {}, - "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", - "createdAt": "2022-01-01T00:00:00.000Z", - "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", - "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", - "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" - } - } + "items": { + "type": "string" + }, + "type": "array" } } } } }, - "description": "Accept a connection response as invitee by sending a trust ping message\nfor the connection with the specified connection id.\n\nThis is not needed when auto accepting of connection is enabled.", "tags": [ - "DIDComm - Connections" + "x509" ], "security": [ { @@ -9161,92 +1839,75 @@ ] } ], - "parameters": [ - { - "description": "Connection identifier", - "in": "path", - "name": "connectionId", - "required": true, - "schema": { - "$ref": "#/components/schemas/RecordId" - } - } - ] + "parameters": [] } }, - "/didcomm/url/{invitationId}": { - "get": { - "operationId": "GetInvitation", + "/x509/decode": { + "post": { + "operationId": "DecodeCertificate", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/ConnectionRecord" - }, - "type": "array" + "$ref": "#/components/schemas/X509Certificate" } } } } }, "tags": [ - "DIDComm - Connections" + "x509" ], - "security": [], - "parameters": [ + "security": [ { - "in": "path", - "name": "invitationId", - "required": true, - "schema": { - "type": "string" + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "certificate": { + "type": "string" + } + }, + "required": [ + "certificate" + ], + "type": "object" + } } } - ] + } } }, - "/didcomm/basic-messages/{connectionId}": { + "/didcomm/question-answer": { "get": { - "operationId": "GetBasicMessages", + "operationId": "GetQuestionAnswerRecords", "responses": { "200": { - "description": "BasicMessageRecord[]", + "description": "QuestionAnswerRecord[]", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/BasicMessageRecord" - }, + "items": {}, "type": "array" - }, - "examples": { - "Example 1": { - "value": [ - { - "_tags": { - "role": "sender", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834" - }, - "metadata": {}, - "id": "74bcf865-1fdc-45b4-b517-9def02dfd25f", - "createdAt": "2022-08-18T08:38:40.216Z", - "content": "string", - "sentTime": "2022-08-18T08:38:40.216Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834" - } - ] - } } } } } }, - "description": "Retrieve basic messages by connection id", + "description": "Retrieve question and answer records by query", "tags": [ - "DIDComm - Basic Messages" + "DIDComm - Question Answer" ], "security": [ { @@ -9259,48 +1920,64 @@ "parameters": [ { "description": "Connection identifier", - "in": "path", + "in": "query", "name": "connectionId", - "required": true, + "required": false, "schema": { - "$ref": "#/components/schemas/RecordId" + "type": "string" + } + }, + { + "description": "Role of the question", + "in": "query", + "name": "role", + "required": false, + "schema": { + "$ref": "#/components/schemas/QuestionAnswerRole" + } + }, + { + "description": "State of the question", + "in": "query", + "name": "state", + "required": false, + "schema": { + "$ref": "#/components/schemas/QuestionAnswerState" + } + }, + { + "description": "Thread identifier", + "in": "query", + "name": "threadId", + "required": false, + "schema": { + "type": "string" } } ] - }, + } + }, + "/didcomm/question-answer/question/{connectionId}": { "post": { - "operationId": "SendMessage", + "operationId": "SendQuestion", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BasicMessageRecord" + "$ref": "#/components/schemas/Record_string.unknown_" }, "examples": { - "Example 1": { - "value": { - "_tags": { - "role": "sender", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834" - }, - "metadata": {}, - "id": "74bcf865-1fdc-45b4-b517-9def02dfd25f", - "createdAt": "2022-08-18T08:38:40.216Z", - "content": "string", - "sentTime": "2022-08-18T08:38:40.216Z", - "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834" - } - } + "Example 1": {} } } } } }, - "description": "Send a basic message to a connection", + "description": "Send a question to a connection", "tags": [ - "DIDComm - Basic Messages" + "DIDComm - Question Answer" ], "security": [ { @@ -9326,331 +2003,424 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_content.string_" + "properties": { + "detail": { + "type": "string" + }, + "validResponses": { + "items": { + "$ref": "#/components/schemas/ValidResponse" + }, + "type": "array" + }, + "question": { + "type": "string" + } + }, + "required": [ + "validResponses", + "question" + ], + "type": "object" } } } } } }, - "/multi-tenancy/create-tenant": { + "/didcomm/question-answer/answer/{id}": { "post": { - "operationId": "CreateTenant", + "operationId": "SendAnswer", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "properties": { - "token": {}, - "metadata": { - "$ref": "#/components/schemas/Metadata____" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "storageVersion": { - "type": "string" - }, - "config": { - "$ref": "#/components/schemas/TenantConfig" - }, - "type": { - "type": "string", - "enum": [ - "TenantRecord" - ], - "nullable": false - } - }, - "required": [ - "token", - "metadata", - "createdAt", - "id", - "storageVersion", - "config", - "type" - ], - "type": "object" + "$ref": "#/components/schemas/Record_string.unknown_" } } } } }, + "description": "Send a answer to question", "tags": [ - "MultiTenancy" + "DIDComm - Question Answer" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], - "parameters": [], + "parameters": [ + { + "description": "The id of the question answer record", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateTenantOptions" + "$ref": "#/components/schemas/Record_response.string_" } } } } } }, - "/multi-tenancy/get-token/{tenantId}": { - "post": { - "operationId": "GetTenantToken", + "/didcomm/question-answer/{id}": { + "get": { + "operationId": "GetQuestionAnswerRecordById", "responses": { "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "properties": { - "reason": { - "type": "string" - } - }, - "required": [ - "reason" - ], - "type": "object" + "$ref": "#/components/schemas/Record_string.unknown_" } } } - }, - "500": { - "description": "", + } + }, + "description": "Retrieve question answer record by id", + "tags": [ + "DIDComm - Question Answer" + ], + "security": [ + { + "jwt": [ + "tenant", + "dedicated" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/didcomm/oob": { + "get": { + "operationId": "GetAllOutOfBandRecords", + "responses": { + "200": { + "description": "OutOfBandRecord[]", "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" + "items": {}, + "type": "array" + }, + "examples": { + "Example 1": { + "value": [ + { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + } + ] + } } } } } }, + "description": "Retrieve all out of band records", "tags": [ - "MultiTenancy" + "DIDComm - Out Of Band" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], "parameters": [ { - "in": "path", - "name": "tenantId", - "required": true, + "description": "invitation identifier", + "in": "query", + "name": "invitationId", + "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] } }, - "/multi-tenancy/{tenantId}": { + "/didcomm/oob/{outOfBandId}": { "get": { - "operationId": "GetTenantById", + "operationId": "GetOutOfBandRecordById", "responses": { "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "", - "content": { - "application/json": { - "schema": { - "properties": { - "reason": { - "type": "string" - } - }, - "required": [ - "reason" - ], - "type": "object" - } - } - } - }, - "500": { - "description": "", + "description": "OutOfBandRecord", "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false } - }, - "required": [ - "message" - ], - "type": "object" + } } } } } }, + "description": "Retrieve an out of band record by id", "tags": [ - "MultiTenancy" + "DIDComm - Out Of Band" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], "parameters": [ { "in": "path", - "name": "tenantId", + "name": "outOfBandId", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] }, "delete": { - "operationId": "DeleteTenantById", + "operationId": "DeleteOutOfBandRecord", "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } - }, - "404": { - "description": "", - "content": { - "application/json": { - "schema": { - "properties": { - "reason": { - "type": "string" - } - }, - "required": [ - "reason" - ], - "type": "object" - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } + "204": { + "description": "No content" } }, + "description": "Deletes an out of band record from the repository.", "tags": [ - "MultiTenancy" + "DIDComm - Out Of Band" ], "security": [ { "jwt": [ - "Basewallet" + "tenant", + "dedicated" ] } ], "parameters": [ { + "description": "Record identifier", "in": "path", - "name": "tenantId", + "name": "outOfBandId", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] } }, - "/openid4vc/issuance-sessions/create-credential-offer": { + "/didcomm/oob/create-invitation": { "post": { - "operationId": "CreateCredentialOffer", + "operationId": "CreateInvitation", "responses": { "200": { - "description": "Ok", + "description": "Out of band record", "content": { "application/json": { "schema": { "properties": { - "issuanceSession": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + "invitationDid": { + "type": "string" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "invitation": { + "$ref": "#/components/schemas/DidCommPlaintextMessage" }, - "credentialOffer": { + "invitationUrl": { "type": "string" } }, "required": [ - "issuanceSession", - "credentialOffer" + "invitationDid", + "outOfBandRecord", + "invitation", + "invitationUrl" ], "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "invitationUrl": "string", + "invitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + } + } + } } } } } }, - "description": "Creates a credential offer with the specified credential configurations and authorization type.", + "description": "Creates an outbound out-of-band record containing out-of-band invitation message defined in\nAries RFC 0434: Out-of-Band Protocol 1.1.", "tags": [ - "oid4vc issuance sessions" + "DIDComm - Out Of Band" ], "security": [ { @@ -9662,72 +2432,71 @@ ], "parameters": [], "requestBody": { + "description": "configuration of how out-of-band invitation should be created", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionsCreateOffer" + "allOf": [ + { + "$ref": "#/components/schemas/CreateInvitationOptions" + }, + { + "$ref": "#/components/schemas/RecipientKeyOption" + } + ], + "description": "configuration of how out-of-band invitation should be created" } } } } } }, - "/openid4vc/issuance-sessions/{issuanceSessionId}": { - "get": { - "operationId": "GetIssuanceSessionsById", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" - } - } - } - } - }, - "description": "Get issuance details by issuance SessionId", - "tags": [ - "oid4vc issuance sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "put": { - "operationId": "UpdateSessionById", + "/didcomm/oob/create-legacy-connectionless-invitation": { + "post": { + "operationId": "CreateLegacyConnectionlessInvitation", "responses": { "200": { - "description": "Ok", + "description": "a message and a invitationUrl", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + "properties": { + "outOfBandRecord": { + "$ref": "#/components/schemas/DidCommOutOfBandRecord" + }, + "invitationUrl": { + "type": "string" + }, + "message": { + "$ref": "#/components/schemas/DidCommMessage" + } + }, + "required": [ + "outOfBandRecord", + "invitationUrl", + "message" + ], + "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "message": { + "@id": "eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00", + "@type": "https://didcomm.org/connections/1.0/invitation" + }, + "invitationUrl": "http://example.com/invitation_url" + } + } } } } } }, - "description": "Update issuance session metadata by session ID", + "description": "Creates a new connectionless legacy invitation.", "tags": [ - "oid4vc issuance sessions" + "DIDComm - Out Of Band" ], "security": [ { @@ -9737,443 +2506,118 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { + "description": "configuration of how a connection invitation should be created", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Record_string.unknown_" - } - } - } - } - }, - "delete": { - "operationId": "DeleteIssuanceSessionById", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Delete issuance session by session ID", - "tags": [ - "oid4vc issuance sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "issuanceSessionId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/openid4vc/issuance-sessions": { - "get": { - "operationId": "GetIssuanceSessionsByQuery", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionRecord" + "properties": { + "routing": { + "$ref": "#/components/schemas/DidCommRouting" }, - "type": "array" - } + "domain": { + "type": "string" + }, + "message": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "recordId": { + "type": "string" + } + }, + "required": [ + "domain", + "message", + "recordId" + ], + "type": "object", + "description": "configuration of how a connection invitation should be created" } } } - }, - "description": "Fetch all issuance sessions by query", - "tags": [ - "oid4vc issuance sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "cNonce", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "publicIssuerId", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "preAuthorizedCode", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "state", - "required": false, - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuanceSessionState" - } - }, - { - "in": "query", - "name": "credentialOfferUri", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "authorizationCode", - "required": false, - "schema": { - "type": "string" - } - } - ] + } } }, - "/openid4vc/issuer": { + "/didcomm/oob/receive-invitation": { "post": { - "operationId": "CreateIssuer", + "operationId": "ReceiveInvitation", "responses": { "200": { - "description": "Ok", + "description": "out-of-band record and connection record if one has been created.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "type": "object" }, "examples": { "Example 1": { "value": { - "issuerId": "abc-gov", - "accessTokenSignerKeyType": "ed25519", - "display": [ - { - "name": "ABC Gov", - "locale": "en", - "logo": { - "uri": "https://upload.wikimedia.org/wikipedia/commons/2/2f/ABC-2021-LOGO.svg", - "alt_text": "abc_logo" - } - } - ], - "dpopSigningAlgValuesSupported": [ - "RS256", - "ES256" - ], - "credentialConfigurationsSupported": { - "VaccinationCredential-sdjwt": { - "format": "vc+sd-jwt", - "vct": "VaccinationCredential", - "scope": "openid4vc:credential:VaccinationCredential-sdjwt", - "claims": { - "name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Full Name", - "locale": "en" - } - }, - "vaccine": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Vaccine Type", - "locale": "en" - } - }, - "lotNumber": { - "value_type": "string", - "display": { - "name": "Batch Number", - "locale": "en" - } - }, - "performer": { - "value_type": "string", - "display": { - "name": "Healthcare Provider", - "locale": "en" - } - }, - "doseDate": { - "value_type": "date", - "display": { - "name": "Date of Dose", - "locale": "en" - } - } - }, - "credential_signing_alg_values_supported": [ - "ES256" - ], - "cryptographic_binding_methods_supported": [ - "did:key" - ], - "display": [ - { - "name": "COVID-19 Vaccination Certificate", - "description": "Proof of vaccination against COVID-19", - "locale": "en" - } - ] - }, - "NationalIDCredential-mdoc": { - "format": "mso_mdoc", - "doctype": "org.iso.18013.5.1", - "scope": "openid4vc:credential:NationalIDCredential-mdoc", - "claims": { - "family_name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Last Name", - "locale": "en" - } - }, - "given_name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "First Name", - "locale": "en" - } - }, - "birth_date": { - "value_type": "date", - "display": { - "name": "Date of Birth", - "locale": "en" - } - }, - "gender": { - "value_type": "string", - "display": { - "name": "Gender", - "locale": "en" - } - }, - "nationality": { - "value_type": "string", - "display": { - "name": "Nationality", - "locale": "en" - } - }, - "document_number": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Document Number", - "locale": "en" - } - }, - "issuing_authority": { - "value_type": "string", - "display": { - "name": "Issuing Authority", - "locale": "en" - } - }, - "expiry_date": { - "value_type": "date", - "display": { - "name": "Expiry Date", - "locale": "en" - } - } - }, - "credential_signing_alg_values_supported": [ - "ES256" - ], - "cryptographic_binding_methods_supported": [ - "did:key" - ], - "display": [ - { - "name": "National ID", - "description": "Digital government-issued identity credential", - "locale": "en" - } + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" ] }, - "UniversityDegreeCredential-sdjwt": { - "format": "vc+sd-jwt", - "vct": "UniversityDegreeCredential", - "scope": "openid4vc:credential:UniversityDegreeCredential-sdjwt", - "claims": { - "full_name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Full Name", - "locale": "en" - } - }, - "diploma_name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Degree Title", - "locale": "en" - } - }, - "college_name": { - "value_type": "string", - "display": { - "name": "College/University", - "locale": "en" - } - }, - "graduation_date": { - "value_type": "date", - "display": { - "name": "Graduation Date", - "locale": "en" - } - }, - "awarded_date": { - "value_type": "date", - "display": { - "name": "Award Date", - "locale": "en" - } - } - }, - "credential_signing_alg_values_supported": [ - "ES256", - "EdDSA" + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" ], - "cryptographic_binding_methods_supported": [ - "did:key" + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" ], - "display": [ + "services": [ { - "name": "University Degree Credential", - "description": "Issued by a recognized educational institution", - "locale": "en" + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] } ] }, - "DrivingLicenseCredential-mdoc": { - "format": "mso_mdoc", - "doctype": "org.iso.18013.5.1", - "scope": "openid4vc:credential:DrivingLicenseCredential-mdoc", - "claims": { - "family_name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Surname", - "locale": "en" - } - }, - "given_name": { - "mandatory": true, - "value_type": "string", - "display": { - "name": "Given Name", - "locale": "en" - } - }, - "birth_date": { - "value_type": "date", - "display": { - "name": "Date of Birth", - "locale": "en" - } - }, - "issue_date": { - "value_type": "date", - "display": { - "name": "Issued On", - "locale": "en" - } - }, - "expiry_date": { - "value_type": "date", - "display": { - "name": "Expires On", - "locale": "en" - } - }, - "issuing_country": { - "value_type": "string", - "display": { - "name": "Issuing Country", - "locale": "en" - } - }, - "license_number": { - "value_type": "string", - "display": { - "name": "License Number", - "locale": "en" - } - }, - "categories_of_vehicles": { - "value_type": "string", - "display": { - "name": "Authorized Vehicle Types", - "locale": "en" - } - } - }, - "credential_signing_alg_values_supported": [ - "ES256" - ], - "cryptographic_binding_methods_supported": [ - "did:key" - ], - "display": [ - { - "name": "Driving License", - "description": "ISO-compliant mobile driving license", - "locale": "en" - } - ] - } + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + }, + "connectionRecord": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" } } } @@ -10182,9 +2626,9 @@ } } }, - "description": "Creates an issuer with issuer metadata.", + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "oid4vc issuers" + "DIDComm - Out Of Band" ], "security": [ { @@ -10200,71 +2644,102 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateIssuerOptions" + "$ref": "#/components/schemas/ReceiveInvitationProps" } } } } - }, - "get": { - "operationId": "GetIssuersByQuery", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - }, - "type": "array" - } - } - } - } - }, - "description": "Query issuers by optional publicIssuerId.", - "tags": [ - "oid4vc issuers" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "publicIssuerId", - "required": false, - "schema": { - "type": "string" - } - } - ] } }, - "/openid4vc/issuer/{publicIssuerId}": { - "put": { - "operationId": "UpdateIssuerMetadata", + "/didcomm/oob/receive-invitation-url": { + "post": { + "operationId": "ReceiveInvitationFromUrl", "responses": { "200": { - "description": "Ok", + "description": "out-of-band record and connection record if one has been created.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + }, + "connectionRecord": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } } } } } }, - "description": "Updates issuer metadata for a given publicIssuerId.", + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", "tags": [ - "oid4vc issuers" + "DIDComm - Out Of Band" ], "security": [ { @@ -10274,116 +2749,108 @@ ] } ], - "parameters": [ - { - "in": "path", - "name": "publicIssuerId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateIssuerRecordOptions" + "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" } } } } - }, - "get": { - "operationId": "GetIssuer", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcIssuerRecord" - } - } - } - } - }, - "description": "Returns a specific issuer by publicIssuerId.", - "tags": [ - "oid4vc issuers" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "publicIssuerId", - "required": true, - "schema": { - "type": "string" - } - } - ] } }, - "/openid4vc/issuer/{issuerId}/metadata": { - "get": { - "operationId": "GetIssuerAgentMetaData", + "/didcomm/oob/{outOfBandId}/accept-invitation": { + "post": { + "operationId": "AcceptInvitation", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "type": "number", - "format": "double" + "properties": { + "connectionRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "outOfBandRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + } + }, + "required": [ + "connectionRecord", + "outOfBandRecord" + ], + "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + }, + "connectionRecord": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } } } } } }, - "description": "Returns metadata for a specific issuer.", - "tags": [ - "oid4vc issuers" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "issuerId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/openid4vc/issuer/{id}": { - "delete": { - "operationId": "DeleteIssuer", - "responses": { - "204": { - "description": "No content" - } - }, - "description": "Deletes a specific issuer by record id.", + "description": "Accept a connection invitation as invitee (by sending a connection request message) for the connection with the specified connection id.\nThis is not needed when auto accepting of connections is enabled.", "tags": [ - "oid4vc issuers" + "DIDComm - Out Of Band" ], "security": [ { @@ -10396,74 +2863,67 @@ "parameters": [ { "in": "path", - "name": "id", + "name": "outOfBandId", "required": true, "schema": { - "type": "string" - } - } - ] - } - }, - "/openid4vc/verification-sessions/create-presentation-request": { - "post": { - "operationId": "CreateProofRequest", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } + "$ref": "#/components/schemas/RecordId" } } - }, - "description": "Create an authorization request, acting as a Relying Party (RP)", - "tags": [ - "oid4vc verification sessions" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } ], - "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAuthorizationRequest" + "$ref": "#/components/schemas/AcceptInvitationConfig" } } } } } }, - "/openid4vc/verification-sessions": { + "/didcomm/connections": { "get": { - "operationId": "GetAllVerificationSessions", + "operationId": "GetAllConnections", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord[]", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + "$ref": "#/components/schemas/Record_string.unknown_" }, "type": "array" + }, + "examples": { + "Example 1": { + "value": [ + { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + ] + } } } } } }, - "description": "Retrieve all verification session records", + "description": "Retrieve all connections records", "tags": [ - "oid4vc verification sessions" + "DIDComm - Connections" ], "security": [ { @@ -10476,39 +2936,52 @@ "parameters": [ { "in": "query", - "name": "publicVerifierId", + "name": "outOfBandId", "required": false, "schema": { "type": "string" } }, { + "description": "Alias", "in": "query", - "name": "payloadState", + "name": "alias", "required": false, "schema": { "type": "string" } }, { + "description": "Connection state", "in": "query", "name": "state", "required": false, "schema": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionState" + "$ref": "#/components/schemas/DidCommDidExchangeState" + } + }, + { + "description": "My DID", + "in": "query", + "name": "myDid", + "required": false, + "schema": { + "type": "string" } }, { + "description": "Their DID", "in": "query", - "name": "authorizationRequestUri", + "name": "theirDid", "required": false, "schema": { "type": "string" } }, { + "description": "Their label", "in": "query", - "name": "nonce", + "name": "theirLabel", "required": false, "schema": { "type": "string" @@ -10517,24 +2990,43 @@ ] } }, - "/openid4vc/verification-sessions/{verificationSessionId}": { + "/didcomm/connections/{connectionId}": { "get": { - "operationId": "GetVerificationSessionsById", + "operationId": "GetConnectionById", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcVerificationSessionRecord" + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } } } } } }, - "description": "Get verification session by ID", + "description": "Retrieve connection record by connection id", "tags": [ - "oid4vc verification sessions" + "DIDComm - Connections" ], "security": [ { @@ -10546,31 +3038,26 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "verificationSessionId", + "name": "connectionId", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] - } - }, - "/openid4vc/verification-sessions/response/{verificationSessionId}": { - "get": { - "operationId": "GetVerifiedAuthorizationResponse", + }, + "delete": { + "operationId": "DeleteConnection", "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "No content" } }, + "description": "Deletes a connection record from the connection repository.", "tags": [ - "oid4vc verification sessions" + "DIDComm - Connections" ], "security": [ { @@ -10582,37 +3069,54 @@ ], "parameters": [ { + "description": "Connection identifier", "in": "path", - "name": "verificationSessionId", + "name": "connectionId", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/RecordId" } } ] } }, - "/openid4vc/holder/sd-jwt-vcs": { - "get": { - "operationId": "GetSdJwtCredentials", + "/didcomm/connections/{connectionId}/accept-request": { + "post": { + "operationId": "AcceptRequest", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/SdJwtVcRecord" - }, - "type": "array" + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } } } } } }, - "description": "Get SdJwt type of credentials", + "description": "Accept a connection request as inviter by sending a connection response message\nfor the connection with the specified connection id.\n\nThis is not needed when auto accepting of connection is enabled.", "tags": [ - "oid4vc holders" + "DIDComm - Connections" ], "security": [ { @@ -10622,58 +3126,56 @@ ] } ], - "parameters": [] - } - }, - "/openid4vc/holder/mdoc-vcs": { - "get": { - "operationId": "GetMdocCredentials", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/MdocRecord" - }, - "type": "array" - } - } - } - } - }, - "description": "Fetch all mso mdoc credentials in wallet", - "tags": [ - "oid4vc holders" - ], - "security": [ + "parameters": [ { - "jwt": [ - "tenant", - "dedicated" - ] + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } } - ], - "parameters": [] + ] } }, - "/openid4vc/holder/mdoc-vcs/decode": { + "/didcomm/connections/{connectionId}/accept-response": { "post": { - "operationId": "DecodeMdocCredential", + "operationId": "AcceptResponse", "responses": { "200": { - "description": "Ok", + "description": "ConnectionRecord", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } } } } }, - "description": "Decode mso mdoc credential in wallet", + "description": "Accept a connection response as invitee by sending a trust ping message\nfor the connection with the specified connection id.\n\nThis is not needed when auto accepting of connection is enabled.", "tags": [ - "oid4vc holders" + "DIDComm - Connections" ], "security": [ { @@ -10683,80 +3185,133 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "base64Url": { - "type": "string" - } - }, - "required": [ - "base64Url" - ], - "type": "object" - } + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" } } - } + ] } }, - "/openid4vc/holder/resolve-credential-offer": { - "post": { - "operationId": "ResolveCredOffer", + "/didcomm/url/{invitationId}": { + "get": { + "operationId": "GetInvitation", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "items": { + "$ref": "#/components/schemas/DidCommConnectionRecord" + }, + "type": "array" + } } } } }, - "description": "Resolve a credential offer", "tags": [ - "oid4vc holders" + "DIDComm - Connections" ], - "security": [ + "security": [], + "parameters": [ { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveCredentialOfferBody" - } + "in": "path", + "name": "invitationId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/openid4vc/holder/authorization-request": { - "post": { - "operationId": "RequestAuthorizationForCredential", + "/dids/{did}": { + "get": { + "operationId": "GetDidRecordByDid", "responses": { "200": { - "description": "Ok", + "description": "DidResolutionResult", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "didDocumentMetadata": { + "$ref": "#/components/schemas/DIDDocumentMetadata" + }, + "didResolutionMetadata": { + "$ref": "#/components/schemas/DidResolutionMetadata" + }, + "didDocument": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "didDocumentMetadata", + "didResolutionMetadata", + "didDocument" + ], + "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "didDocument": { + "@context": [ + "https://w3id.org/did/v1", + "https://w3id.org/security/suites/ed25519-2018/v1", + "https://w3id.org/security/suites/x25519-2019/v1" + ], + "id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", + "verificationMethod": [ + { + "id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", + "type": "Ed25519VerificationKey2018", + "controller": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", + "publicKeyBase58": "6fioC1zcDPyPEL19pXRS2E4iJ46zH7xP6uSgAaPdwDrx" + } + ], + "authentication": [ + "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" + ], + "assertionMethod": [ + "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" + ], + "capabilityInvocation": [ + "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" + ], + "capabilityDelegation": [ + "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL" + ], + "keyAgreement": [ + { + "id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL#z6LSrdqo4M24WRDJj1h2hXxgtDTyzjjKCiyapYVgrhwZAySn", + "type": "X25519KeyAgreementKey2019", + "controller": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL", + "publicKeyBase58": "FxfdY3DCQxVZddKGAtSjZdFW9bCCW7oRwZn1NFJ2Tbg2" + } + ] + }, + "didDocumentMetadata": {}, + "didResolutionMetadata": { + "contentType": "application/did+ld+json" + } + } + } + } } } } }, + "description": "Resolves did and returns did resolution result", "tags": [ - "oid4vc holders" + "Dids" ], "security": [ { @@ -10766,35 +3321,60 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthorizeRequestCredentialOffer" - } + "parameters": [ + { + "description": "Decentralized Identifier", + "in": "path", + "name": "did", + "required": true, + "schema": { + "$ref": "#/components/schemas/Did" } } - } + ] } }, - "/openid4vc/holder/request-credential": { + "/dids/write": { "post": { - "operationId": "RequestCredential", + "operationId": "WriteDid", "responses": { "200": { - "description": "Ok", + "description": "DidResolutionResult", "content": { "application/json": { - "schema": {} + "schema": {}, + "examples": { + "Example 1": { + "value": { + "did": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", + "didDocument": { + "@context": [ + "https://w3id.org/did/v1", + "https://w3id.org/security/suites/ed25519-2018/v1" + ], + "id": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", + "verificationMethod": [ + { + "id": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey", + "type": "Ed25519VerificationKey2018", + "controller": "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7", + "publicKeyBase58": "BapLDK4dEY88vWcQgNbpAPVVP4r3CHs4MvShmmhqkxXM" + } + ], + "authentication": [ + "did:indy:bcovrin:testnet:LRCUFcizUL74AGgLqdJHK7#verkey" + ] + } + } + } + } } } } }, - "description": "Initiates a token request, then requests credentials from issuer", + "description": "Did nym registration", "tags": [ - "oid4vc holders" + "Dids" ], "security": [ { @@ -10810,29 +3390,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequestCredentialBody" + "$ref": "#/components/schemas/DidCreate" } } } } } }, - "/openid4vc/holder/resolve-proof-request": { - "post": { - "operationId": "ResolveProofRequest", + "/dids": { + "get": { + "operationId": "GetDids", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "items": { + "$ref": "#/components/schemas/DidRecord" + }, + "type": "array" + } } } } }, - "description": "Resolve a proof request", "tags": [ - "oid4vc holders" + "Dids" ], "security": [ { @@ -10842,114 +3426,84 @@ ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" - } - } - } - } + "parameters": [] } }, - "/openid4vc/holder/accept-proof-request": { - "post": { - "operationId": "AcceptProofRequest", + "/agent": { + "get": { + "operationId": "GetAgentInfo", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "anyOf": [ - { - "properties": { - "body": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/Record_string.unknown_" - } - ] - }, - "status": { - "type": "number", - "format": "double" - } - }, - "required": [ - "body", - "status" - ], - "type": "object" - }, - { - "properties": { - "body": { - "$ref": "#/components/schemas/Record_string.unknown_" - }, - "status": { - "type": "number", - "format": "double" - } - }, - "required": [ - "body", - "status" - ], - "type": "object" - } - ] + "$ref": "#/components/schemas/AgentInfo" } } } } }, - "description": "Accept a proof request", + "description": "Retrieve basic agent information", "tags": [ - "oid4vc holders" + "Agent" ], "security": [ { "jwt": [ "tenant", - "dedicated" + "dedicated", + "Basewallet" ] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolveProofRequest" + "parameters": [] + } + }, + "/agent/token": { + "post": { + "operationId": "GetAgentToken", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentToken" + } } } } - } + }, + "description": "Retrieve agent token", + "tags": [ + "Agent" + ], + "security": [ + { + "apiKey": [] + } + ], + "parameters": [] } }, - "/openid4vc/holder/decode-sdjwt": { + "/agent/credential/verify": { "post": { - "operationId": "DecodeSdJwt", + "operationId": "VerifyCredential", "responses": { "200": { "description": "Ok", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/W3cVerifyCredentialResult" + } } } } }, "tags": [ - "oid4vc holders" + "Agent" ], "security": [ { @@ -10965,45 +3519,83 @@ "content": { "application/json": { "schema": { - "properties": { - "jwt": { - "type": "string" - } - }, - "required": [ - "jwt" - ], - "type": "object" + "anyOf": [ + { + "$ref": "#/components/schemas/SafeW3cJsonLdVerifyCredentialOptions" + }, + {} + ] } } } } } }, - "/openid4vc/verifier": { + "/multi-tenancy/create-tenant": { "post": { - "operationId": "CreateVerifier", + "operationId": "CreateTenant", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcVerifierRecord" + "properties": { + "token": {}, + "metadata": { + "$ref": "#/components/schemas/Metadata____" + }, + "allowCache": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "storageVersion": { + "type": "string" + }, + "config": { + "$ref": "#/components/schemas/TenantConfig" + }, + "type": { + "type": "string", + "enum": [ + "TenantRecord" + ], + "nullable": false + } + }, + "required": [ + "token", + "metadata", + "allowCache", + "createdAt", + "id", + "storageVersion", + "config", + "type" + ], + "type": "object" } } } } }, - "description": "Create a new verifier and store the verifier record", "tags": [ - "oid4vc verifiers" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], @@ -11013,46 +3605,77 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcSiopCreateVerifierOptions" + "$ref": "#/components/schemas/CreateTenantOptions" } } } } - }, - "get": { - "operationId": "GetVerifiersByQuery", + } + }, + "/multi-tenancy/get-token/{tenantId}": { + "post": { + "operationId": "GetTenantToken", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/OpenId4VcVerifierRecord" + "properties": { + "reason": { + "type": "string" + } }, - "type": "array" + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, - "description": "Get verifiers by query", "tags": [ - "oid4vc verifiers" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], "parameters": [ { - "in": "query", - "name": "publicVerifierId", - "required": false, + "in": "path", + "name": "tenantId", + "required": true, "schema": { "type": "string" } @@ -11060,116 +3683,138 @@ ] } }, - "/openid4vc/verifier/{publicVerifierId}": { - "put": { - "operationId": "UpdateVerifierMetadata", + "/multi-tenancy/{tenantId}": { + "get": { + "operationId": "GetTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcVerifierRecord" + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" } } } } }, - "description": "Update verifier metadata", "tags": [ - "oid4vc verifiers" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], "parameters": [ { "in": "path", - "name": "publicVerifierId", + "name": "tenantId", "required": true, "schema": { "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenId4VcUpdateVerifierRecordOptions" - } - } - } - } + ] }, - "get": { - "operationId": "GetVerifier", + "delete": { + "operationId": "DeleteTenantById", "responses": { "200": { "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenId4VcVerifierRecord" + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" } } } - } - }, - "description": "Get single verifier by ID", - "tags": [ - "oid4vc verifiers" - ], - "security": [ - { - "jwt": [ - "tenant", - "dedicated" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "publicVerifierId", - "required": true, - "schema": { - "type": "string" + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } } } - ] - } - }, - "/openid4vc/verifier/{verifierId}": { - "delete": { - "operationId": "DeleteVerifier", - "responses": { - "204": { - "description": "No content" - } }, - "description": "Delete verifier by ID", "tags": [ - "oid4vc verifiers" + "MultiTenancy" ], "security": [ { "jwt": [ - "tenant", - "dedicated" + "Basewallet" ] } ], "parameters": [ { "in": "path", - "name": "verifierId", + "name": "tenantId", "required": true, "schema": { "type": "string" diff --git a/src/utils/agent.ts b/src/utils/agent.ts index 4acfabf7..582ff80b 100644 --- a/src/utils/agent.ts +++ b/src/utils/agent.ts @@ -1,14 +1,14 @@ import type { InitConfig } from '@credo-ts/core' -import { PolygonModule } from '@ayanworks/credo-polygon-w3c-module' +// import { PolygonModule } from '@ayanworks/credo-polygon-w3c-module' import { AnonCredsModule, - LegacyIndyCredentialFormatService, - LegacyIndyProofFormatService, - V1CredentialProtocol, - V1ProofProtocol, - AnonCredsCredentialFormatService, - AnonCredsProofFormatService, + LegacyIndyDidCommProofFormatService, + DidCommCredentialV1Protocol, + DidCommProofV1Protocol, + AnonCredsDidCommProofFormatService, + LegacyIndyDidCommCredentialFormatService, + AnonCredsDidCommCredentialFormatService, } from '@credo-ts/anoncreds' import { AskarModule } from '@credo-ts/askar' import { @@ -21,22 +21,17 @@ import { } from '@credo-ts/core' import { - HttpOutboundTransport, - JsonLdCredentialFormatService, - DifPresentationExchangeProofFormatService, - ProofsModule, - AutoAcceptCredential, - V2ProofProtocol, - CredentialsModule, - V2CredentialProtocol, + DidCommHttpOutboundTransport, + DidCommJsonLdCredentialFormatService, + DidCommDifPresentationExchangeProofFormatService, + DidCommAutoAcceptCredential, + DidCommProofV2Protocol, + DidCommCredentialV2Protocol, DidCommModule, - OutOfBandModule, - MediationRecipientModule, - BasicMessagesModule, - ConnectionInvitationMessage + DidCommConnectionInvitationMessage } from '@credo-ts/didcomm' import { IndyVdrAnonCredsRegistry, IndyVdrModule } from '@credo-ts/indy-vdr' -import { agentDependencies, HttpInboundTransport } from '@credo-ts/node' +import { agentDependencies, DidCommHttpInboundTransport } from '@credo-ts/node' import { TenantsModule } from '@credo-ts/tenants' import { anoncreds } from '@hyperledger/anoncreds-nodejs' import { askar } from '@openwallet-foundation/askar-nodejs' @@ -48,18 +43,13 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp const logger = new TsLogger(LogLevel.debug) const config: InitConfig = { - label: name, // endpoints: endpoints, - walletConfig: { - id: name, - key: name, - }, logger: logger, allowInsecureHttpUrls: process.env.ALLOW_INSECURE_HTTP_URLS === 'true' } - const legacyIndyCredentialFormat = new LegacyIndyCredentialFormatService() - const legacyIndyProofFormat = new LegacyIndyProofFormatService() + const legacyIndyCredentialFormat = new LegacyIndyDidCommCredentialFormatService() + const legacyIndyProofFormat = new LegacyIndyDidCommProofFormatService() const agent = new Agent({ config: config, modules: { @@ -76,6 +66,10 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp }), askar: new AskarModule({ askar, + store: { + id: name, + key: name + }, }), anoncreds: new AnonCredsModule({ @@ -87,71 +81,71 @@ export const setupAgent = async ({ name, endpoints, port }: { name: string; endp registrars: [new KeyDidRegistrar()], resolvers: [new KeyDidResolver(), new WebDidResolver()], }), - proofs: new ProofsModule({ - proofProtocols: [ - new V1ProofProtocol({ - indyProofFormat: legacyIndyProofFormat, - }), - new V2ProofProtocol({ - proofFormats: [ - legacyIndyProofFormat, - new AnonCredsProofFormatService(), - new DifPresentationExchangeProofFormatService(), - ], - }), - ], - }), - credentials: new CredentialsModule({ - autoAcceptCredentials: AutoAcceptCredential.ContentApproved, - credentialProtocols: [ - new V1CredentialProtocol({ - indyCredentialFormat: legacyIndyCredentialFormat, - }), - new V2CredentialProtocol({ - credentialFormats: [ - legacyIndyCredentialFormat, - new JsonLdCredentialFormatService(), - new AnonCredsCredentialFormatService(), - ], - }), - ], - }), tenants: new TenantsModule(), didcomm: new DidCommModule({ processDidCommMessagesConcurrently: true, + anoncreds: new AnonCredsModule({ + registries: [new IndyVdrAnonCredsRegistry()], + anoncreds, + }), + oob: true, + mediationRecipient: true, + messagePickup: true, + basicMessages: true, + connections: { + autoAcceptConnections: true, + }, + proofs: { + proofProtocols: [ + new DidCommProofV1Protocol({ + indyProofFormat: legacyIndyProofFormat, + }), + new DidCommProofV2Protocol({ + proofFormats: [legacyIndyProofFormat, new AnonCredsDidCommProofFormatService, new DidCommDifPresentationExchangeProofFormatService], + }), + ], + }, + credentials: { + autoAcceptCredentials: DidCommAutoAcceptCredential.Always, + credentialProtocols: [ + new DidCommCredentialV1Protocol({ + indyCredentialFormat: legacyIndyCredentialFormat, + }), + new DidCommCredentialV2Protocol({ + credentialFormats: [legacyIndyCredentialFormat, new DidCommJsonLdCredentialFormatService(), new AnonCredsDidCommCredentialFormatService()], + }), + ], + }, }), - oob: new OutOfBandModule(), - mediationRecipient: new MediationRecipientModule(), - basicMessages: new BasicMessagesModule(), - polygon: new PolygonModule({ - didContractAddress: '', - schemaManagerContractAddress: '', - fileServerToken: '', - rpcUrl: '', - serverUrl: '', - }), + // polygon: new PolygonModule({ + // didContractAddress: '', + // schemaManagerContractAddress: '', + // fileServerToken: '', + // rpcUrl: '', + // serverUrl: '', + // }), }, dependencies: agentDependencies, }) - const httpInbound = new HttpInboundTransport({ + const httpInbound = new DidCommHttpInboundTransport({ port: port, }) agent.modules.didcomm.registerInboundTransport(httpInbound) - agent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) + agent.modules.didcomm.registerOutboundTransport(new DidCommHttpOutboundTransport()) - httpInbound.app.get('/invitation', async (req, res) => { + httpInbound.app.get('/invitation', async (req: { query: { d_m: any; c_i: any }; url: string }, res: { send: (arg0: any) => void }) => { if (typeof req.query.d_m === 'string') { - const invitation = await ConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) + const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url.replace('d_m=', 'c_i=')) res.send(invitation.toJSON()) } if (typeof req.query.c_i === 'string') { - const invitation = await ConnectionInvitationMessage.fromUrl(req.url) + const invitation = await DidCommConnectionInvitationMessage.fromUrl(req.url) res.send(invitation.toJSON()) } else { - const { outOfBandInvitation } = await agent.modules.oob.createInvitation() + const { outOfBandInvitation } = await agent.modules.didcomm.oob.createInvitation() res.send(outOfBandInvitation.toUrl({ domain: endpoints + '/invitation' })) } diff --git a/src/utils/constant.ts b/src/utils/constant.ts index 03741d0a..cfb07dba 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -1 +1,24 @@ +import type { Curve } from '../controllers/x509/x509.types' + +import { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' + export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE' +export const keyAlgorithmToCurve: Partial> = { + [KeyAlgorithm.Ed25519]: 'Ed25519', + [KeyAlgorithm.X25519]: 'X25519', + + [KeyAlgorithm.EcSecp256r1]: 'P-256', + [KeyAlgorithm.EcSecp384r1]: 'P-384', + [KeyAlgorithm.EcSecp256k1]: 'secp256k1', +} +export const curveToKty = { + Ed25519: 'OKP', + X25519: 'OKP', + 'P-256': 'EC', + 'P-384': 'EC', + 'P-521': 'EC', + secp256k1: 'EC', +} as const + +export const verkey = '#verkey' +export const p521 = 'p521' diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index fdee31ae..464125db 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,6 +1,12 @@ +import type { Curve, EcCurve, EcType, OkpCurve, OkpType } from '../controllers/x509/x509.types' +import type { KeyAlgorithm } from '@openwallet-foundation/askar-nodejs' + import { JsonEncoder, JsonTransformer } from '@credo-ts/core' import { randomBytes } from 'crypto' +import { curveToKty, keyAlgorithmToCurve } from './constant' + + export function objectToJson(result: T) { const serialized = JsonTransformer.serialize(result) return JsonEncoder.fromString(serialized) @@ -24,7 +30,6 @@ export async function generateSecretKey(length: number = 32): Promise { return secretKey } - export function getCertificateValidityForSystem(IsRootCA = false) { let options: { validityYears?: number, startFromCurrentMonth?: boolean }; if (IsRootCA) { @@ -64,4 +69,36 @@ export function getCertificateValidity(options?: { const notAfter = new Date(Date.UTC(startYear + validityYears, startMonth, startDay, 0, 0, 0)) return { notBefore, notAfter } -} \ No newline at end of file +} + +function normalizeToCurve(input: Curve | KeyAlgorithm): Curve | undefined { + // Already a Curve + if (input in curveToKty) { + return input as Curve + } + + // Try mapping from KeyAlgorithm + return keyAlgorithmToCurve[input as KeyAlgorithm] +} + +export function getTypeFromCurve(key: Curve | KeyAlgorithm): OkpType | EcType { + let keyTypeInfo: OkpType | EcType + const normalizedCurve = normalizeToCurve(key) + if (normalizedCurve && curveToKty[normalizedCurve] === 'OKP') { + keyTypeInfo = { + kty: 'OKP', + crv: normalizedCurve as OkpCurve, + } + } else if (normalizedCurve && curveToKty[normalizedCurve] === 'EC') { + keyTypeInfo = { + kty: 'EC', + crv: normalizedCurve as EcCurve, + } + } else { + keyTypeInfo = { + kty: 'EC', + crv: 'P-256', + } + } + return keyTypeInfo +} diff --git a/src/utils/oid4vc-agent.ts b/src/utils/oid4vc-agent.ts index 14ef14aa..644d8870 100644 --- a/src/utils/oid4vc-agent.ts +++ b/src/utils/oid4vc-agent.ts @@ -1,3 +1,5 @@ +// FIXME: We've made many changes in this file for building agent with OIDC modules, please check the types and proper implementation of the changes + import type { DisclosureFrame } from '../controllers/types' import type { OpenId4VcCredentialHolderBinding, @@ -8,7 +10,7 @@ import type { OpenId4VciSignW3cCredentials, } from '@credo-ts/openid4vc' -import { DidsApi, X509Service } from '@credo-ts/core' +import { DidsApi, SdJwtVcHolderBinding, X509Certificate, X509Service } from '@credo-ts/core' import { ClaimFormat, CredoError, @@ -25,23 +27,19 @@ import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc' import { SignerMethod } from '../enums/enum' export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRequestToCredentialMapper { - return async ({ - holderBindings, - issuanceSession, - verification, - credentialConfigurationIds, - credentialConfigurationsSupported: supported, - agentContext, - authorization, - }: { - holderBindings: OpenId4VcCredentialHolderBinding[] - issuanceSession: any - verification?: any - credentialConfigurationIds: string[] - credentialConfigurationsSupported: any - agentContext: any - authorization: any - }) => { + return async (options) => { + const { + holderBinding, + issuanceSession, + verification, + credentialConfigurationId, + credentialConfiguration, + agentContext, + authorization, + credentialRequest, + credentialOffer, + } = options + const issuanceMetadata = issuanceSession.issuanceMetadata const issuerDid = issuanceMetadata?.['issuerDid'] as string | undefined const issuerx509certificate = issuanceMetadata?.['issuerx509certificate'] as string[] | undefined @@ -69,13 +67,10 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe const allCredentialPayload = issuanceMetadata?.['credentials'] - const credentialConfigurationId = credentialConfigurationIds[0] - // Returns an array of all matching credentials const credentialPayload = Array.isArray(allCredentialPayload) ? allCredentialPayload.filter((c) => c.credentialSupportedId === credentialConfigurationId) : [] - const credentialConfiguration = supported[credentialConfigurationId] if (credentialConfigurationId === 'PresentationAuthorization') { const trustedCertificates = agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates @@ -83,280 +78,298 @@ export function getCredentialRequestToCredentialMapper(): OpenId4VciCredentialRe throw new Error(`Expected exactly one trusted certificate. Received ${trustedCertificates?.length}.`) } - return { - credentialConfigurationId, - format: ClaimFormat.SdJwtVc, - credentials: holderBindings.map((holderBinding) => ({ - payload: { - vct: credentialConfiguration.vct, - authorized_user: authorization.accessToken.payload.sub, - }, - holder: holderBinding, - issuer: - holderBindings[0].method === 'did' - ? { - method: 'did', - didUrl: issuerDidUrl ?? '', - } - : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, - })), - } satisfies OpenId4VciSignSdJwtCredentials - } - - if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.JwtVcJson) { - for (const holderBinding of holderBindings) { - assertDidBasedHolderBinding(holderBinding) + // For PresentationAuthorization, use JWK binding + if (holderBinding.bindingMethod !== 'jwk') { + throw new Error('PresentationAuthorization requires JWK binding') } return { - credentialConfigurationId, - format: ClaimFormat.JwtVc, - credentials: holderBindings.map((holderBinding) => { - assertDidBasedHolderBinding(holderBinding) - - const verificationMethod: string = issuerDidUrl ?? '' - if (!verificationMethod) { - throw new Error('issuerDidUrl is required for verificationMethod') - } - - const finalVC = { - credential: new W3cCredential({ - type: credentialConfiguration.credential_definition.type, - issuer: new W3cIssuer({ - id: parseDid(verificationMethod).did, - }), - credentialSubject: JsonTransformer.fromJSON( - { - id: parseDid(holderBinding.didUrl).did, - claims: { - ...credentialPayload[0].payload, - }, - }, - W3cCredentialSubject, - ), - issuanceDate: w3cDate(Date.now()), - }), - verificationMethod, - } - return finalVC - }), - } satisfies OpenId4VciSignW3cCredentials - } - - if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { - const disclosureFramePayload = - credentialPayload[0].disclosureFrame && Object.keys(credentialPayload[0].disclosureFrame).length > 0 - ? credentialPayload[0].disclosureFrame - : {} - - return { - credentialConfigurationId, - format: ClaimFormat.SdJwtVc, - credentials: holderBindings.map((holderBinding) => ({ - payload: credentialPayload[0].payload, - holder: holderBinding, - issuer: issuerDidUrl - ? { - method: 'did', - didUrl: issuerDidUrl, - } - : { - method: 'x5c', - x5c: issuerx509certificate ?? [], //[issuerx509certificate??""], - issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', - }, - disclosureFrame: disclosureFramePayload, - })), - } satisfies OpenId4VciSignSdJwtCredentials - } - throw new Error('Invalid request') - } -} - -export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredentialRequestToCredentialMapper { - return async ({ - holderBindings, - issuanceSession, - verification, - credentialConfigurationIds, - credentialConfigurationsSupported, - agentContext, - authorization, - }) => { - const issuanceMetadata = issuanceSession.issuanceMetadata - - if (!issuanceMetadata?.['credentials']) throw new Error('credential payload is not provided') - - const allCredentialPayload = issuanceMetadata?.['credentials'] - - const credentialConfigurationId = credentialConfigurationIds[0] - - // Returns an array of all matching credentials - const credentialPayload = Array.isArray(allCredentialPayload) - ? allCredentialPayload.filter( - (c: Record) => c.credentialSupportedId === credentialConfigurationId, - ) - : [] - const credentialConfiguration = credentialConfigurationsSupported[credentialConfigurationId] - - const credential = credentialPayload[0] - - let issuerDidVerificationMethod: string | undefined = '' - let issuerx509certificate: string[] | undefined - - if (credential.signerOptions.method === SignerMethod.Did) { - if (credential.signerOptions.did) { - const didsApi = agentContext.dependencyManager.resolve(DidsApi) - const didDocument = await didsApi.resolveDidDocument(credential.signerOptions.did) - - // Set the first verificationMethod as backup, in case we won't find a match - if (didDocument.verificationMethod?.[0].id) { - issuerDidVerificationMethod = didDocument.verificationMethod?.[0].id - } - - if (!issuerDidVerificationMethod) { - throw new Error('No matching verification method found') - } - } - } else if (credential.signerOptions.method === SignerMethod.X5c) { - if (credential.signerOptions.x5c) { - issuerx509certificate = credential.signerOptions.x5c // as string[] | undefined; - - if (!issuerx509certificate) { - throw new Error('x509certificate must be provided when using x5c as signer method') - } - } - } - - if (credentialConfigurationId === 'PresentationAuthorization') { - const trustedCertificates = agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates - if (trustedCertificates?.length !== 1) { - throw new Error(`Expected exactly one trusted certificate. Received ${trustedCertificates?.length}.`) - } - - return { - credentialConfigurationId, - format: ClaimFormat.SdJwtVc, - credentials: holderBindings.map((holderBinding) => ({ - payload: { - vct: credentialConfiguration.vct, - authorized_user: authorization.accessToken.payload.sub, + format: ClaimFormat.SdJwtDc, + credentials: [ + { + payload: { + vct: credentialConfiguration.vct, + authorized_user: authorization.accessToken.payload.sub, + }, + holder: { + method: 'jwk', + jwk: holderBinding.keys[0].jwk, + } as SdJwtVcHolderBinding, + issuer: { + method: 'x5c', + x5c: trustedCertificates.map((cert) => X509Certificate.fromEncodedCertificate(cert)), + issuer: 'ISSUER_HOST', + }, }, - holder: holderBinding, - issuer: - holderBindings[0].method === 'did' - ? { - method: 'did', - didUrl: issuerDidVerificationMethod ?? '', - } - : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, - })), + ], + type: 'credentials', } satisfies OpenId4VciSignSdJwtCredentials } - if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.MsoMdoc) { - if (!issuerx509certificate) - throw new Error( - `issuerx509certificate is not provided for credential type ${OpenId4VciCredentialFormatProfile.MsoMdoc}`, - ) - - if (!credentialConfiguration.doctype) { - throw new Error( - `'doctype' not found in credential configuration, ${JSON.stringify(credentialConfiguration, null, 2)}`, - ) + if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.JwtVcJson) { + if (holderBinding.bindingMethod !== 'did') { + throw new Error('JwtVcJson requires DID binding') } - // national id and ICAO default - const namespace = credentialConfiguration.doctype - - return { - credentialConfigurationId, - format: ClaimFormat.MsoMdoc, - credentials: holderBindings.map((holderBinding) => ({ - issuerCertificate: issuerx509certificate[0], - holderKey: holderBinding.key, - ...credential.payload, - docType: credentialConfiguration.doctype, - })), - } satisfies OpenId4VciSignMdocCredentials - } - - if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.JwtVcJson) { - for (const holderBinding of holderBindings) { - assertDidBasedHolderBinding(holderBinding) + const didKey = holderBinding.keys[0] + if (didKey.method !== 'did') { + throw new Error('Expected DID binding method') } return { - credentialConfigurationId, format: ClaimFormat.JwtVc, - credentials: holderBindings.map((holderBinding) => { - assertDidBasedHolderBinding(holderBinding) - - const finalVC = { + credentials: [ + { credential: new W3cCredential({ type: credentialConfiguration.credential_definition.type, issuer: new W3cIssuer({ - id: parseDid(issuerDidVerificationMethod).did, + id: parseDid(issuerDidUrl ?? '').did, }), credentialSubject: JsonTransformer.fromJSON( { - id: parseDid(holderBinding.didUrl).did, + id: parseDid(didKey.didUrl).did, claims: { - ...credential.payload, + ...credentialPayload[0]?.payload, }, }, - W3cCredentialSubject, + W3cCredentialSubject ), issuanceDate: w3cDate(Date.now()), }), - verificationMethod: issuerDidVerificationMethod, - } - return finalVC - }), + verificationMethod: issuerDidUrl ?? '', + }, + ], + type: 'credentials', } satisfies OpenId4VciSignW3cCredentials } if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { const disclosureFramePayload = - credentialPayload[0].disclosureFrame && Object.keys(credentialPayload[0].disclosureFrame).length > 0 + credentialPayload[0]?.disclosureFrame && Object.keys(credentialPayload[0].disclosureFrame).length > 0 ? credentialPayload[0].disclosureFrame : {} - //Taking leaf certifcate from chain as issuer certificate, if not provided explicitly taking AGENT_HTTP_URL as issuer - let parsedCertificate: any - if (!issuerDidVerificationMethod && issuerx509certificate) { - parsedCertificate = X509Service.parseCertificate(agentContext, { - encodedCertificate: issuerx509certificate[0], - }) - } else if (!issuerDidVerificationMethod) { - throw new Error(`issuerx509certificate is not provided for credential ${credentialConfigurationId}`) - } + const holder = + holderBinding.bindingMethod === 'did' + ? { + method: 'did' as const, + didUrl: holderBinding.keys[0].method === 'did' ? holderBinding.keys[0].didUrl : '', + } + : { + method: 'jwk' as const, + jwk: holderBinding.keys[0].method === 'jwk' ? holderBinding.keys[0].jwk : {}, + } return { - credentialConfigurationId, - format: ClaimFormat.SdJwtVc, - credentials: holderBindings.map((holderBinding) => ({ - payload: credential.payload, - holder: holderBinding, - issuer: issuerDidVerificationMethod - ? { + format: ClaimFormat.SdJwtDc, + credentials: [ + { + payload: credentialPayload[0]?.payload, + holder: holder as SdJwtVcHolderBinding, + issuer: issuerDidUrl + ? { method: 'did', - didUrl: issuerDidVerificationMethod, + didUrl: issuerDidUrl, } - : { + : { method: 'x5c', - x5c: issuerx509certificate ?? [], - issuer: parsedCertificate.sanUriNames[0], + x5c: (issuerx509certificate ?? []).map((cert) => X509Certificate.fromEncodedCertificate(cert)), + issuer: process.env.AGENT_HOST ?? 'http://localhost:4001', }, - disclosureFrame: disclosureFramePayload, - })), + disclosureFrame: disclosureFramePayload, + }, + ], + type: 'credentials', } satisfies OpenId4VciSignSdJwtCredentials } - throw new Error('Invalid request') } } +// export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredentialRequestToCredentialMapper { +// return async ({ +// holderBindings, +// issuanceSession, +// verification, +// credentialConfigurationIds, +// credentialConfigurationsSupported, +// agentContext, +// authorization, +// }) => { +// const issuanceMetadata = issuanceSession.issuanceMetadata + +// if (!issuanceMetadata?.['credentials']) throw new Error('credential payload is not provided') + +// const allCredentialPayload = issuanceMetadata?.['credentials'] + +// const credentialConfigurationId = credentialConfigurationIds[0] + +// // Returns an array of all matching credentials +// const credentialPayload = Array.isArray(allCredentialPayload) +// ? allCredentialPayload.filter( +// (c: Record) => c.credentialSupportedId === credentialConfigurationId, +// ) +// : [] +// const credentialConfiguration = credentialConfigurationsSupported[credentialConfigurationId] + +// const credential = credentialPayload[0] + +// let issuerDidVerificationMethod: string | undefined = '' +// let issuerx509certificate: string[] | undefined + +// if (credential.signerOptions.method === SignerMethod.Did) { +// if (credential.signerOptions.did) { +// const didsApi = agentContext.dependencyManager.resolve(DidsApi) +// const didDocument = await didsApi.resolveDidDocument(credential.signerOptions.did) + +// // Set the first verificationMethod as backup, in case we won't find a match +// if (didDocument.verificationMethod?.[0].id) { +// issuerDidVerificationMethod = didDocument.verificationMethod?.[0].id +// } + +// if (!issuerDidVerificationMethod) { +// throw new Error('No matching verification method found') +// } +// } +// } else if (credential.signerOptions.method === SignerMethod.X5c) { +// if (credential.signerOptions.x5c) { +// issuerx509certificate = credential.signerOptions.x5c // as string[] | undefined; + +// if (!issuerx509certificate) { +// throw new Error('x509certificate must be provided when using x5c as signer method') +// } +// } +// } + +// if (credentialConfigurationId === 'PresentationAuthorization') { +// const trustedCertificates = agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates +// if (trustedCertificates?.length !== 1) { +// throw new Error(`Expected exactly one trusted certificate. Received ${trustedCertificates?.length}.`) +// } + +// return { +// credentialConfigurationId, +// format: ClaimFormat.SdJwtVc, +// credentials: holderBindings.map((holderBinding) => ({ +// payload: { +// vct: credentialConfiguration.vct, +// authorized_user: authorization.accessToken.payload.sub, +// }, +// holder: holderBinding, +// issuer: +// holderBindings[0].method === 'did' +// ? { +// method: 'did', +// didUrl: issuerDidVerificationMethod ?? '', +// } +// : { method: 'x5c', x5c: trustedCertificates, issuer: 'ISSUER_HOST ' }, +// })), +// } satisfies OpenId4VciSignSdJwtCredentials +// } + +// if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.MsoMdoc) { +// if (!issuerx509certificate) +// throw new Error( +// `issuerx509certificate is not provided for credential type ${OpenId4VciCredentialFormatProfile.MsoMdoc}`, +// ) + +// if (!credentialConfiguration.doctype) { +// throw new Error( +// `'doctype' not found in credential configuration, ${JSON.stringify(credentialConfiguration, null, 2)}`, +// ) +// } + +// // national id and ICAO default +// const namespace = credentialConfiguration.doctype + +// return { +// credentialConfigurationId, +// format: ClaimFormat.MsoMdoc, +// credentials: holderBindings.map((holderBinding) => ({ +// issuerCertificate: issuerx509certificate[0], +// holderKey: holderBinding.key, +// ...credential.payload, +// docType: credentialConfiguration.doctype, +// })), +// } satisfies OpenId4VciSignMdocCredentials +// } + +// if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.JwtVcJson) { +// for (const holderBinding of holderBindings) { +// assertDidBasedHolderBinding(holderBinding) +// } + +// return { +// credentialConfigurationId, +// format: ClaimFormat.JwtVc, +// credentials: holderBindings.map((holderBinding) => { +// assertDidBasedHolderBinding(holderBinding) + +// const finalVC = { +// credential: new W3cCredential({ +// type: credentialConfiguration.credential_definition.type, +// issuer: new W3cIssuer({ +// id: parseDid(issuerDidVerificationMethod).did, +// }), +// credentialSubject: JsonTransformer.fromJSON( +// { +// id: parseDid(holderBinding.didUrl).did, +// claims: { +// ...credential.payload, +// }, +// }, +// W3cCredentialSubject, +// ), +// issuanceDate: w3cDate(Date.now()), +// }), +// verificationMethod: issuerDidVerificationMethod, +// } +// return finalVC +// }), +// } satisfies OpenId4VciSignW3cCredentials +// } + +// if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc) { +// const disclosureFramePayload = +// credentialPayload[0].disclosureFrame && Object.keys(credentialPayload[0].disclosureFrame).length > 0 +// ? credentialPayload[0].disclosureFrame +// : {} + +// //Taking leaf certifcate from chain as issuer certificate, if not provided explicitly taking AGENT_HTTP_URL as issuer +// let parsedCertificate: any +// if (!issuerDidVerificationMethod && issuerx509certificate) { +// parsedCertificate = X509Service.parseCertificate(agentContext, { +// encodedCertificate: issuerx509certificate[0], +// }) +// } else if (!issuerDidVerificationMethod) { +// throw new Error(`issuerx509certificate is not provided for credential ${credentialConfigurationId}`) +// } + +// return { +// credentialConfigurationId, +// format: ClaimFormat.SdJwtVc, +// credentials: holderBindings.map((holderBinding) => ({ +// payload: credential.payload, +// holder: holderBinding, +// issuer: issuerDidVerificationMethod +// ? { +// method: 'did', +// didUrl: issuerDidVerificationMethod, +// } +// : { +// method: 'x5c', +// x5c: issuerx509certificate ?? [], +// issuer: parsedCertificate.sanUriNames[0], +// }, +// disclosureFrame: disclosureFramePayload, +// })), +// } satisfies OpenId4VciSignSdJwtCredentials +// } + +// throw new Error('Invalid request') +// } +// } + function assertDidBasedHolderBinding( holderBinding: OpenId4VcCredentialHolderBinding, ): asserts holderBinding is OpenId4VcCredentialHolderDidBinding { @@ -365,61 +378,61 @@ function assertDidBasedHolderBinding( } } -export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { - /** - * The id of the `credential_supported` entry that is present in the issuer - * metadata. This id is used to identify the credential that is being offered. - * - * @example "ExampleCredentialSdJwtVc" - */ - credentialSupportedId: string - - /** - * The format of the credential that is being offered. - * MUST match the format of the `credential_supported` entry. - * - * @example {@link OpenId4VciCredentialFormatProfile.SdJwtVc} - */ - format: OpenId4VciCredentialFormatProfile - - /** - * The payload of the credential that will be issued. - * - * If `vct` claim is included, it MUST match the `vct` claim from the issuer metadata. - * If `vct` claim is not included, it will be added automatically. - * - * @example - * { - * "first_name": "John", - * "last_name": "Doe", - * "age": { - * "over_18": true, - * "over_21": true, - * "over_65": false - * } - * } - */ - payload: { - vct?: string - [key: string]: unknown - } - - /** - * Disclosure frame indicating which fields of the credential can be selectively disclosed. - * - * @example - * { - * "first_name": false, - * "last_name": false, - * "age": { - * "over_18": true, - * "over_21": true, - * "over_65": true - * } - * } - */ - disclosureFrame: DisclosureFrame -} +// export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions { +// /** +// * The id of the `credential_supported` entry that is present in the issuer +// * metadata. This id is used to identify the credential that is being offered. +// * +// * @example "ExampleCredentialSdJwtVc" +// */ +// credentialSupportedId: string + +// /** +// * The format of the credential that is being offered. +// * MUST match the format of the `credential_supported` entry. +// * +// * @example {@link OpenId4VciCredentialFormatProfile.SdJwtVc} +// */ +// format: OpenId4VciCredentialFormatProfile + +// /** +// * The payload of the credential that will be issued. +// * +// * If `vct` claim is included, it MUST match the `vct` claim from the issuer metadata. +// * If `vct` claim is not included, it will be added automatically. +// * +// * @example +// * { +// * "first_name": "John", +// * "last_name": "Doe", +// * "age": { +// * "over_18": true, +// * "over_21": true, +// * "over_65": false +// * } +// * } +// */ +// payload: { +// vct?: string +// [key: string]: unknown +// } + +// /** +// * Disclosure frame indicating which fields of the credential can be selectively disclosed. +// * +// * @example +// * { +// * "first_name": false, +// * "last_name": false, +// * "age": { +// * "over_18": true, +// * "over_21": true, +// * "over_65": true +// * } +// * } +// */ +// disclosureFrame: DisclosureFrame +// } export async function getTrustedCerts() { try { @@ -437,3 +450,4 @@ export async function getTrustedCerts() { return [] } } + diff --git a/yarn.lock b/yarn.lock index 32efea90..f4ef7485 100644 --- a/yarn.lock +++ b/yarn.lock @@ -386,34 +386,34 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@credo-ts/anoncreds@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.6.0.tgz#e705077236ebd63067291a3978a771452c63a9f6" - integrity sha512-oDzaPMmtIqlvCIQRan/iXleGVgtJinsQ/UQn1PChCuifo6nzZWJo/xHOqYypNuWDc9dkgADwJjkUtFoU3NhhsA== +"@credo-ts/anoncreds@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.6.1.tgz#604d9ec391034f85ba66132f6512f145c374b99f" + integrity sha512-woHktaf84z8ECdyUKb8nzRbk960bK6ZEMf6mavoC91bND54VoSAKRV2nkhXFydrH3AT/H8FS/NHBLN0CD4XthQ== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.6.0" - "@credo-ts/didcomm" "0.6.0" + "@credo-ts/core" "0.6.1" + "@credo-ts/didcomm" "0.6.1" "@sphereon/pex-models" "^2.3.2" class-transformer "0.5.1" class-validator "^0.14.1" reflect-metadata "0.2.2" -"@credo-ts/askar@0.5.3", "@credo-ts/askar@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.6.0.tgz#12fe485252d51abdcbebbbeb9e8bfed47ff12448" - integrity sha512-TYBgmpQ3qi49HIA7vIb64j2jiFTynCRF9aN0G67pwhwyTJR/sULvvD/o4FdqH9K7pAoEvVqw99xOvp9ojigqsg== +"@credo-ts/askar@0.5.3", "@credo-ts/askar@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.6.1.tgz#762c21c8cdb27444b4a9f3f9f3e420a5a20aed70" + integrity sha512-U8bgol3PNekjrsrGci5p/8PgHxBJpS4DlasX/FGKtUybFXLSMgkfmQSsZIdllqhCWYlQ2RLfMxxD5gXiPsRxgg== dependencies: - "@credo-ts/core" "0.6.0" + "@credo-ts/core" "0.6.1" class-transformer "0.5.1" class-validator "^0.14.1" rxjs "^7.8.2" tsyringe "^4.10.0" -"@credo-ts/core@0.5.3", "@credo-ts/core@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.6.0.tgz#391c14b9cdea64f91d5b741c1b37ce51a1705d9f" - integrity sha512-gZQgaZzj27Mzm0Ei2Axw+qNDBRsqsHVeEv/Rkqu4yzd0v1QIl/XQV+fUF44krvanzf0mlVBA0JXD0ZNESharCQ== +"@credo-ts/core@0.5.3", "@credo-ts/core@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.6.1.tgz#4fe8c484e6ad12e9700c4c9757da8205ee908278" + integrity sha512-KAl9c2tNWn8c6R3o1fJRkkalyjP0wsdKjHc/xEoxb2w3i1q+4nsqe9f0sWelDjbCtQ/lwxH82TCZPhfGfHHk3g== dependencies: "@animo-id/mdoc" "^0.5.2" "@animo-id/pex" "^6.1.1" @@ -458,50 +458,48 @@ webcrypto-core "^1.8.1" zod "^4.1.12" -"@credo-ts/didcomm@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.0.tgz#2508710d2af8eb8be963d59e282223951278bde6" - integrity sha512-QPInULf6ECSWk5SZoFKiXC8jcJFUhiRUFx2ghouyWsPb7wtN+eWkUMQNFt2+l0/TqqUmcvLlpAn9xICSTWQCsQ== +"@credo-ts/didcomm@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/didcomm/-/didcomm-0.6.1.tgz#994b11746998bca8fd12664c0694f271ee93c728" + integrity sha512-boDMfmzA7Pkf6CxTAjcb1zZys2APR13XHdkmCHJy4OrAxgBdZmSROfwuWsTMYK20UFfINKv7TOM4O/THpRFWGw== dependencies: - "@credo-ts/core" "0.6.0" + "@credo-ts/core" "0.6.1" class-transformer "0.5.1" class-validator "^0.14.1" luxon "^3.7.2" query-string "^9.3.1" rxjs "^7.8.2" -"@credo-ts/indy-vdr@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.6.0.tgz#e1b033ba8b3b47e9146eb70d47360504b1e7a68b" - integrity sha512-ziqw0k8KXK5KikLyw6AypuTbjfShi5DBbjQAgnn0CS7/iY394xZ3H9oVeaK94BezN7Axvm9uFsr7TS0pTApHJg== +"@credo-ts/indy-vdr@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.6.1.tgz#c3a1c50422c99fb818878c08a79eeaa775023e01" + integrity sha512-0p0ZwXdCpqrRgGGE9v7t5YeCIVeej1T0vxWZtVHy64wcswx9Oc/75l3FgNHhek7m83s+Z8uCbOTL1xe48bwamQ== dependencies: - "@credo-ts/anoncreds" "0.6.0" - "@credo-ts/core" "0.6.0" + "@credo-ts/anoncreds" "0.6.1" + "@credo-ts/core" "0.6.1" -"@credo-ts/node@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.6.0.tgz#963e610d38103feab39499da24d827bea44dee27" - integrity sha512-9p/3u6lU63wRfdxlRvAy15E+WOHcMJK7S4ftQ6icj75gDL3FlfT0qfZ2/R1eIANOkkzktOV0MhxVn+MyVrxLjQ== +"@credo-ts/node@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.6.1.tgz#e1401f6b93c3e585f37881b69eba78a01b7e850a" + integrity sha512-vJCu4xPVA0IPeBfNcByL02jWlPv71ejcdojZ1TJNa6NH3hCdzzdTJ6DXFIAHSKKxQJVd2iOvjct8Qm5lKqUAgA== dependencies: - "@2060.io/ffi-napi" "^4.0.9" - "@2060.io/ref-napi" "^3.0.6" - "@credo-ts/core" "0.6.0" - "@credo-ts/didcomm" "0.6.0" + "@credo-ts/core" "0.6.1" + "@credo-ts/didcomm" "0.6.1" "@types/express" "^5.0.6" express "^5.2.0" rxjs "^7.8.2" ws "^8.18.3" -"@credo-ts/openid4vc@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/openid4vc/-/openid4vc-0.6.0.tgz#8fad7f9720b1c71a341ec6ff840aab7205bee205" - integrity sha512-p2+4eMFuNB6vaZn4IM9EkXZE4eqoswjI8YzD4zcOHIGO02XgbW6X0Ftj5TSO2Djc5pmYDqEp/+G/ESWsinUAXw== - dependencies: - "@credo-ts/core" "0.6.0" - "@openid4vc/oauth2" "^0.4.0" - "@openid4vc/openid4vci" "^0.4.0" - "@openid4vc/openid4vp" "^0.4.0" - "@openid4vc/utils" "^0.4.0" +"@credo-ts/openid4vc@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/openid4vc/-/openid4vc-0.6.1.tgz#13996edce859639b1281a2905654dcd6788bf3c8" + integrity sha512-Odl1u4wnuy90dP2bI0MHIa7W8Al6+gQbG2eR1RFDAEgYmFA/0OQcqSlBSLI/YpceFBTEuzabp/7ohr0Z9GS4wA== + dependencies: + "@credo-ts/core" "0.6.1" + "@openid4vc/oauth2" "^0.4.1" + "@openid4vc/openid4vci" "^0.4.1" + "@openid4vc/openid4vp" "^0.4.1" + "@openid4vc/utils" "^0.4.1" "@types/express" "^5.0.6" class-transformer "0.5.1" express "^5.2.0" @@ -517,24 +515,24 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@credo-ts/question-answer@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.6.0.tgz#e948fa6980744e3fa5e373ddca3357459384b72f" - integrity sha512-jxkO2e3j4NNohBnD/A8LhhDwMfGh3f1Hi3QjcCNI2lpGduceQnb/YD9E4tMJM70Id0oxGaoLKUV8vGyL47m7ZQ== +"@credo-ts/question-answer@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.6.1.tgz#9521216116e73b0e627681659a5d1071ff6875a0" + integrity sha512-HBwlg4FWUBrhLDAvtVUxcAjSRD7NQK0H1Lulw3OkvVIIrljwxlldc8ENYJjrhfLDbhunNrD4dxKxQX7c7+Ty9w== dependencies: - "@credo-ts/core" "0.6.0" - "@credo-ts/didcomm" "0.6.0" + "@credo-ts/core" "0.6.1" + "@credo-ts/didcomm" "0.6.1" class-transformer "0.5.1" class-validator "^0.14.1" rxjs "^7.8.2" -"@credo-ts/tenants@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.6.0.tgz#10f74f27980e093094c247a0a1846e5e38b2b8a7" - integrity sha512-rPPQlW4uWgmVnvd0P9HbLyHqiLeJAeQ2n+9mRE1YkCXyUzD6zysBlN49jVgc9nvlSxuxb5BiFafGJpX11I8Rmw== +"@credo-ts/tenants@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.6.1.tgz#8eccb6520657b9fc01cea73e5d50049caebd0b49" + integrity sha512-UdOGPz3GNlrx5Tfj0AGiMZU9mHrZCNgQhFXs6Yae/xwHidhBNBOtEMvpjrUTHM72WJLDwVd6/mIGGzutWnoBeg== dependencies: - "@credo-ts/core" "0.6.0" - "@credo-ts/didcomm" "0.6.0" + "@credo-ts/core" "0.6.1" + "@credo-ts/didcomm" "0.6.1" async-mutex "^0.5.0" "@cspotcode/source-map-support@^0.8.0": @@ -1736,36 +1734,36 @@ table "^6.8.0" undici "^5.14.0" -"@openid4vc/oauth2@0.4.1", "@openid4vc/oauth2@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@openid4vc/oauth2/-/oauth2-0.4.1.tgz#550c9e55770eda2a54cbdd148096c0ff88b144eb" - integrity sha512-x2y7VF0fc02LBHrJWeEtNIgfXDt9X6w0bKUhn/aJ8aKueE/E74n+aEpW5qRMMnAKlMCryCzs5MUaoBvELZ84Lw== +"@openid4vc/oauth2@0.4.2", "@openid4vc/oauth2@^0.4.1": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@openid4vc/oauth2/-/oauth2-0.4.2.tgz#708e50d01860f6dbb221c5c9f07455428d281cbb" + integrity sha512-SUZJaa2EXS2NOsTZEhUzd4/FanGLWimi6I6R/Tqp8NOTe74hnoMixnb6U7EOOle/5FXT/YHccOqIcxC0iSAolQ== dependencies: - "@openid4vc/utils" "0.4.1" + "@openid4vc/utils" "0.4.2" zod "^4.1.13" -"@openid4vc/openid4vci@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@openid4vc/openid4vci/-/openid4vci-0.4.1.tgz#38d320f7c3b7e1feba4d2885a1e35f82da7ca066" - integrity sha512-abmIdog9TtjejxpKCpxKMl47qHVUEI1RO3OG3NZwsItpAxDJCnQ8CTEYuleX7dTcAtRghc0V08rNgIo+6Pf4PA== +"@openid4vc/openid4vci@^0.4.1": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@openid4vc/openid4vci/-/openid4vci-0.4.2.tgz#60287f8c63479c08b6d14849a95c3c53a50cd7eb" + integrity sha512-TAEiImvANZQKrm048hVWE8XPEUecXhXSdmTblqG6t1rxsKTWzaQcMJa2gaePhgfDkCSlIGs3CK1y3IfLOgemxA== dependencies: - "@openid4vc/oauth2" "0.4.1" - "@openid4vc/utils" "0.4.1" + "@openid4vc/oauth2" "0.4.2" + "@openid4vc/utils" "0.4.2" zod "^4.1.13" -"@openid4vc/openid4vp@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@openid4vc/openid4vp/-/openid4vp-0.4.1.tgz#848d632b4a2bec907c214d46a7a1d00b72c38670" - integrity sha512-6d6GpoiyIRcTa+VOqZN8F4qw/jPLLeXRaCd/znlelMTWgb7wrf64WOzCy5mS7phw3SIDYPw7SDxeGKZ0Ek+OUQ== +"@openid4vc/openid4vp@^0.4.1": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@openid4vc/openid4vp/-/openid4vp-0.4.2.tgz#51e2be1f9353c85e7a38cea72ad3d8a6cbb3b5e2" + integrity sha512-ARJjGlWheIBgcuMKhF0rvgdvfjTH82Hq4EHJjiYY0IXPPi6Z0MIPzFYKR0KVbnx4b6AO7DDULh46VRcoMyDWow== dependencies: - "@openid4vc/oauth2" "0.4.1" - "@openid4vc/utils" "0.4.1" + "@openid4vc/oauth2" "0.4.2" + "@openid4vc/utils" "0.4.2" zod "^4.1.13" -"@openid4vc/utils@0.4.1", "@openid4vc/utils@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@openid4vc/utils/-/utils-0.4.1.tgz#918ebaf15bb5fd9651af5d22aa3e08dd6d991003" - integrity sha512-kxEtmnzjmq1TX+RtfFZ1myGIdOO9EgPKp7cRbnhzWus//dUa+qV5zhLzLZcK0S2r9IP9QpTEd8ilCUWh9Aia+g== +"@openid4vc/utils@0.4.2", "@openid4vc/utils@^0.4.1": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@openid4vc/utils/-/utils-0.4.2.tgz#e312884b9ef32d200e912f20ee8741b6ff82b40b" + integrity sha512-D9qj7rACa5Dt62FXxO/kbZyrrZtRJGJXG6Y7nPG0w9Mmb5qnGH7eRl8weZmPt8h9/WFpNNr1F3HlKVIOAXOX6Q== dependencies: buffer "^6.0.3" zod "^4.1.13" @@ -2093,21 +2091,21 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz#8b5f415395a7ddb7c8e0c7932171deb9278df1a3" integrity sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg== -"@openwallet-foundation/askar-nodejs@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@openwallet-foundation/askar-nodejs/-/askar-nodejs-0.3.2.tgz#344de2a4cdba7c22a4fa632581013520cc858270" - integrity sha512-kHZaPl32azKzqT/+ksRqGXNs9lxTrhbuWVuILS1HNGXA+A5vSINRA8WwDHk2KGZ9WP7jhszbPx804cfRKrrBPA== +"@openwallet-foundation/askar-nodejs@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@openwallet-foundation/askar-nodejs/-/askar-nodejs-0.4.3.tgz#c53a29ef29fa9ef6dddb335034556f407919bf18" + integrity sha512-+7hJaCUz/GP9hhOdbLL+9OzYgb5vILcTmSyqSGTR3Qd/ba+j5HdN3BJfgRETK4Svz1jlbEKbjRLE7RwDqEr2RA== dependencies: "@2060.io/ffi-napi" "^4.0.9" "@2060.io/ref-napi" "^3.0.6" - "@openwallet-foundation/askar-shared" "0.3.2" + "@openwallet-foundation/askar-shared" "0.4.3" ref-array-di "^1.2.2" ref-struct-di "^1.1.1" -"@openwallet-foundation/askar-shared@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@openwallet-foundation/askar-shared/-/askar-shared-0.3.2.tgz#076e4c5bda41c075da722877a6846054c9738724" - integrity sha512-WQSHM5+5Vy1QMUpUTj0DpwFKYdciNcksWsft/iD6Ff+AdDERKo5Mjv/4JSIZIzXUEyq7kqqNbejl4a3TDGeU3A== +"@openwallet-foundation/askar-shared@0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@openwallet-foundation/askar-shared/-/askar-shared-0.4.3.tgz#e1e4576e347c922c18a3a6abd452945060bb1520" + integrity sha512-Zt9zlvjJxNs8UWlnRydZH594Lak15YPHY72VT1+iDbXh0OjTdyq6Bf0FIsh9sfFnRYIgh2zd8+VoXxZ07GjADA== dependencies: buffer "^6.0.3" tar "^7.4.3" @@ -8167,7 +8165,7 @@ tsoa@^6.0.1: "@tsoa/cli" "^6.6.0" "@tsoa/runtime" "^6.6.0" -tsyringe@^4.10.0, tsyringe@^4.6.0, tsyringe@^4.8.0: +tsyringe@^4.10.0, tsyringe@^4.6.0: version "4.10.0" resolved "https://registry.yarnpkg.com/tsyringe/-/tsyringe-4.10.0.tgz#d0c95815d584464214060285eaaadd94aa03299c" integrity sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==